Home > CMS Tutorial > DEDECMS > body text

What should I do if Dreamweaver Collection does not automatically generate abstracts and keywords?

藏色散人
Release: 2020-01-08 09:51:49
Original
2419 people have browsed it

What should I do if Dreamweaver Collection does not automatically generate abstracts and keywords?

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=[&#39;\"]keywords[&#39;\"] content=[&#39;\"](.*)[&#39;\"]/isU",$this->tmpHtml,$inarr);  
preg_match("/<meta[\s]+content=[&#39;\"](.*)[&#39;\"] name=[&#39;\"]keywords[&#39;\"]/isU",$this->tmpHtml,$inarr2);  
if(!isset($inarr[1]) && isset($inarr2[1]))  
{  
$inarr[1] = $inarr2[1];  
}
Copy after login

Replace the above

//自动分析关键字和摘要  
preg_match("/<meta[\s]+name=[&#39;\"]keywords[&#39;\"] content=[&#39;\"](.*)[&#39;\"]/isU",$this->tmpHtml,$inarr);  
preg_match("/<meta[\s]+content=[&#39;\"](.*)[&#39;\"] name=[&#39;\"]keywords[&#39;\"]/isU",$this->tmpHtml,$inarr2);  
preg_match("/<meta[\s]+name=keywords content=[&#39;\"](.*)[&#39;\"]/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];  
}
Copy after login

with the following piece of code After changing the above, there is another place that needs to be modified

preg_match("/<meta[\s]+name=[&#39;\"]description[&#39;\"] content=[&#39;\"](.*)[&#39;\"]/isU",$this->tmpHtml,$inarr);  
preg_match("/<meta[\s]+content=[&#39;\"](.*)[&#39;\"] name=[&#39;\"]description[&#39;\"]/isU",$this->tmpHtml,$inarr2);  
if(!isset($inarr[1]) && isset($inarr2[1]))  
{  
$inarr[1] = $inarr2[1];  
}
Copy after login

Replace the above with the following code:

preg_match("/<meta[\s]+name=[&#39;\"]description[&#39;\"] content=[&#39;\"](.*)[&#39;\"]/isU",$this->tmpHtml,$inarr);  
preg_match("/<meta[\s]+content=[&#39;\"](.*)[&#39;\"] name=[&#39;\"]description[&#39;\"]/isU",$this->tmpHtml,$inarr2);  
preg_match("/<meta[\s]+name=description content=[&#39;\"](.*)[&#39;\"]/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];  
}
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template