How to automatically add hyperlinks to keywords in published articles by dedecms
How does dedecms automatically add hyperlinks to keywords in published articles? This problem may be often seen in our daily study or work. I hope you can gain a lot from this question. The following is the reference content that the editor brings to you, let's take a look at it!
How does dedecms automatically add hyperlinks to keywords in published articles?
Dedecms automatically adds hyperlinks to keywords in published articles.
Dedecms automatically adds hyperlinks to keywords in published articles, which helps with optimization, but overoptimization is not good either.
The code is as follows:
Foreach ($kws as $k) {$k = trim ($k); if ($k = ") {if ($I > $maxkey) {break;} $myrow = $this- > dsql- > GetOne (" select * from dede_keywords where keyword='$k' And rpurl "); if (is_array ($myrow)) {$karr [] = $k; $GLOBALS ['replaced'] [$k] = 0; $kaarr [] =" $k ";} $iTunes;}
Replace it with:
The code is as follows:
Global $dsql; $query= "SELECT * FROM dede_keywords WHERE rpurl" ORDER BY rank DESC "; $dsql- > SetQuery ($query); $dsql- > Execute (); while ($row = $dsql- > GetArray ()) {$key = trim ($row ['keyword']); $key_url=trim ($row [' rpurl']); $karr [] = $key; $kaarr [] =" $key ";}
Friendly reminder: please pay attention to the backup of the modification of the file!
In the background, just set the number of automatic replacements in the system settings.
Thank you for reading! After reading the above, do you have a general idea of how dedecms automatically adds hyperlinks to keywords in published articles? I hope the content of the article will be helpful to all of you. If you want to know more about the relevant articles, you are welcome to follow the industry information channel.