dedecms統(tǒng)計欄目文章數(shù)量實(shí)現(xiàn)代碼修訂版
更新時間:2008年03月23日 18:11:11 作者:
以下的實(shí)現(xiàn)辦法為修訂的方法,可實(shí)現(xiàn)任意指定欄目的文章數(shù)量統(tǒng)計,包括最終列表欄目和含有子欄目的欄目。
修改include/inc_functions.php文件
function GetTotalArc($typeid){
$dsql = new DedeSql(false);
if(!empty($typeid))
{
$reids = explode(",",$typeid);
$ridnum = count($reids);
if($ridnum>1){
$tpsql = "";
for($i=0;$i<$ridnum;$i++){
if($tpsql=="") $tpsql .= " And (".TypeGetSunID($reids[$i],$dsql,'');
else $tpsql .= " Or ".TypeGetSunID($reids[$i],$dsql,'');
}
$tpsql .= ") ";
$orwhere .= $tpsql;
unset($tpsql);
}else{
$orwhere .= " And ".TypeGetSunID($typeid,$dsql,'');
}
unset($reids);
}
$row = $dsql->GetOne("Select count(ID) as dd From #@__archives where typeid>0 $orwhere");
return $row['dd'];
}
調(diào)用方法
[field:id function='GetTotalArc(@me)'/]
復(fù)制代碼 代碼如下:
function GetTotalArc($typeid){
$dsql = new DedeSql(false);
if(!empty($typeid))
{
$reids = explode(",",$typeid);
$ridnum = count($reids);
if($ridnum>1){
$tpsql = "";
for($i=0;$i<$ridnum;$i++){
if($tpsql=="") $tpsql .= " And (".TypeGetSunID($reids[$i],$dsql,'');
else $tpsql .= " Or ".TypeGetSunID($reids[$i],$dsql,'');
}
$tpsql .= ") ";
$orwhere .= $tpsql;
unset($tpsql);
}else{
$orwhere .= " And ".TypeGetSunID($typeid,$dsql,'');
}
unset($reids);
}
$row = $dsql->GetOne("Select count(ID) as dd From #@__archives where typeid>0 $orwhere");
return $row['dd'];
}
調(diào)用方法
復(fù)制代碼 代碼如下:
[field:id function='GetTotalArc(@me)'/]
相關(guān)文章
DeDecms中利用關(guān)鍵詞實(shí)現(xiàn)簡單tag功能的php代碼
此方法的思路是直接調(diào)用dedecms每篇文章的關(guān)鍵詞,以此作為tag標(biāo)簽,在通過模板的編程為每個關(guān)鍵詞增加搜索鏈接,好處即為無需修改程序即可實(shí)現(xiàn)簡單的tag標(biāo)簽功能,實(shí)現(xiàn)方法參考如下:2008-03-03dedecms v5.1 WriteBookText() code injection vul注入漏洞
來源:Ph4nt0m Google Group by Flyh4t@126.com QQ:3783679422008-05-05Dedecms模板常用調(diào)用標(biāo)簽代碼整理
因?yàn)橐恢庇玫絛edecms的模板,特把經(jīng)常用到的調(diào)用標(biāo)簽代碼整理如下2008-05-05dedecms統(tǒng)計欄目文章數(shù)量實(shí)現(xiàn)代碼修訂版
以下的實(shí)現(xiàn)辦法為修訂的方法,可實(shí)現(xiàn)任意指定欄目的文章數(shù)量統(tǒng)計,包括最終列表欄目和含有子欄目的欄目。2008-03-03DEDECMS TAG偽靜態(tài) IIS_rewrite配置方法附rewrite下載
使dedecms出現(xiàn)的偽靜態(tài)效果實(shí)現(xiàn)代碼2008-10-10