Файл: modules/forum/post.php
Строк: 41
<?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';
if(!isset($_GET['id'])) redirect('/forum');
$id = num($_GET['id']);
if($db->query("SELECT * FROM `forum_pt` WHERE `id` = '$id'")->rowCount() == 0) NotFound();
$post = $db->query("SELECT * FROM `forum_pt` WHERE `id` = '$id'")->fetch();
include_header($db->query("SELECT name FROM `forum_t` WHERE `id` = '{$post['topic_id']}'")->fetchColumn().' - '. _t('forum'));
Template::div('title', $db->query("SELECT name FROM `forum_t` WHERE `id` = '{$post['topic_id']}'")->fetchColumn().' - '. _t('forum'));
echo '<div class="post">'. nick($post['user_id'], '<small class="gray">'. rtime($post['time']) .'</small>') .'
'. output($post['text']) .'
</div>';
echo '<div class="menu">'. (User::level() == 3 || User::level() >= 5 || (User::Id() == $post['user_id'] && $post['time'] > (time()-300)) ?
NAV. ' <a href="/forum/delete_post/'.$post['id'].'?topic_id='.$post['topic_id'].'">'. _t('delete') .'</a><br/>'.
NAV. ' <a href="/forum/edit_post/'.$post['id'].'?topic_id='.$post['topic_id'].'">'. _t('edit').'</a>' : NULL).'</div>';
echo '<div class="block">
'. img('back.png').' <a href="/forum/topic/'.$post['topic_id'].'?page=end">'. _t('back').'</a><br/>
'. img('forum.png').' <a href="/forum/">'. _t('forum').'</a><br/>
'. img('home.png').' <a href="/">'. _t('forum').'</a></div>';
include_footer();