category.php
来自「一个简单的网站管理系统,他能实现你所需要的功能,是个值得一看的系统」· PHP 代码 · 共 65 行
PHP
65 行
<?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 + =
减小字号Ctrl + -
显示快捷键?