function wenzhangnumber($sort){
$fenlei = isset($sort)?$sort:0;
$timestamp = time() + 28800;//获得当前日期,得到当天零点的时间戳,28800是8个小时的时区
$n_year = gmdate("Y", $timestamp);
$n_month = gmdate("m", $timestamp);
$n_day = gmdate("d", $timestamp);
$shijianchuo = gmmktime(0,0,0,$n_month,$n_day,$n_year);
$shijianchuo = $shijianchuo - 28800;
$DB = MySql::getInstance();
$sql = "SELECT * FROM ".DB_PREFIX."blog WHERE date >=$shijianchuo AND type = 'blog' AND sortid=$fenlei AND hide = 'n'";
$result = $DB->query($sql);
return mysql_num_rows($result);
}
?>
调用方法 分类ID不填的话获取的是未分类的文章数.