Файл: modules/cat.php
Строк: 97
<?php
define('NTOP', 1);
$title = 'Категории';
require_once ('../system/connect.php');
require_once ('../system/core.php');
require_once ('../system/function.php');
require_once ('../system/head.php');
switch($act){
default:
echo'
<div id="container" class="container main-container" data-spy="affix" data-offset-top="160">
<!-- Breadcrumbs -->
<ol class="breadcrumb">
<li><a href="/">Главная</a></li>
<li class="active">Категории</li>
</ol>
<!-- End of Breadcrumbs -->
<!-- Main Content -->
<section role="main">
<header class="main-page-header">
<h1>Категории</h1>
<div class="social-share">
<script type="text/javascript" src="//yastatic.net/es5-shims/0.0.2/es5-shims.min.js" charset="utf-8"></script>
<script type="text/javascript" src="//yastatic.net/share2/share.js" charset="utf-8"></script>
<div class="ya-share2" data-services="vkontakte,facebook,gplus,twitter" data-counter=""></div>
</div>
</header>
<form class="search-server-form"></form>';
$cats = mysql_query("SELECT * FROM `".$prefix."cat` ORDER BY `position`");
while($cat = mysql_fetch_array($cats)){
$count_sites = mysql_num_rows(mysql_query("SELECT * FROM `".$prefix."sait` WHERE `category` = '".$cat['id']."' AND `status` = '1' AND `hosts` > '0'"));
$count_all = mysql_num_rows(mysql_query("SELECT * FROM `".$prefix."sait` WHERE `category` = '".$cat['id']."'"));
echo'<a class="btn btn-info" title="'.$cat['name'].'" href="http://'.$set['home'].'/modules/category/view/'.$cat['id'].'">'.$cat['name'].' ('.$count_sites.' / '.$count_all.')</a>';
}
echo'</div>';
break;
case "view":
$isset = mysql_query("SELECT * FROM `". $prefix."cat` WHERE `id` = '".$id."'");
if(mysql_num_rows($isset) > 0){
$catt = mysql_fetch_array($isset);
echo'<div id="container" class="container main-container" data-spy="affix" data-offset-top="160">
<section role="main">
<header class="main-page-header">
<h1>'.$catt['name'].'</h1>
<div class="social-share">
<script type="text/javascript" src="//yastatic.net/es5-shims/0.0.2/es5-shims.min.js" charset="utf-8"></script>
<script type="text/javascript" src="//yastatic.net/share2/share.js" charset="utf-8"></script>
<div class="ya-share2" data-services="vkontakte,facebook,gplus,twitter" data-counter=""></div>
</div>
</header>';
$count = mysql_num_rows(mysql_query("SELECT * FROM `".$prefix."sait` WHERE `category` = '".$id."' AND `status` = '1' AND `ban` = '0' AND `hosts` > '0'"));
if($count > 0){
$total=intval(($count-1)/$page_sait)+1;
$page=abs(intval($_GET['page']));
if(empty($page) OR $page < 0){
$page = 1;
}
if($page > $total){
$page = $total;
}
$past=intval($count/$page_sait);
$start=$page*$page_sait-$page_sait;
$saits = mysql_query("SELECT * FROM `".$prefix."sait` WHERE `category` = '".$id."' AND `status` = '1' AND `ban` = '0' AND `hosts` > '0' ORDER BY `hosts` DESC LIMIT ".$start.",".$page_sait."");
echo'<div class="rating">';
while($row = mysql_fetch_array($saits)){
$start++;
echo'
<section class="server-pr-cards">
<div class="row">
<article class="col-xs-12 user-pr-card">
<div class="row">
<div class="col-xs-1">
<div class="user-pr-card__num">'.$start.'</div>
</div>
<div class="col-xs-11">
<div class="user-pr-card__h"><a href="http://'.$set['home'].'/stats/'.$row['id'].'">'.$row['url'].'</a></div>
<div class="row">
<div class="col-md-7 col-sm-6 user-pr-card__banner">
<a href="http://'.$set['home'].'/stats/'.$row['id'].'"><img src="http://mini.s-shot.ru/468x90/468/png/?'.$row['url'].'" alt="" class="img-responsive"></a>
</div>
<div class="col-md-5 col-sm-6 user-pr-card__info">
<div class="user-pr-card__rt"><div class="user-pr-card__rt-inner"><span>СТАТА</span><span class="user-pr-card__rt-qty">'.$row['hosts'].' / '.$row['hits'].'</span></div></div>
<div class="server-rt-card__btn"><a href="http://'.$set['home'].'/stats/'.$row['id'].'" class="btn btn-info btn-vote">ПЕРЕЙТИ</a></div>
</div>
</div>
</div>
</div>
</article>
</div>
</section>';
}
echo'</div></div>';
navigation($count,$page_sait,$page,'http://'.$set['home'].'/modules/category/view/'.$id.'/',$total);
}else{
echo "<div class='project'>";
echo "<h3><center>Сайтов в данной категории нет!</center></h3>";
echo "</div>";
}
}else{
echo "<div class='project'>";
echo "<h3><center>Ошибка!Данной категории не существует!</center></h3>";
echo "</div>";
}
break;
}
require_once ('foot.php');
?>