$total_sql = "SELECT COUNT(id) as num FROM `archives` $typesql3 ";
$temp = $dsql->GetOne($total_sql);
$total = 0;//数据总数
$load_num =0;
if(is_array($temp)){
$load_num= round(($temp['num']-$pagesize)/$pagesize);//要加载的次数,因为默认已经加载了
$total = $temp['num'];
}
//print_r($total);exit;
if($orderby==1){//新
$sql = "SELECT a.*,t.typedir,t.typename,t.isdefault,t.defaultname,t.namerule,
t.namerule2,t.ispart, t.moresite,t.siteurl,t.sitepath
FROM `archives` as a JOIN `arctype` AS t ON a.typeid=t.id $typesql ORDER BY a.id DESC LIMIT $start,$pagesize";
}else{//热门
$sql = "SELECT a.*,t.typedir,t.typename,t.isdefault,t.defaultname,t.namerule,
t.namerule2,t.ispart, t.moresite,t.siteurl,t.sitepath
FROM `archives` as a JOIN `arctype` AS t ON a.typeid=t.id $typesql ORDER BY a.click DESC LIMIT $start,$pagesize";
}
//echo "$sql";exit;
$dsql->SetQuery($sql);//
$dsql->Execute('list');//die(mysql_error());
$statu = 0;//是否有数据,默认没有数据
$data = array();
$index = 0;
while($row = $dsql->GetArray("list")){
$row['info'] = $row['info'] = $row['infos'] = cn_substr($row['description'],250);