Файл: modules/forum/new_posts.php
Строк: 43
<?php
/**
* Licensed under The MIT License
* For full copyright and license information, please see the LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright (c) 2013, Taras Chornyi, Sergiy Mazurenko, Ivan Kotliar
* @link http://perf-engine.net
* @package PerfEngine
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
$locate = 'in_forum';
$title = _t('new_messages').' | '._t('forum');
include_header($title);
$tpl->div('title', _t('new_messages').' | '._t('forum'));
$topic_r = $db->query("SELECT * FROM `forum_pt` WHERE `time` > '". (time()-60*60*24) ."'")->rowCount();
$pages = new Paginator($topic_r, $ames);
if($topic_r == 0) {
echo $tpl->div('menu', _t('no_posts'));
}
else {
$topic_q = $db->query("SELECT * FROM `forum_pt` WHERE `time` > '". (time()-60*60*24) ."' ORDER BY time DESC LIMIT $start, $ames");
while($topic = $topic_q->fetch()) {
echo '<div class="menu">';
$topic_u = $db->query("SELECT * FROM `forum_t` WHERE `id` = '". $topic['topic_id']."' LIMIT 1")->fetch();
$topic_i = $db->query("SELECT * FROM `forum_pt` WHERE `id` = '". $topic['id']."' ORDER BY time ASC LIMIT 1")->fetch();
$topic_a = $db->query("SELECT * FROM `forum_pt` WHERE `topic_id` = '". $topic_u['id']."' ORDER BY time DESC LIMIT 1")->fetch();
echo ' '. output($topic['text']).'<br/> [<small class="gray">'. tnick($topic_i['user_id']).' / '. rtime($topic_i['time']).' / <a href="/forum/topic/'. $topic['topic_id'] .'/?page=end">'. $topic_u['name'] .'</a> (<span class="green">+'. $db->query("SELECT id FROM `forum_pt` WHERE `topic_id` = '". $topic_u['id'] ."' AND `time` > '". (time()-60*60*24) ."'")->rowCount().'</span>)</small>]
</div>';
}
$pages->view();
}
$tpl->div('block', NAV . ' <a href="/forum/">'. _t('forum') .'</a><br/>' . HICO .' <a href="/">'. _t('home') .'</a>');
include_footer();
?>