apesal addbox aku xfunction ek?
klu x ade videobox.. tp bla aku try masukan dropdown menu nizam punya.. 2,2 xfunction.
cuba sape2 check js aku jap.
[spoiler]// BAGIAN A
//css injection
Asset.css('http://h1.ripway.com/redbloodx/page.css');
//onload handler
function onProfileLoad() {
// BAGIAN B (onload handler)
var header="VIDEO BOX";
var code="<div align=\"center\" id=\"cboxdiv\">"+
"<object width=\"300\" height=\"300\"><param name=\"movie\" value=\"http://www.youtube.com/v/wAxSsEdZ5LQ&hl=en&fmt=18&color1=0x5d1719&color2=0xcd311b&autoplay=1&border=1\"></param><param name=\"wmode\" value=\"transparent\"></param><embed src=\"http://www.youtube.com/v/wAxSsEdZ5LQ&hl=en&fmt=18&color1=0x5d1719&color2=0xcd311b&autoplay=1&border=1\" type=\"application/x-shockwave-flash\" wmode=\"transparent\" width=\"400\" height=\"300\"></embed></object>";addBox(header,code,"custombox_388","right");
var header="REDBLOOD FORUMLINK";
var code="<form name=\"jump\">"+
"<select name=\"menu\">"+
"<option value=\"http://www.iluvislam.com/v1/news.php\">FORUM ILUVISLAM</option>"+
"<option value=\"http://theftalk.com/\">FORUM FRIENDSTERTALK</option>"+
"<option value=\"http://zonkita.forumotion.net/\">FORUM AKU (ZONKITA)</option>"+
"</select>"+
"<input type=\"button\" onClick=\"location=document.jump.menu.options[document.jump.menu.selectedIndex].value;\" value=\"GO\">"+
"</form>";
addBox(header,code,"custombox_323","right");
}
// BAHAGIAN C
/*global VIEWERPIC*/
(function () {
VIEWERPIC = {
// private property
photo: null,
init: function () {
if (pageViewerID !== "") {
try {
sendXMLHttpRequestText("http://" + location.hostname + "/" + pageViewerID, "VIEWERPIC.viewer");
} catch (e) {}
}
},
viewer: function (htm) {
if (htm.trim() === "") {
window.alert("ERROR: Empty xmlresponse! \n Unable to parse your details!");
return;
} else {
htm = htm.slice(htm.indexOf("<div class=\"imgblock200\">") + 0, htm.indexOf("<ul id=\"controlPanelButtons\">") + 0);
htm = htm.slice(htm.indexOf("<img src=\"") + 10, htm.indexOf("\"></a></div>") + 0);
VIEWERPIC.photo = document.createElement("div");
VIEWERPIC.photo.id = "viewerphoto";
VIEWERPIC.photo.align = "center";
VIEWERPIC.photo.appendChild(document.createElement("a"));
VIEWERPIC.photo.getElementsByTagName("a")[0].href = "/" + pageViewerID;
VIEWERPIC.photo.getElementsByTagName("a")[0].target = "_blank";
VIEWERPIC.photo.getElementsByTagName("a")[0].title = pageViewerFName;
VIEWERPIC.photo.getElementsByTagName("a")[0].appendChild(document.createElement("img"));
VIEWERPIC.photo.getElementsByTagName("img")[0].src = htm;
VIEWERPIC.photo.appendChild(document.createElement("br"));
VIEWERPIC.photo.appendChild(document.createElement("span"));
VIEWERPIC.photo.getElementsByTagName("span")[0].className = "q";
VIEWERPIC.photo.getElementsByTagName("span")[0].appendChild(document.createElement("a"));
VIEWERPIC.photo.getElementsByTagName("a")[1].href = "/" + pageViewerID;
VIEWERPIC.photo.getElementsByTagName("a")[1].target = "_blank";
VIEWERPIC.photo.getElementsByTagName("a")[1].title = pageViewerFName;
VIEWERPIC.photo.getElementsByTagName("a")[1].innerHTML = pageViewerFName;
document.getElementById("viewerpic").parentNode.replaceChild(VIEWERPIC.photo, document.getElementById("viewerpic"));
}
}
};
VIEWERPIC.init();
})();
if (!attachOnLoadHandler(function(){onProfileLoad()})) window.onload = function(){onProfileLoad()};
function addBox(head,code,id,siblingafter) {
/*
head:
html string title
null - no header bar
code:
html string content
id:
unique string css pointer
siblingafter:
regexp classname
'left' - mainbar column end
'right' - sidebar column end
*/
try {
var li=document.createElement("li");
} catch(e) {
var li=document.createElement("<li>");
}
if(!head) head="";
else head="<h2>"+head+"</h2>";
li.innerHTML="<div id=\""+id+"\" class=\"commonbox "+id+"\">"+
head+
"<div id=\"content_"+id+"\">"+
code+
"</div>"+
"</div>";
if(siblingafter=="left") getElementsByClass(/commonbox[\s]*?controlpanel/i,null,"DIV")[0].parentNode.parentNode.appendChild(li);
else if(siblingafter=="right") getElementsByClass(/commonbox[\s]*?friends/i,null,"DIV")[0].parentNode.parentNode.appendChild(li);
else {
var si=getElementsByClass(siblingafter,null,"DIV")[0];
si.parentNode.parentNode.insertBefore(li,si.parentNode);
}
}
function getElementsByClass(searchClass,node,tag) {
var classElements = new Array();
if ( node == null )
node = document;
if ( tag == null )
tag = '*';
var els = node.getElementsByTagName(tag);
var elsLen = els.length;
var pattern = new RegExp(searchClass);
for (i = 0, j = 0; i < elsLen; i++) {
if ( pattern.test(els[i].className) ) {
classElements[j] = els[i];
j++;
}
}
return classElements;
}[/spoiler]
lagi satu mana nak dapat logo friendstertalk?
Last edited by redbloodx (2008-12-29 06:02:01)