fetch1("select tbname,qmname,sonclass from {$dbtbpre}enewsmod where mid='$mid'"); if(!$mr['tbname']||InfoIsInTable($mr['tbname'])) { printerror("ErrorUrl","",1); } $yhid=$etable_r[$mr[tbname]][yhid]; $search.="&userid=$userid&mid=$mid"; //用户 $add="userid='$userid'"; //显示方式 if($public_r['qlistinfomod']) { $modnum=$empire->gettotal("select count(*) as total from {$dbtbpre}enewsmod where tbname='$mr[tbname]'"); if($modnum>1) { $add.=' and ('.ReturnClass($mr['sonclass']).')'; } } //栏目 $classid=intval($_GET['classid']); if($classid) { if($class_r[$classid][islast]) { $add.=" and classid='$classid'"; } else { $add.=' and '.ReturnClass($class_r[$classid][sonclass]); } $yhid=$class_r[$classid][yhid]; $search.="&classid=$classid"; } //优化 $yhadd=''; if($yhid) { $yhadd=ReturnYhSql($yhid,$yhvar,1); } $start=0; $page=intval($_GET['page']); $page=RepPIntvar($page); $line=$public_r['space_num'];//每行显示 $page_line=10; $offset=$page*$line; $query="select ".ReturnSqlListF($mid)." from {$dbtbpre}ecms_".$mr['tbname']." where ".$yhadd.$add." and ismember=1"; $totalquery="select count(*) as total from {$dbtbpre}ecms_".$mr['tbname']." where ".$yhadd.$add." and ismember=1"; $totalnum=intval($_GET['totalnum']); if(!$public_r['usetotalnum']) { $totalnum=0; } if($totalnum<1) { $num=$empire->gettotal($totalquery);//取得总条数 } else { $num=$totalnum; } if($public_r['usetotalnum']) { $search.="&totalnum=$num"; } //checkpageno eCheckListPageNo($page,$line,$num); $query.=" order by newstime desc limit $offset,$line"; $sql=$empire->query($query); $returnpage=page1($num,$line,$page_line,$start,$page,$search); require('template/'.$spacestyle.'/list.temp.php'); db_close(); $empire=null; ?>