Вход Регистрация
Файл: modules/forum/post.php
Строк: 54
<?php
/****
* @package LiveCMS
* @link livecms.org
* @author MyZik
* @version See attached file VERSION.txt
* @license See attached file LICENSE.txt
* @copyright Copyright (C) LiveCMS Development Team
****/

$lang_forum load_lng('forum'); // Подключаем файл языка

$title $lang_forum['forum']; // Заголовок страницы
$module 'forum'// Модуль

  /**
    * Проверяем, задан ли параметр
  **/
  
if (!isset($_GET['id']) || empty($_GET['id']) || !is_numeric($_GET['id'])) {
    require_once(
HOME .'/incfiles/header.php');
    echo 
'<div class="error">' $lang['error_parameter'] . '</div>';
    echo 
'<div class="home">' .
    
'<img src="/design/themes/' $set_user['theme'] . '/images/back.png" alt="" /> <a href="index.php">' $lang['back'] . '</a>' .
    
'</div>';
    require_once(
HOME .'/incfiles/footer.php');
      }

  
/**
    * Проверяем наличие сообщения
  **/
  
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `cms_forum_messages` WHERE `id` = '" num($_GET['id']) . "'"), 0) == 0) {
    require_once(
HOME .'/incfiles/header.php');
    echo 
'<div class="error">' $lang_forum['message_not_exists'] . '</div>';
    echo 
'<div class="home">' .
    
'<img src="/design/themes/' $set_user['theme'] . '/images/back.png" alt="" /> <a href="index.php">' $lang['back'] . '</a>' .
    
'</div>';
    require_once(
HOME .'/incfiles/footer.php');
      }

  
$ID num($_GET['id']);
  
$post mysql_fetch_assoc(mysql_query("SELECT * FROM `cms_forum_messages` WHERE `id` = '$ID' LIMIT 1"));
  
$category mysql_fetch_assoc(mysql_query("SELECT * FROM `cms_forum_categories` WHERE `id` = '" $post['category_id'] . "' LIMIT 1"));
  
$section mysql_fetch_assoc(mysql_query("SELECT * FROM `cms_forum_sections` WHERE `id` = '" $post['section_id'] . "' LIMIT 1"));

    
$pagesMess mysql_result(mysql_query("SELECT COUNT(*) FROM `cms_forum_messages` WHERE `topic_id` = '" $post['topic_id'] . "'"), 0);
    
$ceil ceil($pagesMess $countMess);
    
$end_page = ($ceil '&page=' $ceil '');

  require_once(
HOME .'/incfiles/header.php'); // подключаем шапку

  /**
    * Небольшая панель навигации
  **/
  
echo '<div class="title"><a href="/forum/">' $lang['forum'] . '</a> | <a href="category.php?id=' $category['id'] . '">' txt($category['name']) . '</a> | <a href="section.php?id=' $section['id'] . '">' txt($section['name']) . '</a></div>';

  
/**
    * Выводим сообщение
  **/
  
echo '<div class="main"><b>' $lang_forum['message_no'] . ' ' $post['id'] . '</b><br />';
   
$info ' [' display_time($post['time']) . ']';
   
$body output(txt($post['text']));
   echo 
display_user($post['user_id'], $info$body) . '</div>';

  
/**
    * Нижняя панель навигации
  **/
  
echo '<div class="home">' .
  
'<img src="/design/themes/' $set_user['theme'] . '/images/back.png" alt="" /> <a href="topic.php?id=' $post['topic_id'] . $end_page '">' $lang['back'] . '</a>' .
  
'</div>';

   require_once(
HOME .'/incfiles/footer.php'); // подключаем ноги
?>
Онлайн: 0
Реклама