发布时间:2015-05-27 19:25:28作者:知识屋
1、用途
$CATEGORY 是一个二维数组,主要用来保存当前频道或者模块所以栏目的基本配置信息。
2、如何设置
您可以登录后台进入模块或者频道的栏目管理,然后在线修改任何一个栏目设置即可改变参数值。修改栏目参数设置系统会更新phpcms_category里相应记录的值,同时把各栏目基本信息数组缓存到 ./data/cache/category_频道ID.php ,每次访问有栏目的模块或频道时系统会自动加载其栏目基本配置信息。
3、作用范围
$CATEGORY 数组是系统默认加载的,可以在当前模块或频道的任何php文件和模板中调用。
如何加载另一个模块或者频道的栏目信息呢?
$product_cats = cache_read('categorys_product.php'); //加载product模块栏目信息的方法
$cats_1 = cache_read('categorys_1.php'); //加载频道ID为1的栏目信息的方法
4、数组元素
下面以默认安装的文章频道为例
Array
(
[1] => Array
(
[module] => article
[channelid] => 1
[catid] => 1
[catname] => 新闻
[style] =>
[introduce] =>
[catpic] =>
[islink] => 0
[catdir] => xinwen
[linkurl] => /2007/phpcms/article/xinwen/
[parentid] => 0
[arrparentid] => 0
[parentdir] => /
[child] => 1
[arrchildid] => 1,2,3
[items] => 0
[itemordertype] => 0
[itemtarget] => 0
[ismenu] => 1
[islist] => 1
[ishtml] => 1
[htmldir] => list
[prefix] => list_
[urlruleid] => 0
[item_prefix] =>
[item_html_urlruleid] => 0
[item_php_urlruleid] => 0
)
[5] => Array
(
[module] => article
[channelid] => 1
[catid] => 5
[catname] => 国内军事
[style] =>
[introduce] =>
[catpic] =>
[islink] => 0
[catdir] => guonajunshi
[linkurl] => /2007/phpcms/article//guonajunshi/
[parentid] => 4
[arrparentid] => 0,4
[parentdir] => /junshi/
[child] => 0
[arrchildid] => 5
[items] => 0
[itemordertype] => 0
[itemtarget] => 0
[ismenu] => 1
[islist] => 1
[ishtml] => 1
[htmldir] => list
[prefix] => list_
[urlruleid] => 0
[item_prefix] =>
[item_html_urlruleid] => 0
[item_php_urlruleid] => 0
)
[2] => Array
(
[module] => article
[channelid] => 1
[catid] => 2
[catname] => 国内新闻
[style] =>
[introduce] =>
[catpic] =>
[islink] => 0
[catdir] => guonaxinwen
[linkurl] => /2007/phpcms/article//guonaxinwen/
[parentid] => 1
[arrparentid] => 0,1
[parentdir] => /xinwen/
[child] => 0
[arrchildid] => 2
[items] => 5
[itemordertype] => 0
[itemtarget] => 0
[ismenu] => 1
[islist] => 1
[ishtml] => 1
[htmldir] => list
[prefix] => list_
[urlruleid] => 0
[item_prefix] =>
[item_html_urlruleid] => 0
[item_php_urlruleid] => 0
)
[3] => Array
(
[module] => article
[channelid] => 1
[catid] => 3
[catname] => 国外新闻
[style] =>
[introduce] =>
[catpic] =>
[islink] => 0
[catdir] => guowaixinwen
[linkurl] => /2007/phpcms/article//guowaixinwen/
[parentid] => 1
[arrparentid] => 0,1
[parentdir] => /xinwen/
[child] => 0
[arrchildid] => 3
[items] => 2
[itemordertype] => 0
[itemtarget] => 0
[ismenu] => 1
[islist] => 1
[ishtml] => 1
[htmldir] => list
[prefix] => list_
[urlruleid] => 0
[item_prefix] =>
[item_html_urlruleid] => 0
[item_php_urlruleid] => 0
)
[4] => Array
(
[module] => article
[channelid] => 1
[catid] => 4
[catname] => 军事
[style] =>
[introduce] =>
[catpic] =>
[islink] => 0
[catdir] => junshi
[linkurl] => /2007/phpcms/article/junshi/
[parentid] => 0
[arrparentid] => 0
[parentdir] => /
[child] => 1
[arrchildid] => 4,5
[items] => 0
[itemordertype] => 0
[itemtarget] => 0
[ismenu] => 1
[islist] => 1
[ishtml] => 1
[htmldir] => list
[prefix] => list_
[urlruleid] => 0
[item_prefix] =>
[item_html_urlruleid] => 0
[item_php_urlruleid] => 0
)
)
如何对PHP文件进行加密方法 PHP实现加密的几种方式介绍
php生成圆角图片的方法 电脑中php怎么生成圆角图片教程
用PHP构建一个留言本方法步骤 php怎么实现留言板功能
php中三元运算符用法 php中的三元运算符使用说明
php文件如何怎么打开方式介绍 php文件用什么打开方法
PHP怎么插入数据库方法步骤 php编程怎么导入数据库教程
如何安装PHPstorm并配置方法教程 phpstorm安装后要进行哪些配置
PHP 获取远程文件大小的3种解决方法 如何用PHP获取远程大文件的大小
20个实用PHP实例代码 php接口开发实例代码详细介绍
如何架设PHP服务器方法步骤 怎么搭建php服务器简单教程