Файл: __system/pages/sitelist.php
Строк: 62
<?
$site_category = $db -> query
("
SELECT * FROM `site_category` WHERE `id` = '".filtration::int($_GET['categoryID'])."' LIMIT 1
");
if($site_category -> rowCount() > 0)
{
$sc = $site_category -> fetch(PDO::FETCH_ASSOC);
DEFINE('TITLE' , 'Категории - '.$sc['name'].''); # фиксируем титул
}
else
{
DEFINE('TITLE' , 'Ошибка'); # фиксируем титул
}
head();
$siteRand = $db -> query
("
SELECT * FROM site,site_statistic WHERE site.status = '1' and site.id = site_statistic.siteID
and site.category != 4
and site_statistic.date = '".date("Y-m-d",time())."' and `host` > '0' ORDER BY RAND() LIMIT 3
");
if($siteRand -> rowCount() > 0)
{
while($sR = $siteRand -> fetch(PDO::FETCH_ASSOC))
{
echo '<div class=list><table id="sites_list"><tbody><span class=font-weight: 700;>';
echo '<img src="http://www.google.com/s2/favicons?domain='.$sR['url'].'" alt="/fivicons.png" />
'.url('/out/'.$sR['id'].'/',''.$sR['about'].'','','_blanc').'';
echo '</td></tr></tbody></table></div></div></div></div>';
}
}
if(!isset($_GET['id']))
{
$_GET['id'] = '';
}
$sites = $db -> query
("
SELECT * FROM site,site_statistic WHERE site.status = '1' and site.id = site_statistic.siteID
and site_statistic.date = '".date("Y-m-d",time())."' and `host` > '0' and site.category = '".filtration::int($_GET['categoryID'])."'
ORDER BY site_statistic.host DESC
");
if(!isset($_GET['pages']))
{
$_GET['pages'] = '';
}
$num = 10;
$pages = $_GET['pages'];
$posts = $sites -> rowCount();
$total = filtration::int(($posts - 1) / $num) + 1;
$pages = filtration::int($pages);
if(empty($pages) or $pages < 0) $pages = 1;
if($pages > $total) $pages = $total;
$start = $pages * $num - $num;
$site = $db -> query
("
SELECT * FROM site,site_statistic WHERE site.status = '1' and site.id = site_statistic.siteID
and site_statistic.date = '".date("Y-m-d",time())."' and `host` > '0' and site.category = '".filtration::int($_GET['categoryID'])."'
ORDER BY site_statistic.host DESC LIMIT $start, $num
");
if($site -> rowCount() > 0)
{ $start_limit = $start + 1;
while($s = $site -> fetch(PDO::FETCH_ASSOC))
{
if($_GET['id'] == $s['id'])
{
$siteUrl = '<b>'.$s['url'].'</b>';
}
else
{
$siteUrl = $s['url'];
}
echo '<div class=list><table id="sites_list"><tbody><tr><td class="tplace">'.$start_limit.'</td><td><span class=font-weight: 700;>';
echo '<img src="http://www.google.com/s2/favicons?domain='.$s['url'].'" alt="/fivicons.png" />
'.url('/out/'.$s['id'].'/',''.$siteUrl.'','','_blanc').'<span class=font-weight: 700;>
['.url('/siteStatistics/'.$s['id'].'/',''.$s['host'].'/'.$s['hits'].'','','').']
<span style="float:right;padding-right: 10px;"><a href="/siteStatistics/'.$s['id'].'/"><img src=/__desing/images/n77.png></a></span>';
echo '<br />'.$s['about'].'<br /></td></tr></tbody></table></div></div></div></div>';
$start_limit++;
}
pagination($posts,$num,$total,$pages,'/sitelist/');
}
else
{
echo '<div class = "main">В категории сайтов нет</div>';
}
echo '</div>';
foot();
?>