View file forum/new.posts.php

File size: 1.35Kb
<?
define('SHCMS', true);
include_once'../system/inc/basic_settings.php';
$shcmsengine['title'] = 'Новые сообщения';
include_once'../template/head.php';

  $allfield = mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_mess` WHERE `time` > ".(time()-86400).""),0);
  $newlist = new Navigation($allfield, // кол-во полей для вывода
                            10,         // выводить 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">Новых сообщений нет</div>';
}
else
{
do
{
echo '<div class="posts">';
echo '<img src="/template/icon/forum/them.png"/> <a href="mess.php?id='.$new_themes['id'].'">'.$new_themes['name'].'</a> ';
$count_mess = mysql_result(mysql_query("SELECT COUNT(*) FROM forum_mess WHERE id_them = '$new_themes[id]'"),0);
echo  "<b>+ ".$count_mess.'</b>';
echo '</div>';
}
while($new_themes = mysql_fetch_array($new_them));
echo '<div class="link_reg">';
echo $newlist->pagination();
echo '</div>';
}



include_once'../template/foot.php';
?>