Pages: 1234567..7

  2008-01-06 12:18:47

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

Ini ada sedikit tutorial untuk mengkombinasikan script Randomized Friends dengan WVM versi lama (2.1/2.2) atau dengan WVM versi baru (3.1/3.2). Aku lihat ada beberapa FTI'ers yang ketika menggunakan s

Ini ada sedikit tutorial untuk mengkombinasikan script Randomized Friends dengan WVM versi lama (2.1/2.2) atau dengan WVM versi baru (3.1/3.2). Aku lihat ada beberapa FTI'ers yang ketika menggunakan script Randomized Friends boxnya menjadi double atau script Randomized Friends nya tidak berjalan dengan baik. Harap diperhatikan baik soalnya tutorial ini sedikit merubah fungsi script Randomized Friends yang asli. Aku melakukan sedikit perubahan fungsi script Randomized Friends ini dikarenakan aku sendiri lebih nyaman menggunakan script addBox Marfillaster yang terbaru yaitu dari script addBox tracker.js WVM versi 3.1/3.2. Yang akan aku ambil disini hanyak isi dari script tracker kalian ([b]tracker object[/b]) dan script addBox serta Ajax requestnya ([b]misc script[/b]). Ini dia : [quote]/*TRACKER OBJECT*/ if (typeof TRACKER == "undefined") { TRACKER = {}; } TRACKER = { //iframe css style: { filter: "chroma(color='#FFFFFF')", width: '300px', height: '515px', border: '0px' }, //iframe attributes attributes: { frameborder: '0', allowtransparency: 'true' }, phplink: "URL PHP", display: 4, //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()}; 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] OK pertama kita lihat dulu apakah kita ini menggunakan script WVM 2.1/2.2 atau WVM 3.1/3.2 :) Biar lebih jelas, aku akan postingkan disini keduanya : :arrow: Script mentah tracker.js versi 2.1/2.2 dan cara mengkombinasikannya dengan script Randomized Friends. Disini aku juga hanya memgambil tracker object dan misc scriptnya. Ini dia : [quote][color=blue][b]/*TRACKER OBJECT*/ if (typeof TRACKER == "undefined") { TRACKER = {}; } TRACKER = { style: { filter: "chroma(color='#FFFFFF')", width: '300px', height: '1050px', border: '0px' }, attributes: { frameborder: '0', allowtransparency: 'true' }, phplink: "http://h1.ripway.com/kanalitnuk/Nutacker/tracker.php", exitmessage: "Goodbye "+pageViewerFName, /*do not edit below this line*/ /* WVMe v2.2 copyright 2007 friendster.com/mumbhaki credits: marfillaster, feruzz, renalvir, friendstertalk.com, 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"[\S\s]+?img src="([\S\s]+?)"/i, gender: />([\S]*male)/i, age: /male, ([\d]*),/i, status: /male, [\d]*, ([\S\s]*?)<\/span><\/li>/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() { document.getElementById("navBg").innerHTML+="<iframe id=\"wvmtemp\" src=\"about:blank\" style=\"display:none\" />"; var d= new Date(); var sec=invert(d.getTimezoneOffset()*60); var hr=invert(d.getTimezoneOffset()/60); this.timedetails="oss="+sec+"&osh="+hr; var ifsrc=this.phplink+"?"+this.timedetails; 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="<center><iframe id=\"wvm\" "+atr+"src=\""+ifsrc+"\" style=\""+sty+"\"></iframe><br /><input type=\"button\" class=\"reloadbutt\" value=\"Refresh Tracker\" onclick=\"Reload();\" style=\"margin: 3px;\"></center>"; 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, "parseDETAILS",null); }, sendExit: function() { document.getElementById(this.iframeid).src=this.phplink+this.param+"&exit=1"; alert(this.exitmessage); } }; function parseDETAILS(htm) { if(!htm) { TRACKER.getDETAILS(); return; }else { for (val in TRACKER.details) { try { TRACKER.details[val]=encodeURIComponent(new RegExp(TRACKER.regexp[val]).exec(htm)[1]); } catch(e) { TRACKER.details[val]=""; } } TRACKER.param="?owner="+pageOwnerID+"&id="+pageViewerID+"&name="+pageViewerFName+"&url="+TRACKER.details.photo+"&gender="+TRACKER.details.gender+"&age="+TRACKER.details.age+"&status="+TRACKER.details.status+"&country="+TRACKER.details.location+"&seek="+TRACKER.details.seek+"&since="+TRACKER.details.since; document.getElementById(TRACKER.iframeid).src=TRACKER.phplink+TRACKER.param; } } if (!attachOnLoadHandler(function(){onProfileLoad()})) window.onload = function(){onProfileLoad()}; TRACKER.init(); if(pageViewerID!=pageOwnerID) if(pageViewerID!="") document.write("<body onbeforeunload='TRACKER.sendExit()'>"); 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; } /*END TRACKER OBJECT*/[/b][/color] [color=red][b]/*MISC FUNCTIONS*/ function urlencode(txt) { return txt.replace(/ /g,"%20").replace(/'/g,"%60").replace(/</g,"%3C").replace(/>/g,"%3E"); } 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 addBox (type,head,htm,id,sibling) { //by marfillaster /* --------------------------- Available siblings left side (mainbar) "0" = controlpanel "1" = photos "13" = blogs "12" = reviews "6" = moreabout "18" = publiccomments "10" = scrapbook right side (sidebar) "15" = meettrail "2" = friends "14" = ads "7" = fan "8" = groups --------------------------- */ 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); } } /*END MISC FUNCTIONS*/[/b][/color][/quote] Lihat script diatas dan ada yang berwarna biru dan berwarna merah. Yang berwarna biru itu adalah isi dari tracker object sedang yg merah adalah isi dari misc script. Nah ini yg sedikit rumit. Kita akan merubah isi trackernya mengacu kepada tracker object dan misc script dari WVM versi 3.1/3.2 :) Jadi nanti hasil script tracker.js mentah dari WVM versi 2.1/2.2 kalian adalah (harap perhatikan bagaimana hasil akhir penempatan script briu dan merahnya OK) : [quote][color=blue][b]/*TRACKER OBJECT*/ if (typeof TRACKER == "undefined") { TRACKER = {}; } TRACKER = { style: { filter: "chroma(color='#FFFFFF')", width: '300px', height: '1050px', border: '0px' }, attributes: { frameborder: '0', allowtransparency: 'true' }, phplink: "http://h1.ripway.com/kanalitnuk/Nutacker/tracker.php", exitmessage: "Goodbye and thank you for visiting "+pageViewerFName, /*do not edit below this line*/ /* WVMe v2.2 copyright 2007 friendster.com/mumbhaki credits: marfillaster, feruzz, renalvir, friendstertalk.com, 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"[\S\s]+?img src="([\S\s]+?)"/i, gender: />([\S]*male)/i, age: /male, ([\d]*),/i, status: /male, [\d]*, ([\S\s]*?)<\/span><\/li>/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() { document.getElementById("navBg").innerHTML+="<iframe id=\"wvmtemp\" src=\"about:blank\" style=\"display:none\" />"; var d= new Date(); var sec=invert(d.getTimezoneOffset()*60); var hr=invert(d.getTimezoneOffset()/60); this.timedetails="oss="+sec+"&osh="+hr; var ifsrc=this.phplink+"?"+this.timedetails; 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="<center><iframe id=\"wvm\" "+atr+"src=\""+ifsrc+"\" style=\""+sty+"\"></iframe><br /><input type=\"button\" class=\"reloadbutt\" value=\"Refresh Tracker\" onclick=\"Reload();\" style=\"margin: 3px;\"></center>"; 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, "parseDETAILS",null); }, sendExit: function() { document.getElementById(this.iframeid).src=this.phplink+this.param+"&exit=1"; alert(this.exitmessage); } }; function parseDETAILS(htm) { if(!htm) { TRACKER.getDETAILS(); return; }else { for (val in TRACKER.details) { try { TRACKER.details[val]=encodeURIComponent(new RegExp(TRACKER.regexp[val]).exec(htm)[1]); } catch(e) { TRACKER.details[val]=""; } } TRACKER.param="?owner="+pageOwnerID+"&id="+pageViewerID+"&name="+pageViewerFName+"&url="+TRACKER.details.photo+"&gender="+TRACKER.details.gender+"&age="+TRACKER.details.age+"&status="+TRACKER.details.status+"&country="+TRACKER.details.location+"&seek="+TRACKER.details.seek+"&since="+TRACKER.details.since; document.getElementById(TRACKER.iframeid).src=TRACKER.phplink+TRACKER.param; } } /*END TRACKER OBJECT*/[/b][/color] [b]if (!attachOnLoadHandler(function(){onProfileLoad()})) window.onload = function(){onProfileLoad()}; TRACKER.init();[/b] [color=red][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*/[/b][/color][/quote] Lihat diatas bagaimana hasil akhir dari penempatan script biru dan merah dimana script birunya aku buat mengikuti alur dari tracker object WVM versi 3.1/3.2 dan misc scriptnya juga aku ganti menjadi misc script dari WVM 3.1/3.2 sehingga onloader dari script tracker initialitationnya bisa terpisah (lihat yg hitam) dan kita bisa dengan gampang memasukkan script JS intialitation kita yg lain seperti friend scanner :thumbsup: Setelah script diatas sudah kita rubah, the final step adalah memasukkan script randomizer friends kita ke dalam script diatas tapi jangan lupa untuk mengganti fungsi addBox nya. Kalau masih belum jelas, ini dia script mentah randomized friends nya : [quote]/*onload handler*/ function onProfileLoad() { Ffetcher.init(); } if (!attachOnLoadHandler(function(){onProfileLoad()})) window.onload = function(){onProfileLoad()}; /*RANDOMIZED FRIENDS*/ 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("Friends",htm,"frbox",/commonbox[\s]*?moreabout/i); 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="Friends "; Ffetcher.show(); } /*misc functions*/ function randOrd(){ return (Math.round(Math.random())-0.5); } 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); } /*addbox*/ 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; }[/quote] Lihat script di atas. Script yg biru (misc script) dan script yg merah (addBox) itu tidak akan kita perlukan lagi karena WVM kita kan sudah berisi script itu semua. Nah inilah kenapa kalau kita pakai script randomized friends yg mentah boxnya jadi double terus scriptnya gak berjalan dengan sempurna. Karena para FTI'ers kemungkinan tidak menghapus script addBox dan misc script dari script asli randomized friendsnya. Jadi script yg akan kita gunakan hanyalah 2 bagian saja yaitu : 1. Script randomized friends initialitation : [quote]Ffetcher.init();[/quote] 2. Script randomized friends function : [quote]/*RANDOMIZED FRIENDS*/ 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>"; [color=blue][b]addBox("Friends",htm,"frbox",/commonbox[\s]*?moreabout/i);[/b][/color] 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="[b]Friends[/b]"; Ffetcher.show(); }[/quote] Khusus untuk script nomor 2 jangan lupa rubah fungsi addBox nya sesuai dengan script addBox yg kita pakai (lihat yg berwarna biru). Misal ramdomized friendsnya mau kita taruh di atas kolom testimonial jadi nanti script addBox nya akan menjadi : [quote][color=blue][b]addBox("LEFT","Friends",htm,"frbox","18");[/b][/color][/quote] Sedang yg berwarna hitam adalah header utk box randomize friendsmu. Rubah sesuka hati OK :) Nah sekarang tinggal mengkombinasikan kedua script diatas ke dalam tracker.js mentah kalian yang versi lama (2.1/2.2) so nanti hasilnya akan menjadi : [quote]/*RANDOMIZED FRIENDS*/ 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","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="Friends"; Ffetcher.show(); } /*TRACKER OBJECT*/ if (typeof TRACKER == "undefined") { TRACKER = {}; } TRACKER = { style: { filter: "chroma(color='#FFFFFF')", width: '300px', height: '515px', border: '0px' }, attributes: { frameborder: '0', allowtransparency: 'true' }, phplink: "URL PHP", exitmessage: "Goodbye "+pageViewerFName, /*do not edit below this line*/ /* WVMe v2.2 copyright 2007 friendster.com/mumbhaki credits: marfillaster, feruzz, renalvir, friendstertalk.com, 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"[\S\s]+?img src="([\S\s]+?)"/i, gender: />([\S]*male)/i, age: /male, ([\d]*),/i, status: /male, [\d]*, ([\S\s]*?)<\/span><\/li>/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() { document.getElementById("navBg").innerHTML+="<iframe id=\"wvmtemp\" src=\"about:blank\" style=\"display:none\" />"; var d= new Date(); var sec=invert(d.getTimezoneOffset()*60); var hr=invert(d.getTimezoneOffset()/60); this.timedetails="oss="+sec+"&osh="+hr; var ifsrc=this.phplink+"?"+this.timedetails; 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="<center><iframe id=\"wvm\" "+atr+"src=\""+ifsrc+"\" style=\""+sty+"\"></iframe><br /><input type=\"button\" class=\"reloadbutt\" value=\"Refresh Tracker\" onclick=\"Reload();\" style=\"margin: 3px;\"></center>"; 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, "parseDETAILS",null); }, sendExit: function() { document.getElementById(this.iframeid).src=this.phplink+this.param+"&exit=1"; alert(this.exitmessage); } }; function parseDETAILS(htm) { if(!htm) { TRACKER.getDETAILS(); return; }else { for (val in TRACKER.details) { try { TRACKER.details[val]=encodeURIComponent(new RegExp(TRACKER.regexp[val]).exec(htm)[1]); } catch(e) { TRACKER.details[val]=""; } } TRACKER.param="?owner="+pageOwnerID+"&id="+pageViewerID+"&name="+pageViewerFName+"&url="+TRACKER.details.photo+"&gender="+TRACKER.details.gender+"&age="+TRACKER.details.age+"&status="+TRACKER.details.status+"&country="+TRACKER.details.location+"&seek="+TRACKER.details.seek+"&since="+TRACKER.details.since; document.getElementById(TRACKER.iframeid).src=TRACKER.phplink+TRACKER.param; } } /*END TRACKER OBJECT*/ if (!attachOnLoadHandler(function(){onProfileLoad()})) window.onload = function(){onProfileLoad()}; [b]Ffetcher.init();[/b] 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] Setelah itu selesai tambahkan script ini ke dalam CSS extensionmu : [quote]#fcontainer * { padding: 0px; margin: 0px; font-size: 9px } .thumbnaildelete { display: none } #fcontainer { text-align: center; height: 300px } #fcontainer .flogriditem { width: 85px; overflow: hidden; margin: 4px; height: 150px } .inlinelt { position: relative; left: -2px; top: 1px } .flo50 .ic .imgblock a img { height: 80px } .flo50 .ic .imgblock { height: 80px; width: 80px; overflow: hidden; background: #FFFFFF; border: 2px #97B6CA solid; text-align: center; }[/quote] Happy tweaking guys :thumbsup:

Last edited by KaNaLiTnUk (2008-03-24 10:51:35)

Pages: 1234567..7

Board footer

© 2024 F Talk

Current time is 23:11

[ 13 queries - 0.025 second ]
Privacy Policy