Вход Регистрация
Файл: jbtop.ru/m/cat.php
Строк: 51
<?php
define
('NTOP'1);
$title 'Категории';
require_once (
'../system/connect.php');
require_once (
'../system/core.php');
require_once (
'../system/function.php');
require_once (
'head.php');
switch(
$act)
    {
        default:
        echo 
'<div class="title2"> <strong>Категории</strong><br/></div>';
        
$cats mysql_query("SELECT * FROM `".$prefix."cat` ORDER BY `position`");
        echo 
'<div class = "main">';
        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'"));
                
                echo 
'<img src="/img/index/icon.png" alt="*" /> <a href = "http://'.$set['home'].'/m/category/view/'.$cat['id'].'">'.$cat['name'].'</a> ['.$count_sites.']</br>';
                
                    
            
            
            }
            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 class="title2"><strong>'.$catt['name'].'</strong></div>';
                
$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."");
                        while(
$row mysql_fetch_array($saits)) 
                            {
                                
$start++;
                                
                                echo 
'<div class="topni"><span class="o">'.$start.'</span> <img src="http://www.google.com/s2/favicons?domain='.$row['url'].'"/> <a href="http://'.$set['home'].'/out/'.$row['id'].'">'.$row['name'].'</a> ['.$row['hosts'].'/'.$row['hits'].'] <a href="http://'.$set['home'].'/stats/'.$row['id'].'"><img src="/img/index/s.gif" alt="?"></a></br>';
                                if(
mb_strlen($row['about']) > 100)
                                    {
                                        
$text substr($row['about'],0,100);
                                        echo 
''.$text.'...<br/>'
                                    }
                                else
                                    {
                                        echo 
''.$row['about'].'<br/>'
                                    }
                                    echo 
'</div>';
                                    echo 
'<div class="topni">';
                                echo 
'[В Топ: <b>'.$row['in'].'</b> | Из Топа: <b>'.$row['out'].'</b>]<br/>';
                                echo 
'</div>';
                            }
                        
navigation($count,$page_sait,$page,'http://'.$set['home'].'/m/category/view/'.$id.'/',$total);
                    }
                else
                    {
                        echo 
'<div class="topni">';
                        echo 
'Сайтов в данной категории нет!</div>';
                        echo 
'<div class="topni">';
                        echo 
'<a href="http://'.$set['home'].'/m/category">К списку категорий</a><br/>';
                        echo 
'</div>';
                    }
            }
        else
            {
                echo 
'<div class="error">';
                echo 
'Ошибка!Данной категории не существует!<br/>';
                echo 
'<a href="http://'.$set['home'].'/m/category">К списку категорий</a><br/>';
                echo 
'</div>';
            }
        break;
    }

require_once (
'foot.php');
?>
Онлайн: 1
Реклама