a. open vb2/global.php
find:
PHP Code:
// ###################### Start init #######################
Immediately ABOVE it put any PHP counter, i using this:
PHP Code:
// ipcounter hack by CX
// config
// create these two files count.txt and ip.txt, chmod them to 777
$count_file = "count.txt";
$ip_file = "ip.txt";
$userip = getenv('REMOTE_ADDR'); // in some fixed IP server, change this line to $userip = getenv('HTTP_X_FORWARDED_FOR');
$count_temp=file($count_file);
$ip_temp=file($ip_file);
$detail=explode("|",$count_temp[0]);
$count_t=getdate(time());
$count_day=$count_t['mday'];
if ($detail[0]==$count_day) {
$detail[1]++;
$detail[2]++;
$count=count($ip_temp);
$check=1;
for ($i=0; $i<$count; $i++) {
$ip_list=str_replace("\r","",str_replace("\n","",$ip_temp[$i]));
if ($ip_list==$userip) $check=0;
}
if ($check==1) {
$detail[3]++;
$detail[4]++;
$fp=fopen($ip_file,"a");
flock($fp,3);
fputs($fp,$userip."\n");
fclose($fp);
}
}
else {
$detail[0]=$count_day;
$detail[1]=1;
$detail[3]=1;
$detail[2]++;
$detail[4]++;
$fp=fopen($ip_file,"w");
flock($fp,3);
fputs($fp,$userip."\n");
fclose($fp);
}
$new=implode("|",$detail);
$fp=fopen($count_file,"w");
flock($fp,3);
fputs($fp,$new);
fclose($fp);
// end ipcounter hack
b. edit the template footer
find in last:
PHP Code:
</smallfont>
</p>
Immediately ABOVE it put:
PHP Code:
<br><br>
page views: today = $detail[1], total = $detail[2]. variant IP visitors: today = $detail[3], total = $detail[4].
Done!
Bookmarks