Файл: pages/rewrite_kat.php
Строк: 50
<?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['page']) and isset($_GET['id']))
{
$id=((int)abs($_GET['id']));
if(mysql_num_rows($sql=mysql_query('SELECT * FROM `top` where `id`=''.$id.'' LIMIT 1;'))>=1)
{
$arr=mysql_fetch_assoc($sql);
$config['TITLE']=$arr['name'];
$config['description']=$arr['opisanie'];
include_once $config['OTS'].'sistem/head.php';
$data=round(date('Ymd'));
$count=mysql_result(mysql_query('SELECT COUNT(*) FROM `site` WHERE `top`=''.$id.'' and `data`=''.$data.'';'),0);
if($page=page($count,isset($_GET['page'])?$_GET['page']:1))
{
$sql=mysql_query('SELECT * FROM `site` WHERE `top`=''.$id.'' and `data`=''.$data.'' ORDER BY `host` DESC LIMIT '.$page['ot'].','.$_SESSION['kol_sites'].';');
while($arr=mysql_fetch_assoc($sql))
print '<a'.($_SESSION['wiev_opis']==1?' title="'.$arr['opisanie'].'"':'').' class="link" href="'.$config['home'].'/site/'.$arr['id'].'/index.php">'.$arr['name'].'</a> ('.$arr['host'].'/<small>'.$arr['hit'].'</small>)<br />'.($_SESSION['wiev_opis']!=1?'<div class="func">'.$arr['opisanie'].'<br /></div>':'');
pages($page['page'],$page['str'],'','.php');
}
else
print 'Такой страници не существует, или в данной категории еще нету активных сайтов!<br />';
include_once $config['OTS'].'sistem/foot.php';
}
else
{
header('location: '.$config['home'].'/?act=error&error=404');
exit;
}
}
else
{
header('location: '.$config['home'].'/?act=error&error=404');
exit;
}
?>