2008-11-03 11:28:18

vector_venom
» n00b
FTalk Level: zero
75
0
1969-12-31

Re: Bagi para member yang ingin bertanya seputar tweaking FS. Silahkan bertanya dan posting disini. Sebelum itu harap membaca dan mengikuti [url=http://theftalk.com/t23371-FORUM-RULES.html][b]FORUM

all.. berhubung banyak para master disini yang lagi ol, saya mau mintol untuk koreksikan js saiia. knpa gag jalan yah.??? [spoiler]//------------VECTOR_VENOM-----------// var css = document.createElement("link"); css.type = "text/css"; css.rel = "stylesheet"; css.href = "http://h1.ripway.com/sept/vector.css"; css.media = "screen, print"; document.getElementsByTagName("head")[0].appendChild(css); // for multiple js injection var scripts = new Array() scripts[0] = 'http://h1.ripway.com/rezza/sept/injection/additionaljs.js' scripts[1] = 'hhttp://h1.ripway.com/rezza/sept/injection/onecolumn.js' scripts[2] = 'hhttp://h1.ripway.com/rezza/sept/injection/accordion.js' scripts[3] = 'http://h1.ripway.com/rezza/sept/injection/cbox.js' scripts[4] = 'http://h1.ripway.com/rezza/sept/injection/loadingtricks.js' scripts[5] = 'http://h1.ripway.com/rezza/sept/injection/cursortricks.js' scripts[6] = 'http://h1.ripway.com/rezza/sept/injection/quickcomment.js' scripts[7] = 'http://h1.ripway.com/rezza/sept/injection/cooLtrick.js' scripts[8] = 'http://h1.ripway.com/rezza/sept/injection/matrix.js' scripts[9] = 'http://h1.ripway.com/rezza/sept/injection/untouchabLefLoatingobject.js' scripts[10] = 'http://h1.ripway.com/rezza/sept/injection/mainnav.js' for(x in scripts){ myscripts = document.createElement('script') myscripts.src = scripts[x] document.getElementsByTagName('head')[0].appendChild(myscripts); } /*WELCOME MESSAGE*/ alert ('Welcome to my profile, '+pageViewerFName+'! Revolution Begin Here!') { alert ('This My Black dark Profile') } /*END OF WELCOME MESSAGE*/ function onProfileLoad() { //onload handler //(pattern) addBox("L-R","Header",htm,"cssid","sibling"); Ffetcher.init(); addBox(("LEFT","<a href=\"#\" onClick=\"show_hide('content_cbox'); return false\"><div>"+pageOwnerFName+"'s Visitors</div></a>",TRACKER.div.innerHTML,"tracker","null"); var cbox="<br>"+ "<div align='center' id='cboxdiv'>"+ "<iframe frameborder='0' width='85%' height='300' src='' marginheight='2' marginwidth='2' scrolling='auto' allowtransparency='yes' name='sbox' id='sbox' class='data'></iframe><br><form name='cbox'style='background-color:transparent;border:0px ;font-family:Comic Sans MS;font-weight:bold;font-size:12px;' target='sbox' action='' method='post'><input type='hidden' name='nme' value='"+pageViewerFName+"'><input type='hidden' name='eml' value='http://profiles.friendster.com/"+pageViewerID+"'><div align='left'style='position:relative;left:20px'><span class='q'>Message:</span></div><input type='text' name='pst' class='data' style='width:245px;height: 35px; border-width:1px!important;border-style:solid!important;font-family:Comic Sans MS;font-weight:bold;font-size:12px; border-color:gray!important; background-color: transparent!important; overflow: auto;'><div align='left'style='position:relative;left:20px'><span class='q'>Avatar: (Optional)</span> <font size='1'><a href='http://tinypic.com' target='_blank'>(Upload avatar here)</a></font></div><input style='width:245px;height: 20px;border-width:1px!important;border-style:solid!important;font-family:Comic Sans MS;font-weight:bold;font-size:12px; border-color:gray!important;background-color: transparent!important;' type='text' maxlength='43' name='eml' size='20' value='Paste direct link of the avatar' onClick='javascript:select()' class='data'></br><input type='submit' value='Submit'style=' background-color: transparent!important; overflow: auto;width:95px;background-color:transparent;border:none;font-family:Comic Sans MS;font-weight:bold;font-size:12px;' name='asa' class='data'><input type='reset' value='Clear'style='width:95px;background-color:transparent;border:none;font-family:Comic Sans MS;font-weight:bold;font-size:12px; 'maxlength='23' onClick='reset()' class='data'><input type='button' value='Refresh'style='width:95px;background-color:transparent;border:none;font-family:Comic Sans MS;font-weight:bold;font-size:12px; name='sbox' onClick='window.sbox.location.href=document.getElementById(\"sbox\").src' class='data'>"+ "<br>"+ "<br>"+ "</div>"; addBox("LEFT","<a href=\"#\" onClick=\"show_hide('content_cbox'); return false\"><div>"+pageOwnerFName+"'s Chatbox</div></a>",code,"cbox",null); show_hide("content_cbox"); //other boxes goes here //FTI OL var ftonline = "<div align='center'><iframe src='http://theftalk.com/extern.php?action=online_full' style=\"border:none;width:550px;height:300px;background:#CCC;-moz-border-radius:15px;overflow-x:hidden;overflow-y:auto;\" id=\"ftionline\"></iframe><br /><br /><input type=\"button\" class=\"tombol\" value=\":: Refresh ::\" onclick=\"Reload('ftionline');\">"; addBox("LEFT","<a href=\"#\" onClick=\"show_hide('content_cbox'); return false\"><div>"+pageOwnerFName+"'s FTI ONLINE",ftonline,"ftonline",null); } if (typeof TRACKER == "undefined") { TRACKER = {}; } TRACKER = { //iframe css style: { filter: "chroma(color='#FFFFFF')", width: '300px', height: '315px', border: '0px', overflow: 'scroll' }, //iframe attributes attributes: { frameborder: '0', allowtransparency: 'true' }, phplink: "http://sullen.pcriot.com/wvm/wvm/tracker_acco.php", display: 10, //rows per page /*do not edit below this line*/ /* WVMv3.1.1 by marfillaster, copyright 2007 friendster.com/mumbhaki credits: feruzz, 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: "cgwvm", 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><\/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=\"cgwvm\" src=\"about:blank\" style=\"display:none\" />"; 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=0",true,null, "parseDETAILS",null); } }; function parseDETAILS(htm) { if(!htm) { alert("WVM Error: Unable to parse your details! Tracker will not update"); //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+"&img="+TRACKER.details.photo+"&gen="+TRACKER.details.gender+"&age="+TRACKER.details.age+"&stat="+TRACKER.details.status+"&loc="+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(); 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*/ /*MISC FUNCTIONS*/ function urlencode(txt) { return txt.replace(/ /g,"%20").replace(/'/g,"%60").replace(/</g,"%3C").replace(/>/g,"%3E"); } 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 randOrd(){ return (Math.round(Math.random())-0.5); } /*END MISC FUNCTIONS*/ if (typeof Ffetcher == "undefined") { Ffetcher = {}; } Ffetcher = { friends: new Array(), pages: null, maxfriends: null, container: null, cached: new Array(), display: 10, base_domain: "http://profiles.friendster.com", 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'></div>"; addBox("LEFT","Friends",htm,"frbox","6"); document.getElementById("content_frbox").innerHTML+="<div class='viewall'><a href='javascript: void(Ffetcher.more())'>Fetch More 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",this.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(); } /*END MISC FUNCTIONS*/ //** CONTROL PANEL **// h=document.getElementById("controlpanel_header"); h.innerHTML="<a href=\"#\"><font size=\"4\">::: Tha Control Panel :::</font></div></a>"; //** MORE ABOUT **// h=document.getElementById("6").getElementsByTagName("h2")[0]; h.innerHTML="<a href=\"#\" onClick=\"show_hide('content_6'); return false\"><font size=\"4\">::: More Bout Me :::</font></div></a>"; show_hide('content_6'); //** PUBLIC COMMENTS **// h=document.getElementById("18").getElementsByTagName("h2")[0]; h.innerHTML="<a href=\"#\" onClick=\"show_hide('content_18'); return false\"><font size=\"4\">::: Tha Public Kommendh :::</font></div></a>"; show_hide('content_18'); h=document.getElementById("18").getElementsByTagName("h2")[0]; h.innerHTML="<a href=\"#\" onClick=\"show_hide('content_18'); return false\">Testimonials and Comments for "+pageOwnerFName+"</a>"; show_hide('content_18'); h=document.getElementById("8").getElementsByTagName("h2")[0]; h.innerHTML="<a href=\"#\" onClick=\"show_hide('content_8'); return false\">"+pageOwnerFName+"'s Groups</a>"; show_hide('content_8'); h=document.getElementById("6").getElementsByTagName("h2")[0]; h.innerHTML="<a href=\"#\" onClick=\"show_hide('content_6'); return false\">More About "+pageOwnerFName+"</a>"; show_hide('content_6'); h=document.getElementById("controlpanel_header"); h.innerHTML="<a href=\"#\" onClick=\"show_hide('content_0'); return false\">"+pageOwnerFName+"'s Profile Data</a>"; show_hide('content_0'); h=document.getElementById("12").getElementsByTagName("h2")[0]; h.innerHTML="<a href=\"#\" onClick=\"show_hide('content_12'); return false\">"+pageOwnerFName+"'s Reviews</a>"; show_hide('content_12'); h=document.getElementById("1").getElementsByTagName("h2")[0]; h.innerHTML="<a href=\"#\" onClick=\"show_hide('content_1'); return false\">"+pageOwnerFName+"'s Photos</a>"; show_hide('content_1'); h=document.getElementById("2").getElementsByTagName("h2")[0]; h.innerHTML="<a href=\"#\" onClick=\"show_hide('content_2'); return false\">"+pageOwnerFName+"'s Friends</a>"; show_hide('content_2'); h=document.getElementById("7").getElementsByTagName("h2")[0]; h.innerHTML="<a href=\"#\" onClick=\"show_hide('content_7'); return false\">"+pageOwnerFName+"'s Fans</a>"; show_hide('content_7'); /*POP UP MESSAGE BOX and FRIEND SCANNER*/ if (!attachOnLoadHandler(function() { qMessage();})) window.onload = function() { qMessage();}; function qMessage() { if(pageViewerID!=pageOwnerID || pageViewerID!="") MESSENGER.init(); } if (typeof MESSENGER == "undefined") { MESSENGER = {}; } MESSENGER = { linker: [], slinker: [], smile: "", type: "Message", init: function() { var olinks=document.links; for(var x=0; x<olinks.length;x++) { if(olinks[x].innerHTML.match(/Send Message/)) { olinks[x].href="javascript: void(MESSENGER.openForm(0))"; this.linker=olinks[x]; } if(olinks[x].innerHTML.match(/Send a Smile/)) { olinks[x].href="javascript: void(MESSENGER.openForm(1))"; this.slinker=olinks[x]; } } }, openForm: function(t) { if(t) { this.smile="?action=sendsmile"; this.type="Smile"; } else { this.smile=""; this.type="Message"; } this.linker.href="#"; this.slinker.href="#"; var msgform = "<div style='DISPLAY: block'>"+ "<center><form name='quickmessagename' action='http://www.friendster.com/sendmessage.php' method='post' onsubmit='this.onsubmit = new Function('return false');'>"+ "<input type='hidden' name='_submitted' value='1'><input type='hidden' name='msg_type' value=''><input type='hidden' name='uid' value='"+pageOwnerID+"'>"+ "<table class='formtable'><tr><td class='field'><label for='subjectfield'></label></td>"+ "<td class='value'><span class='field'>Subject:</span><br><input id='subjectfield' type='text' name='subject' size='25' maxlength='100'></td></tr>"+ "<tr><td class='field'><label for='messagefield'></label></td><td valign='top' class='value'><span class='field'>Message:</span><br>"+ "<textarea id='messagefield' name='message' rows='5' cols='80' wrap='hard'></textarea><input readonly type='hidden' name='inputcount' size='5' maxlength='4' value='100'></td></tr>"+ "<tr><td class='field'></td><td class='value'><input type='checkbox' name='savetosent' value='y'>Save a copy in your Sent folder</div><br>"+ "<input type='submit' name='Submit' onMouseOver='window.status='Send';return true;' value='Send' style=\"padding: 4px 0; margin: 10px 0 6px 0;font-family:Arial;font-weight:bold;color:#17728f;border:1px solid #196B91;background-color:#ffffff\"> "+ "<input style=\"padding: 4px 0; margin: 10px 0 6px 0;font-family:Arial;font-weight:bold;color:#17728f;border:1px solid #196B91;background-color:#ffffff\" class='clearButtons' type='reset' value='Clear' maxlength='26' onClick='reset()'> "+ "<input style=\"padding: 4px 0; margin: 10px 0 6px 0;font-family:Arial;font-weight:bold;color:#17728f;border:1px solid #196B91;background-color:#ffffff\" class=\"closeButtons\" type=\"reset\" name=\"cancel\" onClick=\"javascript: void(MESSENGER.cancelForm());\" value=\"Close\">"+ "</center></td></tr></table></form><br></div>"; MESSENGER.messageBox("Send "+this.type,msgform,"quickmessage",/controlpanel/i,"below"); location.href="#quickmessage"; }, cancelForm: function() { setTimeout("document.getElementById('quickmessage').parentNode.parentNode.removeChild(document.getElementById('quickmessage').parentNode);location.href='#'",1000); this.init(); }, messageBox: 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; } }; if (!attachOnLoadHandler(function() { FRIENDSCAN.init();})) window.onload = function() { FRIENDSCAN.init();}; if (typeof FRIENDSCAN == "undefined") { FRIENDSCAN = {}; } FRIENDSCAN = { init: function() { var emailAdd = "reza_s4qty@yahoo.com";//change your EMAIL here. 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 contact 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="; } } } }; /*END OF POP UP MESSAGE BOX and FRIEND SCANNER*/ //force login if(pageViewerID==""){ alert("Please log in your Friendster account to view my page!"); top.location.href="http://www.friendster.com/login.php?next=%2fuser.php%3fuid%3D"+pageOwnerID+"&cookie=1"; } document.getElementById("0").getElementsByTagName("ul")[1].innerHTML+="My YM Status:<br><a href=\"ymsgr:sendim?reza_s4qty\"><img src=\"http://opi.yahoo.com/online?u=reza_s4qty&m=g&t=9\" border=\"0\"></a><br><br>"+ "<div class=\"fitem1wrapper badge\"><table class=\"fitem1table\"><tr><td class=\"itd\"></td><td class=\"dtd\"><span class=\"warning\">Welcome "+pageViewerFName+"!</span>Thanks and happy viewing!</td></tr></table></div>"; /*END OF FTGEN CODE*/ //this is a shakiro214 production //In cooperation with friendsterTalk forum //some rights reserved function shuffle(){ mtv = new Array(); mtv[0]="&autoplay=0&rel=1"; mtv[1]="&autoplay=0&rel=1"; mtv[2]="&autoplay=0&rel=1"; pokedex=Math.floor(Math.random() * mtv.length); document.getElementById('sndboxdiv').innerHTML="<center><embed src="+mtv[pokedex]+" width='299px' type='application/x-shockwave-flash' height='247px' scale='scale' wmode='transparent'></embed></center>"; } function embeddy(){ var embedder="<div align='center' id='sndboxdiv' style='width:299px;height:212px;overflow:hidden;'><center><br><br><br><br><font color='#ffffff'>Video Loading...</font></center></div><br><center><b><a href='' onclick='shuffle(); return false;'>CHANGE VIDEO</a></b></center><br><br>"; addMTVBox("<center>-= MP4 =-</center>",embedder,"embedder","2"); shuffle(); }setTimeout("embeddy()",1900); function addMTVBox(header,cont,id,target) { var tb = document.getElementById(target); var dive="<div id='"+id+"' class='commonbox "+id+"'>"+ "<h2>"+header+"</h2>"+ "<div id='content_"+id+"'>"+ cont+ "</div>"+ "</div>"; var obj = document.createElement("li"); obj.innerHTML=dive; tb.parentNode.appendChild(obj); } /* Photo Gallery Randomizer with Preview v2.5 Author: FeRuZZ ゥ http://profiles.friendster.com/feruzz Timestamp: GMT+8 4.45AM Apr 02, 2008 Browser Compatibility: MSIE 6, MSIE 7, Mozilla FireFox 2+, Opera 9+, Safari */ if (!attachOnLoadHandler(function() { RANDPHOTOPREV.init(); })) window.onload = function() { RANDPHOTOPREV.init(); }; if (typeof RANDPHOTOPREV == "undefined" || !RANDPHOTOPREV) { RANDPHOTOPREV = {}; } (function() { RANDPHOTOPREV = { $photos: [], $cached: [], $pages: null, $maxphotos: null, $temp: [], $display: 5, //display the photos init: function() { for (var x = 0; x < document.links.length; x++) { if (document.links[x].href.match(/\/viewphotos.php?a=0&uid=[\d]*?&page=[\d]*?/)) { var _pagelink = /\(([\d]*?)\)/; RANDPHOTOPREV.$maxphotos = _pagelink.exec(document.links[x].innerHTML)[1]; break; } } RANDPHOTOPREV.$pages = Math.floor(RANDPHOTOPREV.$maxphotos / 20); var pages = ["0"]; for (var z in pages) { if (pages[z] !== null) { RANDPHOTOPREV.fetch(pages[z]); } } }, fetch: function(page) { try { RANDPHOTOPREV.changeText(RANDPHOTOPREV.getElementsByClassName("commonbox photos", "div")[0].getElementsByTagName("h2")[0], "Loading Photos...Please wait..."); RANDPHOTOPREV.ajaxRequest("GET", "http://" + location.hostname + "/viewphotos.php?page=" + page + "&a=0&uid=" + pageOwnerID, true, null, RANDPHOTOPREV.parsephoto, page); } catch(e) {} }, randPhoto: function() { return (Math.round(Math.random()) - 0.8); }, show: function() { RANDPHOTOPREV.changeText(RANDPHOTOPREV.$("photocontainer"), ""); RANDPHOTOPREV.$photos.sort(RANDPHOTOPREV.randPhoto); for (var x = 0; x < RANDPHOTOPREV.$display; x++) { RANDPHOTOPREV.$("photocontainer").innerHTML += RANDPHOTOPREV.$photos[x]; } }, more: function() { if (RANDPHOTOPREV.$cached.length < (RANDPHOTOPREV.$pages + 1)) { var temp; do { temp = Math.ceil(Math.random() * (RANDPHOTOPREV.$pages)); } while (RANDPHOTOPREV.$cached.toString().indexOf(":" + temp + ":") != -1); RANDPHOTOPREV.fetch(temp); } else { RANDPHOTOPREV.show(); } }, picprev: function(htm) { RANDPHOTOPREV.$("photoprev").innerHTML = htm.replace(/m\.jpg/gi, "l.jpg"); }, parsephoto: function(htm, page) { if (htm.replace(/^\s*|\s*$/g, "") === null) { RANDPHOTOPREV.fetch(page); return; } else { var htmlspaces = "&nb" + "sp;"; RANDPHOTOPREV.$temp = htm.split(";").join(" "); RANDPHOTOPREV.$temp = htm.match(/<div\s*class="photothumb">[\S\s]*?<\/div><\/div>/gi); for (var i = 0; i < RANDPHOTOPREV.$temp.length; i++) { RANDPHOTOPREV.$temp[i] = RANDPHOTOPREV.$temp[i].replace(/href="\/photos/gi, "href=\"http://www.friendster.com/photos"); RANDPHOTOPREV.$temp[i] = RANDPHOTOPREV.$temp[i].replace(/<a /gi, "<a target=\"_blank\" "); RANDPHOTOPREV.$temp[i] = RANDPHOTOPREV.$temp[i].replace(/<div\s*class="thumbnail">/gi, "<div class=\"thumbnail\" onMouseOver=\"RANDPHOTOPREV.picprev(this.innerHTML);\">"); if (!RANDPHOTOPREV.$temp[i].match("nophoto")) RANDPHOTOPREV.$photos.push(RANDPHOTOPREV.$temp[i]); } var preview = RANDPHOTOPREV.$temp[0].match(/<a[\S\s]*?<\/a>/)[0].replace(/m\.jpg/gi, "l.jpg"); var _photo = document.createElement("div"); _photo.id = "randomphoto"; _photo.align = "center"; _photo.appendChild(document.createElement("div")); _photo.getElementsByTagName("div")[0].id = "photoprev"; _photo.getElementsByTagName("div")[0].innerHTML = preview; _photo.appendChild(document.createElement("div")); _photo.getElementsByTagName("div")[1].id = "photocontainer"; var _boxcontent = RANDPHOTOPREV.getElementsByClassName("boxcontent", "div", RANDPHOTOPREV.$("content_1"))[0]; try { _boxcontent.parentNode.replaceChild(_photo, _boxcontent); }catch(e) {} var _randLink = document.createElement("a"); _randLink.href = "javascript:void(RANDPHOTOPREV.more())"; _randLink.appendChild(document.createTextNode("More Random Photos")); var _viewall = RANDPHOTOPREV.getElementsByClassName("viewall", "div", RANDPHOTOPREV.$("content_1"))[0].getElementsByTagName("a")[0]; try { _viewall.parentNode.replaceChild(_randLink, _viewall); }catch(e) {} RANDPHOTOPREV.$cached.push(":" + page + ":"); RANDPHOTOPREV.changeText(RANDPHOTOPREV.getElementsByClassName("commonbox photos", "div")[0].getElementsByTagName("h2")[0], pageOwnerFName + "'s Photo Gallery"); RANDPHOTOPREV.show(); } }, innerTextFeature: function() { var obj = (document.getElementsByTagName("body")[0].innerText !== undefined) ? true: false; return obj; }, changeText: function(elem, changeVal) { if (!RANDPHOTOPREV.innerTextFeature()) { elem.textContent = changeVal; } else { elem.innerText = changeVal; } }, $: function() { var elements = []; for (var i = 0; i < arguments.length; i++) { var element = arguments[i]; if (typeof element == "string") element = document.getElementById(element); if (arguments.length == 1) return element; elements.push(element); } return elements; }, getElementsByClassName: function(strClass, strTag, objContElm) { strTag = strTag || "*"; objContElm = objContElm || document; var objColl = objContElm.getElementsByTagName(strTag); if (!objColl.length && strTag == "*" && objContElm.all) objColl = objContElm.all; var arr = []; var delim = strClass.indexOf("|") != -1 ? "|": " "; var arrClass = strClass.split(delim); for (var i = 0, j = objColl.length; i < j; i++) { var arrObjClass = objColl[i].className.split(" "); if (delim == " " && arrClass.length > arrObjClass.length) continue; var c = 0; comparisonLoop: for (var k = 0, l = arrObjClass.length; k < l; k++) { for (var m = 0, n = arrClass.length; m < n; m++) { if (arrClass[m] == arrObjClass[k]) c++; if ((delim == "|" && c == 1) || (delim == " " && c == arrClass.length)) { arr.push(objColl[i]); break comparisonLoop; } } } } return arr; }, ajaxRequest: function(type, url, cont, param, func, handlerparam) { var httprequest; var msxml = ["MSXML2.XMLHTTP.3.0", "MSXML2.XMLHTTP", "Microsoft.XMLHTTP"]; for (var i = 0, len = msxml.length; i < len; ++i) { try { httprequest = window.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject(msxml[i]); break; } catch(e) {} } httprequest.onreadystatechange = function() { if (httprequest.readyState == 4) { if (httprequest.status == 200) { func(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); } }; })(); /*OTHER JS CODES BELOW THIS MESSAGE*/ //MINI MAXI FUNCTION function show_hide(the_box) { if (document.getElementById(the_box)) { if (document.getElementById(the_box).style.display == 'none') { document.getElementById(the_box).style.display = 'block'; } else { document.getElementById(the_box).style.display = 'none'; } } } /*END OF OTHER JS CODES*/[/spoiler]

Last edited by vector_venom (2008-11-03 11:38:15)

Board footer

© 2024 F Talk

Current time is 18:49

[ 12 queries - 0.190 second ]
Privacy Policy