",$listtemp); $listtemp=str_replace("[!--self.hotnews--]","",$listtemp); $listtemp=str_replace("[!--newnews--]","",$listtemp); $listtemp=str_replace("[!--self.newnews--]","",$listtemp); $listtemp=str_replace("[!--goodnews--]","",$listtemp); $listtemp=str_replace("[!--self.goodnews--]","",$listtemp); $listtemp=str_replace("[!--hotplnews--]","",$listtemp); $listtemp=str_replace("[!--self.hotplnews--]","",$listtemp); $listtemp=str_replace("[!--firstnews--]","",$listtemp); $listtemp=str_replace("[!--self.firstnews--]","",$listtemp); return $listtemp; } $link=db_connect(); $empire=new mysqlquery(); $editor=1; //变量处理 $page=(int)$_GET['page']; $start=(int)$_GET['start']; $classid=(int)$_GET['classid']; if(empty($classid)) { printerror("ErrorUrl","history.go(-1)"); } $search="&classid=".$classid; $page_line=16;//每页显示链接数 $line=$class_r[$classid]['lencord'];//每页显示记录数 $offset=$start+$page*$line;//总偏移量 $tbname=$class_r[$classid][tbname]; $modid=$class_r[$classid][modid]; if(empty($tbname)||empty($modid)) { printerror("ErrorUrl","history.go(-1)"); } //是否列表式 if(!($class_r[$classid][islist]||$class_r[$classid][islast])) { printerror("ErrorUrl","history.go(-1)"); } //终极类别 if($class_r[$classid][islast]) { $add.=" and classid='$classid'"; $have_class=0; } else { $where=ReturnClass($class_r[$classid][sonclass]); if(empty($where)) {$where="classid=0";} $add.=" and (".$where.")"; $have_class=1; } $pagetitle=$class_r[$classid]['classname']; //排序 if(empty($class_r[$classid][reorderf])) { $addorder=",newstime desc"; } else { $addorder=",".$class_r[$classid][reorderf]." ".$class_r[$classid][reorder]; } //栏目导航 $url="".ReturnClassLink($classid).""; $totalquery="select count(*) as total from phome_ecms_".$tbname." where checked=1".$add; $num=$empire->gettotal($totalquery); $query="select * from phome_ecms_".$tbname." where checked=1".$add; $query.=" order by istop desc".$addorder.",id desc limit $offset,$line"; $sql=$empire->query($query); $listpage=page1($num,$line,$page_line,$start,$page,$search); //取得模板 $tempr=$empire->fetch1("select temptext,subnews,listvar,rownum,showdate,modid,subtitle from phome_enewslisttemp where tempid='".$class_r[$classid]['listtempid']."'"); $listtemp=RepListInfoVars($tempr[temptext],$url,$pagetitle,$classid,$listpage); $rownum=$tempr[rownum]; if(empty($rownum)) {$rownum=1;} $formatdate=$tempr[showdate]; $subnews=$tempr[subnews]; $subtitle=$tempr[subtitle]; $modid=$tempr[modid]; $listvar=$tempr[listvar]; //字段 $ret_r=ReturnAddF($tempr[modid]); $field=$ret_r[0]; //取得列表模板 $list_exp="[!--empirenews.listtemp--]"; $list_r=explode($list_exp,$listtemp); $listtext=$list_r[1]; $no=$offset; $changerow=1; while($r=$empire->fetch($sql)) { //替换列表变量 $repvar=ReplaceListVars($no,$listvar,$subnews,$subtitle,$formatdate,$url,$have_class,$r,$field); $listtext=str_replace("",$repvar,$listtext); $changerow+=1; //超过行数 if($changerow>$rownum) { $changerow=1; $string.=$listtext; $listtext=$list_r[1]; } $no++; } db_close(); $empire=null; //多余数据 if($changerow<=$rownum&&$listtext<>$list_r[1]) { $string.=$listtext; } $string=$list_r[0].$string.$list_r[2]; echo stripSlashes($string); ?>