📄 category.php
字号:
<?php
if(!defined('IN_PHPCMS')) {
exit('Access Denied');
}
$cat = $_CAT[$catid];
$cat[url] = $rootpath.'/data/'.$cat[catdir].'/1'.$fileext;
$cat[target] = $cat[target] ? '_bank' : '_self';
$inc = $inc ? "<?php\n \$readgrade=$cat[readgrade];\n ?>".$inc : "";
$cat[keywords] = $cat[keywords] ? $cat[keywords] : $sitekeywords;
$cat[description] = $cat[description] ? $cat[description] : $sitedescription;
$head[title]=$cat[catname].'|'.$cat[keywords];
$head[keywords]=$cat[keywords];
$head[description]=$cat[description];
$GLOBALS[template]=$template=$cat[cattemplate] ? $cat[cattemplate] : $dtemplate;
$GLOBALS[style]=$style=$cat[catstyle] ? $cat[catstyle] : $dstyle;
$rssstring = "?catid=".$catid;
$query="select count(*) as num from $table_article where passed>0 and recycle=0 and catid='$catid'";
$result=$db->query($query);
$r=$db->fetch_array($result);
$number=$r["num"];
$pagesize=$cat[maxperpage];
$pagenumber=ceil($number/$pagesize);
for($listpage=0;$listpage<$pagenumber+1;$listpage++){
$filename = $listpage ? $phpcms_root."/data/".$cat[catdir]."/".$listpage.$fileext : $phpcms_root."/data/".$cat[catdir]."/index".$fileext;
$page = $listpage ? $listpage : 1;
$url = $rootpath."/data/".$cat[catdir]."/";
ob_start();
include template('category_list');
copyright($version);
$data=$inc.ob_get_contents();
ob_clean();
file_write($filename,$data);
}
if($cat[child]){
$catmenus = menu($catid);
$childcatids = childcatids($catid);
if(is_array($childcatids)){
foreach($childcatids as $scatid){
if($_CAT[$scatid][cattype] && $_CAT[$scatid][islist]){
$childcat = $_CAT[$scatid];
$childcat[url] = $rootpath.'/data/'.$childcat[catdir].'/';
$childcat[target] = $childcat[target] ? '_bank' : '_self';
$childcats[] = $childcat;
}
}
}
ob_start();
include template('category');
copyright($version);
$data=$inc.ob_get_contents();
ob_clean();
$filename=$phpcms_root."/data/".$cat[catdir]."/index".$fileext;
file_write($filename,$data);
}
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -