Dedecms v5.7 SP1 keyword Frequency Research and Test

Source: Internet
Author: User

Dedecms keyword replacement solution

Under dedecms v5.7sp1 background "core> batch maintenance", a keyword maintenance document is provided. It allows you to add keywords and their corresponding link URLs. When published articles contain these keywords, the program adds a text link [1] to the keyword. This function is very useful when anchor text is used in the station:

However, there is a frequency option that doesn't quite understand what it means. After some tests, it is found that the frequency indicates the priority of the keyword. The larger the value, the higher the priority, this keyword is first searched and replaced. For example, if there are two keywords A and B, the frequency of A is 1 and the frequency of B is 2, then when generating the article page, keyword B will first add text links and then.

But what is the purpose? For example, which of the following keywords is not the same for the final page generated? Yes, when the two keywords do not exist in the inclusion relationship, setting the frequency is meaningless. When the two keywords have the inclusion relationship, the significance of the frequency is displayed, for example, the two keywords "wooden house" and "wooden house" are part of the former. How can this be replaced? As shown in, the frequency of the two keywords is the same, so the keywords will be replaced in the order of addition. The wooden house will be replaced first, and then the wooden house will be replaced. The final page code is:

Copy the content to the clipboard program code <ahref = 'HTTP: // www.mzwu.com/'targetinto'_blank'> <u> <ahref = 'HTTP: // www.qq.com/'targetpolic'_blank'> <u> wooden house </u> </a>

This code is obviously problematic. How should I set it if I want to replace the keyword wood instead of the wooden house? You only need to set the frequency of the wooden sub-house to be greater than that of the wooden sub-house. For example, if the frequency of the wooden sub-house is set to 2 [2], the generated Page code is:

Copy the content to the clipboard program code <ahref = 'HTTP: // www.qq.com/'targetpolic'_blance'> <u> wooden sub </u> </a>.

What should I do if I want to replace the key word wooden house without replacing the wooden house? Sorry, the program cannot achieve this at present, because all keywords will eventually be searched once, so no matter how you set the frequency, short keywords can always be replaced, it is a defect.

Additional instructions

[1]. the keyword replacement switch must be on. keywords can be replaced only when an article page is generated. The switch position is system> system Settings> basic system parameters> core Settings> keyword replacement (yes/no) this function affects the HTML generation speed. In addition, dedecms also provides a user-friendly parameter that can be used to set the number of times the same keyword is replaced in the same article. Parameter location: system → system settings → system basic parameters → other options → number of times the same keyword is replaced in the document content (0 indicates that all parameters are replaced). This can prevent the number of times the anchor text in the station appears too many times.

[2]. dedecms v5.7sp1 has a bug. After the keyword is successfully added, you can modify the link URL, disable, and delete the keyword, but you cannot modify the keyword frequency. The bug correction method is as follows:

① Open Dede \ templets \ article_keywords_main.htm and find the following code: copy the content to the clipboard program code <TD>
    <Inputtype = 'text' size = '5' class = 'nnpp' value = '{Dede: field. rank/} 'name = 'rank _ {Dede: field. aid/} '/>
</TD>

Modify the following: (Red new) copy the content to the clipboard program code <TD>
    <Inputtype = 'did' value = '{Dede: field. Rank/}' name = 'rankold _ {Dede: field. Aid/} '/>
    <Inputtype = 'text' size = '5' class = 'nnpp' value = '{Dede: field. rank/} 'name = 'rank _ {Dede: field. aid/} '/>
</TD>

②. Open Dede/article_keywords_main.php and find the following code: copy the content to the clipboard program code // update the link URL.
If ($ rpurl! = $ Rpurlold)
{
    $ Query1 = "updat' #@__ keywords 'set rpurl = '$ rpurl' where aid =' $ aid '";
    $ Dsql-> executenonequery ($ query1 );
}

Add the following code: copy the content to the clipboard program code // update frequency
$ Rank =$ {'rank _ '. $ aid };
$ Rankold =$ {'rankold _ '. $ aid };
If ($ rank! = $ Rankold)
{
    $ Query1 = "updat' #@__ keywords 'set Rank = '$ rank' where aid = '$ aid '";
    $ Dsql-> executenonequery ($ query1 );
}

After saving, you can modify the keyword frequency in the background.

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.