Файл: obmen/inc/komm.php
Строк: 59
<?
$k_post=mysql_result(mysql_query("SELECT COUNT(*) FROM `obmennik_komm` WHERE `id_file` = '$file_id[id]'"),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'>n";
if ($k_post==0){
echo '<div class="gmenu">Нет комментариев</div>';
}else{
/*------------сортировка по времени--------------
if (isset($user)){
echo "<div id='comments' class='menus'>";
echo "<div class='webmenu'>";
echo "<a href='?komm&page=$page&sort=1' class='".($user['sort']==1?'activ':'')."'>Внизу</a>";
echo "</div>";
echo "<div class='webmenu'>";
echo "<a href='?komm&page=$page&sort=0' class='".($user['sort']==0?'activ':'')."'>Вверху</a>";
echo "</div>";
echo "</div>";
}
/*---------------alex-borisi---------------------*/
}
$q=mysql_query("SELECT * FROM `obmennik_komm` WHERE `id_file` = '$file_id[id]' ORDER BY `id` $sort LIMIT $start, $set[p_str]");
while ($post = mysql_fetch_assoc($q)){
$ank=mysql_fetch_assoc(mysql_query("SELECT * FROM `user` WHERE `id` = '$post[id_user]' LIMIT 1"));
echo '<table class="mess">';
echo "<td width='3%'>";
if (isset($user) && $user['id'] != $ank['id']){
echo " <a href='?showinfo&page=$page&response=$ank[id]'>";
}
echo "".avatar($ank['id'])."</a>";
echo "</td><td>";
echo " ".group($ank['id'])." ";
echo " ".user::nick($ank['id'])."";
echo "".online($ank['id'])." <span style='float:right;font-size: .7em;'>".vremja($post['time'])."</span></br>";
$postBan = mysql_result(mysql_query("SELECT COUNT(*) FROM `ban` WHERE (`razdel` = 'all' OR `razdel` = 'files') AND `post` = '1' AND `id_user` = '$ank[id]' AND (`time` > '$time' OR `navsegda` = '1')"), 0);
if ($postBan == 0) // Блок сообщения
{
echo output_text($post['msg']);
}else{
echo output_text($banMess).'<br />'; // Текст при блоке поста
}
if (isset($user)){
echo '<div style="text-align:right;margin-top: -15px;">';
if ($ank['id']!=$user['id'])
echo "<a href="?showinfo&page=$page&spam=$post[id]"><img src='/style/icons/blicon.gif' alt='*' title='Это спам'></a> ";
if (user_access('obmen_komm_del') || $avtor['id'] == $user['id'])
echo '<a href="?showinfo&page='.$page.'&del_post='.$post['id'].'"><i class="fas fa-times-circle"></i></a>';
echo " </div>n";
}
echo '</td></table>';
}
echo "</table>n";
if ($k_page>1)str('?showinfo&',$k_page,$page); // Вывод страниц
if (isset($user)){
echo '<div class="main">';
echo "<form method="post" name='message' action="?showinfo&".$go_otv."">n";
if ($set['web'] && is_file(H.'style/themes/'.$set['set_them'].'/altername_post_form.php'))
include_once H.'style/themes/'.$set['set_them'].'/altername_post_form.php';
else
echo "$tPanel<textarea placeholder='Введите сообщение...' name="msg">$respons_msg</textarea><br />n";
echo "<input value="Отправить" type="submit" />n";
echo "</form>n";
echo '</div>';
}
?>