How to get dedecms to do internal links automatically

Source: Internet
Author: User

Intermediary transaction http://www.aliyun.com/zixun/aggregation/6858.html ">seo diagnose Taobao guest cloud host technology Hall

Believe that a lot of friends with Dedecms for the article to do within the chain 211.html "> Feel cumbersome, for a lot of plug-ins may be realized, but a lot of the need to spend money to buy, for many 7474.html" > grassroots webmaster spend this money is not worth, small series I have learned the PHP program, Simply to study this problem, and finally spent 4 hours of research on the program to modify the implementation of the function, do not say that we start operation!

1. Add New variable

First enter the website background-> system set-> system basic Parameters-> System Basic Parameters-> Add new variable

  

Variable name: "Key_www"

Variable type: Select multiple lines of text

Parameter description: "The contents of the chain set as follows:" Need to be the content of the chain "|" The inner chain of the connection "multiple please", "separated."

Group: It is recommended that you choose other options (easy to manage).

2. Set the keywords and links in the chain

Complete the first step into "other options"

  

Pull to the bottom set inside the chain:

Format: "Inside chain keywords | Inside chain address, inside chain keywords |

As:

  

3. Modify the Web site program

Locate the "article_add.php" file in the root of the Web site background, and open the file to find the code. "$body = Analysehtmlbody ($body, $description, $litpic, $keywords, ' HTMLText ');", add "//inner chain" above this code.

$key _www = $dsql->getone ("select * from ' dede_sysconfig ' WHERE varname= ' key_www '");

foreach (Explode (', ', $key _www[' value ']) as $value) {

$keys =explode (' | ', $value);

$key _http[]= $keys [0];

$value _http[]= "". $keys [0]. "";

}

$body =str_replace ($key _http, $value _http, $body);

Inner Chain "Save file last overwrite completed.

To complete the above steps, if the article has a set of key and internal links will be automatically added.

The effect is as follows:

  

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.