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

$abt_act = trim($_POST['action']);
if($abt_act=='set'){
	$abt_type = trim($_POST['type']);
	if($abt_type==''){die('About Error!');}
	$abt_title	= trim($_POST['title']);
	$abt_keys	= trim($_POST['keys']);
	$abt_desc	= trim($_POST['desc']);
	$abt_info	= trim($_POST['info']);
	$abt_info	= htmlspecialchars_decode($abt_info);
	
	$abt = $_VDB['abt'];
	if($abt_name = $abt[$abt_type]){
		$vdb->open('about/'.$abt_type);
		$_ABT = array();
		$_ABT['this_name']	= $abt_name;
		$_ABT['this_type']	= $abt_type;
		$_ABT['this_title']	= $abt_title;
		$_ABT['this_keys']	= $abt_keys;
		$_ABT['this_desc']	= $abt_desc;
		$vdb->update($_ABT, $abt_info);
		$vdb->write();
		unset($_ABT);
		unset($abt);
		die(refresh('about.php?type='.$abt_type).'<script>alert(\'内容修改成功！\')</script>');
	}else{
		unset($abt);
		die('About Error!');
	}
}else{
	$abt_type = trim($_GET['type']);
	if($abt_type==''){die('About Error!');}
	$abt = $_VDB['abt'];
	if($abt_name = $abt[$abt_type]){
		$_ABT = $vdb->open('about/'.$abt_type);
		$abt_title	= $_ABT['this_title'];
		$abt_keys	= $_ABT['this_keys'];
		$abt_desc	= $_ABT['this_desc'];
		$abt_info	= htmlspecialchars($vdb->txt);
		unset($_ABT);
	}
	unset($abt);
}

unset($_VDB);
unset($vdb);
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title><? echo $sys_title; ?></title>
<link href="images/sueam.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div style="margin:20px;">
	<div style="margin:10px;font-size:14px;color:green"><b><? echo $abt_name; ?></b></div>
	<div class="sec_menu">
	<form action="about.php" method="post" style="margin:auto;padding:25px;width:600px;">
		<div style="font-size:14px;font-weight:bold"><? echo $abt_name; ?></div>
		<br>标　题：<input type="text" name="title" value="<? echo $abt_title; ?>" class="input_txt2"><br>
		<br>关键词：<input type="text" name="keys" value="<? echo $abt_keys; ?>" class="input_txt2"><br>
		<br>描　述：<input type="text" name="desc" value="<? echo $abt_desc; ?>" class="input_txt2"><br>
		<input type="hidden" name="info" value="<? echo $abt_info; ?>"><br>
		<iframe id="editor" src="editor/editor.htm?id=info&style=coolblue" frameborder="0" scrolling="no" width="550" height="350"></iframe><br><br>
		<input type="reset" value="还原">&nbsp;&nbsp;&nbsp;&nbsp;<input type="submit" value="提交">
		<input type="hidden" name="type" value="<? echo $abt_type; ?>">
		<input type="hidden" name="action" value="set">
	</form>
	</div>
</body>
</html>