View file pages/referer.php

File size: 2.48Kb
<?php
// mod by Golem http://veplog.ru

require_once"../template/start.php";
require_once"../template/regglobals.php";
require_once"../template/config.php";
require_once"../template/functions.php";
require_once"../template/antidos.php";
require_once"../template/cookies.php";
require_once"../template/gzip.php";
require_once"../template/header.php";
require_once"../template/referer.php";
include_once"../themes/$config_themes/index.php";

echo'<div class=tp>Кто-откуда</div><div class="forum">';

$reffile = file(BASEDIR."local/referer.dat");

foreach($reffile as $refvalue){
$data = explode("|",$refvalue);
if($data[0]!=""){
$arrsite[]=$data[0];
$arralltime[$data[0]]=$data[1];
$arrallip[$data[0]]=$data[2];
}}

$countvalues =  array_count_values ($arrsite);

arsort($countvalues);

$newkey = array_keys($countvalues);
$newvalues = array_values($countvalues);

$total = count($countvalues);

$start = (int)$_GET['start'];
if($start < 0 || $start > $total){$start = 0;}
if ($total < $start + $config_showref){ $end = $total; }
else {$end = $start + $config_showref; }
for ($i = $start; $i < $end; $i++){


echo '<div class="r0"> '.($i+1).'. <b><a href="http://'.$newkey[$i].'">'.$newkey[$i].'</a></b> ('.date_fixed($arralltime[$newkey[$i]]).')<br>';
echo 'Переходов: '. $newvalues[$i].'<br>Последний IP: '. $arrallip[$newkey[$i]].'</div>';
}

echo'<div class=body>';
if ($start != 0) {echo '<a href="referer.php?start='.($start - $config_showref).'&amp;'.SID.'">&lt;пред.</a>';}else{echo'&lt;пред.';}
echo ' | ';
if ($total > $start + $config_showref) {echo ' <a href="referer.php?start='.($start + $config_showref).'&amp;'.SID.'">след.&gt;</a>';}else{echo'след.&gt;';}
if($total>0){
$ba=ceil($total/$config_showref);
$ba2=$ba*$config_showref-$config_showref;

echo '<br>Стр.:';
$asd=$start-($config_showref*3);
$asd2=$start+($config_showref*4);

if($asd<$total && $asd>0){echo ' <a href="referer.php?start=0&amp;'.SID.'">1</a> ... ';}

for($i=$asd; $i<$asd2;){

if($i<$total && $i>=0){
$ii=floor(1+$i/$config_showref);

if ($start==$i) {
echo ' <b>('.$ii.')</b>';
} else {
echo ' <a href="referer.php?start='.$i.'&amp;'.SID.'">'.$ii.'</a>';
}}


$i=$i+$config_showref;}
if($asd2<$total){echo ' ... <a href="referer.php?start='.$ba2.'&amp;'.SID.'">'.$ba.'</a>';}
}


echo'</div><div class=btm>[<a href="../index.php?'.SID.'">На главную</a>]</div>';
include_once "../themes/$config_themes/foot.php";
?>