www.gusucode.com > 08CMS空白站群系统 3.3 繁体 UTF-8 > upload/list.php

    <?
include_once './include/general.inc.php';
include_once './include/common.fun.php';
$querystr = $_SERVER['QUERY_STRING'];
un_virtual($querystr);
parse_str($querystr,$temparr);

//处理子站id
$nsid = empty($temparr['sid']) ? 0 : max(0,intval($temparr['sid']));
if($nsid && empty($subsites[$nsid])) $nsid = 0;
switch_cache($nsid);
$sid = $nsid;
if_siteclosed($sid);

$page = $temparr['nowpage'] = empty($temparr['page']) ? 1 :  max(1, intval($temparr['page']));
$isbk = empty($temparr['bk']) ? 0 : 1;
unset($temparr['sid'],$temparr['page'],$temparr['bk'],$nsid);
$cnstr = cnstr($temparr);

if($cnstr && ($cnode = cnodearr($cnstr,$sid))){
	$pmids = cn_pmids($cnstr,$sid);
	!$curuser->pmbypmids('cread',$pmids) && message(lang('none catas browse permission'));
}else message(lang('confirmchoose catas cnode'));

if($cache1circle && (!$listcachenum || $page <= $listcachenum)){
	$cachefile = htmlcac_dir('cn','',1).cac_namepre($isbk ? 'bk' : 'list',$cnstr).'_'.$page.'.php';
	if(is_file($cachefile) && (filemtime($cachefile) > ($timestamp - $cache1circle * 60))){
		mexit(read_htmlcac($cachefile));
	}
}
$item = cn_parsearr($cnstr,$sid);
re_cnode($item,$cnstr,$cnode);
if(!($tplname = $isbk ? $cnode['bktpl'] : $cnode['listtpl']) || !($template = @load_tpl($tplname))) message(lang('please define related template'));

if(preg_match("/\{p\\$(.+?)\s+(.*?)\{\/p\\$\\1\}/is",$template,$matches)){
	$midarr = $temparr;
	$mpinfo = mpinfo($matches[1],stripslashes($matches[2]),$midarr);
	$midarr = array_merge($midarr,$mpinfo);
	$midarr['durlpre'] = $cms_abs.'list.php?'.($sid ? "sid=$sid&" : '').($isbk ? 'bk=1&' : '').$cnstr.'&page=';
	$midarr['static'] = 0;
	$item['mpnav'] = mpnav($midarr,$virtualurl,$liststaticnum);
	nreplace($template,'p',$midarr);
	unset($matches,$midarr);
}

nreplace($template,'c',$temparr);
nreplace($template,'u',$item);
nreplace($template,'b',$item);
code_parse($template);
$template .= "<script language=\"javascript\" src=\"".$cms_abs."static.php?mode=".($isbk ? 'cnbk' : 'cnlist')."&fromd=1".($sid ? "&sid=$sid" : '').($cnstr ? "&$cnstr" : '')."\"></script>";
($cache1circle && (!$listcachenum || $page <= $listcachenum)) && save_htmlcac($template,$cachefile);
mexit($template);
?>