phpcms 自定义方法

路径:\install_package\phpcms\libs\functions\extention.func.php

<?php
//输入栏目ID获取父级栏目名称
function catposparentname($catid){
    $category_arry = array();
    $siteids = getcache('category_content','commons');
    $siteid = $siteids[$catid];
    $category_arr = getcache('category_content_'.$siteid,'commons');
    $parentid = $category_arr[$catid]['parentid'];
    $parentName=$category_arr[$parentid]['catname'];
    return $parentName;
}

//输入栏目ID获取父级栏目描述
function catposparentdescription($catid){
    $category_arry = array();
    $siteids = getcache('category_content','commons');
    $siteid = $siteids[$catid];
    $category_arr = getcache('category_content_'.$siteid,'commons');
    $parentid = $category_arr[$catid]['parentid'];
    $parentDescription=$category_arr[$parentid]['description'];
    return $parentDescription;
}
//输入栏目ID获取父级栏目ID
function catposparentid($catid){
    $category_arry = array();
    $siteids = getcache('category_content','commons');
    $siteid = $siteids[$catid];
    $category_arr = getcache('category_content_'.$siteid,'commons');
    $parentid = $category_arr[$catid]['parentid'];
    return $parentid;
}
?>

 

posted @ 2018-03-27 14:06  怪咖咖  阅读(406)  评论(0编辑  收藏  举报