您现在的位置是:网站首页> 编程资料编程资料
dedecms统计栏目文章数量实现代码修订版_dedecms_
2023-05-27
255人已围观
简介 dedecms统计栏目文章数量实现代码修订版_dedecms_
修改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'];
}
调用方法
[field:id function='GetTotalArc(@me)'/]
复制代码 代码如下:
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'];
}
调用方法
复制代码 代码如下:
[field:id function='GetTotalArc(@me)'/]
相关内容
- DeDecms中实现更漂亮整齐的缩略图的实现代码_dedecms_
- 实现dedecms图集单击图片翻页的功能_dedecms_
- dedecms实现仿downkr的sitemap效果代码_dedecms_
- dedecms 自由列表调用代码_dedecms_
- 实现dedecms图集单击图片翻页的功能_整站程序_
- 科汛V4.5伪静态的实现正则规则_科讯相关_
- kesion 科讯不用登录实现digg的修改方法_科讯相关_
- 动易开源PowerEasy® SiteWeaver™ 6.5系列产品发布免费下载了[原创]_整站程序_
- DEDE 4.0 自动采集源文件 提供了_整站程序_
- 全面优化V4.0及AJAX标签使用技巧_科讯相关_