Файл: in4at/a_com.php
Строк: 34
<?php
##################################################################################################
## Script name : In4at ##
## Version : Final ##
## Made by : XPYCT(Сергей Мищенко) ##
## E-mail : bce-ok@bk.ru ##
## ICQ : 447-50-50-62 ##
## Site : http://vkontakte.ru/id31604521 ##
## Внимание! Скрипт распространяется бесплатно! Модификация W4at by XPYCT ##
##################################################################################################
define('REQ_2_chat', true);
require('4at_set.php');
require('db_con.php');
require('style.php');
if ($py !== spy_code) require('us_info.php');
$cm = mysql_query("select count(id) as num from comm where title=$mid;");
$cmc = mysql_fetch_array($cm);
$news = $cmc['num'];
echo head;
if ($vv!=0) echo '<div class="d0"><b>Комментарии</b></div>';
else echo '<card id="news" title="Комментарии"><p>';
if(empty($action)) {
echo $fsize1;
if(empty($page)) $page=0;
$query = mysql_query("select * from `comm` where title=$mid");
$num_of_rows=mysql_num_rows($query);
$total_mat_number=$num_of_rows;
$mat_per_page=5;
$total_pages=ceil($total_mat_number/$mat_per_page);
$print = mysql_query("select * from `comm` where title=$mid order by id desc limit ".$page.",".($mat_per_page).";");
if (mysql_affected_rows() == 0) {
echo 'Пусто...<br/>';
}
while($arr = mysql_fetch_array($print)) {
echo '<u>'.$arr['date']." в ".$arr['time']."</u><br/>".$arr['content'].'<br/>';
$us = mysql_query("select user from users where id='".$arr['usid']."';");
$usr = mysql_fetch_array($us);
$nick = $usr['user'];
echo "[<a href="search.php?go=view&$wp&nk=".$arr['usid']."">$nick</a>]n";
if ($row["level"]>=6){
echo " [<a href="a_com.php?action=del&id=$id&ps=$ps&mid1=".$arr['id']."&uid=".$uid."&mid=".$mid."">X</a>]<br/>"; }else{echo '<br/>';}
echo divide;}
for ($v=0;$v<$total_pages;$v++){
$page_number=$v*$mat_per_page;
if ($page_number!=$page) {
echo "<a href="a_com.php?$wp&page=$page_number&mid1=".$arr['id']."&uid=".$uid."&mid=".$mid."">[".($v+1)."]</a> ";
} else {
echo '['.($v+1).'] ';
}
}
echo '<br/>'.divide;
echo '<a href="album.php?'.$wp.'&uid='.$uid.'&mod=comm&mid='.$mid.'">Добавить</a><br/>';
echo divide;
echo '<a href="album.php?'.$wp.'&uid='.$uid.'&mod=view">Назад</a><br/>';
echo '<a href="enter.php?'.$wp.'">Пpuxoжaя</a><br/>';
echo $fsize2;
} else {
if ($row["level"]>=6){
if(mysql_query("delete from comm where id='".$mid1."' limit 1;")){
echo $fsize1;
echo "<b>Комментарий успешно удален!</b><br/>";
echo "<a href="a_com.php?id=$id&ps=$ps&mid=$mid&uid=$uid">назад</a>";
echo $fsize2;
}}
echo $fsize1;
if (($row["level"]<6)) echo "Сработала система защиты<br/>";
echo $fsize2;}
echo foot;
mysql_close($link);
?>