<?php
	if($admin !=1 &&$admin !=2 &&$admin !=4 && !is_bbsadmin(MYID)){
		ehtml("权限不足！");
		exit();
	}
	$filename = root_path.'/lib/bbs/'.WAPID.'_'.$_GET['cid'].'.txt';
	if(!is_dir(root_path.'/lib/bbs')){
		mkdir(root_path.'/lib/bbs');
	}
	if(!is_file($filename)){
		file_put_contents($filename,'12');
	}
	if($_GET['type'] == 'mod'){
		if(file_put_contents($filename,$_POST['nums'])){
			echo '<div class="tip">修改成功</div>';
		}else{
			echo '<div class="tip">修改失败</div>';
		}
		echo '<div class="mylink"><a href="?act=listcfg&cid='.$_GET['cid'].'">返回修改</a>|<a href="admin.php?cid='.$_GET['cid'].'">版务管理</a></div>';
	}else{
	$this_list = file_get_contents($filename);
	echo '<form method="POST" action="?act=listcfg&cid='.$_GET['cid'].'&type=mod">';
	echo '<input value="'.$this_list.'" type="text" name="nums">';
	echo '<input value="保存修改" type="submit">';
	echo '</form>';
	echo '<div class="mylink"><a href="admin.php?cid='.$_GET['cid'].'">版务管理</a></div>';
	}