源码网商城,靠谱的源码在线交易网站 我的订单 购物车 帮助

源码网商城

dedecms统计栏目文章数量实现代码修订版

  • 时间:2022-11-01 04:08 编辑: 来源: 阅读:
  • 扫一扫,手机访问
摘要:dedecms统计栏目文章数量实现代码修订版
修改include/inc_functions.php文件
[u]复制代码[/u] 代码如下:
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'];  } 
调用方法
[u]复制代码[/u] 代码如下:
[field:id function='GetTotalArc(@me)'/] 
  • 全部评论(0)
联系客服
客服电话:
400-000-3129
微信版

扫一扫进微信版
返回顶部