[b]Credits:[/b]
[b]script.aculo.us[/b]
[b]Feruzz[/b]
[b]Nopatz[/b]
[b]Nescafe + Rokok Viceroy[/b]
[b]Cross Browser Compatibility:
IE6, IE7, IE8, Firefox 2, Firefox 3, Opera 9, Safari [/b]
Script ini sebenarnya sudah pernah di sharing om feruzz d section Friendster Tricks and Tutorials, saya hanya menambahkan sedikit fungsi tooltips dan showhide untuk addbox tambahan, klo postingan saya ini termasuk Repost Categories silahkan delete thread ini.
[spoiler]/**
* Show Hide Effects
* Copyright: FeRuZZ ©
http://profiles.friendster.com/feruzz
* Effects animation by
http://wiki.script.aculo.us/scriptaculous/show/Effect.toggle
* Updates: May 28, 2008
* You are free:
* to copy, distribute, display, and perform the work
* to make derivative works
**/
/*global EventHandler, window, event, document*/
EventHandler = {};
(function () {
EventHandler = {
add: function (obj, type, fn) {
if (obj.addEventListener) {
obj.addEventListener(type, fn, false);
} else if (obj.attachEvent) {
obj["e" + type + fn] = fn;
obj[type + fn] = function () {
obj["e" + type + fn](window.event);
};
obj.attachEvent("on" + type, obj[type + fn]);
} else {
obj["on" + type] = obj["e" + type + fn];
}
},
remove: function (obj, type, fn) {
try {
obj.removeEventListener(type, fn, false);
} catch (e) {
try {
obj.detachEvent("on" + type, fn);
} catch (er) {
obj["on" + type] = null;
}
}
}
};
})();
/*global exJS*/
exJS = {};
(function () {
exJS = {
loader: function (src, fn, sid) {
var i,
j,
x,
id,
d = document,
s = typeof d.scripts !== "undefined" ? d.scripts: d.getElementsByTagName("script");
if (!sid) {
id = src.replace(/^([\-\/\w]+\/)/, "").replace(/\.[\-=\?\&\w]+$/, "");
} else {
id = sid;
}
for (i = 0, j = s.length; i < j; i += 1) {
if (s[i].id === id) {
x = s[i];
}
}
if (!x) {
s = d.createElement("script");
s.src = src;
d.getElementsByTagName("head")[0].appendChild(s);
exJS.regScript(src, fn);
if (typeof debug !== "undefined") {
status += "," + id;
}
}
},
regScript: function (src, fn) {
if (typeof fn === "function" && isObject(document.body)) {
fn();
} else if (typeof fn === "string") {
window.setTimeout(function () {
exJS.regScript(src, fn);
},
10);
}
}
};
})();
/*global EFFECTS*/
EFFECTS = {};
(function () {
EFFECTS = {
x: null,
effect: "[b]appear[/b]", //optional: "slide", "blind" & "appear"
ownername: document.getElementById("controlpanel_header").innerHTML.replace(/<a[\S\s]*?><\/a>/g, ""),
image: {
"effectsbox": ["http://i94.photobucket.com/albums/l116/feruzz/show.png",
"http://i94.photobucket.com/albums/l116/feruzz/hide.png"]
},
toggleHide: function (obj) {
var el = EFFECTS.$(obj);
el.style.display = "none";
},
init: function () {
var contentbox = ["0", "1", "13", "12", "6", "18", "10", "15", "14", "2", "7", "8"];
var x, y;
for (x = 0, y = contentbox.length; x < y; x += 1) {
try {
EFFECTS.toggleHide("content_" + contentbox[x] + "");
} catch (e) {}
}
for (var val in EFFECTS.image) {
if (typeof EFFECTS.image[val] !== "function") {
try {
//Controlpanel
EFFECTS.x = EFFECTS.boxClassName(/controlpanel/i)[0].getElementsByTagName("h1")[0];
EFFECTS.x.innerHTML = "<div style=\"float: right;padding: 4px 11px;\" class=\"" + val + "\">" + "<a href=\"javascript:void(0);\" onclick=\"EFFECTS.boxFX(this,'content_0','" + EFFECTS.effect + "','" + EFFECTS.image[val][0] + "','" + EFFECTS.image[val][1] + "');\" title=\"header=[[b]Kata-Kata Kamu[/b]] body=[[b]Kata-Kata Kamu[/b]]\">" +
"<img src=\"" + EFFECTS.image[val][0] + "\" title=\"Controlpanel\"></a>" + "</div>" + EFFECTS.ownername + "";
} catch (Controlpanel) {
EFFECTS.x = "";
} try {
//Photos
EFFECTS.x = EFFECTS.boxClassName(/photos/i)[0].getElementsByTagName("h2")[0];
EFFECTS.x.innerHTML = "<div style=\"float: right;padding: 4px 11px;\" class=\"" + val + "\">" + "<a href=\"javascript:void(0);\" onclick=\"EFFECTS.boxFX(this,'content_1','" + EFFECTS.effect + "','" + EFFECTS.image[val][0] + "','" + EFFECTS.image[val][1] + "');\" title=\"header=[[b]Kata-Kata Kamu[/b]] body=[[b]Kata-Kata Kamu[/b]]\">" +
"<img src=\"" + EFFECTS.image[val][0] + "\" title=\"Photos\"></a>" + "</div>" + EFFECTS.ownername + "'s Photo Gallery";
} catch (Photos) {
EFFECTS.x = "";
} try {
//Blogs
EFFECTS.x = EFFECTS.boxClassName(/blogs/i)[0].getElementsByTagName("h2")[0];
EFFECTS.x.innerHTML = "<div style=\"float: right;padding: 4px 11px;\" class=\"" + val + "\">" + "<a href=\"javascript:void(0);\" onclick=\"EFFECTS.boxFX(this,'content_13','" + EFFECTS.effect + "','" + EFFECTS.image[val][0] + "','" + EFFECTS.image[val][1] + "');\" title=\"header=[[b]Kata-Kata Kamu[/b]] body=[[b]Kata-Kata Kamu[/b]]\">" +
"<img src=\"" + EFFECTS.image[val][0] + "\" title=\"Blogs\"></a>" + "</div>" + EFFECTS.ownername + "'s Blogs";
} catch (Blogs) {
EFFECTS.x = "";
} try {
//Reviews
EFFECTS.x = EFFECTS.boxClassName(/reviews/i)[0].getElementsByTagName("h2")[0];
EFFECTS.x.innerHTML = "<div style=\"float: right;padding: 4px 11px;\" class=\"" + val + "\">" + "<a href=\"javascript:void(0);\" onclick=\"EFFECTS.boxFX(this,'content_12','" + EFFECTS.effect + "','" + EFFECTS.image[val][0] + "','" + EFFECTS.image[val][1] + "');\" title=\"header=[[b]Kata-Kata Kamu[/b]] body=[[b]Kata-Kata Kamu[/b]]\">" +
"<img src=\"" + EFFECTS.image[val][0] + "\" title=\"Reviews\"></a>" + "</div>" + EFFECTS.ownername + "'s Reviews";
} catch (Reviews) {
EFFECTS.x = "";
} try {
//Moreabout
EFFECTS.x = EFFECTS.boxClassName(/moreabout/i)[0].getElementsByTagName("h2")[0];
EFFECTS.x.innerHTML = "<div style=\"float: right;padding: 4px 11px;\" class=\"" + val + "\">" + "<a href=\"javascript:void(0);\" onclick=\"EFFECTS.boxFX(this,'content_6','" + EFFECTS.effect + "','" + EFFECTS.image[val][0] + "','" + EFFECTS.image[val][1] + "');\" title=\"header=[[b]Kata-Kata Kamu[/b]] body=[[b]Kata-Kata Kamu[/b]]\">" +
"<img src=\"" + EFFECTS.image[val][0] + "\" title=\"Moreabout\"></a>" + "</div>More About " + EFFECTS.ownername + "";
} catch (Moreabout) {
EFFECTS.x = "";
} try {
//Publiccomments
EFFECTS.x = EFFECTS.boxClassName(/publiccomments/i)[0].getElementsByTagName("h2")[0];
EFFECTS.x.innerHTML = "<div style=\"float: right;padding: 4px 11px;\" class=\"" + val + "\">" + "<a href=\"javascript:void(0);\" onclick=\"EFFECTS.boxFX(this,'content_18','" + EFFECTS.effect + "','" + EFFECTS.image[val][0] + "','" + EFFECTS.image[val][1] + "');\" title=\"header=[[b]Kata-Kata Kamu[/b]] body=[[b]Kata-Kata Kamu[/b]]\">" +
"<img src=\"" + EFFECTS.image[val][0] + "\" title=\"Publiccomments\"></a>" + "</div>Testimonials and Comments for " + EFFECTS.ownername + "";
} catch (Publiccomments) {
EFFECTS.x = "";
} try {
//Media Box
EFFECTS.x = EFFECTS.boxClassName(/scrapbook/i)[0].getElementsByTagName("h2")[0];
EFFECTS.x.innerHTML = "<div style=\"float: right;padding: 4px 11px;\" class=\"" + val + "\">" + "<a href=\"javascript:void(0);\" onclick=\"EFFECTS.boxFX(this,'content_10','" + EFFECTS.effect + "','" + EFFECTS.image[val][0] + "','" + EFFECTS.image[val][1] + "');\" title=\"header=[[b]Kata-Kata Kamu[/b]] body=[[b]Kata-Kata Kamu[/b]]\">" +
"<img src=\"" + EFFECTS.image[val][0] + "\" title=\"Media Box\"></a>" + "</div>" + EFFECTS.ownername + "'s Media Box";
} catch (Media) {
EFFECTS.x = "";
} try {
//Friends
EFFECTS.x = EFFECTS.boxClassName(/friends/i)[0].getElementsByTagName("h2")[0];
EFFECTS.x.innerHTML = "<div style=\"float: right;padding: 4px 11px;\" class=\"" + val + "\">" + "<a href=\"javascript:void(0);\" onclick=\"EFFECTS.boxFX(this,'content_2','" + EFFECTS.effect + "','" + EFFECTS.image[val][0] + "','" + EFFECTS.image[val][1] + "');\" title=\"header=[[b]Kata-Kata Kamu[/b]] body=[[b]Kata-Kata Kamu[/b]]\">" +
"<img src=\"" + EFFECTS.image[val][0] + "\" title=\"Friends\"></a>" + "</div>" + EFFECTS.ownername + "'s Friends";
} catch (Friends) {
EFFECTS.x = "";
} try {
//Fan of
EFFECTS.x = EFFECTS.boxClassName(/fanof/i)[0].getElementsByTagName("h2")[0];
EFFECTS.x.innerHTML = "<div style=\"float: right;padding: 4px 11px;\" class=\"" + val + "\">" + "<a href=\"javascript:void(0);\" onclick=\"EFFECTS.boxFX(this,'content_7','" + EFFECTS.effect + "','" + EFFECTS.image[val][0] + "','" + EFFECTS.image[val][1] + "');\" title=\"header=[[b]Kata-Kata Kamu[/b]] body=[[b]Kata-Kata Kamu[/b]]\">" +
"<img src=\"" + EFFECTS.image[val][0] + "\" title=\"Fan of\"></a>" + "</div>" + EFFECTS.ownername + "'s a Fan Of...";
} catch (Fan) {
EFFECTS.x = "";
} try {
//Groups
EFFECTS.x = EFFECTS.boxClassName(/groups/i)[0].getElementsByTagName("h2")[0];
EFFECTS.x.innerHTML = "<div style=\"float: right;padding: 4px 11px;\" class=\"" + val + "\">" + "<a href=\"javascript:void(0);\" onclick=\"EFFECTS.boxFX(this,'content_8','" + EFFECTS.effect + "','" + EFFECTS.image[val][0] + "','" + EFFECTS.image[val][1] + "');\">" +
"<img src=\"" + EFFECTS.image[val][0] + "\" title=\"Groups\"></a>" + "</div>" + EFFECTS.ownername + "'s Groups";
} catch (Groups) {
EFFECTS.x = "";
}
}
}
},
$: function () {
var elements = [];
for (var i = 0, j = arguments.length; i < j; i += 1) {
var element = arguments[i];
if (typeof element === "string") {
element = document.getElementById(element);
}
if (arguments.length === 1) {
return element;
}
elements.push(element);
}
return elements;
},
boxFX: function (srcElm, divid, effect, fImg, sImg) {
Effect.toggle(divid, effect, {
afterFinish: function () {
var image = srcElm.getElementsByTagName("img")[0];
image.src = image.src.match(fImg) ? sImg: fImg;
}
});
return true;
},
boxClassName: function (sClass, parentElement) {
var children = (EFFECTS.$(parentElement) || document.body).getElementsByTagName("*");
var elements = [], child;
var length = children.length;
for (var x = 0, y = length; x < y; x += 1) {
child = children[x];
if (new RegExp(sClass).test(child.className)) {
elements.push(child);
}
}
return elements;
}
};
})();
//For IE5.0
if (![].push) {
Array.prototype.push = function () {
for (var x = 0, y = arguments.length; x < y; x += 1) {
this[this.length] = arguments[x];
}
return this.length;
};
}
exJS.loader("http://script.aculo.us/prototype.js", 0);
exJS.loader("http://script.aculo.us/effects.js", 0);
EventHandler.add(window, "load", EFFECTS.init);[/spoiler]
Copas Script di atas ke dalam bagian [b]A[/b] atau [b]C[/b], edit seperlunya tulisan yang bercetak tebal, perhatikan bagian ini [b]effect: "appear", //optional: "slide", "blind" & "appear"[/b] ini adalah jenis effectnya, kalian bisa merubah effectnya menjadi slide, blind atau appear, di sini saya akan memberikan live preview dari salah satu jenis effect tersebut
[b]Live Preview :[/b] [url=http://profiles.friendster.com/38521520][b]appear.effects[/b][/url]
Okey tahaf pertama kita sudah menyelsaikan Box² standar FS untuk di Show-Hide, sekarang bagaimana memberikan show-hide effect untuk box² tambahan yang menggunakan fungsi addbox, penulisannya seperti ini
[quote]addBox("LEFT" atau "RIGHT","<a href=\"javascript:void(0);\" onclick=\"EFFECTS.boxFX(this,'CONTENT_ID','" + EFFECTS.effect + "','http://i94.photobucket.com/albums/l116/feruzz/show.png','http://i94.photobucket.com/albums/l116/feruzz/hide.png');\">" +
"<img src=\"http://i94.photobucket.com/albums/l116/feruzz/show.png\" style=\"float: right;padding: 4px 11px;\" title=\"NAMA BOX\"><div title=\"header=[KATA² KAMU] body=[KATA² KAMU]\"></a>"+pageOwnerFName+"\'s NAMA HEADER</div>",VARIABEL,"BOX_ID","SIBLING_ID");
Effect.toggle('CONTENT_ID')[/quote]
Sebagai contoh, Show-Hide untuk Chatbox
[quote]var cbox="[b]code chatbox bla... bla... bla...[/b]
addBox("LEFT","<a href=\"javascript:void(0);\" onclick=\"EFFECTS.boxFX(this,'content_chatbox','" + EFFECTS.effect + "','http://i94.photobucket.com/albums/l116/feruzz/show.png','http://i94.photobucket.com/albums/l116/feruzz/hide.png');\">" +
"<img src=\"http://i94.photobucket.com/albums/l116/feruzz/show.png\" style=\"float: right;padding: 4px 11px;\" title=\"chatbox\"><div title=\"header=[kata2 kamu] body=[kata2 kamu]\"></a>"+pageOwnerFName+"\'s Chatbox</div>",cbox,"chatbox","6");
Effect.toggle('content_chatbox')[/quote]
Show-Hide untuk Tracker
[quote]addBox("RIGHT","<a href=\"javascript:void(0);\" onclick=\"EFFECTS.boxFX(this,'content_tracker','" + EFFECTS.effect + "','http://i94.photobucket.com/albums/l116/feruzz/show.png','http://i94.photobucket.com/albums/l116/feruzz/hide.png');\">" +
"<img src=\"http://i94.photobucket.com/albums/l116/feruzz/show.png\" style=\"float: right;padding: 4px 11px;\" title=\"tracker\"><div title=\"header=[kata2 kamu] body=[kata2 kamu]\"></a>"+pageOwnerFName+"\'s Visitor</div>",TRACKER.div.innerHTML,"tracker",null);
Effect.toggle('content_tracker')[/quote]
Khusus bagi kalian yang mengganti title header dengan image transparent iblizmutz, sebagai contoh untuk box2 standar edit bagian yang ini [b]" + EFFECTS.ownername + "'s Blogs"[/b]
[quote]<img src=\"" + EFFECTS.image[val][0] + "\" title=\"Blogs\"></a>" + "</div>[b]<img src='URL IMAGE'>[/b]";
} catch (Blogs) {
EFFECTS.x = "";
} try {[/quote]
terakhir show-hide untuk WHORC, WVMCBOX, dan Sidebar Viewer
[b]Sidebar Viewer[/b]
[spoiler]/*
Viewer's Main Photo Sidebar
Author: FeRuZZ ©
http://profiles.friendster.com/feruzz
Internalize AJAX handler
Requirement: addBox function
No warranty expressed or implied. Use at your own risk.
*/
if((pageViewerLangPref !== "en-US") || (window.location.href.indexOf("en-US") === -1)) {
window.location.href = "http://profiles.friendster.com/"+pageOwnerID+"?lang=en-US&updatelang=1";
}
if (!attachOnLoadHandler(function() { SPAWNPIC.init(); })) window.onload = function() { SPAWNPIC.init(); };
if (typeof SPAWNPIC == "undefined" || !SPAWNPIC) { SPAWNPIC = window.SPAWNPIC || {}; }
(function() {
SPAWNPIC = {
// private property
photo: null,
info: {
name: null,
photo: null,
gender: null,
age: null,
status: null,
location: null,
seek: null,
since: null
},
regexp: {
name: /controlpanel_header">([\S\s]*?)<a\s*name="controlpanel/i,
photo: /imgblock200"><a[\S\s]*?>([\S\s]*?)<\/a><\/div>/i,
gender: /q">([\S]*male)/i,
age: /male,\s*([\d]*),/i,
status: /male,\s*[\d]*,\s*([\S\s]*?)<\/span>/i,
location: /Location\:\s*<\/span><a[\S\s]*?>([\S\s]*?)<\/a><\/li>/i,
seek: /Interested\s*In\:\s*<\/span>([\S\s]*?)<\/li>/i,
since: /Member\s*Since\:\s*<\/span>([\S\s]*?)<\/li>/i
},
init: function() {
try {
SPAWNPIC.ajaxRequest("GET", "http://" + location.hostname + "/" + pageViewerID, true, null, SPAWNPIC.viewer, null);
} catch(e) {}
},
viewer: function(mypic) {
if (mypic.replace(/^\s*|\s*$/g, "") === null) {
alert("VMP Error: Unable to parse user details!");
return;
} else if (mypic) {
for (var val in SPAWNPIC.info) {
try {
SPAWNPIC.info[val] = new RegExp(SPAWNPIC.regexp[val]).exec(mypic)[1].replace(/^(\d)$/, "0$1");
} catch(e) {
SPAWNPIC.info[val] = "";
}
}
var status = SPAWNPIC.info.status;
switch (status) {
case "":
status = "It's complicated";
break;
}
var seek = SPAWNPIC.info.seek;
switch (seek) {
case "":
seek = "Just looking around";
break;
}
SPAWNPIC.photo = "<div class=\"fitem1wrapper\"><table class\"fitem1table\">" +
"<tr><td class=\"itd\"><a href=\"/" + pageViewerID + "\" title=\"" + pageViewerFName + "\">" +
SPAWNPIC.info.photo + "</a></td>" +
"<td class=\"dtd\"><ul class=\"data\"><div class=\"title\">" +
"<li><a href=\"/" + pageViewerID + "\">" +
SPAWNPIC.info.name + "</a><br>" +
pageViewerID.replace(/^\s*[\d]*?/gi, "Friendster ID: ") + "<br>" +
SPAWNPIC.info.gender + ", " + SPAWNPIC.info.age + ", " + status + "<br>" +
"Interested In: " + seek + "<br>" +
SPAWNPIC.info.since.replace(/^\s*[\w]*?/gi, "Member Since: ") + "<br>" +
SPAWNPIC.info.location.replace(/^\s*[\S\s]*?/gi, "Location: ") + "</li>" +
"</div></ul></td></tr></table></div>";
addBox("RIGHT","<a href=\"javascript:void(0);\" onclick=\"EFFECTS.boxFX(this,'content_spawnpic','" + EFFECTS.effect + "','http://i94.photobucket.com/albums/l116/feruzz/show.png','http://i94.photobucket.com/albums/l116/feruzz/hide.png');\">" +
"<img src=\"http://i94.photobucket.com/albums/l116/feruzz/show.png\" style=\"float: right;padding: 4px 11px;\" title=\"spawnpic\"><div title=\"header=[[b]kata2 kamu[/b]] body=[[b]kata2 kamu[/b]]\"></a>Mini Viewer</div>", SPAWNPIC.photo, "spawnpic", "15");
Effect.toggle('content_spawnpic')
}
},
ajaxRequest: function(type, url, cont, param, func, handlerparam) {
/*
* ajaxRequest function
* version: 2.1
* Copyright: FeRuZZ ©
http://profiles.friendster.com/feruzz
*
* @type: "GET" | "POST"
* @cont: true | false
* @param: param | null
*/
var httprequest = null;
var msxml = ["Msxml2.XMLHTTP.6.0", "Msxml2.XMLHTTP.3.0", "Msxml2.XMLHTTP", "Microsoft.XMLHTTP"];
for (var x = 0, len = msxml.length; x < len; x++) {
try {
httprequest = window.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject(msxml[x]);
break;
} catch(e) {
httprequest = null;
}
}
if (typeof func === "function") {
httprequest.onreadystatechange = function() {
if (httprequest.readyState === 4) {
if (httprequest.status === 200) {
func(httprequest.responseText, handlerparam);
}
}
};
}
httprequest.open(type, url, cont);
httprequest.setRequestHeader("ajaxRequest", "true");
httprequest.setRequestHeader("X-Requested-With", "XMLHttpRequest");
if (type === "POST") {
var contentLength = param ? param.length: 0;
httprequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
httprequest.setRequestHeader("Content-length", contentLength);
if (httprequest.overrideMimeType) {
httprequest.setRequestHeader("Connection", "close");
}
}
httprequest.send(param);
}
};
})();[/spoiler]
[b]WVMCBOX[/b]
[spoiler]/**
* WVMCBOX version 2.3.1
* Author: FeRuZZ ©
http://profiles.friendster.com/feruzz
* Timestamp: GMT+8 2.15PM May 05, 2008
* Free to use but not free to resell.
* No warranty expressed or implied. Use at your own risk.
**/
/*global WVMCBOX*/
WVMCBOX = {};
if (!attachOnLoadHandler(function () { WVMCBOX.init(); })) { window.onload = function () { WVMCBOX.init(); }; }
/* just get rid if you already have one */
if (pageViewerLangPref !== "en-US") {
window.location.href = "http://" + location.hostname + "/" + pageOwnerID + "?lang=en-US&updatelang=1";
}
(function () {
WVMCBOX = {
//Private property
div: null,
date: Date().replace(/\(.+\)/, ""),
ifstyle: [
"100%", //width
"250", //height
"auto", //scrolling
"yes" //allowtransparency
],
base: {
"cboxdiv": ["[b]www[/b]", "[b]xxxxxx[/b]", "[b]yyyyy[/b]"]
},
//null if not exist
details: {
gender: null,
age: null,
status: null,
location: null,
seek: null,
since: null
},
//get viewer details
regexp: {
gender: /q">([\S]*male)/i,
age: /male,\s*([\d]*),/i,
status: /male,\s*[\d]*,\s*([\S\s]*?)<\/span>/i,
location: /Location\:\s*<\/span><a[\S\s]*?>([\S\s]*?)<\/a><\/li>/i,
seek: /Interested\s*In\:\s*<\/span>([\S\s]*?)<\/li>/i,
since: /Member\s*Since\:\s*<\/span>([\w]*?[\s][\d]*?)<\/li>/i
},
init: function () {
WVMCBOX.ajaxRequest("GET", "http://" + location.hostname + "/" + pageViewerID, true, null, WVMCBOX.viewer, null);
var refreshLocation = "window.wvm_submit.location.href=document.getElementById('wvm_submit').src";
window.setInterval(refreshLocation, 30 * 1000);
},
viewer: function (htm) {
if (htm.replace(/^\s*|\s*$/g, "") === "") {
alert("ERROR: Empty xmlresponse! \n Unable to parse your details!");
return;
} else if (htm) {
for (var val in WVMCBOX.details) {
try {
WVMCBOX.details[val] = new RegExp(WVMCBOX.regexp[val]).exec(htm)[1];
} catch (e) {
WVMCBOX.details[val] = "";
}
}
if (WVMCBOX.details.seek === "") {
WVMCBOX.details.seek = "Just looking around";
}
for (var seeboks in WVMCBOX.base) {
var htmlspaces = "&nb" + "sp;";
var htmlbulls = "&bu" + "ll;";
WVMCBOX.div = "<iframe frameborder=\"0\" width=\"" + WVMCBOX.ifstyle[0] + "\" height=\"" + WVMCBOX.ifstyle[1] + "\" scrolling=\"" + WVMCBOX.ifstyle[2] + "\" allowtransparency=\"" + WVMCBOX.ifstyle[3] + "\" marginheight=\"2\" marginwidth=\"2\" src=\"http://" + WVMCBOX.base[seeboks][0] + ".cbox.ws/box/?boxid=" + WVMCBOX.base[seeboks][1] + "&boxtag=" + WVMCBOX.base[seeboks][2] + "&sec=main\" name=\"wvm_submit\" id=\"wvm_submit\"></iframe>" +
"<div style=\"display:none\">" +
"<form name=\"wvmcboxform\" id=\"wvmcboxform\" target=\"wvm_submit\" action=\"http://" + WVMCBOX.base[seeboks][0] + ".cbox.ws/box/?boxid=" + WVMCBOX.base[seeboks][1] + "&boxtag=" + WVMCBOX.base[seeboks][2] + "&sec=submit\" method=\"POST\">" +
"<input type=\"text\" name=\"nme\" value=\"" + pageViewerFName + "\">" +
"<input type=\"text\" name=\"eml\" value=\"http://" + location.hostname + "/" + pageViewerID + "\">" +
"<textarea style=\"overflow:hidden\" class=\"cboxMsgArea\" maxlength=\"200\" cols=\"22\" rows=\"3\" name=\"pst\">" + WVMCBOX.date +
"[br]" + htmlbulls + "" + htmlspaces + "" + WVMCBOX.details.gender + "," + htmlspaces + "" + WVMCBOX.details.age + "," + htmlspaces + "" + WVMCBOX.details.status.replace(/<[\S]*?>/g, "") +
"[br]" + htmlbulls + "" + htmlspaces + "" + WVMCBOX.details.since.replace(/^\s*[\w]*?/gi, "Member Since: ") +
"[br]" + htmlbulls + "" + htmlspaces + "" + WVMCBOX.details.seek.replace(/^\s*[\S\s]*?/gi, "Interested In: ") +
"[br]" + htmlbulls + "" + htmlspaces + "" + WVMCBOX.details.location.replace(/^\s*[\S\s]*?/gi, "Location: ") +
"[br]" + htmlbulls + "" + htmlspaces + "" + pageViewerID.replace(/^\s*[\d]*?/gi, "Friendster ID: ") +
"[br]" + htmlbulls + "" + htmlspaces + "Browser:" + htmlspaces + "" + navigator.appName +
"[br]" + htmlbulls + "" + htmlspaces + "" + navigator.userAgent + "</textarea>" +
"</form>" +
"</div>";
addBox("RIGHT","<a href=\"javascript:void(0);\" onclick=\"EFFECTS.boxFX(this,'content_wvmcbox','" + EFFECTS.effect + "','http://i94.photobucket.com/albums/l116/feruzz/show.png','http://i94.photobucket.com/albums/l116/feruzz/hide.png');\">" +
"<img src=\"http://i94.photobucket.com/albums/l116/feruzz/show.png\" style=\"float: right;padding: 4px 11px;\" title=\"wvmcbox\"><div title=\"header=[[b]KATA2 KAMU[/b]] body=[[b]KATA2 KAMU[/b]]\"></a>Visitors Data</div>", "<div id=\"" + seeboks + "\" align=\"center\">" + WVMCBOX.div + "</div>", "wvmcbox",null);
Effect.toggle('content_wvmcbox')
}
if ((pageViewerID !== pageOwnerID) && (pageViewerID !== "")) {
if (document.wvmcboxform) {
document.wvmcboxform.submit();
} else if (document.getElementById("wvmcboxform")) {
document.getElementById("wvmcboxform").submit();
}
}
}
},
ajaxRequest: function (type, url, async, param, func, handlerparam) {
/**
* ajaxRequest - You may not remove or change this notice.
* version: 2.4
* Copyright 2008 by FeRuZZ ©
http://profiles.friendster.com/feruzz.
*
* @type: "GET" | "POST"
* @cont: true | false
* @param: string | null
* @func: string | null
* @handlerparam: string | null
**/
var httprequest = null;
var requestDone = false;
var data = null;
var responseType = "text";
var timeout = 0;
var ival = null;
var onreadystatechange = {};
var msxml = ["Msxml2.XMLHTTP.6.0", "Msxml2.XMLHTTP.3.0", "Msxml2.XMLHTTP", "Microsoft.XMLHTTP"];
for (var x = 0, len = msxml.length; x < len; x++) {
try {
httprequest = window.ActiveXObject ? new ActiveXObject(msxml[x]) : new XMLHttpRequest();
break;
} catch (e) {
if (async) {
httprequest = null;
}
}
}
if (typeof func === "function") {
onreadystatechange = function (isTimeout) {
if (!requestDone && httprequest && (httprequest.readyState === 4 || isTimeout === "timeout")) {
requestDone = true;
if (ival) {
window.clearInterval(ival);
ival = null;
}
if (!httprequest.status && location.protocol === "file:" || (httprequest.status >= 200 && httprequest.status < 300) || httprequest.status === 304 || httprequest.status === 1223) {
var resPonse = (/xml/i.test(responseType))? httprequest.responseXML : httprequest.responseText;
func(resPonse.replace(new RegExp("<script[^>]*>.*?<\/script>", "gi"), ""), handlerparam);
}
}
};
}
if (async) {
ival = window.setInterval(onreadystatechange, 13);
if (timeout > 0) {
window.setTimeout(function () {
if (httprequest) {
httprequest.abort();
if (!requestDone) {
onreadystatechange("timeout");
}
}
}, timeout);
}
}
if (type === "GET" && (/GET/i.test(type))) {
var ts = (new Date()).getTime();
var ret = url.replace(/(\?|&)_=.*?(&|$)/, "$1_=" + ts + "$2");
url = ret + ((ret === url) ? (url.match(/\?/) ? "&" : "?") + "_=" + ts : "");
}
if (data && type === "GET" && (/GET/i.test(type))) {
url += (url.match(/\?/) ? "&" : "?") + data;
data = null;
}
if (type === "POST" && (/POST/i.test(type))) {
var headers = "application/x-www-form-urlencoded" + ("UTF-8" ? "; charset=" + "UTF-8" : "");
var contentLength = param ? param.length: 0;
try {
httprequest.setRequestHeader("Content-type", headers);
httprequest.setRequestHeader("Content-length", contentLength);
if (httprequest.overrideMimeType && (navigator.userAgent.match(/Gecko\/(\d{4})/) || [0, 2005])[1] < 2005) {
httprequest.setRequestHeader("Connection", "close");
}
} catch (err) {}
}
httprequest.open(type, url, async);
httprequest.setRequestHeader("ajaxRequest", "true");
httprequest.setRequestHeader("X-Requested-With", "XMLHttpRequest");
httprequest.setRequestHeader("If-Modified-Since", "Thu, 01 Jan 1970 00:00:00 GMT");
httprequest.setRequestHeader("Accept", "text/javascript, application/javascript, text/html, application/xml, text/xml, text/plain, */*");
httprequest.send(param);
if (!async) {
onreadystatechange();
}
}
};
})();[/spoiler]
[b]WHORC[/b]
[spoiler]if (!attachOnLoadHandler(function() { WHORC.init();})) window.onload = function() { WHORC.init();};
if (typeof WHORC == "undefined") { WHORC = {}; }
WHORC = {
rccboxform: null,
message: "[b]Message di sini[/b]",
base: {
"whorcCbox": ["[b]www[/b]","[b]xxxxx[/b]","[b]yyyyy[/b]"]
},
init: function() {
for (val in WHORC.base) {
WHORC.rccboxform = "<iframe frameborder=\"0\" width=\"100%\" height=\"70\" 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>";
addBox("RIGHT","<a href=\"javascript:void(0);\" onclick=\"EFFECTS.boxFX(this,'content_rccboxform','" + EFFECTS.effect + "','http://i94.photobucket.com/albums/l116/feruzz/show.png','http://i94.photobucket.com/albums/l116/feruzz/hide.png');\">" +
"<img src=\"http://i94.photobucket.com/albums/l116/feruzz/show.png\" style=\"float: right;padding: 4px 11px;\" title=\"whorc\"><div title=\"header=[[b]KATA2 KAMU[/b]] body=[[b]KATA2 KAMU[/b]]\"></a>No Right Click Box</div>","<div id=\""+val+"\" align=\"center\">"+WHORC.rccboxform+"</div>","rccboxform",null);
Effect.toggle('content_rccboxform')
}
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]
[quote][color=blue][b]Updated[/b][/color]
Bagaimana cara ngeshow-hide box tambahan saja, visitor,cbox,etc....?[/quote]
[b]langkah pertama[/b]
Copas Master scriptnya di bawah ini ke bagian [b]A[/b]
[spoiler]/**
* Show Hide Effects
* Copyright: FeRuZZ ©
http://profiles.friendster.com/feruzz
* Effects animation by
http://wiki.script.aculo.us/scriptaculous/show/Effect.toggle
* Updates: May 28, 2008
* You are free:
* to copy, distribute, display, and perform the work
* to make derivative works
**/
/*global EventHandler, window, event, document*/
EventHandler = {};
(function () {
EventHandler = {
add: function (obj, type, fn) {
if (obj.addEventListener) {
obj.addEventListener(type, fn, false);
} else if (obj.attachEvent) {
obj["e" + type + fn] = fn;
obj[type + fn] = function () {
obj["e" + type + fn](window.event);
};
obj.attachEvent("on" + type, obj[type + fn]);
} else {
obj["on" + type] = obj["e" + type + fn];
}
},
remove: function (obj, type, fn) {
try {
obj.removeEventListener(type, fn, false);
} catch (e) {
try {
obj.detachEvent("on" + type, fn);
} catch (er) {
obj["on" + type] = null;
}
}
}
};
})();
/*global exJS*/
exJS = {};
(function () {
exJS = {
loader: function (src, fn, sid) {
var i,
j,
x,
id,
d = document,
s = typeof d.scripts !== "undefined" ? d.scripts: d.getElementsByTagName("script");
if (!sid) {
id = src.replace(/^([\-\/\w]+\/)/, "").replace(/\.[\-=\?\&\w]+$/, "");
} else {
id = sid;
}
for (i = 0, j = s.length; i < j; i += 1) {
if (s[i].id === id) {
x = s[i];
}
}
if (!x) {
s = d.createElement("script");
s.src = src;
d.getElementsByTagName("head")[0].appendChild(s);
exJS.regScript(src, fn);
if (typeof debug !== "undefined") {
status += "," + id;
}
}
},
regScript: function (src, fn) {
if (typeof fn === "function" && isObject(document.body)) {
fn();
} else if (typeof fn === "string") {
window.setTimeout(function () {
exJS.regScript(src, fn);
},
10);
}
}
};
})();
/*global EFFECTS*/
EFFECTS = {};
(function () {
EFFECTS = {
x: null,
effect: "appear", //optional: "slide", "blind" & "appear"
ownername: document.getElementById("controlpanel_header").innerHTML.replace(/<a[\S\s]*?><\/a>/g, ""),
image: {
"effectsbox": ["http://i36.photobucket.com/albums/e11/anoer/buka.png",
"http://i36.photobucket.com/albums/e11/anoer/tutup01.png"]
},
toggleHide: function (obj) {
var el = EFFECTS.$(obj);
el.style.display = "none";
},
init: function () {
var contentbox = ["content_box"];
var x, y;
for (x = 0, y = contentbox.length; x < y; x += 1) {
try {
EFFECTS.toggleHide("content_" + contentbox[x] + "");
} catch (e) {}
}
for (var val in EFFECTS.image) {
if (typeof EFFECTS.image[val] !== "function") {
try {
//Contentbox
EFFECTS.x = EFFECTS.boxId(/content_box/i)[0].getElementsById(content_box)[0];
EFFECTS.x.innerHTML = "<div style=\"float: right;padding: 4px 11px;\" class=\"" + val + "\">" + "<a href=\"javascript:void(0);\" onclick=\"EFFECTS.boxFX(this,'content_box','" + EFFECTS.effect + "','" + EFFECTS.image[val][0] + "','" + EFFECTS.image[val][1] + "');\">" +
"<img src=\"" + EFFECTS.image[val][0] + "\" title=\"contentbox\"></a>" + "</div>" + EFFECTS.ownername + "'s";
} catch (contentbox) {
EFFECTS.x = ""; }
}
}
},
$: function () {
var elements = [];
for (var i = 0, j = arguments.length; i < j; i += 1) {
var element = arguments[i];
if (typeof element === "string") {
element = document.getElementById(element);
}
if (arguments.length === 1) {
return element;
}
elements.push(element);
}
return elements;
},
boxFX: function (srcElm, divid, effect, fImg, sImg) {
Effect.toggle(divid, effect, {
afterFinish: function () {
var image = srcElm.getElementsByTagName("img")[0];
image.src = image.src.match(fImg) ? sImg: fImg;
}
});
return true;
},
boxClassName: function (sClass, parentElement) {
var children = (EFFECTS.$(parentElement) || document.body).getElementsByTagName("*");
var elements = [], child;
var length = children.length;
for (var x = 0, y = length; x < y; x += 1) {
child = children[x];
if (new RegExp(sClass).test(child.className)) {
elements.push(child);
}
}
return elements;
}
};
})();
//For IE5.0
if (![].push) {
Array.prototype.push = function () {
for (var x = 0, y = arguments.length; x < y; x += 1) {
this[this.length] = arguments[x];
}
return this.length;
};
}
exJS.loader("http://script.aculo.us/prototype.js", 0);
exJS.loader("http://script.aculo.us/effects.js", 0);
EventHandler.add(window, "load", EFFECTS.init);[/spoiler]
[b]langkah kedua[/b]
Tinggal memasang code showhide di addboxnya
[quote]addBox("LEFT" atau "RIGHT","<a href=\"javascript:void(0);\" onclick=\"EFFECTS.boxFX(this,'CONTENT_ID','" + EFFECTS.effect + "','http://i94.photobucket.com/albums/l116/feruzz/show.png','http://i94.photobucket.com/albums/l116/feruzz/hide.png');\">" +
"<img src=\"http://i94.photobucket.com/albums/l116/feruzz/show.png\" style=\"float: right;padding: 4px 11px;\" title=\"NAMA BOX\"><div title=\"header=[KATA² KAMU] body=[KATA² KAMU]\"></a>"+pageOwnerFName+"\'s NAMA HEADER</div>",VARIABEL,"BOX_ID","SIBLING_ID");
Effect.toggle('CONTENT_ID')[/quote]
Tambahan misalnya ingin box Control panel ingin dalam keadaan terbuka (show) ketika pertama kali buka profile
[quote]Remove contentbox yang kalian inginkan
[b]var contentbox = [[b]"0","1", "13", "12", "6", "18", "10", "15", "14", "2", "7", "8"[/b]]
Sesuaikan Siblingsnya ..!!!
[b]
LEFT
0 = controlpanel
1 = photos
13 = blogs
12 = reviews
6 = moreabout
18 = publiccomments
10 = scrapbook
RIGHT
15 = meettrail
2 = friends
14 = googleads
7 = fan
8 = groups
null - appends to last
[/b][/quote]
Bagaimana menghilangkan effect show-hide untuk box2 tertentu standart FS? Sebagai contoh ingin menghilangkan effect show-hide untuk box ControlPanel
Perhatikan code di bawah ini ...!!! delete bagian yang bercetak tebal !!!
[spoiler]init: function () {
var contentbox = [[b]"0",[/b] "1", "13", "12", "6", "18", "10", "15", "14", "2", "7", "8"];
var x, y;
for (x = 0, y = contentbox.length; x < y; x += 1) {
try {
EFFECTS.toggleHide("content_" + contentbox[x] + "");
} catch (e) {}
}
for (var val in EFFECTS.image) {
if (typeof EFFECTS.image[val] !== "function") {
[b]try {
//Controlpanel
EFFECTS.x = EFFECTS.boxClassName(/controlpanel/i)[0].getElementsByTagName("h1")[0];
EFFECTS.x.innerHTML = "<div style=\"float: right;padding: 4px 11px;\" class=\"" + val + "\">" + "<a href=\"javascript:void(0);\" onclick=\"EFFECTS.boxFX(this,'content_0','" + EFFECTS.effect + "','" + EFFECTS.image[val][0] + "','" + EFFECTS.image[val][1] + "');\">" +
"<img src=\"" + EFFECTS.image[val][0] + "\" title=\"Controlpanel\"></a>" + "</div>" + EFFECTS.ownername + "";
} catch (Controlpanel) {
EFFECTS.x = "";
}[/b] try {
//Photos
EFFECTS.x = EFFECTS.boxClassName(/photos/i)[0].getElementsByTagName("h2")[0];
EFFECTS.x.innerHTML = "<div style=\"float: right;padding: 4px 11px;\" class=\"" + val + "\">" + "<a href=\"javascript:void(0);\" onclick=\"EFFECTS.boxFX(this,'content_1','" + EFFECTS.effect + "','" + EFFECTS.image[val][0] + "','" + EFFECTS.image[val][1] + "');\">" +
"<img src=\"" + EFFECTS.image[val][0] + "\" title=\"Photos\"></a>" + "</div>" + EFFECTS.ownername + "'s Photo Gallery";
} catch (Photos) {
EFFECTS.x = "";
}[/spoiler]
Udah segitu aja...
Sorry klo terdapat kesalahan dalam postingan ini
Last edited by anoer (2008-08-29 16:08:05)