Dream about the process of document anchor text link quantity

Source: Internet
Author: User
Keywords Processing side Anchor text

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

Dream Weaving (DEDECMS) document what is the frequency of the keyword maintenance? Since very early on, many friends on the Internet have been entangled in this problem, using the Dream setting to automatically add anchor text can not avoid a problem. This article, Little bear to introduce the meaning of this frequency and the design of a dream anchor text set a detailed question.

First, explain the meaning of this "frequency" in the maintenance of the document keyword. We know that the dream is set to 30 by default, and many friends see it as the number of links to anchor text. In fact, this frequency is only the heat of the keyword, the same dynamic system keyword weight equivalent. It's just, it's not good to weave dreams in this place. Therefore, the author suggested that it is best not to change.

So how exactly should you control the number of document anchor text links? System basic parameters The last line of other options. Document content The same keyword replacement number (0 for all): 1 (1 means to link only the first occurrence of the target keyword). Figure:

  

Speaking of which, there may be another problem. For example, I set up two anchor text links in the background "SEO blog", "SEO, but the first occurrence of the article" SEO blog "This word, originally conceived to be linked to the" SEO blog "corresponding to the page, but the dream of weaving default settings to link to the" SEO "page corresponding to. So what should be done about it?

Workaround (Back up first)

First step: Open the arc.archivew.class.php in the directory include
Locate the function Replacekeyword ($kw,& $body) code, from here to the bottom. Replace this piece of code:

function Replacekeyword ($kw,& $body)


  {


Global $cfg _cmspath;


$maxkey = 5;


$KWS = Explode (",", Trim ($kw)); In order to divide the gap character


$i = 0;


$karr = $kaarr = $GLOBALS [' replaced '] = array ();


//Temporarily masks hyperlinks


$body = Preg_replace ("/(<a (. *)) (>) (. *) (<) (\/a>)/isu", ' \\1-]-\\4-[-\\6 ', $body);


Global $dsql;


$query = "SELECT * from Dede_keywords WHERE rpurl<> ' and sta=1 order by length (keyword) desc";


$dsql->setquery ($query);


$dsql->execute ();


while ($row = $dsql->getarray ())


  {


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


$key _url=trim ($row [' Rpurl ']);


$karr [] = $key;


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


  }


foreach ($karr as $key => $word)


  {


$body = Preg_replace ("/(^|>) (^<]+) (? =<|$)/sue", "_highlight (' \\2 ', \ $karr [$key], \ $kaarr [$key], ' \\1 ') ", $body);


//echo $body. " <br/> ";


//Redo Hyperlink


$body = Preg_replace ("/(<a (. *))-\]-(. *)-\[-(\/a>)/isu", ' \\1>\\3<\\4 ', $body);


//Temporarily masks hyperlinks


$body = Preg_replace ("/(<a (. *)) (>) (. *) (<) (\/a>)/isu", ' \\1-]-\\4-[-\\6 ', $body);


  }


//Redo Hyperlink


$body = Preg_replace ("/(<a (. *))-\]-(. *)-\[-(\/a>)/isu", ' \\1>\\3<\\4 ', $body);


return $body;


  }


}//end Archives


//Highlight specific, replace multiple times is probably not up to the most times


function _highlight ($string, $words, $result, $pre)


  {


Global $cfg _replace_num;


$string = Str_replace (', ', ' "', $string);


if ($GLOBALS [' replaced '] [$words] = = 1)


  {


return $pre. $string


  }


if ($cfg _replace_num > 0)


  {


$string = preg_replace ("/". Preg_quote ($words). /", $result, $string, $cfg _replace_num);


if (Strpos ($string, $words)!== false)


  {


$GLOBALS [' replaced '] [$words] = 1;


//echo $words;


  }


  }


Else


  {


$string = Str_replace ($words, $result, $string);


  }


return $pre. $string


  }

Into the background generation, this is done.

Original article please indicate reproduced from Hunan SEO, this article address: http://www.seoboke.org/seoxg/276.html

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.