One keyword corresponds to multiple links in the automatic internal chain of Dream Weaving, and these links are randomly called

When using dedecsm dream weaving automatic internal chain , there may be a keyword corresponding to multiple websites, and the need to call the URL randomly, such as (dream weaving automatic internal chain) this keyword, some articles are linked to the homepage of the website, and some links Go to the article page, but the original function of Dream Weaving, a keyword can only add one URL. I have searched many ways on the Internet but have not found a useful one. Fortunately, I know a little php, so I can do it myself. The following is a solution for the automatic internal chain of dream weaving, one keyword corresponds to multiple links, and these links are randomly called.

1. Open the /include/arc.archives.class.php file and find the following code

 $key = trim($row['keyword']);

2. Add the following code under the code

//一个内链关键词对应多个链接开始
$keysurl = trim($row['rpurl']);
$keyarrs  = explode("|",$keysurl);
$keyarr = array_rand($keyarrs,1);
$keywords = $keyarrs[$keyarr];
//一个内链关键词对应多个链接结束

3. Then put the link address below

 $kaarr[] = "<a href='$key_url' target='_blank'><u>$key</u></a>";

Replace with

$kaarr[] = "<a href='$keywords' target='_blank'><u>$key</u></a>";

At this point, weaving dreams automatically corresponds to multiple links with a keyword in the internal chain, and the code for randomly calling these links has been modified.

4. Then add links and keywords in the "Document Keyword Batch Maintenance" in the Core of Dream Weaving Backstage. Use "|" to separate multiple links, then save and update the article with one key to update the article. One keyword corresponds to multiple internal links. Links, call these links randomly and the setup is complete.

One keyword corresponds to multiple links in the automatic internal chain of Dream Weaving

 

5. If you have many links, you may need to go to the database to find the dede_keywords table and change the data type of the rpurl field to varcar and the length to 255, as shown in the figure below

 

Guess you like

Origin blog.csdn.net/qq_39339179/article/details/110131638