
摘要
织梦DEDECMS采集没有手动生成摘要和关键字的解决教程
采集交流 • 优采云 发表了文章 • 0 个评论 • 388 次浏览 • 2020-04-18 09:49
织梦5.6采集到了内容,可没有手动生成摘要和关键字dedecms采集的文章怎么没有关键字和描述dedecms采集的文章怎么没有关键字和描述,关键字和摘要都是空的。
可能很多人都碰到了和我一样的问题,在峰会实在没找到好的解决办法,就自己动手去改改文件。废话不多说了。
下面是我的解决办法:
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]; } 查看全部

织梦5.6采集到了内容,可没有手动生成摘要和关键字dedecms采集的文章怎么没有关键字和描述dedecms采集的文章怎么没有关键字和描述,关键字和摘要都是空的。
可能很多人都碰到了和我一样的问题,在峰会实在没找到好的解决办法,就自己动手去改改文件。废话不多说了。
下面是我的解决办法:
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]; }
织梦DEDECMS采集没有手动生成摘要和关键字的解决教程
采集交流 • 优采云 发表了文章 • 0 个评论 • 388 次浏览 • 2020-04-18 09:49
织梦5.6采集到了内容,可没有手动生成摘要和关键字dedecms采集的文章怎么没有关键字和描述dedecms采集的文章怎么没有关键字和描述,关键字和摘要都是空的。
可能很多人都碰到了和我一样的问题,在峰会实在没找到好的解决办法,就自己动手去改改文件。废话不多说了。
下面是我的解决办法:
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]; } 查看全部

织梦5.6采集到了内容,可没有手动生成摘要和关键字dedecms采集的文章怎么没有关键字和描述dedecms采集的文章怎么没有关键字和描述,关键字和摘要都是空的。
可能很多人都碰到了和我一样的问题,在峰会实在没找到好的解决办法,就自己动手去改改文件。废话不多说了。
下面是我的解决办法:
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]; }