Файл: test.masteram.us/comm/forum/inc/razdel.php
Строк: 32
<?php
$k_post=mysql_result(mysql_query("SELECT COUNT(*) FROM `comm_forum_t` WHERE `id_forum` = '$forum[id]' AND `id_razdel` = '$razdel[id]' AND `id_comm` = '$id_comm'"),0);
$k_page=k_page($k_post,$set['p_str']);
$page=page($k_page);
$start=$set['p_str']*$page-$set['p_str'];
echo '<table class="post">';
$q=mysql_query("SELECT * FROM `comm_forum_t` WHERE `id_forum` = '$forum[id]' AND `id_razdel` = '$razdel[id]' AND `id_comm` = '$id_comm' ORDER BY `up` DESC,`time` DESC LIMIT $start, $set[p_str]");
if(mysql_num_rows($q)==0){
echo '<tr><td class="p_t">Нет тем в разделе '.$razdel['name'].'</td></tr>';
}
while($them = mysql_fetch_array($q)){
echo '<tr>';
if($num==1){
echo " <td class='rer'>n";
$num=0;
}else{
echo " <td class='aut'>n";
$num=1;}
echo "<img src='/style/themes/$set[set_them]/forum/14/them_$them[up]$them[close].png' alt='' />";
echo ' <a href="index.php?id_forum='.$forum['id'].'&id_razdel='.$razdel['id'].'&id_them='.$them['id'].'&id_comm='.$id_comm.'"><b>'.$them['name'].'</b></a> <a href="index.php?id_forum='.$forum['id'].'&id_razdel='.$razdel['id'].'&id_them='.$them['id'].'&id_comm='.$id_comm.'&page=end">('.mysql_result(mysql_query("SELECT COUNT(*) FROM `comm_forum_p` WHERE `id_forum` = '$forum[id]' AND `id_razdel` = '$razdel[id]' AND `id_them` = '$them[id]' AND `id_comm` = '$id_comm'"),0).')</a><br/>';
$post1=mysql_fetch_array(mysql_query("SELECT * FROM `comm_forum_p` WHERE `id_them` = '$them[id]' AND `id_razdel` = '$razdel[id]' AND `id_forum` = '$forum[id]' AND `id_comm` = '$id_comm' ORDER BY `time` ASC LIMIT 1"));
$ank=get_user($post1['id_user']);
echo '<a href="/info.php?id='.$ank['id'].'"><span style="color:'.$ank['ncolor'].'">'.$ank['nick'].'</span></a> / ';
$post=mysql_fetch_array(mysql_query("SELECT * FROM `comm_forum_p` WHERE `id_them` = '$them[id]' AND `id_razdel` = '$razdel[id]' AND `id_forum` = '$forum[id]' AND `id_comm` = '$id_comm' ORDER BY `time` DESC LIMIT 1"));
$ank2=get_user($post['id_user']);
echo '<a href="/info.php?id='.$ank2['id'].'"><span style="color:'.$ank2['ncolor'].'">'.$ank2['nick'].'</span></a> <br/></td></tr>';
}
echo '</table>';
if($k_page>1){
str("index.php?id_forum=$forum[id]&id_razdel=$razdel[id]&id_comm=$id_comm&",$k_page,$page);
}
?>