Файл: wall/handler/del_comm.php
Строк: 3
<?php
if (!empty($_GET['del_comm']) && is_numeric($_GET['del_comm']))
{
$del_comm = abs(intval($_GET['del_comm']));
if (mysql_result(mysql_query("SELECT COUNT(`id`) FROM `wall_comm` WHERE `id` = '".$del_comm."' LIMIT 1"),0) == true)
{
$arr_del_comm = mysql_fetch_array(mysql_query("SELECT * FROM `wall_comm` WHERE `id` = '".$del_comm."' LIMIT 1"));
if ($user_id == $arr_del_comm['user_id'] || $user_id == $arr_post['wall_id'] || $user_id == $arr_post['user_id'])
{
mysql_query("DELETE FROM `wall_comm` WHERE `id` = '".$del_comm."'");
mysql_query("UPDATE `wall` SET comm=comm-1 WHERE `id` = '".$arr_post['id']."'");
$arr_post['comm'] = $arr_post['comm']-1;
}
}
}
?>