<?
/*
	[SueamCMS] (C)2009-2010 ZMRNet Studio
	bbs_del.php by 2009-10-16 zmrnet
*/
require_once(dirname(__FILE__).'/include/manage.php');

$bbs_id = (int) trim($_GET['id']);
$bbs_type = trim($_GET['type']);

if($bbs_id){
	$_LST = $vdb->opendir($bbs_type.'/list');
	$key = array_find($_LST, 'id', $bbs_id);
	array_splice($_LST, $key, 1);
	$vdb->writedir($bbs_type.'/list', $_LST);
	unset($_LST);
	
	$vdb->open('index');
	$vdb->write();
	unset($vdb);

	die(refresh('bbs_list.php?type='.$bbs_type).'<script>alert(\'留言删除成功！\')</script>');
}else{
	die('ID Error!');
}
?>