[quote=dj_ohanonline]
all
aq kan dah buat cbox..... tp q buat now right klik...pa kah bs q pasng shout box.... berdampingn dg c box.... mohon pencrhany ....klo bs da kah tg tau code y.......q dah otak-atik tp tak bs2 nih....
[url=http://theftalk.com/?r=74410][url]http://addons.friendstertalk.com/member74410-black.gif[/url][/url][/quote]
pertama Kopas neh
[spoiler]if (!attachOnLoadHandler(function() { WHORC.init();})) window.onload = function() { WHORC.init();};
if (typeof WHORC == "undefined") { WHORC = {}; }
WHORC = {
rccboxform: null,
message: "[b]No Right Click Please
[/b] ",
base: {
"whorcCbox": ["[b]www[/b]","[b]boxID[/b]","[b]boxtag[/b]"]
},
init: function() {
for (val in WHORC.base) {
WHORC.rccboxform = "<iframe frameborder=\"0\" width=\"100%\" height=\"325\" src=\"http://"+WHORC.base[val][0]+".cbox.ws/box/?boxid="+WHORC.base[val][1]+"&boxtag="+WHORC.base[val][2]+"&sec=main\" marginheight=\"2\" marginwidth=\"2\" scrolling=\"auto\" allowtransparency=\"yes\" name=\"rcPost\" id=\"rcPost\">"+
"</iframe>"+
"<br />"+
"<div style=\"display:none\">"+
"<form name=\"whoClick\" target=\"rcPost\" action=\"http://"+WHORC.base[val][0]+".cbox.ws/box/?boxid="+WHORC.base[val][1]+"&boxtag="+WHORC.base[val][2]+"&sec=submit\" method=\"post\">"+
"<input type=\"text\" name=\"nme\" value=\""+pageViewerFName+"\">"+
"<input type=\"text\" name=\"eml\" value=\"http://profiles.friendster.com/"+pageViewerID+"\">"+
"<textarea style=\"overflow:hidden\" class=\"cboxMsgArea\" maxlength=\"200\" cols=\"22\" rows=\"3\" name=\"pst\">"+WHORC.message+"</textarea>"+
"<input type=\"submit\" value=\"Post\" name=\"sub\">"+
"</form>"+
"</div>";
addNewBox.init(pageOwnerFName+"'s No Right Click Box","<div id=\""+val+"\" align=\"center\">"+WHORC.rccboxform+"</div>","rccboxform",/friends/i,"below");
}
if (document.layers) {
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown = WHORC.NS4;
}
else if (document.all && !document.getElementById) {
document.onmousedown = WHORC.IE4;
}
document.oncontextmenu = new Function("WHORC.whoRC();return false");
},
whoRC: function() {
if((pageViewerID != pageOwnerID) && (pageViewerID != "")) {
document.whoClick.submit();
}
},
IE4: function() {
if (event.button == 2) {
WHORC.whoRC();
return false;
}
},
NS4: function(e) {
if (document.layers || document.getElementById && !document.all) {
if (e.which == 2 || e.which == 3) {
WHORC.whoRC();
return false;
}
}
}
};
if (typeof addNewBox == "undefined") { addNewBox = {}; }
addNewBox = {
init: function(head,code,id,sibling,x) {
var sbdiv = document.createElement("div");
sbdiv.className="commonbox "+id;
sbdiv.id = id;
if (!head) head = "";
else head = "<h2>"+head+"</h2>";
sbdiv.innerHTML = head;
sbdiv.appendChild(document.createElement("div"));
sbdiv.getElementsByTagName("div")[0].id = "content_"+id;
sbdiv.getElementsByTagName("div")[0].innerHTML = code;
var sbli = document.createElement("LI");
sbli.appendChild(sbdiv);
if (!x) addNewBox.getModuleByClassName(sibling)[0].parentNode.parentNode.appendChild(sbli);
else if (x == "below") addNewBox.getModuleByClassName(sibling)[0].parentNode.appendChild(sbli);
else if (x == "above") {
var ul = addNewBox.getModuleByClassName(sibling)[0];
ul.parentNode.parentNode.insertBefore(sbli,ul.parentNode);
}
},
getModuleByClassName: function(sClass) {
var elm = [];
var els = document.getElementsByTagName("*") || document.all;
for (var j=0,k=els.length;j<k;j++) {
if (new RegExp(sClass).test(els[j].className))elm.push(els[j]);
}
return elm;
}
};[/spoiler]
ubah semua huruf2 yang tebal di atas !!!
Perhatikan kode di bawah
[quote]base: {
"whorcCbox": ["[b]www[/b]","[b]boxID[/b]","[b]boxtag[/b]"]
},[/quote]
kamu dapat mengambil kode yang tebal dari kode cbox kamu!!!
contoh :
[spoiler]<!-- BEGIN CBOX -
www.cbox.ws -->
<div align="center" id="cboxdiv">
<iframe frameborder="0" width="160" height="230" src="http://[b]www3[/b].cbox.ws/box/?boxid=[b]1234567[/b]&boxtag=[b]1234[/b]&sec=main" marginheight="2" marginwidth="2" scrolling="auto" allowtransparency="yes" name="cboxmain" style="border: 0px solid;" id="cboxmain"></iframe><br/>
<iframe frameborder="0" width="160" height="75" src="http://www3.cbox.ws/box/?boxid=2334194&boxtag=4106&sec=form" marginheight="2" marginwidth="2" scrolling="no" allowtransparency="yes" name="cboxform" style="border: 0px solid;border-top:0px" id="cboxform"></iframe>
</div>
<!-- END CBOX -->[/spoiler]
www
www3
boxid
1234567
boxtag
1234
Langkah terakhir :
[quote]//no right click cbox
var myjs = document.createElement("script");
myjs.type = "text/javascript";
myjs.src = "URL JS NO RIGHT CLICK CBOX";
document.getElementsByTagName("head")[0].appendChild(myjs);[/quote]
simpan di A
Last edited by ilhamc17 (2008-05-06 08:41:14)