<?php

if (!empty($_GET['del_post']) && is_numeric($_GET['del_post']))
{
	$del_post = abs(intval($_GET['del_post']));
	if (mysql_result(mysql_query("SELECT COUNT(`id`) FROM `groups_wall` WHERE `id` = '".$del_post."' LIMIT 1"),0) == true)
	{
		$arr = mysql_fetch_array(mysql_query("SELECT * FROM `groups_wall` WHERE `id` = '".$del_post."' LIMIT 1"));
		if ($user_id == $arr['user_id'] || in_array($user_id, explode("||", substr($arr_group['admins'], 1, -1))) || $arr['from_group'] == 0 && in_array($user_id, explode("||", substr($arr_group['moders'], 1, -1))))
		{
			if (mysql_query("DELETE FROM `groups_wall` WHERE `id` = '".$del_post."'") == true)
			{
				mysql_query("DELETE FROM `groups_wall_comm` WHERE `pid` = '".$del_post."'");
				mysql_query("UPDATE `groups` SET `count_wall` = '".($arr_group['count_wall']-1)."' WHERE `id` = '".$id."'");
			}
		}
	}
}

?>