网络营销电子商务研究中心

网络营销电子商务研究中心 (https://www.0058.net/index.php)
-   Discuz/SupeSite/X-Space (https://www.0058.net/forumdisplay.php?f=10)
-   -   门户keywords和description不能正确显示 (https://www.0058.net/showthread.php?t=4609)

topvip 2013-12-30 12:26 PM

门户keywords和description不能正确显示
 
www.danyangglasses.com

管理员登录后从浏览器查看源文件,能正确显示keywords和description内容:
<meta name="keywords" content="眼睛,眼镜框,近视眼镜,隐形眼镜,眼镜品牌,太阳镜" />

<meta name="description" content="丹阳眼镜网是眼镜行业最具影响力的网络媒体平台,致力于服务眼镜企业和消费者,丹阳眼镜网传递时尚、引导消费,提供最新行业动态、产品信息、眼镜品牌、供求合作、人才招聘 " />

退出登录以游客身份再从浏览器查看源文件,就会变成这样:
<meta name="keywords" content="门户" />
<meta name="description" content="门户" />

解决方法:
打开 source/class/helper/helper_seo.php

75到85行
Code:

        if($descriptiontext && (isset($_G['makehtml']) || CURSCRIPT == 'forum' || IS_ROBOT || $_G['adminid'] == 1)) {

                                $seodescription = helper_seo::strreplace_strip_split($searchs, $replaces, $descriptiontext);

                        }

                        if($keywordstext && (isset($_G['makehtml']) || CURSCRIPT == 'forum' || IS_ROBOT || $_G['adminid'] == 1)) {

                                $seokeywords = helper_seo::strreplace_strip_split($searchs, $replaces, $keywordstext);

                        }

删除:
Code:

&& (isset($_G['makehtml']) || CURSCRIPT == 'forum' || IS_ROBOT || $_G['adminid'] == 1)
代码改为:
Code:

                        if($descriptiontext) {

                                $seodescription = helper_seo::strreplace_strip_split($searchs, $replaces, $descriptiontext);

                        }

                        if($keywordstext) {

                                $seokeywords = helper_seo::strreplace_strip_split($searchs, $replaces, $keywordstext);

                        }



All times are GMT +8. The time now is 07:11 PM.

Powered by vBulletin Version 3.8.7
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.