<?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 `groups_wall_comm` WHERE `id` = '".$del_comm."' LIMIT 1"),0) == true)
	{
		$arr_del_comm = mysql_fetch_array(mysql_query("SELECT * FROM `groups_wall_comm` WHERE `id` = '".$del_comm."' LIMIT 1"));
		
		if ($user_id == $arr_del_comm['user_id'] || $user_id == $arr_post['user_id'] || in_array($user_id, explode("||", substr($arr_group['admins'], 1, -1))) || in_array($user_id, explode("||", substr($arr_group['moders'], 1, -1))))
		{
			mysql_query("DELETE FROM `groups_wall_comm` WHERE `id` = '".$del_comm."'");
			mysql_query("UPDATE `groups_wall` SET comm=comm-1 WHERE `id` = '".$arr_post['id']."'");
			$arr_post['comm'] = $arr_post['comm']-1;
		}
	}
}

?>