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

$cre_lst = array();
$cre_act = trim($_GET['act']);

$art = $_VDB['art'];
$bbs = $_VDB['bbs'];

if($cre_act!=''){
	switch($cre_act){
		case 'all':
			$vdb->open('index');
			array_push($cre_lst, $vdb->write());
			foreach($art as $k => $v){
				$cre_lst = array_merge($cre_lst, $vdb->writedir($k.'/list'));
				$cre_lst = array_merge($cre_lst, $vdb->writedir($k.'/view'));
			}
			foreach($bbs as $k => $v){
				$cre_lst = array_merge($cre_lst, $vdb->writedir($k.'/list'));
				$cre_lst = array_merge($cre_lst, $vdb->writedir($k.'/view'));
				$cre_lst = array_merge($cre_lst, $vdb->writedir($k));
			}
			$cre_lst = array_merge($cre_lst, $vdb->writedir('about'));
			break;
		case 'abt':
			$cre_lst = array_merge($cre_lst, $vdb->writedir('about'));
			break;
		case 'art':
			foreach($art as $k => $v){
				$cre_lst = array_merge($cre_lst, $vdb->writedir($k));
				$cre_lst = array_merge($cre_lst, $vdb->writedir($k.'/list'));
				$cre_lst = array_merge($cre_lst, $vdb->writedir($k.'/view'));
			}
			break;
		case 'bbs':
			foreach($bbs as $k => $v){
				$cre_lst = array_merge($cre_lst, $vdb->writedir($k));
				$cre_lst = array_merge($cre_lst, $vdb->writedir($k.'/list'));
				$cre_lst = array_merge($cre_lst, $vdb->writedir($k.'/view'));
			}
			break;
		case 'index':
			$vdb->open('index');
			array_push($cre_lst, $vdb->write());
			break;
		default :
			$cre_lst = array_merge($cre_lst, $vdb->writedir($cre_act));
			$cre_lst = array_merge($cre_lst, $vdb->writedir($cre_act.'/list'));
			$cre_lst = array_merge($cre_lst, $vdb->writedir($cre_act.'/view'));
	}
}
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>网站更新</b></div>
	<div class="sec_menu" style="padding:10px;">
	<div style="float:left;width:200px;border:0px;color:blue">
		<div style="text-align:left;"><a href="?act=all">[更新全部]</a></div>
		<div style="text-align:left;"><a href="?act=index">[更新首页]</a></div>
		<div style="text-align:left;"><a href="?act=art">[更新文章]</a></div>
<? foreach($art as $k => $v){ ?>
		<div style="padding-left:20px;text-align:left;">
			├ <a href="?act=<? echo $k; ?>">[更新<? echo $v; ?>]</a>
		</div>
<? } ?>
		<div style="text-align:left;"><a href="?act=bbs">[更新留言]</a></div>
<? foreach($bbs as $k => $v){ ?>
		<div style="padding-left:20px;text-align:left;">
			├ <a href="?act=<? echo $k; ?>">[更新<? echo $v; ?>]</a>
		</div>
<? } ?>
		<div style="text-align:left;"><a href="?act=abt">[更新其他]</a></div>
	</div>
	<div style="float:right;padding:10px;width:300px;border:gray 1px dashed;text-align:left;">
		<pre>
<?
foreach($cre_lst as $k => $v){
	echo('['.$k.'] => '.$v.'.html'."\n");
}
?>
		</pre>
	</div>
	</div>
</div>
</body>
</html>