Файл: pesn_voini/peseni_vojni/instalscript/engine/public/forum/notification.php
Строк: 30
<?php
//
require_once($_SERVER['DOCUMENT_ROOT']."/instalscript/engine/_inc/sys.php");
//
head("Уведомления",$uid); # Голова
//
echo logs();
//
$r = rand(100000,999999);
//
//
if($user['forum_check'] != 0){
//
qry("UPDATE `users` SET `forum_check` = ? WHERE `id` = ? LIMIT 1", array(0,$uid));
//
header('location:?r='.$r);
exit();
}
//
//
if(isset($_GET['del'])){
$id = abs(intval($_GET['del']));
$check = fch("SELECT * FROM `forum_post` WHERE `id` = ? AND `id_opp` = ?LIMIT 1", array($id,$uid));
if(!$check){
header('location:?r='.$r);
exit();
}
//
qry("UPDATE `forum_post` SET `id_opp_del` = ? WHERE `id` = ? LIMIT 1", array(1,$check['id']));
//
header('location:?r='.$r);
exit();
}
//
//
$count = $BaseConnect->query("SELECT (id) FROM `forum_post` WHERE `id_opp` = '".$uid."' AND `id_opp_del` = '0'")->rowCount();
//
$str = '10'; # кол-во записей для вывода
$url = "/notification/"; # ссылка
$num = abs(is('1')); # текущая страница
$result = $count; # подсчёт
//
$msg_q = $BaseConnect->query("SELECT * FROM `forum_post` WHERE `id_opp` = '".$uid."' AND `id_opp_del` = '0' ORDER BY `id` DESC LIMIT ".page($num,$str,$result).",$str ");
//
//
if($count == 0)echo '<div class = "message cntr">Уведомлений нет</div>';
//
while($msg = $msg_q->fetch(PDO::FETCH_ASSOC)){
//
$tema = fch("SELECT * FROM `forum_tema` WHERE `id` = ? LIMIT 1", array($msg['id_tema']));
//
if($tema)$t = $tema['name'];
else $t = null;
//
//
echo "
<div class = 'message'>
Тема: <a href='/forum/t".$msg['id_tema']."/page/'>".$t."</a> - <a href='/forum/t".$msg['id_tema']."/page/1/?user=".$msg['id_user']."'>[отв]</a><br>";
//
echo " <b>".user($msg['id_user'],'login')."</b>: ";
//
echo " ".bbcode($msg['text'])."
<span class = 'time'>".clock($msg['time'])." ";
//
echo "- <a class href = '?del=".$msg['id']."'>[х]</a> ";
//
echo "</span>
</div>
";
}
ppage($url,$num,$str,$result);
//
//echo '<div class = "hr"></div><div class = "message"><a href="/forum/">Вернуться на форум</a></div>';
//
foot($uid);
//
?>