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

织梦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]; }  

上一篇:DEDECMS织梦后台及网站栏目管理空白解决教程

下一篇:织梦模板DEDECMS增加代码让文章置顶一天的方法


EyouCms,简单易用的企业网站管理系统,点击了解更多


有问题可以加入织梦技术QQ群一起交流学习

本站vip会员 请加入织梦58 VIP②群 PS:加入时备注用户名或昵称

普通注册会员或访客 请加入织梦58 技术交流②群

作者:DEDE58.COM 关注: 时间:2018-10-31 08:50

首先声明,只要是我们的vip会员所有源码均可以免费下载,不做任何限制(了解更多)
☉本站的源码不会像其它下载站一样植入大量的广告。为了更好的用户体验以后坚持不打水印
☉本站只提供精品织梦源码,源码在于可用,不在多!!希望在这里找到你合适的。
☉本站提供的整站织梦程序,均带数据及演示地址。可以在任一源码详情页查看演示地址
☉本站所有资源(包括源码、模板、素材、特效等)仅供学习与参考,请勿用于商业用途。
☉如有其他问题,请加网站客服QQ(970003436)进行交流。

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/016d6735c3078a619778053052330914.html