Файл: New_top/Modules/category.php
Строк: 56
<?php
$title = 'Категории сайта';
require_once ('Sys/head.php');
switch($act)
{
default:
echo '<div class="block">Катерогии</div>';
$cats = $mysqli->query("SELECT `id`,`name`,`count` FROM `".$prefix."cat` ORDER BY `position`");
echo '<div class = "l1">';
while($cat = $cats->fetch_assoc())
{
$akt = $mysqli->query("SELECT `id`,`name`,`hosts`,`hits`,`about`,`out`,`in`,`url` FROM `".$prefix."sait` WHERE `category` = '".$cat['id']."' AND `status` = '1' AND `hosts` > '0' AND `ban` = '0'")->num_rows;
echo '<img src="http://'.$_SERVER['HTTP_HOST'].'/Design/images/ini/icon.png" alt="*" /> <a href = "http://'.$_SERVER['HTTP_HOST'].'/m/category/view/'.$cat['id'].'">'.$cat['name'].'</a> ['.$akt.'/'.$cat['count'].']<br/>';
}
echo '</div>';
break;
case 'view':
$query = $mysqli->query("SELECT * FROM `".$prefix."cat` WHERE `id` = '".$id."'");
if($query->num_rows == 0)
{
echo '<div class="l1">';
echo 'Вы ошиблись категорией.<br/>';
echo '<a href="http://'.$_SERVER['HTTP_HOST'].'/m/category">Категории</a><br/>';
echo '</div>';
require_once ('Sys/foot.php');
exit;
}
$cat = $query->fetch_array();
echo '<div class="block"><a href="http://'.$_SERVER['HTTP_HOST'].'/m/category">Категории</a> | <strong>'.$cat['name'].'</strong></div>';
$count = $mysqli->query("SELECT `id` FROM `".$prefix."sait` WHERE `category` = '".$id."' AND `status` = '1' AND `hosts` > '0' AND `ban` = '0'")->num_rows;
if($count == 0)
{
echo '<div class="l1">';
echo 'Сайтов в данной категории не обнаружено.<br/>';
echo '</div>';
require_once ('Sys/foot.php');
exit;
}
$total = intval(($count-1)/$pageSait)+1;
$page = (isset($_GET['page'])) ? abs(intval($_GET['page'])) : '';
if(empty($page) OR $page < 0)
{
$page = 1;
}
if($page > $total)
{
$page = $total;
}
$past = intval($count/$pageSait);
$start = $page*$pageSait-$pageSait;
$saits = $mysqli->query("SELECT `id`,`name`,`hosts`,`hits`,`about`,`out`,`in`,`url` FROM `".$prefix."sait` WHERE `category` = '".$id."' AND `status` = '1' AND `ban` = '0' AND `hosts` > '0' ORDER BY `hosts` DESC LIMIT ".$start.",".$pageSait."");
$idd = intval($_GET['idd']);
while($row = $saits->fetch_assoc())
{
if($row['id']==$idd){$u1='<u>'; $u2='</u>';} else{$u1=''; $u2='';}
$start++;
///////////////////////
$porno = $mysqli->query("SELECT * FROM `".$prefix."cat` WHERE `id` = '".$id."'");
$porno_cat = $porno->fetch_assoc();
if($porno_cat['id'] != 21){
}else{
////////////////
$path = $_SERVER['DOCUMENT_ROOT'];
$path .= "/Sys/in/cat_adres.php";
include_once($path);
////////////////////
}
$link = $porno_cat['id'] == 21 ? '<a href="http://'.$_SERVER['HTTP_HOST'].'/out/'.$row['id'].'" onclick="url_open();">' : '<a href="http://'.$_SERVER['HTTP_HOST'].'/out/'.$row['id'].'">';
/////////////////////////
echo '<div class="li"><b>'.$start.'</b></span> '.$link.' <font color=#4682B4><b>'.$u1.''.$row['url'].''.$u2.'</b></font></a> ['.$row['hosts'].'/'.$row['hits'].'] <a href="http://'.$_SERVER['HTTP_HOST'].'/stats/'.$row['id'].'"> <img src="http://'.$_SERVER['HTTP_HOST'].'/Design/images/ini/stat/s.gif" alt="*" /></a> <a href="http://'.$_SERVER['HTTP_HOST'].'/m/complaint/'.$row['id'].'"> x </a> <br />';
if(mb_strlen($row['about']) > 58)
{
$text = mb_substr($row['about'],0,58);
echo ''.$text.'...</div>';
}
else
{
echo ''.$row['about'].'</div>';
}
echo '</div>';
}
if($count > $pageSait)
{
navigation($total,$page,'http://'.$_SERVER['HTTP_HOST'].'/m/category/view/'.$id.'/');
}
break;
}
?>