<?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 `wall` WHERE `id` = '".$del_post."' LIMIT 1"),0) == true)
	{
		$arr = mysql_fetch_array(mysql_query("SELECT * FROM `wall` WHERE `id` = '".$del_post."' LIMIT 1"));
		if ($user_id == $arr['user_id'] || $user_id == $arr['wall_id'])
		{
			if (mysql_query("DELETE FROM `wall` WHERE `id` = '".$del_post."'") == true)
			{
				mysql_query("DELETE FROM `wall_comm` WHERE `pid` = '".$del_post."'");
				mysql_query("UPDATE `users` SET `count_wall` = '".($user['count_wall']-1)."' WHERE `id` = '".$id."'");
			}
		}
	}
}

?>