• ARCHIVES 
  • » Sebenarnya tutorial ini berhubungan dengan script JS yang namanya [b]JS Initialitation[/b] atau [b]JS.init() [/b]. Memang sih loading JS di FS dipengaruhi juga oleh koneksi internet kita tapi kalau JS

Pages: 12345..5

Sebenarnya tutorial ini berhubungan dengan script JS yang namanya [b]JS Initialitation[/b] atau [b]JS.init() [/b]. Memang sih loading JS di FS dipengaruhi juga oleh koneksi internet kita tapi kalau JS

☻KaNaLiTnUk☻
» Banned
FTalk Level: zero
45
0
1969-12-31

Sebenarnya tutorial ini berhubungan dengan script JS yang namanya [b]JS Initialitation[/b] atau [b]JS.init() [/b]. Memang sih loading JS di FS dipengaruhi juga oleh koneksi internet kita tapi kalau JS

Sebenarnya tutorial ini berhubungan dengan script JS yang namanya [b]JS Initialitation[/b] atau [b]JS.init() [/b]. Memang sih loading JS di FS dipengaruhi juga oleh koneksi internet kita tapi kalau JS kita lebih teratur otomatis JS nya juga akan lebih cepat terbaca oleh FS :) Sebagai contoh, kita ambil script tracker.js dari WVM versi 3.1 OK. Ini dia scriptnya : [quote]//onload handler function onProfileLoad() { addBox("RIGHT",pageOwnerFName+"'s Visitors",TRACKER.div.innerHTML,"tracker",null); } /*TRACKER OBJECT*/ if (typeof TRACKER == "undefined") { TRACKER = {}; } TRACKER = { //iframe css style: { filter: "chroma(color='#FFFFFF')", width: '300px', height: '1200px', border: '0px' }, //iframe attributes attributes: { frameborder: '0', allowtransparency: 'true' }, phplink: "http://renalvir.zuiken.net/tracker/tracker.php", display: 10, //rows per page /*do not edit below this line*/ /* WVMv3.1.1 by marfillaster, (c) 2007 www.friendster.com/mumbhaki credits: feruzz, friendstertalk.com, www.friendster.com licensed under GNU General Public License, version 2 http://www.gnu.org/licenses/gpl.html Disclaimer: NO GUARANTEE and WARRANTY provided! For educational purposes only. Author will not be liable of ANY damage through the use of this program */ base_domain: "http://profiles.friendster.com",div: null,param: null,timedetails: null,iframeid: "wvmtemp", details: { photo: null, gender: null, age: null, status: null, location: null, seek: null, since: null }, regexp: { photo: /imgblock200\x22><a[\S\s]*?img src="([\S\s]*?)"/i, gender: />([\S]*?male)/i, age: /male, ([\d]*?),/i, status: /male, [\d]*?, ([\S\s]*?)<\/span>/i, location: /Location\: <\/span><a[\S\s]*?>([\S\s]*?)<\/a><\/li>/i, seek: /In\: <\/span>([\S\s]*?)<\/li>/i, since: /Since\: <\/span>([\S\s]*?)<\/li>/i }, init: function() { getElementsByClass(/commonbox[\s]*?controlpanel/i,null,"DIV")[0].innerHTML+="<iframe id=\""+this.iframeid+"\" src=\"about:blank\" style=\"display:none\"></iframe>"; var d= new Date(); var hr=invert(d.getTimezoneOffset()/60); this.timedetails="os="+hr; var ifsrc=this.phplink+"?"+this.timedetails+"&id="+pageViewerID+"&owner="+pageOwnerID+"&num="+this.display; var atr=""; var sty=""; for (val in this.attributes) { atr += val +"="+ this.attributes[val]+" "; } for (val in this.style) { sty += val +":"+ this.style[val]+";"; } try {this.div=document.createElement("<div>")} catch(e){this.div=document.createElement("div")} this.div.innerHTML="<iframe id=\"wvm\" "+atr+"src=\""+ifsrc+"\" style=\""+sty+"\"></iframe>"; if(pageViewerID!=pageOwnerID) if(pageViewerID!="") this.getDETAILS(); }, getDETAILS: function() { processAjaxRequest("GET",this.base_domain+"/user.php?uid="+pageViewerID+"&_pmr=h&_pmmo=0&_pmt=controlpanel_1_1",true,null, "TRACKER.parseDETAILS",null); }, parseDETAILS: function(htm) { if(htm.replace(/^\s*|\s*$/g,"")=="") {this.error("Empty xmlresponse! Unable to parse your details!");return;} else { for (val in this.details) { try { this.details[val]=encodeURIComponent(new RegExp(this.regexp[val]).exec(htm)[1]); } catch(e) { this.details[val]=""; } } if(!this.details.photo) {this.error("Unable to parse primary photo! Invalid xmlresponse or incorrect photo regexp.");return;} this.param="?owner="+pageOwnerID+"&id="+pageViewerID+"&name="+pageViewerFName+"&img="+this.details.photo+"&gen="+this.details.gender+"&age="+this.details.age+"&stat="+this.details.status+"&loc="+this.details.location+"&seek="+this.details.seek+"&since="+this.details.since; document.getElementById(this.iframeid).src=this.phplink+this.param; } }, error: function(e) { alert("WVM ERROR: "+e+" Tracker will not update."); } }; /*END TRACKER OBJECT*/ if (!attachOnLoadHandler(function(){onProfileLoad()})) window.onload = function(){onProfileLoad()}; [b]TRACKER.init();[/b] /*MISC FUNCTIONS*/ function addBox (type,head,htm,id,sibling) { //by marfillaster //type "LEFT" | "RIGHT" //head header string //htm innerHTML string //id css_id string //sibling css_id_insertbefore string | null /* Available default Siblings 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 */ try { var li=document.createElement("li"); } catch(e) { var li=document.createElement("<li>"); } if(type=="LEFT") { var ul=document.getElementById("0").parentNode.parentNode; htm="<div class='boxcontent'>"+htm+"</div>"; } else var ul=document.getElementById("2").parentNode.parentNode; li.innerHTML="<div id='"+id+"' class='commonbox "+id+"'>"+ "<h2>"+head+"</h2>"+ "<div id='content_"+id+"'>"+ htm+ "</div>"+ "</div>"; if(sibling==null) ul.appendChild(li); else { sibling=document.getElementById(sibling).parentNode; ul.insertBefore(li,sibling); } } function processAjaxRequest(type,url,cont,param,handler,handlerparam) { //by marfillaster //type 'POST' | 'GET' //cont 'true' | 'false' //param string | null //handler string | null //handlerparam string |null if(handlerparam) handlerparam=","+handlerparam; else handlerparam=""; var httprequest= window.XMLHttpRequest? new XMLHttpRequest():new ActiveXObject("Msxml2.XMLHTTP"); if(handler) eval("httprequest.onreadystatechange=function(){if (httprequest.readyState==4) {"+handler+"(httprequest.responseText"+handlerparam+");}}"); httprequest.open( type, url, cont); if(type=="POST") { httprequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); httprequest.setRequestHeader("Content-length", param.length); httprequest.setRequestHeader("Connection", "close"); } httprequest.send(param); } function invert(x) { if(x>0) return parseInt("-"+x); else if(x<0) { x=x+""; return parseInt(x.substr(1,x.length-1)); } return 0; } function randOrd(){ return (Math.round(Math.random())-0.5); } 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; } /*END MISC FUNCTIONS*/[/quote] Lihat bagian yang tebal diatas. Itulah yang kita namakan [b]JS.init()[/b] yang dalam hal ini script tersebut adalah untuk inisialisasi WVM (tracker) kita. Sekarang aku akan ambil contoh 3 macam script sederhana sebagai panduan kalian. Oh iya harap diingat ketika kita ingin bereksperimen untuk mempercepat loading JS di profile kita harap diperhatikan karena yang akan kita gunakan disini hanyalah script yang menggunakan [b]JS.init()[/b]. Perhatikan baik-baik : :arrow: [b]Primary Image Replacer[/b] by Feruzz [quote]if (!attachOnLoadHandler(function() { primaryImg();})) window.onload = function() { primaryImg();}; function primaryImg() { [b]PRIMARYIMAGE.init();[/b] } if (typeof PRIMARYIMAGE == "undefined") { PRIMARYIMAGE = {}; } PRIMARYIMAGE = { HTML: [], sibling: [], init: function() { this.HTML = document.createElement("DIV"); this.HTML.innerHTML = "HTML KITA"; this.sibling = this.getModuleByClassName(/imgblock200/i)[0]; this.sibling.parentNode.replaceChild(this.HTML,this.sibling); }, 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; } };[/quote] :arrow: [b]WIWTM Viewer[/b] by Feruzz [quote]if (!attachOnLoadHandler(function(){viewer();})) window.onload = function(){viewer();}; function viewer() { if(pageViewerID!="") [b]VIEWERPIC.init();[/b] } if (typeof VIEWERPIC == "undefined") { VIEWERPIC = {}; } VIEWERPIC = { photo: [], init: function() { if(document.getElementById("viewerpic") != null) { this.ajaxRequest("http://"+location.hostname+"/modules/module.php?_pmr=a&_pmmo=0&uid="+pageViewerID,"VIEWERPIC.viewer",null); } }, viewer: function(htm) { if (htm.replace(/^\s*|\s*$/g,"") === null) { alert("VMP Error: Unable to parse the photo!");return; }else if (htm) { try { var targetPhoto = htm.match(/<profile_photo>[\S\s]+?<\/profile_photo>/gim)[0].replace(/<[\S\s]+?>/gim, ""); var targetName = htm.match(/<firstname>[\S\s]+?<\/firstname>/gim)[0].replace(/<[\S\s]+?>/gim, ""); var targetEmail = htm.match(/<email>[\S\s]+?<\/email>/gim)[0].replace(/<[\S\s]+?>/gim, ""); this.photo = document.createElement("DIV"); this.photo.align = "center"; this.photo.appendChild(document.createElement("a")); this.photo.getElementsByTagName("a")[0].href = "/"+pageViewerID; this.photo.getElementsByTagName("a")[0].target = "_blank"; this.photo.getElementsByTagName("a")[0].title = pageViewerFName; this.photo.getElementsByTagName("a")[0].appendChild(document.createElement("img")); this.photo.getElementsByTagName("img")[0].src = targetPhoto; this.photo.appendChild(document.createElement("br")); this.photo.appendChild(document.createElement("span")); this.photo.getElementsByTagName("span")[0].className = "q"; this.photo.getElementsByTagName("span")[0].appendChild(document.createElement("a")); this.photo.getElementsByTagName("a")[1].href = "/"+pageViewerID; this.photo.getElementsByTagName("a")[1].target = "_blank"; this.photo.getElementsByTagName("a")[1].title = pageViewerFName; this.photo.getElementsByTagName("a")[1].innerHTML = targetName; this.photo.appendChild(document.createElement("br")); this.photo.appendChild(document.createElement("span")); this.photo.getElementsByTagName("span")[1].className = "q"; this.photo.getElementsByTagName("span")[1].innerHTML = targetEmail; document.getElementById("viewerpic").appendChild(this.photo); }catch(e) {} } }, ajaxRequest: function(url,func,handler) { if (handler) { handler = ","+handler; }else { handler = ""; } var httprequest= window.XMLHttpRequest? new XMLHttpRequest():new ActiveXObject("Msxml2.XMLHTTP"); if (func) { eval("httprequest.onreadystatechange=function(){if (httprequest.readyState==4) {"+func+"(httprequest.responseText"+handler+");}}"); } httprequest.open("GET", url, true); httprequest.send(null); } };[/quote] :arrow: [b]Side Viewer[/b] by Feruzz [quote]if (!attachOnLoadHandler(function() { mainVpic();})) window.onload = function() { mainVpic();}; function mainVpic() { if(pageViewerID!="") [b]SPAWNPIC.init();[/b] } if (typeof SPAWNPIC == "undefined") { SPAWNPIC = {}; } SPAWNPIC = { photo: [], init: function() { this.ajaxRequest("http://"+window.location.host+"/"+pageViewerID,"SPAWNPIC.viewer",null); }, viewer: function(htm) { if (htm.replace(/^\s*|\s*$/g,"") === null) { alert("VMP Error: Unable to parse the photo!"); return; }else if (htm) { var name = /controlpanel_header">([\S\s]+?)<a\s+?name="controlpanel/i.exec(htm)[1].replace(/^(\d)$/,"0$1"); var photo = /imgblock200"><a[\S\s]*?>([\S\s]+?)<\/a><\/div>/i.exec(htm)[1].replace(/^(\d)$/,"0$1"); var status = /data">([\S\s]+?)<\/span><\/li>/i.exec(htm)[1].replace(/^(\d)$/,"0$1"); var since = /Since\:\s+?<\/span>([\S\s]+?)<\/li>/i.exec(htm)[1].replace(/^(\d)$/,"0$1"); var location = /Location\:\s+<\/span>([\S\s]+?)<\/li>/i.exec(htm)[1].replace(/^(\d)$/,"0$1"); this.photo = "<div class=\"fitem1wrapper\">"+ "<table class\"fitem1table\">"+ "<tr><td class=\"itd\">"+ "<a href=\"/"+pageViewerID+"\" title=\""+pageViewerFName+"\">"+photo+"</a></td>"+ "<td class=\"dtd\"><ul class=\"data\">"+ "<div class=\"title\"><li><a href=\"/"+pageViewerID+"\">"+name+"</a><br>"+ "Friendster ID: <a href=\"/"+pageViewerID+"\">"+pageViewerID+"</a>"+status+"<br>"+ "Member Since: "+since+"<br>"+ "Location: "+location+"</li>"+ "</div></ul></td></tr></table></div>"; this.box("Welcome "+name,this.photo,"spawnpic",/meettrail/i,"above"); } }, ajaxRequest: function(url,func,handler) { if (handler) { handler = ","+handler; }else { handler = ""; } var httprequest= window.XMLHttpRequest? new XMLHttpRequest():new ActiveXObject("Msxml2.XMLHTTP"); if (func) { eval("httprequest.onreadystatechange=function(){if (httprequest.readyState==4) {"+func+"(httprequest.responseText"+handler+");}}"); } httprequest.open("GET", url, true); httprequest.send(null); }, box: 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) this.getModuleByClassName(sibling)[0].parentNode.parentNode.appendChild(sbli); else if (x == "below") this.getModuleByClassName(sibling)[0].parentNode.appendChild(sbli); else if (x == "above") { var ul = this.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; } };[/quote] Perhatikan ketiga script di atas dan perhatikan bagian yang tebal. Itulah JS.init() dari masing2 script. Bagi yang baru belajar JS, ketiga script tersebut tentunya akan ditaruh di bagian paling bawah (BAGIAN C kalau bedasarkan tutorial abang terdahulu) dari tracker.js nya. Itu tidak akan menjadi masalah karena scriptnya tetap akan bekerja dengan baik. Yang akan kita lakukan disini hanyalah mengoptimalkan fungsi script2 tersebut agar loading JS di profile kita lebih cepat. Jadi nanti hasil akhir dari ketiga script tersebut setelah kita kombinasikan dengan tracker.js adalah : [quote]//onload handler function onProfileLoad() { addBox("RIGHT",pageOwnerFName+"'s Visitors",TRACKER.div.innerHTML,"tracker",null); } [color=blue][b]/*PRIMARY IMAGE REPLACER*/ if (typeof PRIMARYIMAGE == "undefined") { PRIMARYIMAGE = {}; } PRIMARYIMAGE = { HTML: [], sibling: [], init: function() { this.HTML = document.createElement("DIV"); this.HTML.innerHTML = "HTML KITA"; this.sibling = this.getModuleByClassName(/imgblock200/i)[0]; this.sibling.parentNode.replaceChild(this.HTML,this.sibling); }, 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; } };[/b][/color] [color=red][b]/*WIWTM VIEWER*/ if (typeof VIEWERPIC == "undefined") { VIEWERPIC = {}; } VIEWERPIC = { photo: [], init: function() { if(document.getElementById("viewerpic") != null) { this.ajaxRequest("http://"+location.hostname+"/modules/module.php?_pmr=a&_pmmo=0&uid="+pageViewerID,"VIEWERPIC.viewer",null); } }, viewer: function(htm) { if (htm.replace(/^\s*|\s*$/g,"") === null) { alert("VMP Error: Unable to parse the photo!");return; }else if (htm) { try { var targetPhoto = htm.match(/<profile_photo>[\S\s]+?<\/profile_photo>/gim)[0].replace(/<[\S\s]+?>/gim, ""); var targetName = htm.match(/<firstname>[\S\s]+?<\/firstname>/gim)[0].replace(/<[\S\s]+?>/gim, ""); var targetEmail = htm.match(/<email>[\S\s]+?<\/email>/gim)[0].replace(/<[\S\s]+?>/gim, ""); this.photo = document.createElement("DIV"); this.photo.align = "center"; this.photo.appendChild(document.createElement("a")); this.photo.getElementsByTagName("a")[0].href = "/"+pageViewerID; this.photo.getElementsByTagName("a")[0].target = "_blank"; this.photo.getElementsByTagName("a")[0].title = pageViewerFName; this.photo.getElementsByTagName("a")[0].appendChild(document.createElement("img")); this.photo.getElementsByTagName("img")[0].src = targetPhoto; this.photo.appendChild(document.createElement("br")); this.photo.appendChild(document.createElement("span")); this.photo.getElementsByTagName("span")[0].className = "q"; this.photo.getElementsByTagName("span")[0].appendChild(document.createElement("a")); this.photo.getElementsByTagName("a")[1].href = "/"+pageViewerID; this.photo.getElementsByTagName("a")[1].target = "_blank"; this.photo.getElementsByTagName("a")[1].title = pageViewerFName; this.photo.getElementsByTagName("a")[1].innerHTML = targetName; this.photo.appendChild(document.createElement("br")); this.photo.appendChild(document.createElement("span")); this.photo.getElementsByTagName("span")[1].className = "q"; this.photo.getElementsByTagName("span")[1].innerHTML = targetEmail; document.getElementById("viewerpic").appendChild(this.photo); }catch(e) {} } }, ajaxRequest: function(url,func,handler) { if (handler) { handler = ","+handler; }else { handler = ""; } var httprequest= window.XMLHttpRequest? new XMLHttpRequest():new ActiveXObject("Msxml2.XMLHTTP"); if (func) { eval("httprequest.onreadystatechange=function(){if (httprequest.readyState==4) {"+func+"(httprequest.responseText"+handler+");}}"); } httprequest.open("GET", url, true); httprequest.send(null); } };[/b][/color] [color=green][b]/*SIDE VIEWER*/ if (typeof SPAWNPIC == "undefined") { SPAWNPIC = {}; } SPAWNPIC = { photo: [], init: function() { this.ajaxRequest("http://"+window.location.host+"/"+pageViewerID,"SPAWNPIC.viewer",null); }, viewer: function(htm) { if (htm.replace(/^\s*|\s*$/g,"") === null) { alert("VMP Error: Unable to parse the photo!"); return; }else if (htm) { var name = /controlpanel_header">([\S\s]+?)<a\s+?name="controlpanel/i.exec(htm)[1].replace(/^(\d)$/,"0$1"); var photo = /imgblock200"><a[\S\s]*?>([\S\s]+?)<\/a><\/div>/i.exec(htm)[1].replace(/^(\d)$/,"0$1"); var status = /data">([\S\s]+?)<\/span><\/li>/i.exec(htm)[1].replace(/^(\d)$/,"0$1"); var since = /Since\:\s+?<\/span>([\S\s]+?)<\/li>/i.exec(htm)[1].replace(/^(\d)$/,"0$1"); var location = /Location\:\s+<\/span>([\S\s]+?)<\/li>/i.exec(htm)[1].replace(/^(\d)$/,"0$1"); this.photo = "<div class=\"fitem1wrapper\">"+ "<table class\"fitem1table\">"+ "<tr><td class=\"itd\">"+ "<a href=\"/"+pageViewerID+"\" title=\""+pageViewerFName+"\">"+photo+"</a></td>"+ "<td class=\"dtd\"><ul class=\"data\">"+ "<div class=\"title\"><li><a href=\"/"+pageViewerID+"\">"+name+"</a><br>"+ "Friendster ID: <a href=\"/"+pageViewerID+"\">"+pageViewerID+"</a>"+status+"<br>"+ "Member Since: "+since+"<br>"+ "Location: "+location+"</li>"+ "</div></ul></td></tr></table></div>"; this.box("Welcome "+name,this.photo,"spawnpic",/meettrail/i,"above"); } }, ajaxRequest: function(url,func,handler) { if (handler) { handler = ","+handler; }else { handler = ""; } var httprequest= window.XMLHttpRequest? new XMLHttpRequest():new ActiveXObject("Msxml2.XMLHTTP"); if (func) { eval("httprequest.onreadystatechange=function(){if (httprequest.readyState==4) {"+func+"(httprequest.responseText"+handler+");}}"); } httprequest.open("GET", url, true); httprequest.send(null); }, box: 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) this.getModuleByClassName(sibling)[0].parentNode.parentNode.appendChild(sbli); else if (x == "below") this.getModuleByClassName(sibling)[0].parentNode.appendChild(sbli); else if (x == "above") { var ul = this.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; } };[/b][/color] /*TRACKER OBJECT*/ if (typeof TRACKER == "undefined") { TRACKER = {}; } TRACKER = { //iframe css style: { filter: "chroma(color='#FFFFFF')", width: '300px', height: '1200px', border: '0px' }, //iframe attributes attributes: { frameborder: '0', allowtransparency: 'true' }, phplink: "http://renalvir.zuiken.net/tracker/tracker.php", display: 10, //rows per page /*do not edit below this line*/ /* WVMv3.1.1 by marfillaster, (c) 2007 www.friendster.com/mumbhaki credits: feruzz, friendstertalk.com, www.friendster.com licensed under GNU General Public License, version 2 http://www.gnu.org/licenses/gpl.html Disclaimer: NO GUARANTEE and WARRANTY provided! For educational purposes only. Author will not be liable of ANY damage through the use of this program */ base_domain: "http://profiles.friendster.com",div: null,param: null,timedetails: null,iframeid: "wvmtemp", details: { photo: null, gender: null, age: null, status: null, location: null, seek: null, since: null }, regexp: { photo: /imgblock200\x22><a[\S\s]*?img src="([\S\s]*?)"/i, gender: />([\S]*?male)/i, age: /male, ([\d]*?),/i, status: /male, [\d]*?, ([\S\s]*?)<\/span>/i, location: /Location\: <\/span><a[\S\s]*?>([\S\s]*?)<\/a><\/li>/i, seek: /In\: <\/span>([\S\s]*?)<\/li>/i, since: /Since\: <\/span>([\S\s]*?)<\/li>/i }, init: function() { getElementsByClass(/commonbox[\s]*?controlpanel/i,null,"DIV")[0].innerHTML+="<iframe id=\""+this.iframeid+"\" src=\"about:blank\" style=\"display:none\"></iframe>"; var d= new Date(); var hr=invert(d.getTimezoneOffset()/60); this.timedetails="os="+hr; var ifsrc=this.phplink+"?"+this.timedetails+"&id="+pageViewerID+"&owner="+pageOwnerID+"&num="+this.display; var atr=""; var sty=""; for (val in this.attributes) { atr += val +"="+ this.attributes[val]+" "; } for (val in this.style) { sty += val +":"+ this.style[val]+";"; } try {this.div=document.createElement("<div>")} catch(e){this.div=document.createElement("div")} this.div.innerHTML="<iframe id=\"wvm\" "+atr+"src=\""+ifsrc+"\" style=\""+sty+"\"></iframe>"; if(pageViewerID!=pageOwnerID) if(pageViewerID!="") this.getDETAILS(); }, getDETAILS: function() { processAjaxRequest("GET",this.base_domain+"/user.php?uid="+pageViewerID+"&_pmr=h&_pmmo=0&_pmt=controlpanel_1_1",true,null, "TRACKER.parseDETAILS",null); }, parseDETAILS: function(htm) { if(htm.replace(/^\s*|\s*$/g,"")=="") {this.error("Empty xmlresponse! Unable to parse your details!");return;} else { for (val in this.details) { try { this.details[val]=encodeURIComponent(new RegExp(this.regexp[val]).exec(htm)[1]); } catch(e) { this.details[val]=""; } } if(!this.details.photo) {this.error("Unable to parse primary photo! Invalid xmlresponse or incorrect photo regexp.");return;} this.param="?owner="+pageOwnerID+"&id="+pageViewerID+"&name="+pageViewerFName+"&img="+this.details.photo+"&gen="+this.details.gender+"&age="+this.details.age+"&stat="+this.details.status+"&loc="+this.details.location+"&seek="+this.details.seek+"&since="+this.details.since; document.getElementById(this.iframeid).src=this.phplink+this.param; } }, error: function(e) { alert("WVM ERROR: "+e+" Tracker will not update."); } }; /*END TRACKER OBJECT*/ if (!attachOnLoadHandler(function(){onProfileLoad()})) window.onload = function(){onProfileLoad()}; [color=blue][b]PRIMARYIMAGE.init();[/b][/color] [color=red][b]VIEWERPIC.init();[/b][/color] [color=green][b]SPAWNPIC.init();[/b][/color] [b]TRACKER.init();[/b] /*MISC FUNCTIONS*/ function addBox (type,head,htm,id,sibling) { //by marfillaster //type "LEFT" | "RIGHT" //head header string //htm innerHTML string //id css_id string //sibling css_id_insertbefore string | null /* Available default Siblings 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 */ try { var li=document.createElement("li"); } catch(e) { var li=document.createElement("<li>"); } if(type=="LEFT") { var ul=document.getElementById("0").parentNode.parentNode; htm="<div class='boxcontent'>"+htm+"</div>"; } else var ul=document.getElementById("2").parentNode.parentNode; li.innerHTML="<div id='"+id+"' class='commonbox "+id+"'>"+ "<h2>"+head+"</h2>"+ "<div id='content_"+id+"'>"+ htm+ "</div>"+ "</div>"; if(sibling==null) ul.appendChild(li); else { sibling=document.getElementById(sibling).parentNode; ul.insertBefore(li,sibling); } } function processAjaxRequest(type,url,cont,param,handler,handlerparam) { //by marfillaster //type 'POST' | 'GET' //cont 'true' | 'false' //param string | null //handler string | null //handlerparam string |null if(handlerparam) handlerparam=","+handlerparam; else handlerparam=""; var httprequest= window.XMLHttpRequest? new XMLHttpRequest():new ActiveXObject("Msxml2.XMLHTTP"); if(handler) eval("httprequest.onreadystatechange=function(){if (httprequest.readyState==4) {"+handler+"(httprequest.responseText"+handlerparam+");}}"); httprequest.open( type, url, cont); if(type=="POST") { httprequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); httprequest.setRequestHeader("Content-length", param.length); httprequest.setRequestHeader("Connection", "close"); } httprequest.send(param); } function invert(x) { if(x>0) return parseInt("-"+x); else if(x<0) { x=x+""; return parseInt(x.substr(1,x.length-1)); } return 0; } function randOrd(){ return (Math.round(Math.random())-0.5); } 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; } /*END MISC FUNCTIONS*/[/quote] [b]NOTE :[/b] Tidak semua JS.init() bisa dikombinasikan seperti di atas. Contohnya script Check Account milik bro Nophatz. Ketika abang kombinasikan memang JS nya tampil tapi scriptnya tidak bekerja dengan baik. Tutorial ini hanya sebagai panduan bagi kalian yang ingin belajar membuat JS kalian lebih teratur dan lebih cepat dibaca oleh FS OK. Happy tweaking FTI'ers semua :thumbsup: [quote][b]TIPS :[/b] Bagi mereka yang FS nya kena imbas FS update lalu mencoba pakai JS linker baru abang sarankan pakai JS linker di generator ini :arrow: [url]http://angelldeville.mydiscussionboard.com/Host-Your-Own-File-h19.htm[/url]. Sebelumnya jangan lupa ganti extension .js nya menjdi .txt habis itu masukkan ke dalam Media Box kalian :thumbsup: [b]Tanya :[/b] Setelah JS dimasukkan ke Media Box scriptnya memang jalan tapi kenapa boxnya double semua? [b]Jawab :[/b] Pakai script CSS extension tambahan di bawah ini utk hidden (sembunyikan) Media Box kalian :) [quote].scrapbook {display:none!important;}[/quote] [b]Tanya :[/b] Scriptnya memang jalan tapi kenapa setelah direfresh dia gak muncul lagi? [b]Jawab :[/b] Karena JS linkernya tidak stabil. Jadi kalaupun kalian terpaksa refresh, sambil refresh pencet juga tombol SHIFT :)[/quote]

Last edited by KhErMiNaToR (2008-02-12 00:13:25)

sat|sfact|on
» FTalkAddict
FTalk Level: zero
396
0
1969-12-31

Re: Sebenarnya tutorial ini berhubungan dengan script JS yang namanya [b]JS Initialitation[/b] atau [b]JS.init() [/b]. Memang sih loading JS di FS dipengaruhi juga oleh koneksi internet kita tapi kalau JS

1st commet :thumbsup: :thumbsup: wah.... ini trick dah lama ditunggu2 bang :thumbsup: thanxz for sharing yah bang! :thumbsup: langsung menuju ke TKP :penguin: :penguin: :penguin:
andHa
» FTalkWhiz
FTalk Level: zero
3386
0
1969-12-31

Re: Sebenarnya tutorial ini berhubungan dengan script JS yang namanya [b]JS Initialitation[/b] atau [b]JS.init() [/b]. Memang sih loading JS di FS dipengaruhi juga oleh koneksi internet kita tapi kalau JS

uhm. mu nanya bang. ini bisa d pake buat smua js ato yg cuma punya id? :rolleyes: btw, thx 4 share bang.

Last edited by andHa (2008-02-01 15:46:24)

☻KaNaLiTnUk☻
» Banned
FTalk Level: zero
45
0
1969-12-31

Re: Sebenarnya tutorial ini berhubungan dengan script JS yang namanya [b]JS Initialitation[/b] atau [b]JS.init() [/b]. Memang sih loading JS di FS dipengaruhi juga oleh koneksi internet kita tapi kalau JS

[quote=andHa]uhm. mu nanya bang. ini bisa d pake buat smua js ato yg cuma punya id? :rolleyes: btw, thx 4 share bang.[/quote] Hanya bisa dipakai untuk JS yang pakai fungsi JS.init() bro Andha tapi gak semua JS.init() bisa dikombinasikan seperti di atas lho :)
sahabat.peterpan
» FTalkWhiz
FTalk Level: zero
2815
0
1969-12-31

Re: Sebenarnya tutorial ini berhubungan dengan script JS yang namanya [b]JS Initialitation[/b] atau [b]JS.init() [/b]. Memang sih loading JS di FS dipengaruhi juga oleh koneksi internet kita tapi kalau JS

Thanks for sharing Bang Kanal :cool: :thumbsup:
PAIN
» n00b
FTalk Level: zero
10
0
1969-12-31

Re: Sebenarnya tutorial ini berhubungan dengan script JS yang namanya [b]JS Initialitation[/b] atau [b]JS.init() [/b]. Memang sih loading JS di FS dipengaruhi juga oleh koneksi internet kita tapi kalau JS

thanks for sharing.... :thumbsup: :thumbsup:
Co_don SanAdH
» FTalkAgent
FTalk Level: zero
2289
0
1969-12-31

Re: Sebenarnya tutorial ini berhubungan dengan script JS yang namanya [b]JS Initialitation[/b] atau [b]JS.init() [/b]. Memang sih loading JS di FS dipengaruhi juga oleh koneksi internet kita tapi kalau JS

thanks for sharing bang kanal :thumbsup: trik yg cukup berguna :lol: mo nyoba dulukk ahh ---->>> :penguin: :penguin:
Jirichi Ryunashira
» FTalkElite
FTalk Level: zero
7217
0
1969-12-31

Re: Sebenarnya tutorial ini berhubungan dengan script JS yang namanya [b]JS Initialitation[/b] atau [b]JS.init() [/b]. Memang sih loading JS di FS dipengaruhi juga oleh koneksi internet kita tapi kalau JS

bang kanal terima kasih bang. :rose:
yanstupid
» FTalkManiac
FTalk Level: zero
979
0
1969-12-31

Re: Sebenarnya tutorial ini berhubungan dengan script JS yang namanya [b]JS Initialitation[/b] atau [b]JS.init() [/b]. Memang sih loading JS di FS dipengaruhi juga oleh koneksi internet kita tapi kalau JS

[quote=PAIN]thanks for sharing.... :thumbsup: :thumbsup:[/quote] hahaha fan ofnya ada dimana2 :D ^on sekalian bang kombinasikan dgn friends scanner n randomized friend .. banyak yg ga ngerti tuh :D
yossi
» FTalkAddict
FTalk Level: zero
555
0
1969-12-31

Re: Sebenarnya tutorial ini berhubungan dengan script JS yang namanya [b]JS Initialitation[/b] atau [b]JS.init() [/b]. Memang sih loading JS di FS dipengaruhi juga oleh koneksi internet kita tapi kalau JS

great bang wlwpun ane lommo tambah pucing lagi,.... tapi makaseh beyaaad dah wat babangkuh neh :thumbsup: :eh:
wongudik
» n00b
FTalk Level: zero
48
0
1969-12-31

Re: Sebenarnya tutorial ini berhubungan dengan script JS yang namanya [b]JS Initialitation[/b] atau [b]JS.init() [/b]. Memang sih loading JS di FS dipengaruhi juga oleh koneksi internet kita tapi kalau JS

:thumbsup: yuuuk
HabibiDXXX
» n00b
FTalk Level: zero
88
0
1969-12-31

Re: Sebenarnya tutorial ini berhubungan dengan script JS yang namanya [b]JS Initialitation[/b] atau [b]JS.init() [/b]. Memang sih loading JS di FS dipengaruhi juga oleh koneksi internet kita tapi kalau JS

Syukron katsiron
raykyo
» FTalkManiac
FTalk Level: zero
731
0
1969-12-31

Re: Sebenarnya tutorial ini berhubungan dengan script JS yang namanya [b]JS Initialitation[/b] atau [b]JS.init() [/b]. Memang sih loading JS di FS dipengaruhi juga oleh koneksi internet kita tapi kalau JS

wah ada yg br y dr bang kanal.. tingkiu bang..pgn ngikutan jg ah.. misi bang :penguin: :penguin: :penguin:
pulasara
» FTalkAddict
FTalk Level: zero
574
0
1969-12-31

Re: Sebenarnya tutorial ini berhubungan dengan script JS yang namanya [b]JS Initialitation[/b] atau [b]JS.init() [/b]. Memang sih loading JS di FS dipengaruhi juga oleh koneksi internet kita tapi kalau JS

makacihh bgt bang tadinya aku ga suka pake loading coz lama bgt tapi setelah ada postingan dari bang kanal aku jadi tertarik pengan pake loading :wow: :wow: maksih bang 1+ 4 u :thumbsup:
cremonti
» Banned
FTalk Level: zero
1250
0
1969-12-31

Re: Sebenarnya tutorial ini berhubungan dengan script JS yang namanya [b]JS Initialitation[/b] atau [b]JS.init() [/b]. Memang sih loading JS di FS dipengaruhi juga oleh koneksi internet kita tapi kalau JS

wew, brtambah 1 lagi ilmu fs ku .. =D thx you bang kanal .. :thumbsup:
☻KaNaLiTnUk☻
» Banned
FTalk Level: zero
45
0
1969-12-31

Re: Sebenarnya tutorial ini berhubungan dengan script JS yang namanya [b]JS Initialitation[/b] atau [b]JS.init() [/b]. Memang sih loading JS di FS dipengaruhi juga oleh koneksi internet kita tapi kalau JS

[quote=yanstupid]sekalian bang kombinasikan dgn friends scanner n randomized friend .. banyak yg ga ngerti tuh :D[/quote] OK ini hasilnya bro Yanz :thumbsup: [quote]//onload handler function onProfileLoad() { addBox("RIGHT",pageOwnerFName+"'s Visitors",TRACKER.div.innerHTML,"tracker",null); } [color=blue][b]/*FRIEND SCANNER*/ if (typeof FRIENDSCAN == "undefined") { FRIENDSCAN = {}; } FRIENDSCAN = { init: function() { var emailAdd = "E-MAIL ID FS KALIAN"; var areWeFriend = "yes"; var authCode = ""; var scanner = document.getElementById("controlPanelButtons").innerHTML; var AFRconfirm = scanner.search(/Add as Friend/); if (AFRconfirm > 0) { areWeFriend = "no"; authCode = /href="[\S\s]*?authcode=([\S\s]+?)">Add as Friend/.exec(scanner)[1]; } if(areWeFriend == "no") { var cForm = confirm("It seems that you are not in my friend list.\n Do you want to add me as your friend ?"); if (cForm == true) { document.location.href="http://www.friendster.com/addfriendrequest.php?confirm=1&authcode="+authCode+"&uid="+pageOwnerID+"&id=&email="+encodeURI(emailAdd)+"&lastname="; } } } };[/b][/color] [color=red][b]/*FRIENDS RANDOMIZER*/ if (typeof Ffetcher == "undefined") { Ffetcher = {}; } Ffetcher = { friends: new Array(), pages: null, maxfriends: null, container: null, cached: new Array(), display: 10, init: function() { var num=document.links; for(var x=0;x<num.length;x++) { if (num[x].href.match(/\/friends\/[\d]+?/)) { var t=/\(([\d]+?)\)/; this.maxfriends=t.exec(num[x].innerHTML)[1]; break; } } this.pages=Math.floor(this.maxfriends/30); var htm="<div id='fcontainer' class='boxcontent'></div>"; addBox("LEFT","Randomized Friends",htm,"frbox","18"); document.getElementById("content_frbox").innerHTML+="<div class='viewall'><a href='javascript: void(Ffetcher.more())'>More Random Friends</a></div>"; this.container=document.getElementById("fcontainer"); this.fetch(0); }, fetch: function(page) { document.getElementById("frbox").childNodes[0].innerHTML="Friends Loading... Pls wait..."; processAjaxRequest("GET",TRACKER.base_domain+"/friends/"+pageOwnerID+"/"+page,true,null, "parseFriends",page); }, show: function() { this.container.innerHTML=""; this.friends.sort(randOrd); for(var x=0;x<this.display;x++) { this.container.innerHTML+=this.friends[x]; } }, more: function() { if(this.cached.length<(this.pages+1)) { var temp; do { temp=Math.ceil(Math.random()*(this.pages)); }while(this.cached.toString().indexOf(":"+temp+":")!=-1); this.fetch(temp); } else { this.show(); } } }; function parseFriends(htm,page) { if(!htm){ Ffetcher.fetch(page); return; } var r= /search1\x22>[\S\s]+?paginglinksmodule\x22>([\S\s]+?)<div class=\x22paginglinksmodule/; var temp=r.exec(htm)[1]; temp=temp.match(/<div class="flogriditem">[\S\s]+?<\/div>\n<\/div><\/div>/g); for(var x=0;x<temp.length;x++) { temp[x]=temp[x].replace("samsg_icon.gif>","samsg_icon.gif />"); temp[x]=temp[x].replace(/<a /g,"<a target=_blank "); if(!temp[x].match("nophoto")) Ffetcher.friends.push(temp[x]); } Ffetcher.cached.push(":"+page+":"); document.getElementById("frbox").childNodes[0].innerHTML="Randomized Friends"; Ffetcher.show(); }[/b][/color] /*PRIMARY IMAGE REPLACER*/ if (typeof PRIMARYIMAGE == "undefined") { PRIMARYIMAGE = {}; } PRIMARYIMAGE = { HTML: [], sibling: [], init: function() { this.HTML = document.createElement("DIV"); this.HTML.innerHTML = "HTML KITA"; this.sibling = this.getModuleByClassName(/imgblock200/i)[0]; this.sibling.parentNode.replaceChild(this.HTML,this.sibling); }, 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; } }; /*WIWTM VIEWER*/ if (typeof VIEWERPIC == "undefined") { VIEWERPIC = {}; } VIEWERPIC = { photo: [], init: function() { if(document.getElementById("viewerpic") != null) { this.ajaxRequest("http://"+location.hostname+"/modules/module.php?_pmr=a&_pmmo=0&uid="+pageViewerID,"VIEWERPIC.viewer",null); } }, viewer: function(htm) { if (htm.replace(/^\s*|\s*$/g,"") === null) { alert("VMP Error: Unable to parse the photo!");return; }else if (htm) { try { var targetPhoto = htm.match(/<profile_photo>[\S\s]+?<\/profile_photo>/gim)[0].replace(/<[\S\s]+?>/gim, ""); var targetName = htm.match(/<firstname>[\S\s]+?<\/firstname>/gim)[0].replace(/<[\S\s]+?>/gim, ""); var targetEmail = htm.match(/<email>[\S\s]+?<\/email>/gim)[0].replace(/<[\S\s]+?>/gim, ""); this.photo = document.createElement("DIV"); this.photo.align = "center"; this.photo.appendChild(document.createElement("a")); this.photo.getElementsByTagName("a")[0].href = "/"+pageViewerID; this.photo.getElementsByTagName("a")[0].target = "_blank"; this.photo.getElementsByTagName("a")[0].title = pageViewerFName; this.photo.getElementsByTagName("a")[0].appendChild(document.createElement("img")); this.photo.getElementsByTagName("img")[0].src = targetPhoto; this.photo.appendChild(document.createElement("br")); this.photo.appendChild(document.createElement("span")); this.photo.getElementsByTagName("span")[0].className = "q"; this.photo.getElementsByTagName("span")[0].appendChild(document.createElement("a")); this.photo.getElementsByTagName("a")[1].href = "/"+pageViewerID; this.photo.getElementsByTagName("a")[1].target = "_blank"; this.photo.getElementsByTagName("a")[1].title = pageViewerFName; this.photo.getElementsByTagName("a")[1].innerHTML = targetName; this.photo.appendChild(document.createElement("br")); this.photo.appendChild(document.createElement("span")); this.photo.getElementsByTagName("span")[1].className = "q"; this.photo.getElementsByTagName("span")[1].innerHTML = targetEmail; document.getElementById("viewerpic").appendChild(this.photo); }catch(e) {} } }, ajaxRequest: function(url,func,handler) { if (handler) { handler = ","+handler; }else { handler = ""; } var httprequest= window.XMLHttpRequest? new XMLHttpRequest():new ActiveXObject("Msxml2.XMLHTTP"); if (func) { eval("httprequest.onreadystatechange=function(){if (httprequest.readyState==4) {"+func+"(httprequest.responseText"+handler+");}}"); } httprequest.open("GET", url, true); httprequest.send(null); } }; /*SIDE VIEWER*/ if (typeof SPAWNPIC == "undefined") { SPAWNPIC = {}; } SPAWNPIC = { photo: [], init: function() { this.ajaxRequest("http://"+window.location.host+"/"+pageViewerID,"SPAWNPIC.viewer",null); }, viewer: function(htm) { if (htm.replace(/^\s*|\s*$/g,"") === null) { alert("VMP Error: Unable to parse the photo!"); return; }else if (htm) { var name = /controlpanel_header">([\S\s]+?)<a\s+?name="controlpanel/i.exec(htm)[1].replace(/^(\d)$/,"0$1"); var photo = /imgblock200"><a[\S\s]*?>([\S\s]+?)<\/a><\/div>/i.exec(htm)[1].replace(/^(\d)$/,"0$1"); var status = /data">([\S\s]+?)<\/span><\/li>/i.exec(htm)[1].replace(/^(\d)$/,"0$1"); var since = /Since\:\s+?<\/span>([\S\s]+?)<\/li>/i.exec(htm)[1].replace(/^(\d)$/,"0$1"); var location = /Location\:\s+<\/span>([\S\s]+?)<\/li>/i.exec(htm)[1].replace(/^(\d)$/,"0$1"); this.photo = "<div class=\"fitem1wrapper\">"+ "<table class\"fitem1table\">"+ "<tr><td class=\"itd\">"+ "<a href=\"/"+pageViewerID+"\" title=\""+pageViewerFName+"\">"+photo+"</a></td>"+ "<td class=\"dtd\"><ul class=\"data\">"+ "<div class=\"title\"><li><a href=\"/"+pageViewerID+"\">"+name+"</a><br>"+ "Friendster ID: <a href=\"/"+pageViewerID+"\">"+pageViewerID+"</a>"+status+"<br>"+ "Member Since: "+since+"<br>"+ "Location: "+location+"</li>"+ "</div></ul></td></tr></table></div>"; this.box("Welcome "+name,this.photo,"spawnpic",/meettrail/i,"above"); } }, ajaxRequest: function(url,func,handler) { if (handler) { handler = ","+handler; }else { handler = ""; } var httprequest= window.XMLHttpRequest? new XMLHttpRequest():new ActiveXObject("Msxml2.XMLHTTP"); if (func) { eval("httprequest.onreadystatechange=function(){if (httprequest.readyState==4) {"+func+"(httprequest.responseText"+handler+");}}"); } httprequest.open("GET", url, true); httprequest.send(null); }, box: 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) this.getModuleByClassName(sibling)[0].parentNode.parentNode.appendChild(sbli); else if (x == "below") this.getModuleByClassName(sibling)[0].parentNode.appendChild(sbli); else if (x == "above") { var ul = this.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; } }; /*TRACKER OBJECT*/ if (typeof TRACKER == "undefined") { TRACKER = {}; } TRACKER = { //iframe css style: { filter: "chroma(color='#FFFFFF')", width: '300px', height: '1200px', border: '0px' }, //iframe attributes attributes: { frameborder: '0', allowtransparency: 'true' }, phplink: "http://renalvir.zuiken.net/tracker/tracker.php", display: 10, //rows per page /*do not edit below this line*/ /* WVMv3.1.1 by marfillaster, (c) 2007 www.friendster.com/mumbhaki credits: feruzz, friendstertalk.com, www.friendster.com licensed under GNU General Public License, version 2 http://www.gnu.org/licenses/gpl.html Disclaimer: NO GUARANTEE and WARRANTY provided! For educational purposes only. Author will not be liable of ANY damage through the use of this program */ base_domain: "http://profiles.friendster.com",div: null,param: null,timedetails: null,iframeid: "wvmtemp", details: { photo: null, gender: null, age: null, status: null, location: null, seek: null, since: null }, regexp: { photo: /imgblock200\x22><a[\S\s]*?img src="([\S\s]*?)"/i, gender: />([\S]*?male)/i, age: /male, ([\d]*?),/i, status: /male, [\d]*?, ([\S\s]*?)<\/span>/i, location: /Location\: <\/span><a[\S\s]*?>([\S\s]*?)<\/a><\/li>/i, seek: /In\: <\/span>([\S\s]*?)<\/li>/i, since: /Since\: <\/span>([\S\s]*?)<\/li>/i }, init: function() { getElementsByClass(/commonbox[\s]*?controlpanel/i,null,"DIV")[0].innerHTML+="<iframe id=\""+this.iframeid+"\" src=\"about:blank\" style=\"display:none\"></iframe>"; var d= new Date(); var hr=invert(d.getTimezoneOffset()/60); this.timedetails="os="+hr; var ifsrc=this.phplink+"?"+this.timedetails+"&id="+pageViewerID+"&owner="+pageOwnerID+"&num="+this.display; var atr=""; var sty=""; for (val in this.attributes) { atr += val +"="+ this.attributes[val]+" "; } for (val in this.style) { sty += val +":"+ this.style[val]+";"; } try {this.div=document.createElement("<div>")} catch(e){this.div=document.createElement("div")} this.div.innerHTML="<iframe id=\"wvm\" "+atr+"src=\""+ifsrc+"\" style=\""+sty+"\"></iframe>"; if(pageViewerID!=pageOwnerID) if(pageViewerID!="") this.getDETAILS(); }, getDETAILS: function() { processAjaxRequest("GET",this.base_domain+"/user.php?uid="+pageViewerID+"&_pmr=h&_pmmo=0&_pmt=controlpanel_1_1",true,null, "TRACKER.parseDETAILS",null); }, parseDETAILS: function(htm) { if(htm.replace(/^\s*|\s*$/g,"")=="") {this.error("Empty xmlresponse! Unable to parse your details!");return;} else { for (val in this.details) { try { this.details[val]=encodeURIComponent(new RegExp(this.regexp[val]).exec(htm)[1]); } catch(e) { this.details[val]=""; } } if(!this.details.photo) {this.error("Unable to parse primary photo! Invalid xmlresponse or incorrect photo regexp.");return;} this.param="?owner="+pageOwnerID+"&id="+pageViewerID+"&name="+pageViewerFName+"&img="+this.details.photo+"&gen="+this.details.gender+"&age="+this.details.age+"&stat="+this.details.status+"&loc="+this.details.location+"&seek="+this.details.seek+"&since="+this.details.since; document.getElementById(this.iframeid).src=this.phplink+this.param; } }, error: function(e) { alert("WVM ERROR: "+e+" Tracker will not update."); } }; /*END TRACKER OBJECT*/ if (!attachOnLoadHandler(function(){onProfileLoad()})) window.onload = function(){onProfileLoad()}; [color=blue][b]FRIENDSCAN.init();[/b][/color] [color=red][b]Ffetcher.init();[/b][/color] PRIMARYIMAGE.init(); VIEWERPIC.init(); SPAWNPIC.init(); TRACKER.init(); /*MISC FUNCTIONS*/ function addBox (type,head,htm,id,sibling) { //by marfillaster //type "LEFT" | "RIGHT" //head header string //htm innerHTML string //id css_id string //sibling css_id_insertbefore string | null /* Available default Siblings 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 */ try { var li=document.createElement("li"); } catch(e) { var li=document.createElement("<li>"); } if(type=="LEFT") { var ul=document.getElementById("0").parentNode.parentNode; htm="<div class='boxcontent'>"+htm+"</div>"; } else var ul=document.getElementById("2").parentNode.parentNode; li.innerHTML="<div id='"+id+"' class='commonbox "+id+"'>"+ "<h2>"+head+"</h2>"+ "<div id='content_"+id+"'>"+ htm+ "</div>"+ "</div>"; if(sibling==null) ul.appendChild(li); else { sibling=document.getElementById(sibling).parentNode; ul.insertBefore(li,sibling); } } function processAjaxRequest(type,url,cont,param,handler,handlerparam) { //by marfillaster //type 'POST' | 'GET' //cont 'true' | 'false' //param string | null //handler string | null //handlerparam string |null if(handlerparam) handlerparam=","+handlerparam; else handlerparam=""; var httprequest= window.XMLHttpRequest? new XMLHttpRequest():new ActiveXObject("Msxml2.XMLHTTP"); if(handler) eval("httprequest.onreadystatechange=function(){if (httprequest.readyState==4) {"+handler+"(httprequest.responseText"+handlerparam+");}}"); httprequest.open( type, url, cont); if(type=="POST") { httprequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); httprequest.setRequestHeader("Content-length", param.length); httprequest.setRequestHeader("Connection", "close"); } httprequest.send(param); } function invert(x) { if(x>0) return parseInt("-"+x); else if(x<0) { x=x+""; return parseInt(x.substr(1,x.length-1)); } return 0; } function randOrd(){ return (Math.round(Math.random())-0.5); } 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; } /*END MISC FUNCTIONS*/[/quote]

Last edited by ☻KaNaLiTnUk☻ (2008-02-02 14:25:02)

strigh.plus
» n00b
FTalk Level: zero
99
0
1969-12-31

Re: Sebenarnya tutorial ini berhubungan dengan script JS yang namanya [b]JS Initialitation[/b] atau [b]JS.init() [/b]. Memang sih loading JS di FS dipengaruhi juga oleh koneksi internet kita tapi kalau JS

:thumbsup: nice trick bang n sangat berguna sekali
okacybernet
» FTalkGeek
FTalk Level: zero
1227
0
1969-12-31

Re: Sebenarnya tutorial ini berhubungan dengan script JS yang namanya [b]JS Initialitation[/b] atau [b]JS.init() [/b]. Memang sih loading JS di FS dipengaruhi juga oleh koneksi internet kita tapi kalau JS

:wow: inilah kejutan dari abang n eh trik yg mantab bang :thumbsup: saya coba dulu yah mudah2an berhasil :penguin: :penguin: tengkyu bang :thumbsup:
mbah_ngucir
» n00b
FTalk Level: zero
24
0
1969-12-31

Re: Sebenarnya tutorial ini berhubungan dengan script JS yang namanya [b]JS Initialitation[/b] atau [b]JS.init() [/b]. Memang sih loading JS di FS dipengaruhi juga oleh koneksi internet kita tapi kalau JS

ty dah buat bang kanal walaupun gw kagak ngarti :crybaby: cobain dolo aghhhhh :penguin: klo gak bisa.... :eh: ntar di campur ma air putih lalu di minum sapa tau ngerti :cool:
parlay
» FTalkAddict
FTalk Level: zero
427
0
1969-12-31

Re: Sebenarnya tutorial ini berhubungan dengan script JS yang namanya [b]JS Initialitation[/b] atau [b]JS.init() [/b]. Memang sih loading JS di FS dipengaruhi juga oleh koneksi internet kita tapi kalau JS

mnurut saia [b]init() [/b]diatas ditujukan utk memanggil sub fungsi yg didefinisikan dlm sebuah fungsi utama. ini adalah cara yg keren buat menjalankan fungsi2 jd lebih sistematis. liat contoh kode tracker diatas. if (typeof TRACKER == "undefined") { TRACKER = {}; } didalam fungsi TRACKER{} terdapat beberapa fungsi yaitu: [b] init: function() {}[/b] dan [b]getDETAILS: function() {}[/b] karena sub fungsi2 ini berada didalam fungsi utama yakni TRACKER{} namun berada di luar onload handler, sehingga utk mengeksekusinya, dipanggil dgn perintah: TRACKER.init();
  • ARCHIVES 
  • » Sebenarnya tutorial ini berhubungan dengan script JS yang namanya [b]JS Initialitation[/b] atau [b]JS.init() [/b]. Memang sih loading JS di FS dipengaruhi juga oleh koneksi internet kita tapi kalau JS

Pages: 12345..5

Board footer

© 2024 F Talk

Current time is 18:29

[ 10 queries - 0.069 second ]
Privacy Policy