View file forum/new.themes.php

File size: 1.72Kb
<?
define('SHCMS', true);
include_once'../system/inc/system_core.php';
$shcmsengine['title'] = Lang::get('Новые публикации');
include_once'../template/head.php';

        $allfield = mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_them` WHERE `time` > ".(time()-86400).""),0);
        $newlist = new Navigation($allfield, 10,true);     
        $new_them = mysql_query("SELECT * FROM `forum_them` WHERE `time` >".(time()-86400)." ORDER BY `time` DESC ". $newlist->limit()."");
        $new_themes = mysql_fetch_array($new_them);
    if($new_themes == NULL){
        echo '<div class="posts">'.Lang::get('Новых тем нет').'</div>';
    }
    else{
        do{
            $razd = mysql_fetch_array(mysql_query("SELECT * FROM `forum_razd` WHERE `id` = '$new_themes[id_razd]' "));
            $cat = mysql_fetch_array(mysql_query("SELECT * FROM `forum_cat` WHERE `id` = '$new_themes[id_cat]'"));
            $count = mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_mess` WHERE `id_them` = '$new_themes[id]'"),0);
	        //Вывод новых тем
            echo '<div class="maintitle" style="font-weight:bold;color: #888888;">'.Lang::get('Тема:').' <a href="message.php?id='.$new_themes['id'].'">'.$new_themes['name'].'</a> <span class="mainforum">'.$count.'</span></div>';
            echo "<div class='maintext'><a href='them.php?id=$razd[id]'>$razd[name]</a>&nbsp;-&nbsp;";
            echo "<a href='razd.php?id=$cat[id]'>$cat[name]</a>";
            echo '</div>';}
        while($new_themes = mysql_fetch_array($new_them));
            echo '<div class="pages">';
            echo $newlist->pagination();
            echo '</div>';
    }
include_once'../template/foot.php';
?>