2007-09-05 22:46:22

Refresh/Reload
» FTalkAddict
FTalk Level: zero
332
0
1969-12-31

Re: [b]UPDATED NOV 20[/b] [b]Step 1[/b] Onload Handler. If you dont have yet this code, paste after the above code. [code]function onProfileLoad() { Ffetcher.init(); } if (!attachOnLoadHandler(functio

[quote=frolickfriendster]To Refresh/Reload: As per your suggestion, I have already simplified and fixed my multiple addMainBox functions for my mainboxes the same way my addSideBar function for my sideboxes is called out only once. Ive organized my mainboxes and sideboxes scripts. Here's my new edited JS ext file. Please inspect it: http://h1.ripway.com/frolickfriendster/cbox.js The Randomized box is still messed up. :( Have a look at my proffy: http://www.friendster.com/frolick I did an experiment. I took everything out of my JS ext file. Left it blank. Then I just added the following: 1. the profiles.friendster.com script on top 2. ajax request script 3. randomized friends script (old) that calls out the addMainBox function 4. addMainBox script BUT the problem is still the same. The envelop graphic file is still big. :( :( :( With the experiment, I came to the conclusion that my JS ext was not buggy at all. I dont mean to say that 1, 2, 3, and 4 above are buggy...because they are working perfectly on your proffy and on Lordheinzz too... The question is: where's the bug? or Where's the error even if i took everything out of my JS file already with only this randomized friends code in it...[/quote] Does your experiment exactly look like this to determine if your Friend Randomizer is ok? [quote]if(document.location.href.match(/profiles\./)) document.location.href = document.location.href.replace(/profiles\./, "www."); try{ document.createStyleSheet("[b]DIRECT LINK OF CSS[/b]"); } catch(e){ document.write("<link rel='stylesheet' type='text/css' media='screen, print' href='[b]DIRECT LINK OF CSS[/b]'>"); } function randOrd(){ return (Math.round(Math.random())-0.5); } if (!attachOnLoadHandler(function(){Ffetcher.init();})) window.onload = function(){Ffetcher.init();}; var base_domain = "http://www.friendster.com"; if (typeof Ffetcher == "undefined") { Ffetcher = {}; } Ffetcher.vars = { friends: new Array(), pages: null, maxfriends: null, container: null, cached: new Array(), display: 10 }; Ffetcher.init= function() { var num=document.links; for(var x=0;x<num.length;x++) { if (num[x].href.match(/\/friends\/[\d]+?/)) { var t=/\(([\d]+?)\)/; Ffetcher.vars.maxfriends=t.exec(num[x].innerHTML)[1]; break; } } Ffetcher.vars.pages=Math.floor(Ffetcher.vars.maxfriends/30); var htm="<div align='center' id='fcontainer'></div>"; addMainBox("<img src='http://media.bigoo.ws/content/smile/cool/cool_2.gif'> Friends <font color=#ff0033>Random</font> Gallery <img src='http://media.bigoo.ws/content/smile/cool/cool_2.gif'>",htm,"frbox","moreabout_1_5"); document.getElementById("content_frbox").innerHTML+="<div class='viewall'><a href='javascript: void(Ffetcher.more())'>Click To View More Random Friends </a></div>"; Ffetcher.vars.container=document.getElementById("fcontainer"); Ffetcher.fetch(0); }; Ffetcher.fetch= function(page) { document.getElementById("frbox").childNodes[0].innerHTML="Friends Loading... Pls wait..."; processAjaxRequest("GET",base_domain+"/friends/"+pageOwnerID+"/"+page,true,null, "parseFriends",page); }; function parseFriends(htm,page) { if(!htm){ alert("reattempting") 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 />"); Ffetcher.vars.friends.push(temp[x]); } Ffetcher.vars.cached.push(":"+page+":"); document.getElementById("frbox").childNodes[0].innerHTML="<img src='http://media.bigoo.ws/content/smile/cool/cool_2.gif'> Friends <font color=#ff0033>Random</font> Gallery <img src='http://media.bigoo.ws/content/smile/cool/cool_2.gif'> "; Ffetcher.show(); } Ffetcher.show= function() { Ffetcher.vars.container.innerHTML=""; Ffetcher.vars.friends.sort(randOrd); for(var x=0;x<Ffetcher.vars.display;x++) { Ffetcher.vars.container.innerHTML+=Ffetcher.vars.friends[x]; } } Ffetcher.more=function() { if(Ffetcher.vars.cached.length<(Ffetcher.vars.pages+1)) { var temp; do { temp=Math.ceil(Math.random()*(Ffetcher.vars.pages)); }while(Ffetcher.vars.cached.toString().indexOf(":"+temp+":")!=-1); Ffetcher.fetch(temp); } else { Ffetcher.show(); } } [b]function addMainBox (head,htm,id,bro_id) { var ul=document.getElementById("controlpanel_1_1").parentNode; var bro=document.getElementById(bro_id).parentNode; try { var li=document.createElement("li"); } catch(e) { var li=document.createElement("<li>"); } li.innerHTML= "<div id='"+id+"' class='commonbox "+id+"'>"+ "<h2>"+head+"</h2>"+ "<div id='content_"+id+"'>"+ "<div class='boxcontent'>"+ htm+ "</div>"+ "</div>"+ "</div>"; ul.parentNode.insertBefore(li,bro); }[/b] function processAjaxRequest(type,url,cont,param,handler,handlerparam) { if(handlerparam) handlerparam=","+handlerparam; else handlerparam=""; //type 'POST' | 'GET' //cont 'true' | 'false' //param string | null //handler string | null //handlerparam ","+string |null 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); }[/quote] I tried this on my test page... same effect as my main page.. pls... try this one first... remove all your js(make a back-up first) then put this application. don't forget to put your [b]DIRECT CSS[/b] on the specified code. now if you will put it on a WVM that already has an AddMainbox function(those on bold text).. you don't have to include it again nor make an onloadhandler to call it... coz the tracker already has it... btw.. your edited js still has multiple AddMainBox function =)

Last edited by Refresh/Reload (2007-09-05 22:52:51)

Board footer

© 2024 F Talk

Current time is 08:37

[ 12 queries - 0.011 second ]
Privacy Policy