function tpure_GetDayPostNum($d = null){
global $zbp;
$tz = strtotime(date("Y-m-d"),time());
$db = $zbp->db->sql->get();
$sql = $db->select($zbp->table['Post'])->where(array(array('=','log_Status','0'),array('>=','log_PostTime',$tz)))->sql;
$array_c = $zbp->GetCommentList('*', array(array('=', 'comm_IsChecking', 0),array('>=','comm_PostTime',$tz)));
if($d == 'yesterday'){
$tzy = strtotime(date("Y-m-d"),time())-86400;
$sql = $db->select($zbp->table['Post'])->where(array(array('=','log_Status','0'),array('>=','log_PostTime',$tzy),array('<','log_PostTime',$tz)))->sql;
$array_c = $zbp->GetCommentList('*', array(array('=', 'comm_IsChecking', 0),array('>=','comm_PostTime',$tzy),array('<','comm_PostTime',$tz)));
}
$array_a = $zbp->GetListType('Post', $sql);
return count($array_a)+count($array_c);
}
今日文章数量:{tpure_GetDayPostNum()}
昨日文章数量:{tpure_GetDayPostNum(yesterday)}
阅读全文