<var id="xvh3p"><noframes id="xvh3p"><var id="xvh3p"></var><listing id="xvh3p"><strike id="xvh3p"><listing id="xvh3p"></listing></strike></listing>
<var id="xvh3p"><strike id="xvh3p"><var id="xvh3p"></var></strike></var><th id="xvh3p"><strike id="xvh3p"><th id="xvh3p"></th></strike></th>
<span id="xvh3p"><noframes id="xvh3p"><dl id="xvh3p"></dl>
<span id="xvh3p"><noframes id="xvh3p">
<dl id="xvh3p"><noframes id="xvh3p">
<listing id="xvh3p"><noframes id="xvh3p"><listing id="xvh3p"><strike id="xvh3p"><listing id="xvh3p"></listing></strike></listing><th id="xvh3p"><strike id="xvh3p"><th id="xvh3p"></th></strike></th>
<th id="xvh3p"><strike id="xvh3p"></strike></th>
<dl id="xvh3p"><noframes id="xvh3p">
<th id="xvh3p"><noframes id="xvh3p">

观点

互联网+时代,说建站,谈运营与网络营销

织梦模板文档关键词维护中频率详解

时间:2020-12-15

首先解释下文档关键词维护中这个“频率”的意思。我们知道,织梦默认设置为30,很多朋友都将其看作是锚文本的链接数量。其实不然,这个频率只是表示关键词的热度,同动易系统的关键词权重等同。只是,织梦在这个地方处理的不好。所以,笔者建议最好不要改动。

  那么到底应该如何控制文档锚文本链接数量呢?系统 》系统基本参数 》其他选项 的最后一行。文档内容同一关键词替换次数(0为全部替换):1(1表示只链接第一个出现的目标关键词)。如图:

  

 

 

 

 

  说到这里,可能又会出现一个问题。比如我在后台设置了两个锚文本链接“SEO博客”、“SEO”,但文章第一次出现“SEO博客”这个词的时候,本来设想是应该链接到“SEO博客”所对应的页面,但是织梦默认设置为链接到“SEO”所对应的页面。那么,这种情况应该如何处理呢?

  解决方法(先备份)

  第一步:打开目录include中的arc.archivew.class.php

  找到function ReplaceKeyword($kw,&$body)代码,从这里然后一直到最下面。替换这段代码:

function ReplaceKeyword($kw,&$body)   {   global $cfg_cmspath;   $maxkey = 5;   $kws = explode(",",trim($kw)); //以分好为间隔符   $i=0;   $karr = $kaarr = $GLOBALS['replaced'] = array();   //暂时屏蔽超链接   $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/>";   //恢复超链接   $body = preg_replace("/(<a(.*))-\]-(.*)-\[-(\/a>)/isU", '\\1>\\3<\\4', $body);   //暂时屏蔽超链接   $body = preg_replace("/(<a(.*))(>)(.*)(<)(\/a>)/isU", '\\1-]-\\4-[-\\6', $body);   }   //恢复超链接   $body = preg_replace("/(<a(.*))-\]-(.*)-\[-(\/a>)/isU", '\\1>\\3<\\4', $body);   return $body;   }   }//End Archives   //高亮专用, 替换多次是可能不能达到最多次   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;   }

  进入后台生成,至此大功告成。

    0
    首页
    案例
    关于
    联系