婷婷综合国产,91蜜桃婷婷狠狠久久综合9色 ,九九九九九精品,国产综合av

主頁 > 網站建設 > 建站知識 > 織夢DEDECMS采集沒有自動生成摘要和關鍵字的解決教程

織夢DEDECMS采集沒有自動生成摘要和關鍵字的解決教程

POST TIME:2021-05-24 02:50

織夢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];  
} 



收縮
  • 微信客服
  • 微信二維碼
  • 電話咨詢

  • 400-1100-266
主站蜘蛛池模板: 平江县| 若羌县| 九龙城区| 新化县| 沂源县| 衢州市| 柳江县| 娱乐| 高州市| 行唐县| 岳西县| 乡城县| 库伦旗| 酉阳| 宁夏| 永州市| 比如县| 诸暨市| 平乡县| 腾冲县| 金溪县| 新宾| 永善县| 离岛区| 桐梓县| 定兴县| 吴桥县| 祥云县| 合作市| 兴义市| 通许县| 肥城市| 慈利县| 商都县| 南木林县| 香河县| 太谷县| 黎平县| 安国市| 景德镇市| 故城县|