在v9安装下v9\phpcms\libs\functions\global.func.php 修改函数:
/**
* 生成SEO
* @param $siteid 站点ID
* @param $catid栏目ID
* @param $title标题
* @param $description 描述
* @param $keyword 关键词 */ function seo($siteid, $catid = '', $title = '', $description = '', $keyword = '') { if (!emptyempty($title))$title = strip_tags($title) if (!emptyempty($description)) $description = strip_tags($description) if (!emptyempty($keyword)) $keyword = str_replace(' ', ',', strip_tags($keyword)) $sites = getcache('sitelist', 'commons') $site = $sites[$siteid] $cat = array() if (!emptyempty($catid)) { $siteids = getcache('category_content','commons') $siteid = $siteids[$catid] $categorys = getcache('category_content_'.$siteid,'commons') $cat = $categorys[$catid] $cat['setting'] = string2array($cat['setting']) } //$seo['site_title'] =isset($site['site_title']) &&!empty($site['site_title']) ? $site['site_title'] : $site['name'] $seo['site_title'] = $site['name'] //区分首页和站点的标题$seo['keyword'] = !emptyempty($keyword) ? $keyword : $site['keywords'] $seo['description'] = isset($description) &&!emptyempty($description) ? $description : (isset($cat['setting']['meta_description']) &&!emptyempty($cat['setting']['meta_description']) ? $cat['setting']['meta_description'] : (isset($site['description']) &&!emptyempty($site['description']) ? $site['description'] : '')) //$seo['title'] = (isset($title) &&!empty($title) ? $title.' - ' : '').(isset($cat['setting']['meta_title']) &&!empty($cat['setting']['meta_title']) ? $cat['setting']['meta_title'].' - ' : (isset($cat['catname']) &&!empty($cat['catname']) ? $cat['catname'].' - ' : '')) ////这里只是使用网站做标题,而去掉栏目名称。$seo['title'] = (isset($title) &&!emptyempty($title) ? $title.' - ' : '').(isset($cat['setting']['meta_title']) &&!emptyempty($cat['setting']['meta_title']) ? $cat['setting']['meta_title'].' - ' : '') foreach ($seo as $k=>$v) { $seo[$k] = str_replace(array("\n","\r"),'', $v) } return $seo }
估计是模板的问题,不应该是字段里数据的问题。1、你去后台对应栏目里去看一下栏目设置中的SEO设置里的关键词和描述有没有问题,是否有html代码,如果没有就是模板的问题。
2、如果有的话,这个信息存于
你的表前缀_category
表的
setting字段中,批量修改比较麻烦,如果多余的html代码有规律可以尝试修改。
欢迎分享,转载请注明来源:夏雨云
评论列表(0条)