phpcms中的$CATEGORY 數組_PHP教程

來源:互聯網
上載者:User
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
)

)

http://www.bkjia.com/PHPjc/477162.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/477162.htmlTechArticle1、用途 $CATEGORY 是一個二維數組,主要用來儲存目前通道或者模組所以欄目的基本配置資訊。 2、如何設定 您可以登入後台進入模組或者頻...

  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.