Файл: modules/forum/new_topics.php
Строк: 48
<?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_topics').' | '._t('forum');
include_header($title);
$tpl->div('title', _t('new_topics').' | '._t('forum'));
$topic_r = $db->query("SELECT * FROM `forum_t` WHERE `time_last_post` > '". (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_t` WHERE `time_last_post` > '". (time()-60*60*24) ."' ORDER BY time_last_post DESC LIMIT $start, $ames");
while($topic = $topic_q->fetch()) {
echo '<div class="post">';
if ($topic['closed'] == 1 && $topic['attach'] == 1) echo img('pin-closed.png');
else if ($topic['attach'] == 1) echo img('pin.png');
else if ($topic['closed'] == 1) echo img('topic_closed.png');
else echo img('topic.png');
if ($db->query("SELECT * FROM `forum_vote` WHERE `topic_id` = '". $topic['id'] ."' AND `type` = '1'")->rowCount() > 0 ) echo img('rating.png');
$topic_a = $db->query("SELECT * FROM `forum_pt` WHERE `topic_id` = '". $topic['id']."' ORDER BY time DESC LIMIT 1")->fetch();
echo '<a href="/forum/topic/'. $topic['id'] .'/">'. $topic['name'] .'</a> ('. $db->query("SELECT id FROM `forum_pt` WHERE `topic_id` = '". $topic['id'] ."'")->rowCount().')<a href="/forum/topic/'. $topic['id'] .'/?page=end">»</a> <br/> [<small class="gray">'. tnick($topic_a['user_id']).' / '. rtime($topic_a['time']).'</small>]
</div>';
}
$pages->view();
}
$tpl->div('block', NAV . ' <a href="/forum/">'. _t('forum') .'</a><br/>' . HICO .' <a href="/">'. _t('home') .'</a>');
include_footer();
?>