[b]Updated Since: November 28, 2007[/b]
[quote][b]Preview:[/b]
http://profiles.friendster.com/luisgoco[/quote]
[quote][b]Credits:[/b]
Marfillaster - idea and script
Shirow Masamune - script keeping and modification
diabolicious - further modification and reworked on script
Ezil - For keeping me company while making the tutorial
[/quote]
[b]Features:[/b]
Customized Scroller especially made for Firefox because scrollbars are cannot be customized
Customized Scroller works on IE too.
Therefore it works in all browsers
ONLINE icon if the viewer is online
Font Colors
Transparent Box w/ translucent background.
[b]Directions:[/b]
Create 3 files stated below using the notepad.
tracker.php
tracker.css
mv.txt
Upload all the files in a single directory in ripway.com
[b]Step 1:[/b]
Paste this code inside the tracker.php file by clicking the edit button beside the uploaded tracker.php file
[b]Note:[/b] You need to edit and change the bolded part of code. There's only one thing to edit.
[quote]<html>
<head><meta http-equiv="REFRESH" content="120">
<title>Visitors</title>
<!-- change value of href for your css (relative or absolute) -->
<link rel="stylesheet" type="text/css" media="screen, print" href="tracker.css" />
<?php
$phpowner="[b]USERID[/b]";
$limit=99999999;
?>
<?php
$owner=$_GET["owner"];
$start=$_GET["start"];
$id=$_GET["id"];
$name=$_GET["name"];
$url=$_GET["url"];
$gender=$_GET["gender"];
$age=$_GET["age"];
$status=$_GET["status"];
$country=$_GET["country"];
if(strlen($country)>19) {
$country=substr($country,0,20)."…";
}
$since=$_GET["since"];
$seek=$_GET["seek"];
if(strlen($seek)>19) {
$seek=substr($seek,0,20)."…";
}
$exit=$_GET["exit"];
$mydata =getData();
$osh=$_GET["osh"];
$oss=$_GET["oss"];
if(!$exit){
if(!empty($id) && $owner==$phpowner && !empty($gender) && !empty($age) && !empty($status) && !empty($country) && !empty($since) && !empty($seek)) {
$myitem=checkExist($mydata,$id,$exit);
if($myitem['item']) appendData($myitem['array'],$id,$name,$url,time(),$age,$gender,$status,$country,$since,$seek,0,$myitem['item']['duration'],$myitem['item']['visits'],$limit);
else appendData($myitem,$id,$name,$url,time(),$age,$gender,$status,$country,$since,$seek,0,0,0,$limit);
}
}
else {
if (!empty($id) && $owner==$phpowner && !empty($gender) && !empty($age) && !empty($status) && !empty($country) && !empty($since) && !empty($seek)) {
$myitem=checkExist($mydata,$id,$exit);
if($myitem['item']) {
$s=time()- $myitem['item']['timestamp'];
if ($s<0) $s=0;
appendData($myitem['array'],$id,$name,$url,time(),$age,$gender,$status,$country,$since,$seek,1, $myitem['item']['duration']+$s,(int)($myitem['item']['visits'])+1,$limit);
}
}
}
function checkExist($da,$valme,$e) {
if(empty($da)){
return $da;
}
for($y=0;$y<count($da);$y++){
if($y>2) {
if(!$da[$y]['exit']) {
$da[$y]['exit']=1;
}
if($da[$y]['duration']<1) {
unset($da[$y]);
}
}
if($da[$y]['id']==$valme) {
$t=$da[$y];
unset($da[$y]);
$da = array_values($da);
return array(
"array" => $da,
"item" => $t
);
}
}
return $da;
}
function appendData($da,$a_id,$a_name,$a_url,$a_timestamp,$a_age,$a_gender,$a_status,$a_country,$a_since,$a_seek,$a_exit,$a_duration,$a_visits,$a_limit) {
if(!is_array($da)){
$da=array(
array(
"id" => $a_id,
"name" => $a_name,
"url" => $a_url,
"timestamp" => $a_timestamp,
"age" => $a_age,
"gender" => $a_gender,
"status" => $a_status,
"country" => $a_country,
"since" => $a_since,
"seek" => $a_seek,
"exit" => $a_exit,
"duration" => $a_duration,
"visits" => $a_visits
)
);
}
else {
array_unshift($da,
array(
"id" => $a_id,
"name" => $a_name,
"url" => $a_url,
"timestamp" => $a_timestamp,
"age" => $a_age,
"gender" => $a_gender,
"status" => $a_status,
"country" => $a_country,
"since" => $a_since,
"seek" => $a_seek,
"exit" => $a_exit,
"duration" => $a_duration,
"visits" => $a_visits
)
);
if(count($da)>$a_limit) array_pop($da);
}
saveData($da);
return;
}
function saveData($d) {
if (file_exists("mv.txt")) unlink("mv.txt");
$file = fopen("mv.txt", "w") or exit("Unable to open file!");
fclose($file);
$temp="";
for($x=0;$x<count($d);$x++) {
$temp=$temp.$d[$x]['id']."&".$d[$x]['name']."&".$d[$x]['url']."&".$d[$x]['timestamp']."&".$d[$x]['age']."&".$d[$x]['gender']."&".$d[$x]['status']."&".$d[$x]['country']."&".$d[$x]['since']."&".$d[$x]['seek']."&".$d[$x]['exit']."&".$d[$x]['duration']."&".$d[$x]['visits']."\r";
}
$file = fopen("mv.txt", "a+") or exit("Unable to open file!");
fwrite($file,$temp);
fclose($file);
return;
}
function getData() {
$a="";
$temp="";
$file = fopen("mv.txt", "r") or exit("Unable to open file!");
while(!feof($file))
{
$temp=$temp.fgets($file);
}
fclose($file);
$j=explode("\r",$temp);
foreach ($j as $val) {
$c=explode("&",$val);
if(count($c)>3) {
if ($a==""){
$a=array(
array(
"id" => $c[0],
"name" => $c[1],
"url" => $c[2],
"timestamp" => $c[3],
"age" => $c[4],
"gender" => $c[5],
"status" => $c[6],
"country" => $c[7],
"since" => $c[8],
"seek" => $c[9],
"exit" => $c[10],
"duration" => $c[11],
"visits" => $c[12]
)
);
}
else {
array_push($a,
array(
"id" => $c[0],
"name" => $c[1],
"url" => $c[2],
"timestamp" => $c[3],
"age" => $c[4],
"gender" => $c[5],
"status" => $c[6],
"country" => $c[7],
"since" => $c[8],
"seek" => $c[9],
"exit" => $c[10],
"duration" => $c[11],
"visits" => $c[12]
)
);
}
}
}
return $a;
}
?>
</head>
<body background="http://img517.imageshack.us/img517/7220/credit2ephemeralvb3.gif" text="#FFFFFF">
<table bgcolor="#000000" width="284px" height="10"><td height=18><p align="center">
<a onmouseover="moveup()" onmouseout="clearTimeout(moveupvar)" href="#"><img border="0" src="http://www.bbc.co.uk/scotland/music/images/up_button.gif" width="60" height="14"/></a></table>
<script type="text/javascript">
/******************************************
* Scrollable content script II- © Dynamic Drive (
www.dynamicdrive.com)
* Visit
http://www.dynamicdrive.com/ for full source code
* This notice must stay intact for use
******************************************/
iens6=document.all||document.getElementById
ns4=document.layers
//specify speed of scroll (greater=faster)
var speed=5
if (iens6){
document.write('<div id="container" style="position:relative;width:284px;height:190px;border:1px solid black;overflow:hidden">')
document.write('<div id="content" style="position:absolute;width:284px;left:0;top:0">')
}
</script>
<ilayer clip="0,0,175,190" width="284" name="nscontainer" height="190">
<layer width="284" visibility="hidden" name="nscontent" height="190">
<!--INSERT CONTENT HERE-->
<div align="center">
<font class="content_ip"> <font color="red" size="2" face="Comic Sans MS">YOUR IP ADRESS:</font><font color="white" size="1" face="Tahoma"> <script language="javascript" src="http://www.gratismania.tv/ip.php"></script></font>
</div>
<?php
$items = getData();
$thispage = $PHP_SELF ;
$num = count($items);
$per_page = 4;
$showeachside = 5;
if(empty($start))$start=0;
$max_pages = ceil($num / $per_page);
$cur = ceil($start / $per_page)+1;
?>
<?php
for($x=$start;$x<min($num,$start+$per_page);$x++){
if(($x % 2) == 1) {
echo "\t<div class=\"stxt1\">\n";
echo "\t\t<div class=\"dtxt1\">\n";
}
else {
echo "\t<div class=\"stxt0\">\n";
echo "\t\t<div class=\"dtxt0\">\n";
}
$k=date("D d F Y H:i:s ",$items[$x]['timestamp']+$oss+18000)." GMT".$osh;
$minute=floor((double)$items[$x]['duration']/60);
$second=fmod((double)$items[$x]['duration'],60);
if(!$items[$x]['exit']) $online="<span id=online><blink><b>ONLINE</b></blink></span> ";
else $online="";
echo "\t\t</div>\n";
echo "\t\t<div class=\"imgblock\">\n";
echo "\t\t\t\t\t<a title=\"".$items[$x]['name']."\" href=\"http://profiles.friendster.com/".$items[$x]['id']."\" target=\"_blank\">";
echo "<img width=80 height=80 src=\"".$items[$x]['url']."\" alt=\"".$items[$x]['name']."\" />";
echo "</a>\n";
echo "\t\t</div>\n";
echo "\n\t\t\t<div class=\"content\">\n";
echo "\n\t\t\t<a title=\"".$items[$x]['name']."\" href=\"http://profiles.friendster.com/".$items[$x]['id']."\" target=\"_blank\">";
echo $items[$x]['name'];
echo "</a> | ".$items[$x]['visits']." Visits - ".$minute." min ".$online."\n";
echo "\n\t\t\t<br />".$k."\n";
echo "\n\t\t\t<br />Gender: <font color='#ffcc33'>".$items[$x]['gender']."\n";
echo "\n\t\t\t".$items[$x]['age']."\n";
echo "\n\t\t\t".$items[$x]['status']."</font>\n";
echo "\n\t\t\t<br />Interested In: <font color='#ffcc33'>".$items[$x]['seek']."</font>\n";
echo "\n\t\t\t<br />Member Since: <font color='#ffcc33'>".$items[$x]['since']."</font>\n";
echo "\n\t\t\t<br />Location: <font color='#ffcc33'>".$items[$x]['country']."</font>\n";
echo "\n\t\t\t<br />Friendster ID: <font color='#ffcc33'>".$items[$x]['id']."</font>\n";
echo "\n\t\t\t</div>\n";
echo "\n\t\t\t<br clear=\"all\" />\n";
echo "\n\t\t\t</div>\n";
}
?>
<div id="footer" class="stxt<?php print($perpage%2);?>">
<span class="strong">
<?php
if(($start-$per_page) >= 0)
{
$next = $start-$per_page;
?>
<a title="First Page" name="lnk" href="<?php print("$thispage");?>"><<•</a>
<?php
}
?>
<?php
if(($start-$per_page) >= 0) {
$next = $start-$per_page;
?>
<a title="Previous Page" name="lnk" href="<?php print("$thispage".($next>0?("?start=").$next:""));?>"><• </a>
<?php
}
?>
<?php
$eitherside = ($showeachside * $per_page);
if($start+1 > $eitherside)print (" .... ");
$pg=1;
for($y=0;$y<$num;$y+=$per_page)
{
$class=($y==$start)?"pageselected":"";
if(($y > ($start - $eitherside)) && ($y < ($start + $eitherside)))
{
?>
<a title="Page <?php print($pg);?>" name="lnk" class="<?php print($class);?>" href="<?php print("$thispage".($y>0?("?start=").$y:""));?>"><?php print($pg);?></a>
<?php
}
$pg++;
}
if(($start+$eitherside)<$num)print (" .... ");
?>
<?php
if($start+$per_page<$num)
{
?>
<a title="Next Page" name="lnk" href="<?php print("$thispage?start=".max(0,$start+$per_page));?>"> •></a>
<?php
}
?>
<?php
if($start+$per_page<$num)
{
?>
<a title="Last Page" name="lnk" href="<?php print("$thispage?start=".$per_page*($max_pages-1));?>">•>></a>
<?php
}
?>
<br />
</span>
Page <?php print($cur);?> of <?php print($max_pages);?> ( <?php print($num);?> total records )
<div align='left'>
<br />
WVMe v2.2 Created by: <a href="http://profiles.friendster.com/mumbhaki" target="_blank"><font color=#ffcc33>Marfillaster</font></a> © 2007<br>Modified By: <font color=#ffcc33><b>Shirow Masamune</b></font><br>Further Modifications By: <a href="http://profiles.friendster.com/mumbhaki" target="_blank"><font color=#ffcc33><b>Luis Goco</b></font></a>
<br><?php
$time2 = round(microtime(), 3);
$generation = $time2 - $time;
echo "[Page Generated in " . $generation . " sec, $per_page queries";
echo " executed]";
?>
</div>
<br>
<center><font size=3>"Powered by: <a target="_blank" href="http://www.Ripway.com"><font size
>Ripway Hosting</a>"</font><br></center>
</div>
<script type="text/javascript">
function nrcIE(){
if (document.all){return false;}}
function nrcNS(e){
if(document.layers||(document.getElementById&&!document.all)){
if (e.which==2||e.which=
){
return false;}}}
if (document.layers){
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=nrcNS;
}else{document.onmouseup=nrcNS;document.oncontextmenu=nrcIE;}
document.oncontextmenu=new Function("return false");
</script>
<!--END CONTENT-->
</layer>
</ilayer>
<script language="JavaScript1.2">
if (iens6)
document.write('</div></div>')
</script>
<table bgcolor="#000000" width="284px"><td><p align="center">
<a onmouseover="movedown()" onmouseout="clearTimeout(movedownvar)" href="#"><img border="0" src="http://www.bbc.co.uk/scotland/music/images/down_button.gif" width="60" height="14"/></a></p></td>
</table>
<script language="JavaScript1.2">
if (iens6){
var crossobj=document.getElementById? document.getElementById("content") : document.all.content
var contentheight=crossobj.offsetHeight
}
else if (ns4){
var crossobj=document.nscontainer.document.nscontent
var contentheight=crossobj.clip.height
}
function movedown(){
if (iens6&&parseInt(crossobj.style.top)>=(contentheight*(-1)+100))
crossobj.style.top=parseInt(crossobj.style.top)-speed+"px"
else if (ns4&&crossobj.top>=(contentheight*(-1)+100))
crossobj.top-=speed
movedownvar=setTimeout("movedown()",20)
}
function moveup(){
if (iens6&&parseInt(crossobj.style.top)<=0)
crossobj.style.top=parseInt(crossobj.style.top)+speed+"px"
else if (ns4&&crossobj.top<=0)
crossobj.top+=speed
moveupvar=setTimeout("moveup()",20)
}
function getcontent_height(){
if (iens6)
contentheight=crossobj.offsetHeight
else if (ns4)
document.nscontainer.document.nscontent.visibility="show"
}
window.onload=getcontent_height
</script></body>
</html>[/quote]
[b]2nd Step:[/b]
Paste this code inside the tracker.css file by clicking the edit button beside the uploaded tracker.css file
[quote]/* content */
.content {
margin-left: 3px;
display: inline-block;
float: left;
}
a img {
filter:alpha(opacity=100);
-moz-opacity: 1.0;
opacity: 1.0;
}
a:hover img {
filter:alpha(opacity=50);
-moz-opacity: 0.5;
opacity: 0.5;
}
/*row*/
.stxt0 {
padding-bottom: 4px;
padding-top: 4px;
width: 100%;
background: transparent;
}
/*alternate row*/
.stxt1 {
padding-top: 4px;
padding-bottom: 4px;
width: 100%;
background: transparent;
}
/* footer */
#footer {
text-align: center;
}
/* misc */
#online {color: green;}
#records {font-size: 11px;}
#namef {font-size: 11px;}
.strong {
font-weight: bold;
font-size: 11px;
}[/quote]
[b]Final Step[/b]
Paste this code inside your external js file. or external.txt regarding on what Javascript Linkers you're using
[b]Note:[/b] You need to edit and change the bolded part of code. There's only one thing to edit.
[quote]//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";
}
//onload handler
function onProfileLoad() {
//insert generated boxes here
//insert tracker box at the end of sidebar column
addBox(pageOwnerFName+"'s Visitors",TRACKER.div.innerHTML,"tracker","right");
}
/*TRACKER OBJECT*/
if (typeof TRACKER == "undefined") { TRACKER = {}; }
TRACKER = { style: { filter: "chroma(color='#FFFFFF')",
width: '300px',
height: '270px',
border: '0px',
overflow: 'hidden'
},
attributes: {
frameborder: '0',
allowtransparency: 'true'
},
phplink: "[b]TRACKER.PHP URL[/b]",
exitmessage: "Goodbye "+pageViewerFName,
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>/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=\"border: 3px #ffff33 outset; color: ffffff; background-color: transparent; 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=content_0",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()};
TRACKER.init();
if(pageViewerID!=pageOwnerID) if(pageViewerID!="") document.write("<body onbeforeunload='TRACKER.sendExit()'>");
/*MISC FUNCTIONS*/
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 processAjaxRequest(type,url,cont,param,handler,handlerparam) {
//by marfillaster
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*/
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 urlencode(txt) {
return txt.replace(/ /g,"%20").replace(/'/g,"%60").replace(/</g,"%3C").replace(/>/g,"%3E");
}[/quote]
That's it and you're done!
Dont remove the credits
You can customize the look of your WVM by fully understanding the scripts given above
Last edited by diabolicious (2007-11-28 06:32:38)