隨機(jī)顏色隨機(jī)大小tags的修改方法_DedeCms教程
打開:inc_channel_unit_functions.php
找到函數(shù):
function GetHotKeywords(
.
.
.
)
替換為:
//zouql-hotwords-b:
//用法舉例:
//調(diào)用熱門tags{dede:hotwords num='30' subday='30' istag='yes' /}
//熱門搜索{dede:hotwords num='30' subday='30' istag='no' /}
function GetHotKeywords($dsql,$num=8,$nday=365,$klen=16,$orderby='count',$istag='no'){
global $cfg_phpurl;
$nowtime = mytime();
$num = ereg_replace("[^0-9]","",$num);
$nday = ereg_replace("[^0-9]","",$nday);
$klen = ereg_replace("[^0-9]","",$klen);
if(empty($nday)) $nday = 365;
if(empty($num)) $num = 6;
if(empty($klen)) $klen = 16;
if(empty($istag)) $istag = 'no';
$klen = $klen+1;
$mintime = $nowtime - ($nday * 24 * 3600);
if(empty($orderby)) $orderby = 'count';
if($istag=='no'){
$dsql->SetQuery("Select keyword From dede_search_keywords where lasttime>$mintime And length(keyword)<$klen order by $orderby desc limit 0,$num");
}
elseif($istag=='yes'){
$dsql->SetQuery("Select keyword,result,count From dede_search_keywords where lasttime>$mintime And istag=1 And length(keyword)<$klen order by $orderby desc limit 0,$num");
}
$dsql->Execute('hw');
$hotword = "";
if($istag=='no'){
while($row=$dsql->GetArray('hw')){
$hotword .= " <a href="".$cfg_phpurl."/search.php?keyword=".urlencode($row['keyword'])."&searchtype=titlekeyword" target="_blank">".$row['keyword']."</a> ";
}
}
elseif($istag=='yes'){
while($row=$dsql->GetArray('hw')){
$hotword .= " <a href="".$cfg_phpurl."/search.php?keyword=".urlencode($row['keyword'])."&searchtype=titlekeyword" target="_blank" style=" font-size:".rand(14,20)."px;".rand_color()."" title="共".$row['result']."篇文章 搜索".$row['count']."次">".$row['keyword']."</a> ";
}
}
return $hotword;
}
//zouql-hotwords-e
//zouql-rcolor
function rcolor() {
srand((double)microtime()*10000000);
$rand = (rand(15,235));
return sprintf("%02X","$rand");
}
function rand_color() {
$return = 'color:#'.rcolor().rcolor().rcolor();
return $return;
}
//zouql-rcolor
----------------------------------------------------
打開:inc_arcpart_view.php
找到
GetHotKeywords($this->dsql,$ctag->GetAtt('num'),$ctag->GetAtt('subday'),$ctag->GetAtt('maxlength'),$ctag->GetAtt('orderby')));
改為
GetHotKeywords($this->dsql,$ctag->GetAtt('num'),$ctag->GetAtt('subday'),$ctag->GetAtt('maxlength'),$ctag->GetAtt('orderby'),$ctag->GetAtt('istag')));
其他的地方如需要調(diào)用可以自己改相對應(yīng)的,做第二步即可
- Dedecms生成百度地圖圖文教程
- 織夢dedecms生成下拉式友情鏈接列表
- DEDECMS使用拼音首字母做欄目名稱
- 織夢DEDECMS站群增強(qiáng)版 DedeCMS搭建站群首選
- DedeCMS Error:Tag disabled:php錯誤的完整處理方法
- dedecms編碼轉(zhuǎn)換方法 gbk轉(zhuǎn)UTF-8,UTF-8轉(zhuǎn)GBK
- 防XSS,sql注射,代碼執(zhí)行,文件包含的通用代碼
- DedeCms教程:優(yōu)化DedeCMS搜索結(jié)果
- DedeCms教程:Linux+Apache+PHP+MySQL服務(wù)器環(huán)境(CentOS篇)
- DedeCms教程:LuManager服務(wù)器管理軟件安裝DEDECMS軟件
- DedeCms教程:Ubuntu/Debian上安裝 PHP 5.3, Nginx 和 PHP-fpm
- DedeCms教程:windows server 2003 php 環(huán)境搭建
DedeCms教程教程Rss訂閱Cms教程搜索
DedeCms教程推薦
- DedeCMS Error:Tag disabled:php錯誤的完整處理方法
- 【Pagebreak 標(biāo)記使用實(shí)例】-DedeCMS模板制作使用實(shí)例教程(13)
- 新建目錄為411權(quán)限
- 【Autochannel 標(biāo)記使用實(shí)例】-DedeCMS模板制作使用實(shí)例教程(5)
- 增加父欄目調(diào)用,以及多級支持currentstyle!
- 時區(qū)和更新列表無法生成最后一頁的解決方法
- 讓field:title 標(biāo)題突破30這個長度,修改代碼的方法
- 【Arclist 標(biāo)記使用實(shí)例】-DedeCMS模板制作使用實(shí)例教程(1)
- 讓游客也能發(fā)布分類信息
- 如何利用二行代碼解決全部網(wǎng)頁木馬(含iframe/script木馬)
- 相關(guān)鏈接:
復(fù)制本頁鏈接| 搜索隨機(jī)顏色隨機(jī)大小tags的修改方法| DedeCms模板| Dede模板| 織夢模板| dedecms
- 教程說明:
DedeCms教程-隨機(jī)顏色隨機(jī)大小tags的修改方法。