foreach($kws as $k){$k = trim($k);if($k!=”"){if($i > $maxkey){break;}$myrow = $this->dsql->GetOne(“select * from dede_keywords where keyword=’$k’ And rpurl<>” “);if(is_array($myrow)){$karr[] = $k;$GLOBALS['replaced'][$k] = 0;$kaarr[] = “$k”;}$i++;}}把他替换成:
$dsql = new DedeSql(false);$query=”select * from dede_keywords where rpurl<>” “;$dsql->SetQuery($query);$dsql->Execute();while($row = $dsql->GetArray()){$key = trim($row['keyword']);$rul=trim($row['rpurl']);if($rul!=”")if(!in_array($key, $kw))if(!in_array($kw,$key))if(substr_count($body,$key)<10){$karr[] = $key;$kaarr[] = “$key”;}}注: 1、后台>系统>系统基本参数>其他选项>文档内容同一关键词替换次数(0为全部替换): 1(视情况修改,不宜太多) 2、if(substr_count($body,$key)<5) (关键词链接个数)
新闻热点
疑难解答