当前位置:首页站长学院DEDECMS织梦采集没有自动生成摘要和关键字怎么办
企业营销,就选知企PROSAAS

织梦采集没有自动生成摘要和关键字怎么办

织梦采集没有自动生成摘要和关键字怎么办

织梦采集没有自动生成摘要和关键字怎么办?

织梦DEDECMS采集没有自动生成摘要和关键字的解决办法

推荐学习:织梦cms

织梦5.6采集到了内容,可没有自动生成摘要和关键字,关键字和摘要都是空的。

可能很多人都遇到了和我一样的问题,在论坛实在没找到好的解决办法,就自己动手去改改文件。废话不多说了。

下面是我的解决办法:

1、修改 include/dedecollection.class.php

//自动分析关键字和摘要  
preg_match("/<meta[\s]+name=['\"]keywords['\"] content=['\"](.*)['\"]/isU",$this->tmpHtml,$inarr);  
preg_match("/<meta[\s]+content=['\"](.*)['\"] name=['\"]keywords['\"]/isU",$this->tmpHtml,$inarr2);  
if(!isset($inarr[1]) && isset($inarr2[1]))  
{  
$inarr[1] = $inarr2[1];  
}

用下面一段代码替换上面的

//自动分析关键字和摘要  
preg_match("/<meta[\s]+name=['\"]keywords['\"] content=['\"](.*)['\"]/isU",$this->tmpHtml,$inarr);  
preg_match("/<meta[\s]+content=['\"](.*)['\"] name=['\"]keywords['\"]/isU",$this->tmpHtml,$inarr2);  
preg_match("/<meta[\s]+name=keywords content=['\"](.*)['\"]/isU",$this->tmpHtml,$inarr3);  
if(!isset($inarr[1]) && isset($inarr2[1]))  
{  
$inarr[1] = $inarr2[1];  
}  
if(!isset($inarr[1]) && isset($inarr3[1]))  
{  
$inarr[1] = $inarr3[1];  
}

改了上面的, 还有另一个地方需要修改的

preg_match("/<meta[\s]+name=['\"]description['\"] content=['\"](.*)['\"]/isU",$this->tmpHtml,$inarr);  
preg_match("/<meta[\s]+content=['\"](.*)['\"] name=['\"]description['\"]/isU",$this->tmpHtml,$inarr2);  
if(!isset($inarr[1]) && isset($inarr2[1]))  
{  
$inarr[1] = $inarr2[1];  
}

用下面的代码替换掉上面的:

preg_match("/<meta[\s]+name=['\"]description['\"] content=['\"](.*)['\"]/isU",$this->tmpHtml,$inarr);  
preg_match("/<meta[\s]+content=['\"](.*)['\"] name=['\"]description['\"]/isU",$this->tmpHtml,$inarr2);  
preg_match("/<meta[\s]+name=description content=['\"](.*)['\"]/isU",$this->tmpHtml,$inarr3);  
if(!isset($inarr[1]) && isset($inarr2[1]))  
{  
$inarr[1] = $inarr2[1];  
}  
if(!isset($inarr[1]) && isset($inarr3[1]))  
{  
$inarr[1] = $inarr3[1];  
}

以上就是织梦采集没有自动生成摘要和关键字怎么办的详细内容,更多请关注知企PROSAAS其它相关文章!

温馨提示:

文章标题:织梦采集没有自动生成摘要和关键字怎么办

文章链接:https://ceshi.prosaas.cn/1311.html

更新时间:2020年01月08日

声明: 本站大部分内容均收集于网络!若内容若侵犯到您的权益,请发送邮件至:973664285@qq.com我们将第一时间处理! 资源所需价格并非资源售卖价格,是收集、整理、编辑详情以及本站运营的适当补贴,并且本站不提供任何免费技术支持。 所有资源仅限于参考和学习,版权归原作者所有,更多请阅读知企PROSAAS协议

给TA打赏
共{{data.count}}人
人已打赏
DEDECMS

织梦怎么去掉{dede:field.body/} 中的p元素

2020-1-8 9:48:50

DEDECMS

DEDECMS站点内容怎么自动更新到新浪微博

2020-1-9 9:06:02

0 条回复 A文章作者 M管理员
    暂无讨论,说说你的看法吧
个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索