模块SEO优化中{分类名称}分隔符去掉及只调用下级分类方法

if($catid) {  
    if($CAT['parentid']) {  
        $seo_catname = '';  
        $tmp = strip_tags(cat_pos($CAT, 'DESTOON'));  
        $tmp = explode('DESTOON', $tmp);  
        $tmp = array_reverse($tmp);  
        /* 
        foreach($tmp as $k=>$v) { 
            $seo_catname .= $v.$seo_delimiter; 
        }*/  
         $seo_catname .= $tmp[0];  
    } else {  
        //$seo_catname = $CAT['catname'].$seo_delimiter;  
        $seo_catname = $CAT['catname'];  
    }  
    $seo_cattitle = $CAT['seo_title'] ? $CAT['seo_title'].$seo_delimiter : $seo_catname;  
    $seo_catkeywords = $CAT['seo_keywords'] ? $CAT['seo_keywords'] : '';  
    $seo_catdescription = $CAT['seo_description'] ? $CAT['seo_description'] : '';  
}  
上面文件在seo.inc.php中,原文链接:http://blog.csdn.net/sunbingzibo/article/details/38386689
 
1.去掉后,可以在模块设置SEO信息时,避免读取模块名称的重复,只显示分类名称。
2.针对多个具有一定规律的子分类只需要设置一个规则就可以,避免重复工作。
 
posted @ 2016-07-26 11:28  虾米东东  阅读(449)  评论(0编辑  收藏  举报