<?php

if (!empty($_GET['del_photo']))
{
	$del = check($_GET['del_photo']);
	if (in_array($del, explode("||", substr($arr_post['photos'], 1, -1))))
	{
		$new_post_photos = str_replace("|".$del."|", "", $arr_post['photos']);
		mysql_query("UPDATE `wall` SET `photos` = '".$new_post_photos."' WHERE `id` = '".$id."' LIMIT 1");
	}
		if ($ajax == 'yes') exit;
		else go(URL.'/wall/edit_post.php?id='.$id);
}
else if (!empty($_GET['del_audio']))
{
	$del = abs(intval($_GET['del_audio']));
	if (in_array($del, explode("||", substr($arr_post['audio'], 1, -1))))
	{
		$new_post_audio = str_replace("|".$del."|", "", $arr_post['audio']);
		mysql_query("UPDATE `wall` SET `audio` = '".$new_post_audio."' WHERE `id` = '".$id."' LIMIT 1");
	}
		if ($ajax == 'yes') exit;
		else go(URL.'/wall/edit_post.php?id='.$id);
}

if (!empty($_POST['text']))
{
	$text = check($_POST['text']);
	$text = substr($text, 0, 10000);

	mysql_query("UPDATE `wall` SET `text` = '".$text."', `photos` = '".$arr_post['photos']."', `audio` = '".$arr_post['audio']."' WHERE `id` = '".$id."' LIMIT 1");
	if ($ajax == 'yes') exit;
	else go(URL.'/wall/post.php?id='.$id);
}

?>