Просмотр файла forum/new.posts.php

Размер файла: 1.63Kb
<?
define('SHCMS', true);
include_once'../system/inc/system_core.php';
$shcmsengine['title'] = Lang::get('Новые сообщения в темах');
include_once'../template/head.php';


        $new_them = mysql_query("SELECT * FROM `forum_them` WHERE `time_last` > '".(time()-86400)."'ORDER BY `time_last` DESC");
		if(mysql_num_rows($new_them) > 0) {
        while($new_themes = mysql_fetch_array($new_them)){
            $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_all = mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_mess` WHERE `id_them` = '$new_themes[id]'"),0);
            $count = mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_mess` WHERE `id_them` = '$new_themes[id]' AND `time` > '".(time()-86400)."'"),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_all.' /<font color="red">+ '.$count.'</font></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>';
		}
		}else {
		echo '<div class="posts">'.Lang::get('Новых сообщений в темах нет!').'</div>';
		}
        
include_once'../template/foot.php';
?>