织梦采集没有自动生成摘要和关键字怎么办
织梦采集没有自动生成摘要和关键字怎么办?
织梦DEDECMS采集没有自动生成摘要和关键字的解决办法
推荐学习:织梦cms
织梦5.6采集到了内容,可没有自动生成摘要和关键字,关键字和摘要都是空的。
可能很多人都遇到了和我一样的问题,在论坛实在没找到好的解决办法,就自己动手去改改文件。废话不多说了。
下面是我的解决办法:
1、修改 include/dedecollection.class.php
1 2 3 4 5 6 7 |
//自动分析关键字和摘要 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]; } |
用下面一段代码替换上面的
1 2 3 4 5 6 7 8 9 10 11 12 |
//自动分析关键字和摘要 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]; } |
改了上面的, 还有另一个地方需要修改的
1 2 3 4 5 6 |
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]; } |
用下面的代码替换掉上面的:
1 2 3 4 5 6 7 8 9 10 11 |
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]; } |
以上就是织梦采集没有自动生成摘要和关键字怎么办的详细内容,更多请关注织梦楼其它相关文章!
①本站所有织梦模板资源均来自用户分享和网络收集,如果侵犯了您的权益,请联系网站客服处理
②本站提供的织梦源码,均带数据及演示地址。可以在任一源码详情页查看演示地址。
③由于博主时间紧缺,所有模板源码不提供技术支持。仅部分收费原创源码提供售后
④如遇模板源码下载链接打不开或者有错误,请联系网站客服QQ指出纠正。
⑤人民币与金币汇率为1比1,即1元=1金币
织梦楼 » 织梦采集没有自动生成摘要和关键字怎么办
织梦楼 » 织梦采集没有自动生成摘要和关键字怎么办