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

主頁(yè) > 網(wǎng)站建設(shè) > 建站知識(shí) > DedeCms采集沒(méi)有自動(dòng)生成摘要和關(guān)鍵字的解決辦法

DedeCms采集沒(méi)有自動(dòng)生成摘要和關(guān)鍵字的解決辦法

POST TIME:2021-05-24 02:50

織夢(mèng)5.6采集到了內(nèi)容,可沒(méi)有自動(dòng)生成摘要和關(guān)鍵字,關(guān)鍵字和摘要都是空的。

可能很多人都遇到了和我一樣的問(wèn)題,在論壇實(shí)在沒(méi)找到好的解決辦法,就自己動(dòng)手去改改文件。廢話不多說(shuō)了。

下面是我的解決辦法

比如我采集了網(wǎng)站:http://www.52iphone8.com

首頁(yè)的meta代碼是:

Copy to Clipboard引用的內(nèi)容:[www.dede58.com]
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> 
<title>iphone蘋(píng)果中文網(wǎng)</title> 
<meta name=description content="蘋(píng)果iPhone手機(jī)中文官網(wǎng),為您提供蘋(píng)果iPhone 4代手機(jī)最新報(bào)價(jià),同時(shí)包括蘋(píng)果iPhone手機(jī)圖片、蘋(píng)果iPhone手機(jī)參數(shù)、蘋(píng)果iPhone手機(jī)主題、蘋(píng)果iPhone手機(jī)軟件、蘋(píng)果iPhone手機(jī)游戲、蘋(píng)果iPhone手機(jī)評(píng)測(cè)行情、蘋(píng)果iphone視頻、蘋(píng)果iphone鈴聲、蘋(píng)果iPhone手機(jī)論壇、蘋(píng)果iPhone手機(jī)下載等信息。" /> 
<meta name=keywords content="蘋(píng)果手機(jī),iphone,蘋(píng)果中文網(wǎng),蘋(píng)果手機(jī)官網(wǎng),iphone4代,蘋(píng)果iphone,iPhone手機(jī),蘋(píng)果手機(jī)報(bào)價(jià),圖片,論壇,游戲,電影,主題,鈴聲,鈴聲,下載,軟件,應(yīng)用" /> 

如果用dedecms的采集的時(shí)候就沒(méi)有辦法自動(dòng)獲取description和keywords的值的。 
大家注意到了這段代碼和其它網(wǎng)站的區(qū)別了沒(méi)?? 
<meta name=description content=... /> 
<meta name=keywords content=... /> 
就是name="description" 和 name="keywords" 少了雙引號(hào)"" 
這個(gè)可能是dedecms中自動(dòng)分析關(guān)鍵字和摘要的一個(gè)bug吧,沒(méi)有考慮到<meta name=keywords content ='' />這種情況! 
采集的選項(xiàng)里面也沒(méi)有自己填寫(xiě)關(guān)鍵字和摘要的選項(xiàng)。那我只能自己動(dòng)手修改文件了。 
1、修改 include/dedecollection.class.php

Copy to Clipboard引用的內(nèi)容:[www.dede58.com]
//自動(dòng)分析關(guān)鍵字和摘要 
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]; 

用下面一段代碼替換上面的

Copy to Clipboard引用的內(nèi)容:[www.dede58.com]
//自動(dòng)分析關(guān)鍵字和摘要 
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]; 
} 

改了上面的, 還有另一個(gè)地方需要修改的

Copy to ClipboardLiehuo.Net Codes引用的內(nèi)容:[www.dede58.com]
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]; 
} 

用下面的代碼替換掉上面的:

Copy to ClipboardLiehuo.Net Codes引用的內(nèi)容:[www.dede58.com]
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
主站蜘蛛池模板: 五台县| 南岸区| 平湖市| 连山| 探索| 京山县| 客服| 濉溪县| 伊宁市| 绥化市| 阳朔县| 宁晋县| 苍山县| 商水县| 平果县| 郎溪县| 石河子市| 广灵县| 临泽县| 韶山市| 乐山市| 清水河县| 都安| 孟连| 霍州市| 积石山| 冕宁县| 中西区| 东安县| 淮滨县| 获嘉县| 木兰县| 民和| 文登市| 屏东县| 开化县| 崇文区| 乌苏市| 肃南| 昌宁县| 北安市|