设置DEDECMS的搜索伪静态的方法

天外飘仙 2010-11-24 网络 天外飘仙

大家都知道dedecms设置伪静态比较容易,这个我们不少的站长都进行过尝试,但设置DEDECMS的搜索伪静态却没有进行过尝试,今天就设置搜索伪静态及显示热门搜索词的方法进行小结。

1、DEDECMS搜索伪静态的方法。

RewriteEngine On
RewriteBase /
RewriteRule ^tags/(.+)/$ /plus/search.php?kwtype=0&keyword=$1&searchtype=titlekeyword

2、单页显示显示热门搜索词和搜索次数的方法

把下面的代码保存到index.php中,当然可以其他的名字

<?php

require_once(dirname(__FILE__).'/../include/common.inc.php');

global $cfg_mainsite,$cfg_plus_dir;

$cfg_phpurl = $cfg_mainsite.$cfg_plus_dir;

$dsql = new DedeSql(false);

$dsql->SetQuery("Select keyword,result From dede_search_keywords order by result desc limit 0,100");

$dsql->Execute('hw');

$hotword = "";

while($row=$dsql->GetArray('hw')){

 if($row['istag']==1) $hotword .= "

责任编辑:天外飘仙