Файл: Dvig/news/comm.php
Строк: 26
<?php
####################
## Автор - USER-X ##
## Copyright 2013 ##
## xcms.mcdir.ru ##
####################
define('xcms_pro', 1);
$path = '../';
include_once ($path . 'core/core.php');
#########
$title = 'Все комментарии';
include_once ($path . 'core/head.php');
#########
$total = mysql_result(mysql_query("SELECT COUNT(`id`) FROM `news_comm` WHERE `news` = '$id'"), 0); //Подсчет общего числа записей
$k_page=k_page($total,$set['p_str']);
$page=page($k_page);
$start=$set['p_str']*$page-$set['p_str'];
if ($total) {
$mys = mysql_query("SELECT * FROM `news_comm` WHERE `news` = '$id' order by `time` ASC LIMIT $start, $set[p_str]");
while ($res = mysql_fetch_array($mys)) {
$usero = mysql_fetch_array(mysql_query('SELECT * FROM `users` WHERE `id`='.$res['author'].''));
echo'<div id="body">
<table><tr>
<td><img src="'.$host.'/avatar/small/'.$res['author'].'.png" /></td>
<td></td>
<td><strong><a href="/'.$res['author'].'">'.$usero['login'].'</a>';
$on = time() - $usero['time'] ;
if ( $on <= 300 )
{echo' <img src="' . $host . '/img/online.png" /> ' ;}
if($users['level'] == 5){echo'<a href="/dell.php?act=news_comm&id='.$res['id'].'">[x]</a>';}
echo'</strong><br /><small><small>['.clock($res['time']).']</small></small></td></tr>
</table>' .bb(smiles( $res['text'])) .'</div>';}
echo'<a id="nav" href="/news/'.$id.'">Назад</a>';
if ($k_page>1)str('/news/comm'.$id.'/',$k_page,$page); // Вывод страниц
} else {echo '<div id="razd">Ошибка</div>';}
#########
echo "n";
include_once ($path . 'core/foot.php');
?>