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

$art_id = (int) trim($_GET['id']);
$art_type = trim($_GET['type']);

if($art_id){
	@unlink('../'.$art_type.'/view/'.$art_id.'.html');

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

	die(refresh('art_list.php?type='.$art_type).'<script>alert(\'文章删除成功！\')</script>');
}else{
	die('ID Error!');
}
?>