Файл: ajax/guestKomm.php
Строк: 90
<?php
if(!(isset($_SERVER['HTTP_X_REQUESTED_WITH']) && !empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest')) die;
include_once $_SERVER['DOCUMENT_ROOT'] . '/sys/inc/home.php';
include_once H.'sys/inc/start.php';
include_once H.'sys/inc/compress.php';
include_once H.'sys/inc/sess.php';
include_once H.'sys/inc/settings.php';
include_once H.'sys/inc/db_connect.php';
include_once H.'sys/inc/ipua.php';
include_once H.'sys/inc/fnc.php';
include_once H.'sys/inc/user.php';
if (isset($user))$ank['id']=$user['id'];
if (isset($_GET['id']))$ank['id']=intval($_GET['id']);
$ank = get_user($ank['id']);
$user = get_user($_SESSION['id_user']);$respons = TRUE;
?>
<script>// Функция отмены ответа
function delReply(id)
{
var reply = $("#reply").val(0);
document.getElementById('dcms-modal-status').innerHTML = '';
}
// Функция ответа
function getReply(nick, id_user)
{
var reply = $("#reply").val(id_user);
var reply = $("#msg").val(nick + ', ');
document.getElementById('dcms-modal-status').innerHTML = ' <a href="/id' + id_user + '">' + nick + '</a> <a href="#" onclick="delReply(0)" ><img src="/style/icons/cross_r.gif" alt="*"/></a>';
}
</script><?
if(!isset($_GET['page'])){
$k_post=mysql_result(mysql_query("SELECT COUNT(*) FROM `guest`"),0);
$k_page=k_page($k_post,$set['p_str']);
$page=page($k_page);
}else{
$page=intval($_GET['page']); }
$start=$set['p_str']*$page-$set['p_str'];
$q=mysql_query("SELECT * FROM `guest` ORDER BY id DESC LIMIT $start, $set[p_str]");
while ($post = mysql_fetch_assoc($q))
{
/*-----------зебра-----------*/
if ($num==0)
{echo '<div style="background:#f5f5f5; border-bottom:1px #b3b3b3 solid;" class="nav1">';
$num=1;
}elseif ($num==1)
{echo '<div style="background:#f5f5f5; border-bottom:1px #b3b3b3 solid;" class="nav2">';
$num=0;}
/*---------------------------*/
$ank=mysql_fetch_assoc(mysql_query("SELECT * FROM `user` WHERE `id` = $post[id_user] LIMIT 1"));
echo group($ank['id'])." ";
echo user::nick($ank['id'],1,1,1).' <span style="float:right;"><font color=#666666>'.vremja($post['time']).'</font></span><br/>';
$postBan = mysql_result(mysql_query("SELECT COUNT(*) FROM `ban` WHERE (`razdel` = 'all' OR `razdel` = 'guest') AND `post` = '1' AND `id_user` = '$ank[id]' AND (`time` > '$time' OR `navsegda` = '1')"), 0);
if ($postBan == 0) // Блок сообщения
{
echo ' '.output_text($post['msg']).'<br />';
}else{
echo output_text($banMess).'<br />';
}
if (isset($user))
{
echo "<br/><span style='float:right; position:relative; margin-top:-24px; margin-right:5px;'>";
if($user['id']!=$ank['id']){
if($webbrowser){ ?> <a href="#" onclick="getReply('<?=user::nick($ank['id'], 0)?>', '<?=$ank['id']?>')">Ответить</a> <? }else{echo "<a href='?response=$ank[id]'>Ответ</a> ";}
echo " | <a href="?spam=$post[id]&page=$page">Спам</a> ";
}
if (user_access('guest_delete'))
echo " | <a href='delete.php?id=$post[id]'>Удл</a>";
echo '</span>';
}
echo "</div>";
}
?>