phpcms 杂乱总结

1.根据catid 获取 栏目名称

$CATEGORYS = getcache('category_content_'.$siteid,'commons');
$name = {$CATEGORYS[$catid]['catname']}

 

2.根据catid 取子栏目的catid和名称

/*
     * 根据catid 取子栏目
     */
    private function get_child_catid($parents_catid){
        $categorys = getcache('category_content_1','commons');
        $arrchildid = $categorys[$parents_catid][arrchildid];
        $arrchildid = explode(',',$arrchildid);
        $result = array();
        foreach($arrchildid as $k=>$v){
            $name = $categorys[$v]['catname'];
            $result[$k]['catid']=$v;
            $result[$k]['catname']=$name;
        }
        $result = array_slice($result,1);
        return $result;
    }

 

posted @ 2014-09-03 18:32  笑笑别人  阅读(240)  评论(0编辑  收藏  举报