File size: 2.31Kb
<?php
#-----------------------------------------------------#
# ********* WAP-MOTORS ********* #
# Made by : VANTUZ #
# E-mail : [email protected] #
# Site : http://pizdec.ru #
# WAP-Site : http://visavi.net #
# ICQ : 36-44-66 #
# Вы не имеете право вносить изменения в код скрипта #
#-----------------------------------------------------#
//-------------------- # mod by slavka-r --- # site: http://semax.org.ru/index.php # ICQ: 469327 # E-M@IL: [email protected] # кому не жалко R646970505027 -------------//
$ref_from = $_SERVER['HTTP_REFERER'];
if (ereg ("^http",$ref_from)){
$ref_from=str_replace("http://","",$ref_from);
$ref_from=str_replace("https://","",$ref_from);
$ref_from=strtok($ref_from,'/');
$ref_from=strtok($ref_from,'?');
$ref_from=check($ref_from);
$lines=file(BASEDIR."local/referer.dat");
$count=count($lines);
for ($rb=0; $rb<$count; $rb++) {
$dt=explode("|",$lines[$rb]);
if ($dt[0]==$ref_from) {
$rlinn=(int)$rb; $ref_count=$dt[3];}}
if(!empty($ref_from)){
if($rlinn>0){
$ref_count=$ref_count+1;
$time=time();
$t=$ref_from.'|'.$time.'|'.$ip.'|'.$ref_count.'|';
$reffile=file(BASEDIR."local/referer.dat");
$fp=fopen(BASEDIR."local/referer.dat","a+");
flock ($fp,LOCK_EX);
ftruncate ($fp,0);
for ($ri=0;$ri< sizeof($reffile);$ri++) {if ($rlinn!=$ri) {fputs($fp,$reffile[$ri]);} else {fputs($fp,"$t\r\n");}}
fflush ($fp);
flock ($fp,LOCK_UN);
fclose($fp);}
else{
$time=time();
$t=$ref_from.'|'.$time.'|'.$ip.'|1|';
$fp = fopen(BASEDIR."local/referer.dat","a+");
flock ($fp,LOCK_EX);
fputs($fp,"$t\r\n");
fflush ($fp);
flock ($fp,LOCK_UN);
fclose($fp);
$reffile=file(BASEDIR."local/referer.dat");
$ri = count($reffile);
if ($ri>=$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);}
}}}
if ($dostup==101 && $log==$config_nikname){}else{ if($config_open=="1"){ include BASEDIR."themes/$config_themes/index.php"; echo $config_site_off.'<br>'; include BASEDIR."themes/$config_themes/foot.php"; exit;}}
?>