📄 category.php
字号:
<?php
/*
*####################################################
* PHPCMS v3.0.0 - Advanced Content Manage System.
* Copyright (c) 2005-2006 phpcms.cn
*
* For further information go to http://www.phpcms.cn/
* This copyright notice MUST stay intact for use.
*####################################################
*/
if($_CHA[htmlcreatetype]==0 || $_CHA[htmlcreatetype]==2 || !$_CAT[$catid]['cattype']) return FALSE;
$catid = intval($catid);
if(!$catid) return FALSE;
@extract($_CAT[$catid]);
$position = cat_posurl($catid);
$skindir = $skinid ? PHPCMS_PATH."skin/".$skinid : $skindir;
$meta_title = $catname."-".$_CHA['channelname'];
$meta_keywords = $meta_keywords.",".$_CHA['meta_keywords'];
$meta_description = $meta_description."-".$_CHA['meta_description'];
if($child==1)
{
$p->set_type("url");
$arrchildid = get_childcat($channelid,$catid);
ob_start();
include template($templateid,$mod,'category');
$data = ob_get_contents();
ob_clean();
$p->set_catid($catid);
$p->set_type("path");
$filename = $p->get_listurl(0);
$f->create(dirname($filename));
file_write($filename,$data);
if(!$enableadd) return TRUE;
}
$r = $db->get_one("select count(*) as number from ".TABLE_ARTICLE." where status=3 and recycle=0 and catid=$catid ");
$number = $r['number'];
$pagesize = $maxperpage;
$pagenumber = ceil($number/$pagesize)+1;
for($listpage=0; $listpage<=$pagenumber; $listpage++)
{
if($_CHA[htmlcreatetype]==3 && $listpage>0) break;
if($listpage==0 && $child==1) continue;
$page = $listpage==0 ? 1 : $listpage;
$p->set_type("url");
ob_start();
include template($listtemplateid,$mod,'category_list');
$data = ob_get_contents();
ob_clean();
$p->set_type("path");
$p->set_catid($catid);
$filename = $p->get_listurl($listpage);
if($listpage==0) $f->create(dirname($filename));
file_write($filename,$data);
}
return TRUE;
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -