程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 編程語言 >> 網頁編程 >> PHP編程 >> 關於PHP編程 >> phpcms中的$CATEGORY 數組

phpcms中的$CATEGORY 數組

編輯:關於PHP編程

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
        )

)

 

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved