",$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)htmlspecialchars($_GET['page']);
$start=(int)htmlspecialchars($_GET['start']);
$classid=(int)htmlspecialchars($_GET['classid']);
if(empty($classid))
{
printerror("ErrorUrl","history.go(-1)",1);
}
$search="&classid=".$classid;
$page_line=16;//每页显示链接数
$line=$class_r[$classid]['lencord'];//每页显示记录数
$offset=$start+$page*$line;//总偏移量
$add="";
$tbname=$class_r[$classid][tbname];
$modid=$class_r[$classid][modid];
if(empty($tbname)||empty($modid))
{
printerror("ErrorUrl","history.go(-1)",1);
}
//是否列表式
/*
if(!($class_r[$classid][islist]||$class_r[$classid][islast]))
{
printerror("ErrorUrl","history.go(-1)",1);
}
*/
if(!($class_r[$classid]['listtempid']||$class_r[$classid]['dtlisttempid']))
{
printerror("ErrorUrl","history.go(-1)",1);
}
//系统模型
$ret_r=ReturnAddF($modid,2);
//终极栏目
if($class_r[$classid][islast])
{
$add.=" and classid='$classid'";
$have_class=0;
}
else
{
$where=ReturnClass($class_r[$classid][sonclass]);
$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];
}
//附加项
if(!empty($ret_r['listandf'])&&$_GET['ph']==1)
{
$andor=$_GET['andor']=='or'?'or':'and';
$search.="&ph=1&andor=".$andor;
$listandf="";
$andr=explode(",",$ret_r['listandf']);
$count=count($andr);
for($i=1;$i<$count-1;$i++)
{
$andval=$_GET[$andr[$i]];
if(!empty($andval))
{
$doandor=empty($listandf)?'':' '.$andor.' ';
if(empty($ret_r['setandf']))
{
$listandf.=$doandor.$andr[$i]."='".RepPostVar2($andval)."'";
}
else
{
$listandf.=$doandor.$andr[$i]." like '%".RepPostVar2($andval)."%'";
}
$search.="&".$andr[$i]."=$andval";
}
}
if($listandf)
{
$add.=' and ('.$listandf.')';
}
}
//栏目导航
$url="".ReturnClassLink($classid)."";
//总数
$totalnum=(int)htmlspecialchars($_GET['totalnum']);
if(empty($totalnum))
{
$totalquery="select count(*) as total from {$dbtbpre}ecms_".$tbname." where checked=1".$add;
$num=$empire->gettotal($totalquery);
}
else
{
$num=$totalnum;
}
$search.="&totalnum=".$num;
$query="select * from {$dbtbpre}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);
//取得模板
$listtempid=$class_r[$classid]['dtlisttempid']?$class_r[$classid]['dtlisttempid']:$class_r[$classid]['listtempid'];
$tempr=$empire->fetch1("select temptext,subnews,listvar,rownum,showdate,modid,subtitle from ".GetTemptb("enewslisttemp")." where tempid='".$listtempid."'");
//公共变量
if($public_r['searchtempvar'])
{
$tempr[temptext]=ReplaceTempvar($tempr[temptext]);
}
$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];
//取得列表模板
$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,$ret_r);
$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);
?>