91豆麻精品91久久久久久,中文在线资源,国产精品女视频,yw.139尤物在线精品视频

?
  歡迎訪問全國企業網站設計NO.1網站開發商平臺 付款方式
主頁 > 網站建設 > 建站知識 > 織夢DEDECMS采集沒有自動生成摘要和關鍵字的解決

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

POST TIME:2020-10-09

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

? 主站蜘蛛池模板: 高尔夫| 沈丘县| 灌南县| 遂昌县| 贺州市| 海安县| 黄大仙区| 固始县| 阿克| 岑溪市| 宜良县| 博爱县| 苍梧县| 三门县| 小金县| 神农架林区| 溆浦县| 武穴市| 涟水县| 枣庄市| 松潘县| 陆良县| 鄱阳县| 金堂县| 黄陵县| 江永县| 福贡县| 浮梁县| 抚顺县| 甘孜| 南投县| 红河县| 富蕴县| 隆回县| 营山县| 巧家县| 荥经县| 台东市| 宣武区| 盘山县| 潼关县|