What should I do if DreamWeaver collection does not automatically generate abstracts and keywords?
The solution to the problem that DEDECMS collection does not automatically generate summaries and keywords
Recommended learning: Dreamcms
Dreamweaver 5.6 The content is collected, but the summary and keywords are not automatically generated. The keywords and summary are empty.
Maybe many people have encountered the same problem as me. They couldn't find a good solution in the forum, so they changed the files themselves. stop bullshitting.
The following is my solution:
1. Modify 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]; }
Replace the above
//自动分析关键字和摘要 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]; }
with the following piece of code After changing the above, there is another place that needs to be modified
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]; }
Replace the above with the following code:
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]; }
The above is the detailed content of What should I do if Dreamweaver Collection does not automatically generate abstracts and keywords?. For more information, please follow other related articles on the PHP Chinese website!