Напишите етот код на
template/referer.php
if (!defined("BASEDIR")) { header("Location:../index.php"); exit; }
if ($http_referer!=""){
if (ereg ("^http",$http_referer)){
$http_referer=check_string($http_referer);
if (eregi("^[a-z0-9\.-]+\.[a-z]{2,4}\$", $http_referer)){
if ($http_referer!=$config_servername){
$hostname = gethostbyaddr($ip);
$http_ref = $_SERVER['HTTP_REFERER'];
$textref=$http_ref.'|'.$sitetime.'|'.$ip.'|'.$brow.'|'.$hostname.'|'.$http_referer.'|'.$request_uri.'|'.$username.'|';
$fp = fopen(BASEDIR."local/referer.dat","a+");
flock ($fp,LOCK_EX);
fputs($fp,"$textref\r\n");
fflush ($fp);
flock ($fp,LOCK_UN);
fclose($fp);
$reffile=file(BASEDIR."local/referer.dat");
$refcount = count($reffile);
if ($refcount>=$config_referer) {
$fp=fopen(BASEDIR."local/referer.dat","w");
flock ($fp,LOCK_EX);
unset($reffile[0],$reffile[1]);
fputs($fp, implode($reffile));
flock ($fp,LOCK_UN);
fclose($fp);}
}}}}