Файл: newstats.ru/newstats.ru/system/view/site/pda.php
Строк: 71
<?php
echo '<div class="vx">';
if(!isset($user['id'])){
    echo '<a href="/enter/login">Вход</a> | <a href="/enter/registration">Регистрация</a>';
}else{
    echo '<a href="/cabinet">Кабинет</a> '.($user['admin'] == 2 ? '| <a href="/admin">Админка</a>' : NULL).' | <a href="/enter/logout">Выход</a>';
}echo '</div>';
echo '<div class="rek">';
$rekl_k= Core::count("SELECT COUNT(*) FROM `rekl` where `date_last`>'".time()."'");
if($rekl_k){
    $reklam = Core::query("SELECT * FROM `rekl` where `date_last`>'".time()."' ORDER BY RAND() DESC LIMIT 6");
 while ($rekl = $reklam -> fetch())
        {    
        if($rekl['color']==null){$name=$rekl['name'];}else{$name='<font color="'.$rekl['color'].'">'.$rekl['name'].'</font>';}
       if($rekl['bold']==1){$nam='<b>'.$name.'</b>';}else{$nam=$name;}
       echo '<a href='.$rekl['url'].'>- '.$nam.'</a><br/>';
               }
}  
            echo '<a href=/billing/rekl>- Купить рекламу за '.Core::$config['rekl'].' wmr в сутки</a><br/>';
echo '</div>';
$news_k= Core::count("SELECT COUNT(*) FROM `news`");
if($news_k){
    $qq = Core::query("SELECT * FROM `news` ORDER BY `time` DESC LIMIT 1");
 while ($news = $qq -> fetch())
        {    
       echo '<div class="news"><center><b>'.$news['name'].'</b></center>'.Protect::text(Protect::rez_text($news['text'], 100)).'</div>';
               echo '<div class="news2"><a href=/news/ad/'.$news['id'].'>Подробнее...</a></div>';
 }
}
echo '<div class="rr">';
echo 'Рейтинг | <a href="/category">Категории</a>';
echo '</div>';
$all = Core::count("SELECT COUNT(*) FROM `user_sites` WHERE `ban` = '0' && `mod` = '0' && `host` > '0' && `category`!='27' ");
if($all > 0){
    $Navig = new Navig($all);
    $start = $Navig -> start;
    $pages = 10;
if(isset($_GET['p']) && $_GET['p']!=0){    
$num = $_GET['p']*$pages-($pages-1);
}else{
$num = 1 ;
}
    
    $q = Core::query("SELECT * FROM `user_sites` WHERE `ban` = '0' && `mod` = '0' && `host` > '0' && `category`!='27'  ORDER BY `host` DESC LIMIT $start, $pages");
    $top_c= Core::count("SELECT COUNT(*) FROM `user_sites` WHERE `ban` = '0' && `mod` = '0' && `host` > '0' && `category`!='27' ");
    echo '<div class="top">Топ <b>'.$top_c.'</b> сайтов:</div>';
    while($post = $q -> fetch()){
        $cat = Core::query("SELECT `name` FROM `category` WHERE `id` = ?", array($post['category'])) -> fetch();
        echo '<div class="navig">';
        echo '<span style="padding:5px; margin:2px;"><b>'.$num.'</b></span>';
        
        if(isset($_GET['id_s'])){
                if($_GET['id_s']==$post['id']){
        echo '<a target="_blank" href=http://newstats.ru/out?get='.$post['id'].'><font color="red">'.Protect::title($post['title']).'</font></a> ['.$post['host'].'|'.$post['hit'].']  <a href="/stat/index/'.$post['id'].'"><div style="float:right;"><img src="/style/images/pda/info.gif"></a></div><br/>        
        '.substr($post['opis'],0,120).'...
        </div>';
}else{
        echo '<a target="_blank" href=http://newstats.ru/out?get='.$post['id'].'>'.Protect::title($post['title']).'</a> ['.$post['host'].'|'.$post['hit'].']  <a href="/stat/index/'.$post['id'].'"><div style="float:right;"><img src="/style/images/pda/info.gif"></a></div><br/>        
        '.substr($post['opis'],0,120).'...
        </div>';
}}else{
                echo '<a target="_blank" href=http://newstats.ru/out?get='.$post['id'].'>'.Protect::title($post['title']).'</a> ['.$post['host'].'|'.$post['hit'].']  <a href="/stat/index/'.$post['id'].'"><div style="float:right;"><img src="/style/images/pda/info.gif"></a></div><br/>        
        '.substr($post['opis'],0,120).'...
        </div>';
}
                $num = ++$num;
    }
     $Navig -> str('?');
}else{
    echo '<div class="navig">Активных сайтов не найдено</div>';
}
?>