Файл: pages/rewrite_referer.php
Строк: 42
<?php # Created by Up
include_once '../sistem/start.php';
include_once $config['OTS'].'sistem/config.php';
include_once $config['OTS'].'sistem/function.php';
include_once $config['OTS'].'sistem/db.php';
//include_once $config['OTS'].'sistem/users.php';
if(isset($_GET['id']))
{
$id=((int)abs($_GET['id']));
if(mysql_num_rows($sql=mysql_query('SELECT * FROM `site` where `id`=''.$id.'' LIMIT 1;'))>=1)
{
$arr=mysql_fetch_assoc($sql);
if(isset($_SESSION['id']) and isset($_SESSION['pass']) and $_SESSION['id']==$arr['admin'])
{
$config['TITLE']='Популярные страници '.$arr['name'];
$config['description']=$arr['opisanie'];
include_once $config['OTS'].'sistem/head.php';
$sql=mysql_query('SELECT DISTINCT `referer`, SUM(`hit`) AS `hit` FROM `statistic` WHERE `for`=''.$id.'' GROUP BY `referer` ORDER BY 2 DESC;');
if(mysql_num_rows($sql)>=1)
{
while($s=mysql_fetch_assoc($sql))
print '<a href="http://'.$arr['url'].'/'.$s['referer'].'">http://'.$arr['url'].'/'.$s['referer'].'</a> - <i>'.(round((($s['hit']/$arr['hit'])*100),1)).'%</i><br />';
}
else
print 'Еще нету статистики по популярным страницам!<br />';
print '<a href="index.php">Страница сайта</a><br />';
include_once $config['OTS'].'sistem/foot.php';
}
}
}
#else
{
header('location: '.$config['home'].'/?act=error&error=404');
exit;
}
?>