本帖最后由 lleify 于 2012-8-22 17:20 编辑
门户在未登录状态下面不显示
<meta name="keywords" content="首页" /><meta name="description" content="首页" />这两个里面的内空,实际上在后台是有设置的,但用damin登录后就能显示,后来看了下程序,改了下代码就好了,
所改文件是 source/class/helper/helper_seo.php ,下面是没改之前的代码段- public static function get_seosetting($page, $data = array(), $defset = array()) {
- global $_G;
- $searchs = array('{bbname}');
- $replaces = array($_G['setting']['bbname']);
- $seotitle = $seodescription = $seokeywords = '';
- $titletext = $defset['seotitle'] ? $defset['seotitle'] : $_G['setting']['seotitle'][$page];
- $descriptiontext = $defset['seodescription'] ? $defset['seodescription'] : $_G['setting']['seodescription'][$page];
- $keywordstext = $defset['seokeywords'] ? $defset['seokeywords'] : $_G['setting']['seokeywords'][$page];
- preg_match_all("/\{([a-z0-9_-]+?)\}/", $titletext.$descriptiontext.$keywordstext, $pageparams);
- if($pageparams) {
- foreach($pageparams[1] as $var) {
- $searchs[] = '{'.$var.'}';
- if($var == 'page') {
- $data['page'] = $data['page'] > 1 ? lang('core', 'page', array('page' => $data['page'])) : '';
- }
- $replaces[] = $data[$var] ? strip_tags($data[$var]) : '';
- }
- if($titletext) {
- $seotitle = helper_seo::strreplace_strip_split($searchs, $replaces, $titletext);
- }
- if($descriptiontext && (CURSCRIPT == 'forum' || IS_ROBOT || $_G['adminid'] == 1)) {
- $seodescription = helper_seo::strreplace_strip_split($searchs, $replaces, $descriptiontext);
- }
- if($keywordstext && (CURSCRIPT == 'forum' || IS_ROBOT || $_G['adminid'] == 1)) {
- $seokeywords = helper_seo::strreplace_strip_split($searchs, $replaces, $keywordstext);
- }
- }
- return array($seotitle, $seodescription, $seokeywords);
- }
复制代码 下面是我修改后的部份代码段- if($descriptiontext) {
- $seodescription = helper_seo::strreplace_strip_split($searchs, $replaces, $descriptiontext);
- }
- if($keywordstext) {
- $seokeywords = helper_seo::strreplace_strip_split($searchs, $replaces, $keywordstext);
- }
复制代码 删除里面的 && (CURSCRIPT == 'forum' || IS_ROBOT || $_G['adminid'] == 1) 这段code就OK了
希望你们越做越好
|