Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Can anyone implement this into the script?


agtlewis

Recommended Posts

Posted

I found an awesome script for tracking visitors. It requires that the below page be included before any html or php code so that it can send a cookie. Problem is that osCommerce sends it's own cookie as well so I am not sure where to put it. Anyone have any ideas?

 

<?PHP 

# edit the following variables:

###############################



# Globlal vars - YOU HAVE TO EDIT !



$SQL['Host']="localhost"; // mysql server

$SQL['User']="root"; // mysql user

$SQL['Pwd']=""; // mysql password

$SQL['DB']="rkta"; // mysql database



$VAR['Domain']="yourdomain.com"; // domain name (without www.)

$VAR['RootPath']="/home/username/www/"; // full path to the root directory of the website (with the / at end)

// run "full-path_detect.php" in the desired directory to help you

$VAR['DataPath']="/home/username/www/RKTA_data/"; // full path to the directory 'RKTA_data' (with the / at end)

// run "full-path_detect.php" in the desired directory to help you



# Advanced vars - Only for advanced users



$VAR['Update']="30"; // minimum number of minutes between stats updates

// ex: 30

$VAR['User']=""; // user (only if you want a restricted access)

$VAR['Pwd']=""; // password (only if you want a restricted access)

$VAR['ID']=""; // very useful when you have many websites and only one mysql database

// ex: site1_



#C:1################################

function RKTA_AFile($f,$d,$n){global $VAR;$Dat="";if(file_exists($VAR['DataPath'].$f)){$FDat=@file($VAR['DataPath'].$f);for($i=0; $i<$n; $i++){if($FDat[$i]){$Dat.=trim($FDat[$i])."n";}}}RKTA_WFile($f,$d."n".$Dat);}function RKTA_CheckVersion(){global $RKTA,$HTTP_HOST,$REQUEST_URI;if($Sock=@fsockopen("www.redkernel-softwares.com",80,&$errno,&$errstr,30)){$Dump="GET /checkversion/freewares/http/rkta/?".$RKTA['Ver']." HTTP/1.1rn";$Dump.="Referer: http://".$HTTP_HOST.$REQUEST_URI."?httpcheckrn";$Dump.="Host: www.redkernel-softwares.comrn";$Dump.="Connection: closernrn";@fputs($Sock,$Dump);$Dt="";while($Str=@fgets($Sock,4096)){$Dt.=$Str;}@fclose($Sock);$Line=explode("rn",$Dt);$Count=count($Line);$Data="";for($i=0; $i<$Count; $i++){if(strlen($Line[$i])>5){$Data.=$Line[$i];}}$Split=split("@%@",$Data);return base64_decode($Split[1]);}else{return"";}}function RKTA_ErrorHandler($no,$msg,$file,$line){switch($no){case 1:$Err="Erreur";break;case 2:$Err="Alerte";break;case 4:$Err="Erreur d'analyse";break;case 8:$Err="";break;case 16:$Err="Erreur interne";break;case 32:$Err="Alerte interne";break;case 64:$Err="Erreur de compilation";break;case 128:$Err="Alerte de compilation";break;case 256:$Err="Erreur utilisateur";break;case 512:$Err="Alerte utilisateur";break;case 1024:$Err="Note utilisateur";break;}if($Err){RKTA_WError(str_replace("n"," ",$msg)." $file ($line)");}}function RKTA_ExecQry($Qry){$Count=count($Qry);for($i=0; $i<$Count; $i++){RKTA_SqlQry($Qry[$i]);}}function RKTA_FileArr($f){global $VAR;if(file_exists($VAR['DataPath'].$f)){$Arr=@file($VAR['DataPath'].$f);return$Arr;}}function RKTA_FKill($f){global $VAR;if(file_exists($VAR['DataPath'].$f)){unlink($VAR['DataPath'].$f);}}function RKTA_GetDom($Str){$Dom=spliti("http://",$Str);$Dom=split("/",$Dom[1]);return strtolower(str_replace("www.","",trim($Dom[0])));}function RKTA_GetMicrotime(){list($usec,$sec)=explode(" ",microtime());return((float)$usec+(float)$sec);}function RKTA_RFile($f){global $VAR;if(file_exists($VAR['DataPath'].$f)){$fd=@fopen($VAR['DataPath'].$f,"r");$Dat=@fread($fd,@filesize($VAR['DataPath'].$f));@fclose($fd);return$Dat;}}function RKTA_SqlConnect(){global $SQL;if(!$Link=@mysql_connect($SQL['Host'],$SQL['User'],$SQL['Pwd'])){RKTA_WError(mysql_error());return"";}return$Link;}function RKTA_SqlCount($Qry){global $SQL;if(!$Res=@mysql_query("SELECT COUNT(*) ".$Qry,$SQL['Link'])){RKTA_WError(mysql_error());return"";}$Row=@mysql_fetch_row($Res);return $Row[0];}function RKTA_SqlQry($Qry){global $SQL;if(!$Res=@mysql_query($Qry,$SQL['Link'])){RKTA_WError(mysql_error());return"";}return"1";}function RKTA_SqlRow($Qry){global $SQL;if(!$Res=@mysql_query("SELECT ".$Qry,$SQL['Link'])){RKTA_WError(mysql_error());return"";}$Row=@mysql_fetch_array($Res);return$Row;}function RKTA_SqlSelect($Qry){global $SQL;if(!$Res=@mysql_query("SELECT ".$Qry,$SQL['Link'])){RKTA_WError(mysql_error());return"";}return$Res;}function RKTA_SqlSelectDb($Db){global $SQL;if(!@mysql_select_db($Db,$SQL['Link'])){RKTA_WError(mysql_error());return"";}return"1";}function RKTA_TablesSetup(){global $VAR;$Qry[]="DROP TABLE IF EXISTS rkta_".$VAR['ID']."doms;";$Qry[].="CREATE TABLE rkta_".$VAR['ID']."doms(Dom char(100) NOT NULL default '',RD smallint(5) UNSIGNED NOT NULL default '0',RW mediumint(8) UNSIGNED NOT NULL default '0',RM mediumint(8) UNSIGNED NOT NULL default '0',UD smallint(5) UNSIGNED NOT NULL default '0',UW mediumint(8) UNSIGNED NOT NULL default '0',UM mediumint(8) UNSIGNED NOT NULL default '0',Lst int(10) UNSIGNED NOT NULL default '0',Ref char(255) NOT NULL default '',PRIMARY KEY(Dom),INDEX(Dom))TYPE=MyISAM;;";$Qry[]="DROP TABLE IF EXISTS rkta_".$VAR['ID']."pths;";$Qry[].="CREATE TABLE rkta_".$VAR['ID']."pths(Pth char(255) NOT NULL default '',RD smallint(5) UNSIGNED NOT NULL default '0',RW mediumint(8) UNSIGNED NOT NULL default '0',RM mediumint(8) UNSIGNED NOT NULL default '0',UD smallint(5) UNSIGNED NOT NULL default '0',UW mediumint(8) UNSIGNED NOT NULL default '0',UM mediumint(8) UNSIGNED NOT NULL default '0',Lst int(10) UNSIGNED NOT NULL default '0',Ref char(255) NOT NULL default '',PRIMARY KEY(Pth),INDEX(Pth))TYPE=MyISAM;;";$Qry[].="DROP TABLE IF EXISTS rkta_".$VAR['ID']."domkeys;";$Qry[].="CREATE TABLE rkta_".$VAR['ID']."domkeys(K char(32) NOT NULL default '',PRIMARY KEY(K),INDEX(K))TYPE=MyISAM;;";$Qry[].="DROP TABLE IF EXISTS rkta_".$VAR['ID']."pthkeys;";$Qry[].="CREATE TABLE rkta_".$VAR['ID']."pthkeys(K char(32) NOT NULL default '',PRIMARY KEY(K),INDEX(K))TYPE=MyISAM;;";$Qry[].="DROP TABLE IF EXISTS rkta_".$VAR['ID']."refs;";$Qry[].="CREATE TABLE rkta_".$VAR['ID']."refs(R char(255) NOT NULL default '',PRIMARY KEY(R),INDEX(R))TYPE=MyISAM;;";$Qry[].="DROP TABLE IF EXISTS rkta_".$VAR['ID']."time;";$Qry[].="CREATE TABLE rkta_".$VAR['ID']."time(Id char(1) NOT NULL default '',Day tinyint(2) UNSIGNED NOT NULL default '0',DId tinyint(2) UNSIGNED NOT NULL default '0',Mon tinyint(2) UNSIGNED NOT NULL default '0',Time int(10) UNSIGNED NOT NULL default '0',PRIMARY KEY(Id))TYPE=MyISAM;;";$Qry[].="INSERT INTO rkta_".$VAR['ID']."time VALUES('1','','','','');";RKTA_ExecQry($Qry);RKTA_FKill("errors.log");}function RKTA_WError($d){global $VAR,$Date;$FDat=@file($VAR['DataPath']."errors.log");for($i=0; $i<100; $i++){if($FDat[$i]){$NewDat.=trim($FDat[$i])."n";}}RKTA_WFile("errors.log",$Date['Full']." $dn".$NewDat);}function RKTA_WFile($f,$d){global $VAR;$fp=@fopen($VAR['DataPath'].$f,"w");@flock($fp,2);@fwrite($fp,$d);@fclose($fp);}function RKTA_WGif($f,$c){$ASCII="";$Box="47494638396101000100900000".$c."d8d9e72c00000000010001000002024401003b";$Count=strlen($Box);for($i=0; $i<$Count; $i+=2){$ASCII.=chr(hexdec($Box[$i].$Box[$i+1]));}RKTA_WFile($f,$ASCII);}function RKTA_WritePages(){global $RKTA,$Date,$VAR,$LF,$Html,$Help;$ModGZip=(function_exists('gzencode') && @gzencode("Str",1))?1:0;$Lengths="";$AdminCheck="";for($File=0; $File<10; $File++){$Pg="<html>";$Pg.="<head>";$Pg.="<title>Statistics of ".$VAR['Domain']." - powred by RedKernel Traffic Analysis ".$RKTA['Ver']."</title>";$Pg.="<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">";$Pg.="<style type=text/css>";$Pg.="A{TEXT-DECORATION:none}";$Pg.="TD,DIV{font-family:Arial,Helvetica;font-size:8pt}";$Pg.="TR{background-color:#FFFFFF}";$Pg.="TR.C{background-color:#DDDDDD;font-size:12pt;font-weight:bold}";$Pg.="TR.D{background-color:#E9E9E9;font-size:9pt;font-weight:bold}";$Pg.="TD.A{font-size:7pt}";$Pg.="TD.D{background-color:#E9E9E9;font-weight:bold}";$Pg.="#HelpBox{position:absolute;z-index:1000;top:0px;left:0px}";$Pg.="DIV.HelpBoxDIV{padding:2px;background:#F8F8FF;border:1px solid #000000;color:#550077;font-size:14px;line-height:14px;text-align:center}";$Pg.="</style>";$Pg.="<style fprolloverstyle>A:hover{TEXT-DECORATION:underline}</style>";$Pg.="<script language=JavaScript>";$Pg.="IE4=(document.all)?1:0;NS4=(document.layers)?1:0;VERSION4=(IE4|NS4)?1:0;if(!VERSION4)event=null;";$Pg.="function HelpGetOffset(obj,coord){var val=obj["offset"+coord];if(coord=="Top")val+=obj.offsetHeight;while((obj=obj.offsetParent)!=null){val+=obj["offset"+coord];if(obj.border&&obj.border!=0)val++;}return val;}";$Pg.="function HelpDown(){if(IE4)document.all.HelpBox.style.visibility="hidden";if(NS4)document.HelpBox.visibility="hidden";}";$Pg.="function Help(event,texte){if(!VERSION4)return;var ptrObj,ptrLayer;if(IE4){ptrObj=event.srcElement;ptrLayer=document.all.HelpBox;}if(NS4){ptrObj=event.target;ptrLayer=document.HelpBox;}if(!ptrObj.onmouseout)ptrObj.onmouseout=HelpDown;var str='<DIV CLASS="HelpBoxDIV">'+texte+'</DIV>';if(IE4){ptrLayer.innerHTML=str;ptrLayer.style.top=HelpGetOffset(ptrObj,"Top")-10;ptrLayer.style.left=HelpGetOffset(ptrObj,"Left")+30;ptrLayer.style.visibility="visible";}if(NS4){ptrLayer.document.write(str);ptrLayer.document.close();ptrLayer.document.bgColor="#F8F8FF";ptrLayer.top=ptrObj.y+20;ptrLayer.left=ptrObj.x;ptrLayer.visibility="show";}}";$Pg.="function Ou(item){item.style.background='#FFFFFF';}";$Pg.="function Ov(item){item.style.background='#F8F8FF';}";$Pg.="function Oc(item){item.style.background='#F0F0FF';}";$Pg.="function IR(){var i,x,a=document.sr;for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++)x.src=x.oSrc;}";$Pg.="function preloadImages(){var d=document; if(d.images){if(!d.p)d.p=new Array();var i,j=d.p.length,a=preloadImages.arguments;for(i=0; i<a.length; i++)if(a[i].indexOf("#")!=0){d.p[j]=new Image;d.p[j++].src=a[i];}}}";$Pg.="function findObj(n,d){var p,i,x;if(!d)d=document;if((p=n.indexOf("?"))>0&&parent.frames.length){d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}if(!(x=d[n])&&d.all)x=d.all[n];for(i=0;!x&&i<d.forms.length;i++)x=d.forms[i][n];for(i=0;!x&&d.layers&&i<d.layers.length;i++)x=findObj(n,d.layers[i].document);return x;}";$Pg.="function SA(v){var j=0,x;document.sr=new Array;if((x=findObj('a'+v))!=null){document.sr[j++]=x;if(!x.oSrc)x.oSrc=x.src;x.src="c.gif";}}";$Pg.="function SB(v){var j=0,x;document.sr=new Array;if((x=findObj('b'+v))!=null){document.sr[j++]=x;if(!x.oSrc)x.oSrc=x.src;x.src="c.gif";}}";$Pg.="function SC(v){var j=0,x;document.sr=new Array;if((x=findObj('t'+v))!=null){document.sr[j++]=x;if(!x.oSrc)x.oSrc=x.src;x.src="c.gif";}}";$Pg.="preloadImages('c.gif')";$Pg.="</script>";$Pg.="</head>";$Pg.="<body bgcolor=#EEEEEE text=#000000 link=#000077 vlink=#000077 alink=#000077 leftmargin=0 topmargin=0>";$Pg.="<div id=HelpBox></div>";$Pg.="<table width=760 border=0 cellspacing=0 cellpadding=5>";$Pg.="<tr><td bgcolor=#EEEEEE>";if(file_exists($VAR['DataPath']."errors.log"))$Pg.="<b><a href=?errors target=_blank>[errors.log]</a></b><br>";$Pg.="<b><a href=?phpinfo target=_blank>[Phpinfo]</a>  <a href=?9>[$Help[18]]</a></b><br>";$Pg.="<b><a href=?4>[$Help[10]]</a>  <a href=?6>[$Help[11]]</a>  <a href=?5>[$Help[12]]</a>  <a href=?7>[$Help[13]]</a>  <a href=?8>[$Help[14]]</a></b><br>";$Pg.="<b><a href=?0>[$Help[15]]</a>  <a href=?2>[$Help[11]]</a>  <a href=?1>[$Help[16]]</a>  <a href=?3>[$Help[17]]</a></b>";$Pg.="<hr size=1>";$Pg.=RKTA_RFile("html_news.dat");$Pg.=$Html[$File];$Pg.="<hr size=1>";$Pg.="<div align=center><b>Generated</b> ".$Date['Long']." <b>by</b> <a href="http://www.redkernel-softwares.com">RedKernel Traffic Analysis ".$RKTA['Ver']."</a><br><br><a href=http://www.redkernel-softwares.com><img src=http://www.redkernel-softwares.com/logo/ width=88 height=31 border=0></a></div>";$Pg.="</td></tr>";$Pg.="</table>";$Pg.="</body>";$Pg.="</html>";if($ModGZip){$GZData=@gzencode($Pg,1);$Lengths.='$PgLen[1]['.$File.']="'.strlen($GZData).'";';}$Lengths.='$PgLen[0]['.$File.']="'.strlen($Pg).'";';$Php='function RFile($f)';$Php.='{';$Php.='if(file_exists($f)){$fd=fopen($f,"r");return fread($fd,@filesize($f));}';$Php.='}';$Php.='if($QUERY_STRING=="phpinfo"){phpinfo();exit();}';$Php.='elseif($QUERY_STRING=="errors"){echo"<pre style=font-size:8pt>".RFile("errors.log")."</pre>";exit();}';$Php.='$Pg=($QUERY_STRING>0 && $QUERY_STRING<15)?$QUERY_STRING:"0";';$Php.='header("Last-Modified: '.$Date['Header'].' GMT");';$Php.=$Lengths;if($ModGZip){$Php.='if(eregi("gzip",$HTTP_ACCEPT_ENCODING))';$Php.='{';$Php.='header("Content-Encoding: gzip");';$Php.='header("Content-Length: ".$PgLen[1][$Pg]);';$Php.='$fd=fopen("html_$Pg-gz.dat","r");';$Php.='echo fread($fd,filesize("html_$Pg-gz.dat"));';$Php.='exit();';$Php.='}';RKTA_WFile("html_$File-gz.dat",$GZData);}$Php.='header("Content-Length: ".$PgLen[0][$Pg]);';$Php.='$fd=fopen("html_$Pg.dat","r");';$Php.='echo fread($fd,filesize("html_$Pg.dat"));';$Php.='?>';RKTA_WFile("html_$File.dat",$Pg);}if($VAR['User'] && $VAR['Pwd']){$AdminCheck='if(md5($PHP_AUTH_USER)!="'.md5($VAR['User']).'" || md5($PHP_AUTH_PW)!="'.md5($VAR['Pwd']).'"){header("WWW-Authenticate: Basic realm="RedKernel Traffic Analysis - Stats"");?><html>'.'<head>'.'<title>Statistics of '.$VAR['Domain'].' - powred by RedKernel Traffic Analysis '.$RKTA['Ver'].'</title>'.'<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">'.'<style type=text/css>TD{font-family:Arial,Helvetica;font-size:12pt}TR{background-color:#FFFFFF}TABLE{background-color:#000000}</style>'.'</head>'.'<body bgcolor=#EEEEEE text=#000000 link=#000077 vlink=#000077 alink=#000077 leftmargin=0 topmargin=50>'.'<table width=450 border=0 cellspacing=1 cellpadding=1 bgcolor=#000000 align=center>'.'<tr align=center><td bgcolor=#DDDDDD><font size=5><b>401 Unauthorized</b></font></td></tr>'.'<tr align=center><td><br><b>You don't have permission to access this page.<br>Probable reason: bad login/password</b><br><br></td></tr>'.'<tr align=right><td bgcolor=#DDDDDD><font size=1>Powered by <a href="http://www.redkernel-softwares.com">RedKernel Traffic Analysis '.$RKTA['Ver'].'</a></font></td></tr>'.'</table>'.'</body>'.'</html><?PHP exit();}';}RKTA_WFile("index.php","<?PHP ".$AdminCheck.$Php);RKTA_WGif("a.gif","DCDCFF");RKTA_WGif("b.gif","DCE7FF");RKTA_WGif("c.gif","DDFFFF");RKTA_WGif("r.gif","FFC2C2");RKTA_WFile(".htaccess",'<Files ~ ".(dat|log|sql)$">'."norder allow,denyndeny from alln</Files>n");}if($_SERVER['PATH_TRANSLATED']){$PATH_TRANSLATED=$_SERVER['PATH_TRANSLATED'];}elseif($HTTP_SERVER_VARS['PATH_TRANSLATED']){$PATH_TRANSLATED=$HTTP_SERVER_VARS['PATH_TRANSLATED'];}if($_SERVER['HTTP_REFERER']){$HTTP_REFERER=$_SERVER['HTTP_REFERER'];}elseif($HTTP_SERVER_VARS['HTTP_REFERER']){$HTTP_REFERER=$HTTP_SERVER_VARS['HTTP_REFERER'];}error_reporting(0);set_error_handler("RKTA_ErrorHandler");@mt_srand((double)microtime()*1000000);$Time['Start']=RKTA_GetMicrotime();$Time['Time']=time();$Date['Day']=date("d");$Date['Mon']=date("m");$Date['Full']=date("m/d H:i:s",$Time['Time']);$Date['Long']=date("l F j, Y, G:i:s (T)",$Time['Time']);$Date['Header']=date("D, d M Y G:i:s",$Time['Time']);$RKTA['Ver']="1.0.2";$LF="n";$Error="";$PgData="";$PathTrans['Pth']=@eregi_replace($VAR['RootPath'],"",$PATH_TRANSLATED);$PathTrans['Dir']=dirname($PathTrans['Pth']);$PathTrans['Dir']=($PathTrans['Dir']==".")?"/":"/".$PathTrans['Dir']."/";$PathTrans['Md5']=md5($PathTrans['Pth']);$PathTrans['Key']=md5($PathTrans['Pth'].$REMOTE_ADDR);$Dom['Dom']=RKTA_GetDom($HTTP_REFERER);$Dom['Md5']=md5($Dom['Dom']);$Dom['Key']=md5($Dom['Dom'].$REMOTE_ADDR);$Referer=(eregi("^http://[a-z0-9.-].[a-z0-9.-]",$HTTP_REFERER))?eregi_replace("^http://","",$HTTP_REFERER):"";$Referer=(strlen($Referer)<255)?$Referer:"";if(!$SQL['Link']=RKTA_SqlConnect()){$Error="Unable to connect to mysql server '".$SQL['Host']."' !n  > ".mysql_error();}elseif(!RKTA_SqlSelectDb($SQL['DB'])){$Error="Unable to connect to database '".$SQL['DB']."' !n  > ".mysql_error();}if(!$PATH_TRANSLATED){$Error="Unable to detect 'PATH_TRANSLATED' - check your config";}if(headers_sent()){$Error="Cannot add header information - headers already sent by ".$PATH_TRANSLATED." - You have to inculde 'rkta.php' before the first line of code";}if($Error){RKTA_WError($Error);$Html[0]=$Error;RKTA_WritePages();}else{$TimeRow=RKTA_SqlRow("* FROM rkta_".$VAR['ID']."time WHERE Id='1'");if($TimeRow['Id']!="1"){RKTA_TablesSetup();}if(strlen($PathTrans['Pth'])<255){$SetRef=($Referer)?",Ref='$Referer'":"";if(!$HTTP_COOKIE_VARS[$PathTrans['Md5']] && !RKTA_SqlCount("FROM rkta_".$VAR['ID']."pthkeys WHERE K='".$PathTrans['Key']."'")){if(!RKTA_SqlCount("FROM rkta_".$VAR['ID']."pths WHERE Pth='".$PathTrans['Pth']."'")){RKTA_SqlQry("INSERT INTO rkta_".$VAR['ID']."pths VALUES('".$PathTrans['Pth']."','1','1','1','1','1','1','".$Time['Time']."','$Referer')");}else{RKTA_SqlQry("UPDATE rkta_".$VAR['ID']."pths SET RD=RD+1,RW=RW+1,RM=RM+1,UD=UD+1,UW=UW+1,UM=UM+1,Lst='".$Time['Time']."'$SetRef WHERE Pth='".$PathTrans['Pth']."'");}RKTA_SqlQry("INSERT INTO rkta_".$VAR['ID']."pthkeys VALUES('".$PathTrans['Key']."')");setcookie($PathTrans['Md5'],"1",$Time['Time']+1200,$PathTrans['Dir'],$VAR['Domain']);}else{RKTA_SqlQry("UPDATE rkta_".$VAR['ID']."pths SET RD=RD+1,RW=RW+1,RM=RM+1,Lst='".$Time['Time']."'$SetRef WHERE Pth='".$PathTrans['Pth']."'");}}if($Referer && !eregi($VAR['Domain'],$Dom['Dom'])){if(!$HTTP_COOKIE_VARS[$Dom['Md5']] && strlen($Referer)<255 && !RKTA_SqlCount("FROM rkta_".$VAR['ID']."domkeys WHERE K='".$Dom['Key']."'")){if(!RKTA_SqlCount("FROM rkta_".$VAR['ID']."doms WHERE Dom='".$Dom['Dom']."'")){RKTA_SqlQry("INSERT INTO rkta_".$VAR['ID']."doms VALUES('".$Dom['Dom']."','1','1','1','1','1','1','".$Time['Time']."','$Referer')");}else{RKTA_SqlQry("UPDATE rkta_".$VAR['ID']."doms SET RD=RD+1,RW=RW+1,RM=RM+1,UD=UD+1,UW=UW+1,UM=UM+1,Lst='".$Time['Time']."',Ref='$Referer' WHERE Dom='".$Dom['Dom']."'");}RKTA_SqlQry("INSERT INTO rkta_".$VAR['ID']."domkeys VALUES('".$Dom['Key']."')");setcookie($Dom['Md5'],"1",$Time['Time']+1200,$PathTrans['Dir'],$VAR['Domain']);}else{RKTA_SqlQry("UPDATE rkta_".$VAR['ID']."doms SET RD=RD+1,RW=RW+1,RM=RM+1,Lst='".$Time['Time']."',Ref='$Referer' WHERE Dom='".$Dom['Dom']."'");}if(!RKTA_SqlCount("FROM rkta_".$VAR['ID']."refs WHERE R='$Referer'")){RKTA_SqlQry("INSERT INTO rkta_".$VAR['ID']."refs VALUES('$Referer')");}}if($Time['Time']>($TimeRow['Time']+$VAR['Update']*60)){$Help[0]="<a href=# onMouseover="Help(event,'Last in')">Lstin</a>";$Help[1]="<a href=# onMouseover="Help(event,'Domain name')">Domain</a>";$Help[2]="<a href=# onMouseover="Help(event,'Page')">Page</a>";$Help[3]="<a href=# onMouseover="Help(event,'Raw ins (this day)')">RDin</a>";$Help[4]="<a href=# onMouseover="Help(event,'Raw ins (this week)')">RWin</a>";$Help[5]="<a href=# onMouseover="Help(event,'Raw ins (this month)')">RMin</a>";$Help[6]="<a href=# onMouseover="Help(event,'Unique ins (this day)')">UDin</a>";$Help[7]="<a href=# onMouseover="Help(event,'Unique ins (this week)')">UWin</a>";$Help[8]="<a href=# onMouseover="Help(event,'Unique ins (this month)')">UMin</a>";$Help[9]="<a href=# onMouseover="Help(event,'Unique ins (this month) / Raw ins (this month)')">UMin/RMin</a>";$Help[10]="General referers stats";$Help[11]="Top 10";$Help[12]="Last referers";$Help[13]="All monthly referers";$Help[14]="Referers graphic";$Help[15]="General access stats";$Help[16]="Last access";$Help[17]="Access graphic";$Help[18]="Writing pages graphic";$RowName=array("RDin","UDin","RWin","UWin","RMin","UMin");$RowSql=array("RD","UD","RW","UW","RM","UM");$Total="";$Line="1";if($FDat=RKTA_FileArr("lstdays.dat")){$LstD="";$LstD['Cnt']=count($FDat);$Tmp=split("|",$FDat[$LstD['Cnt']-1]);$LstD['Beg']=$Tmp[0];$Tmp=split("|",$FDat[0]);$LstD['End']=$Tmp[0];for($i=0; $i<$LstD['Cnt'] && $i<93; $i++){$LineDat=split("|",$FDat[$i]);if($LineDat[1]>$LstD['PMax']){$LstD['PMax']=$LineDat[1];}if($LineDat[3]>$LstD['RMax']){$LstD['RMax']=$LineDat[3];}}for($i=$LstD['Cnt']-1; $i>=0; $i--){$LineDat=split("|",$FDat[$i]);$LineDat[1]=($LineDat[1]>0)?$LineDat[1]:0;$LineDat[2]=($LineDat[2]>0)?$LineDat[2]:0;$LineDat[3]=($LineDat[3]>0)?$LineDat[3]:0;$LineDat[4]=($LineDat[4]>0)?$LineDat[4]:0;if($LstD['PMax']){$PRPercent=$LineDat[1]/($LstD['PMax']/100)*4;$PUPercent=$LineDat[2]/($LstD['PMax']/100)*4;}else{$PRPercent=400;$PUPercent=400;}if($LstD['RMax']){$RRPercent=$LineDat[3]/($LstD['RMax']/100)*4;$RUPercent=$LineDat[4]/($LstD['RMax']/100)*4;}else{$RRPercent=400;$RUPercent=400;}$LstD['PDat'].="<a align=center onMouseOut=IR() onMouseOver=SA($i)><img name=a$i border=0 src=a.gif width=4 height=".round($PRPercent)." alt="$LineDat[0] = ".$LineDat[1].""></a><a onMouseOut=IR() onMouseOver=SB($i)><img name=b$i border=0 src=b.gif width=5 height=".round($PUPercent)." alt="$LineDat[0] = ".$LineDat[2].""></a>";$LstD['RDat'].="<a align=center onMouseOut=IR() onMouseOver=SA($i)><img name=a$i border=0 src=a.gif width=4 height=".round($RRPercent)." alt="$LineDat[0] = ".$LineDat[3].""></a><a onMouseOut=IR() onMouseOver=SB($i)><img name=b$i border=0 src=b.gif width=5 height=".round($RUPercent)." alt="$LineDat[0] = ".$LineDat[4].""></a>";}}if($FDat=RKTA_FileArr("exectime.dat")){$ExecT="";$ExecT['Min']="999";$ExecT['Cnt']=count($FDat);$Tmp=split("|",$FDat[$ExecT['Cnt']-1]);$ExecT['Beg']=$Tmp[0];$Tmp=split("|",$FDat[0]);$ExecT['End']=$Tmp[0];for($i=0; $i<$ExecT['Cnt'] && $i<375; $i++){$LineDat=split("|",$FDat[$i]);if($LineDat[1]>$ExecT['Max']){$ExecT['Max']=$LineDat[1];}if($LineDat[1]<$ExecT['Min']){$ExecT['Min']=$LineDat[1];}$ExecT['Tot']=$ExecT['Tot']+$LineDat[1];}$ExecT['Avg']=($ExecT['Cnt']>0)?round($ExecT['Tot']/$ExecT['Cnt'],5):"n/a";for($i=$ExecT['Cnt']-1; $i>=0; $i--){$LineDat=split("|",$FDat[$i]);$Percent=($ExecT['Avg']>0)?$LineDat[1]/($ExecT['Avg']*4/100)*4:400;$Percent=($Percent<400)?$Percent:400;$LineDat[1]=($LineDat[1]>0)?$LineDat[1]:0;$Img=($Percent<400)?"t":"r";$ExecT['Dat'].="<a align=center onMouseOut=IR() onMouseOver=SC($i)><img name=t$i border=0 src=a.gif width=2 height=".round($Percent)." alt="$LineDat[0] = $LineDat[1]"></a>";}$ExecT['Max']=round($ExecT['Max'],5);$ExecT['Min']=round($ExecT['Min'],5);}$Html[0]="<table width=100% border=0 cellspacing=1 cellpadding=1 bgcolor=#000000>";$Html[0].="<tr align=center class=C><td colspan=10>$Help[15]</td></tr>";$Html[0].="<tr align=center class=D><td> </td><td>$Help[2]</td><td>$Help[3]</td><td>$Help[4]</td><td>$Help[5]</td><td>$Help[6]</td><td>$Help[7]</td><td>$Help[8]</td><td>$Help[0]</td><td>$Help[9]</td></tr>";$SQL['Result']=RKTA_SqlSelect("* FROM rkta_".$VAR['ID']."pths ORDER BY RD DESC");while($Dat=@mysql_fetch_row($SQL['Result'])){$Total[1]=$Total[1]+$Dat[1];$Total[2]=$Total[2]+$Dat[2];$Total[3]=$Total[3]+$Dat[3];$Total[4]=$Total[4]+$Dat[4];$Total[5]=$Total[5]+$Dat[5];$Total[6]=$Total[6]+$Dat[6];$Percent=($Dat[3]>0)?$Dat[6]/$Dat[3]*100:0;$Html[0].="<tr align=center onMouseOut=Ou(this) onMouseOver=Ov(this)><td onmousedown=Oc(this)>$Line</td><td align=left onmousedown=Oc(this)><a href=/$Dat[0] target=_blank>$Dat[0]</a></td><td onmousedown=Oc(this)>$Dat[1]</td><td onmousedown=Oc(this)>$Dat[2]</td><td onmousedown=Oc(this)>$Dat[3]</td><td onmousedown=Oc(this)>$Dat[4]</td><td onmousedown=Oc(this)>$Dat[5]</td><td onmousedown=Oc(this)>$Dat[6]</td><td onmousedown=Oc(this)>".date('m/d',$Dat[7])." ".date('H:i:s',$Dat[7])."</td><td align=left class=A onmousedown=Oc(this)><img src=a.gif width=".round($Percent)." height=4><br>".round($Percent,2)."%</td></tr>";$Line++;}$Html[0].="<tr align=center onMouseOut=Ou(this) onMouseOver=Ov(this)><td colspan=2 onmousedown=Oc(this)>total:</td><td onmousedown=Oc(this)>".$Total[1]."</td><td onmousedown=Oc(this)>".$Total[2]."</td><td onmousedown=Oc(this)>".$Total[3]."</td><td onmousedown=Oc(this)>".$Total[4]."</td><td onmousedown=Oc(this)>".$Total[5]."</td><td onmousedown=Oc(this)>".$Total[6]."</td><td colspan=2 onmousedown=Oc(this)> </td></tr>";$Html[0].="</table>";$DayTot['RR']=$Total[1];$DayTot['RU']=$Total[4];$Html[1]="<table width=100% border=0 cellspacing=1 cellpadding=1 bgcolor=#000000>";$Html[1].="<tr align=center class=C><td colspan=2>$Help[16]</td></tr>";$Html[1].="<tr align=center class=D><td>$Help[0]</td><td>$Help[2]</td></tr>";$SQL['Result']=RKTA_SqlSelect("Lst,Pth FROM rkta_".$VAR['ID']."pths ORDER BY Lst DESC");while($Dat=@mysql_fetch_row($SQL['Result'])){$Html[1].="<tr align=center onMouseOut=Ou(this) onMouseOver=Ov(this)><td onmousedown=Oc(this)>".date('m/d',$Dat[0])." ".date('H:i:s',$Dat[0])."</td><td align=left class=A onmousedown=Oc(this)><a href=/$Dat[1] target=_blank>$Dat[1]</a></td></tr>";}$Html[1].="</table>";$Tot=array($Total[1],$Total[4],$Total[2],$Total[5],$Total[3],$Total[6]);$Html[2]="<table width=760 border=0 cellspacing=0 cellpadding=5>";$x=0;for($i=0; $i<3; $i++){$Html[2].="<tr>";for($j=0; $j<2; $j++){$Html[2].="<td bgcolor=#EEEEEE>";$SQL['Result']=RKTA_SqlSelect("Pth,".$RowSql[$x]." FROM rkta_".$VAR['ID']."pths ORDER BY ".$RowSql[$x]." DESC LIMIT 0,10");$Html[2].="<table width=100% border=0 cellspacing=1 cellpadding=1 bgcolor=#000000>";$Html[2].="<tr align=center class=C><td colspan=2>$Help[11] sorted by '".$RowName[$x]."'</td></tr>";$Html[2].="<tr align=center class=D><td>$Help[2]</td><td>%</td></tr>";while($Dat=@mysql_fetch_row($SQL['Result'])){$Percent=($Tot[$x]>0)?$Dat[1]/($Tot[$x]/100):0;$Html[2].="<tr onMouseOut=Ou(this) onMouseOver=Ov(this)><td onmousedown=Oc(this)><a href=/$Dat[0]>$Dat[0]</a></td><td class=A onmousedown=Oc(this)><img src=a.gif width=".round($Percent)." height=4><br>".round($Percent,2)."%</td></tr>";}$Html[2].="</table>";$Html[2].="</td>";$x++;}$Html[2].="</tr>";}$Html[2].="</table>";$Html[3]="<table width=760 border=0 cellspacing=0 cellpadding=5>";$Html[3].="<tr><td bgcolor=#EEEEEE>";$Html[3].="<table width=100% border=0 cellspacing=1 cellpadding=1 bgcolor=#000000>";$Html[3].="<tr align=center class=C><td>$Help[17]</td></tr>";$Html[3].="<tr><td><img src=a.gif width=20 height=6> <b>Access total (raw)</b><br><img src=b.gif width=20 height=6> <b>Access total (uniques)</b><br>";$Html[3].="<b>From</b> ".$LstD['Beg']." <b>to</b> ".$LstD['End']."<br>";$Html[3].=$LstD['PDat'];$Html[3].="</td></tr>";$Html[3].="</table>";$Html[3].="</td></tr>";$Html[3].="</table>";$Total="";$Line="1";$Html[4]="<table width=100% border=0 cellspacing=1 cellpadding=1 bgcolor=#000000>";$Html[4].="<tr align=center class=C><td colspan=10>$Help[10]</td></tr>";$Html[4].="<tr align=center class=D><td> </td><td>$Help[1]</td><td>$Help[3]</td><td>$Help[4]</td><td>$Help[5]</td><td>$Help[6]</td><td>$Help[7]</td><td>$Help[8]</td><td>$Help[0]</td><td>$Help[9]</td></tr>";$SQL['Result']=RKTA_SqlSelect("* FROM rkta_".$VAR['ID']."doms ORDER BY RD DESC");while($Dat=@mysql_fetch_row($SQL['Result'])){$Total[1]=$Total[1]+$Dat[1];$Total[2]=$Total[2]+$Dat[2];$Total[3]=$Total[3]+$Dat[3];$Total[4]=$Total[4]+$Dat[4];$Total[5]=$Total[5]+$Dat[5];$Total[6]=$Total[6]+$Dat[6];$Percent=($Dat[3]>0)?$Dat[6]/$Dat[3]*100:0;$Html[4].="<tr align=center onMouseOut=Ou(this) onMouseOver=Ov(this)><td onmousedown=Oc(this)>$Line</td><td onmousedown=Oc(this)><a href=http://$Dat[8] target=_blank>$Dat[0]</a></td><td onmousedown=Oc(this)>$Dat[1]</td><td onmousedown=Oc(this)>$Dat[2]</td><td onmousedown=Oc(this)>$Dat[3]</td><td onmousedown=Oc(this)>$Dat[4]</td><td onmousedown=Oc(this)>$Dat[5]</td><td onmousedown=Oc(this)>$Dat[6]</td><td onmousedown=Oc(this)>".date('m/d',$Dat[7])." ".date('H:i:s',$Dat[7])."</td><td align=left class=A onmousedown=Oc(this)><img src=a.gif width=".round($Percent)." height=4><br>".round($Percent,2)."%</td></tr>";$Line++;}$Html[4].="<tr align=center onMouseOut=Ou(this) onMouseOver=Ov(this)><td colspan=2 onmousedown=Oc(this)>total:</td><td onmousedown=Oc(this)>".$Total[1]."</td><td onmousedown=Oc(this)>".$Total[2]."</td><td onmousedown=Oc(this)>".$Total[3]."</td><td onmousedown=Oc(this)>".$Total[4]."</td><td onmousedown=Oc(this)>".$Total[5]."</td><td onmousedown=Oc(this)>".$Total[6]."</td><td colspan=2 onmousedown=Oc(this)> </td></tr>";$Html[4].="</table>";$DayTot['PR']=$Total[1];$DayTot['PU']=$Total[4];$Html[5]="<table width=100% border=0 cellspacing=1 cellpadding=1 bgcolor=#000000>";$Html[5].="<tr align=center class=C><td colspan=2>$Help[12]</td></tr>";$Html[5].="<tr align=center class=D><td>$Help[0]</td><td>Referer</td></tr>";$SQL['Result']=RKTA_SqlSelect("Lst,Ref FROM rkta_".$VAR['ID']."doms ORDER BY Lst DESC");while($Dat=@mysql_fetch_row($SQL['Result'])){$Ref=(strlen($Dat[1])>120)?substr($Dat[1],0,120)."(...)":$Dat[1];$Html[5].="<tr align=center onMouseOut=Ou(this) onMouseOver=Ov(this)><td onmousedown=Oc(this)>".date('m/d',$Dat[0])." ".date('H:i:s',$Dat[0])."</td><td align=left class=A onmousedown=Oc(this)><a href=http://$Dat[1] target=_blank>http://$Ref</a></td></tr>";}$Html[5].="</table>";$Tot=array($Total[1],$Total[4],$Total[2],$Total[5],$Total[3],$Total[6]);$Html[6]="<table width=760 border=0 cellspacing=0 cellpadding=5>";$x=0;for($i=0; $i<3; $i++){$Html[6].="<tr>";for($j=0; $j<2; $j++){$Html[6].="<td bgcolor=#EEEEEE>";$SQL['Result']=RKTA_SqlSelect("Dom,".$RowSql[$x].",Ref FROM rkta_".$VAR['ID']."doms ORDER BY ".$RowSql[$x]." DESC LIMIT 0,10");$Html[6].="<table width=100% border=0 cellspacing=1 cellpadding=1 bgcolor=#000000>";$Html[6].="<tr align=center class=C><td colspan=2>$Help[11] sorted by '".$RowName[$x]."'</td></tr>";$Html[6].="<tr align=center class=D><td>$Help[1]</td><td>%</td></tr>";while($Dat=@mysql_fetch_row($SQL['Result'])){$Percent=($Tot[$x]>0)?$Dat[1]/($Tot[$x]/100):0;$Html[6].="<tr onMouseOut=Ou(this) onMouseOver=Ov(this)><td align=center onmousedown=Oc(this)><a href=http://$Dat[2]>$Dat[0]</a></td><td class=A onmousedown=Oc(this)><img src=a.gif width=".round($Percent)." height=4><br>".round($Percent,2)."%</td></tr>";}$Html[6].="</table>";$Html[6].="</td>";$x++;}$Html[6].="</tr>";}$Html[6].="</table>";$Html[7]="<table width=760 border=0 cellspacing=0 cellpadding=5>";$Html[7].="<tr><td bgcolor=#EEEEEE>";$Html[7].="<table width=100% border=0 cellspacing=1 cellpadding=1 bgcolor=#000000>";$Html[7].="<tr align=center class=C><td>$Help[13] (uniques)</td></tr>";$SQL['Result']=RKTA_SqlSelect("R FROM rkta_refs ORDER BY R");while($Dat=@mysql_fetch_row($SQL['Result'])){$Ref=(strlen($Dat[0])>120)?substr($Dat[0],0,120)."(...)":$Dat[0];$Html[7].="<tr onMouseOut=Ou(this) onMouseOver=Ov(this)><td class=A onmousedown=Oc(this)><a href=http://$Dat[0] target=_blank>http://$Ref</a></td></tr>";}$Html[7].="</table>";$Html[7].="</td></tr>";$Html[7].="</table>";$Html[8]="<table width=760 border=0 cellspacing=0 cellpadding=5>";$Html[8].="<tr><td bgcolor=#EEEEEE>";$Html[8].="<table width=100% border=0 cellspacing=1 cellpadding=1 bgcolor=#000000>";$Html[8].="<tr align=center class=C><td>$Help[17]</td></tr>";$Html[8].="<tr><td><img src=a.gif width=20 height=6> <b>Referers total (raw)</b><br><img src=b.gif width=20 height=6> <b>Referers total (uniques)</b><br>";$Html[8].="<b>From</b> ".$LstD['Beg']." <b>to</b> ".$LstD['End']."<br>";$Html[8].=$LstD['RDat'];$Html[8].="</td></tr>";$Html[8].="</table>";$Html[8].="</td></tr>";$Html[8].="</table>";$Html[9]="<table width=760 border=0 cellspacing=0 cellpadding=5>";$Html[9].="<tr><td bgcolor=#EEEEEE>";$Html[9].="<table width=100% border=0 cellspacing=1 cellpadding=1 bgcolor=#000000>";$Html[9].="<tr align=center class=C><td>Writing pages statisics execution time</td></tr>";$Html[9].="<tr><td><img src=a.gif width=20 height=6> <b>Execution time (in secondes).</b><br>";$Html[9].="<b>From</b> ".$ExecT['Beg']." <b>to</b> ".$ExecT['End']."<br>";$Html[9].="<b>Average</b>: ".$ExecT['Avg']." s - <b>Minimum</b>: ".$ExecT['Min']." s - <b>Maximum</b>: ".$ExecT['Max']." s<br>";$Html[9].=$ExecT['Dat'];$Html[9].="</td></tr>";$Html[9].="</table>";$Html[9].="</td></tr>";$Html[9].="</table>";if($Date['Day']!=$TimeRow['Day']){if($News=RKTA_CheckVersion()){RKTA_WFile("html_news.dat",$News);}RKTA_AFile("lstdays.dat",date("m/d/y",($Time['Time']-86400))."|".$DayTot['RR']."|".$DayTot['RU']."|".$DayTot['PR']."|".$DayTot['PU']."|",93);$TimeSet="Day='".$Date['Day']."',";$DataSet="RD='0',UD='0',";if(date("w")==1 && $TimeRow['Day']!=$Date['Day']){$TimeSet.="DId='".$Date['Day']."',";$DataSet.="RW='0',UW='0',";}if($Date['Mon']!=$TimeRow['Mon']){RKTA_FKill("errors.log");$TimeSet.="Mon='".$Date['Mon']."',";RKTA_SqlQry("DELETE FROM rkta_".$VAR['ID']."doms");RKTA_SqlQry("DELETE FROM rkta_".$VAR['ID']."pths");RKTA_SqlQry("DELETE FROM rkta_".$VAR['ID']."refs");}else{RKTA_SqlQry("UPDATE rkta_".$VAR['ID']."doms SET ".substr($DataSet,0,-1));RKTA_SqlQry("UPDATE rkta_".$VAR['ID']."pths SET ".substr($DataSet,0,-1));}RKTA_SqlQry("UPDATE rkta_".$VAR['ID']."time SET ".substr($TimeSet,0,-1));RKTA_SqlQry("DELETE FROM rkta_".$VAR['ID']."domkeys");RKTA_SqlQry("DELETE FROM rkta_".$VAR['ID']."pthkeys");RKTA_SqlQry("OPTIMIZE TABLE rkta_".$VAR['ID']."domkeys");RKTA_SqlQry("OPTIMIZE TABLE rkta_".$VAR['ID']."doms");RKTA_SqlQry("OPTIMIZE TABLE rkta_".$VAR['ID']."pthkeys");RKTA_SqlQry("OPTIMIZE TABLE rkta_".$VAR['ID']."pths");RKTA_SqlQry("OPTIMIZE TABLE rkta_".$VAR['ID']."refs");RKTA_SqlQry("OPTIMIZE TABLE rkta_".$VAR['ID']."time");}RKTA_WritePages();RKTA_SqlQry("UPDATE rkta_".$VAR['ID']."time SET Time='".$Time['Time']."'");RKTA_AFile("exectime.dat",$Date['Full']."|".round((RKTA_GetMicrotime()-$Time['Start']),5)."|",375);}}?>

 

PS. I am not the one who removed all the line breaks and spaces.

Posted

Look in catalog/index.php

IF it goes anywhere it would go between these 2 lines:-

<body marginwidth="0" marginheight="0">

<!-- header //-->

The body tag <body marginwidth="0" marginheight="0"> is line 45 on the most recent version I am using.

:)

HTH

Neil

 

Common sense is genius dressed in working clothes.

Ralph Waldo Emerson

Posted

why not try the user tracking contribution.

 

cheers

barry

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...