123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158 |
- <?php
- require("../class/connect.php");
- require("../class/db_sql.php");
- require("../class/q_functions.php");
- require("../data/dbcache/class.php");
- $link=db_connect();
- $empire=new mysqlquery();
- define('WapPage','list');
- $usewapstyle='';
- $wapstyle=0;
- $pr=array();
- require("wapfun.php");
- //栏目ID
- $classid=(int)$_GET['classid'];
- $bclassid=(int)$_GET['bclassid'];
- if(!$classid||!$class_r[$classid]['tbname']||InfoIsInTable($class_r[$classid]['tbname']))
- {
- DoWapShowMsg('您来自的链接不存在','index.php?style='.$wapstyle);
- }
- $cr=$empire->fetch1("select classid,classpagekey,intro,classimg,cgroupid,islist,bdinfoid,islast,infos,addsql,wapstyleid,wapislist from {$dbtbpre}enewsclass where classid='$classid'");
- if(!$cr['classid'])
- {
- DoWapShowMsg('您来自的链接不存在','index.php?style='.$wapstyle);
- }
- $GLOBALS['navclassid']=$classid;
- $pagetitle=$class_r[$classid]['classname'];
- $pagekey=$cr['classpagekey'];
- $pagedes=$cr['intro'];
- $classimg=$cr['classimg']?$cr['classimg']:$public_r[newsurl].'e/data/images/notimg.gif';
- //权限
- if($cr['cgroupid'])
- {
- DoWapShowMsg('您来自的链接不存在','index.php?style='.$wapstyle);
- }
- //封面式
- $waptempfile='';
- if($cr['wapislist']==1)//封面
- {
- //参数
- $ecmsvar_mbr=array();
- $ecmsvar_mbr['wapstyle']=$wapstyle;
- $ecmsvar_mbr['fbclassid']=$bclassid;
- $ecmsvar_mbr['fclassid']=$classid;
- $ecmsvar_mbr['fcpage']=0;
- $ecmsvar_mbr['urladdcs']=ewap_UrlAddCs();
- $waptempfile='template/'.$usewapstyle.'/cpage.temp.php';
- if(file_exists($waptempfile))
- {
- include($waptempfile);
- db_close();
- $empire=null;
- exit();
- }
- }
- elseif($cr['wapislist']==2)//页面
- {
- //参数
- $ecmsvar_mbr=array();
- $ecmsvar_mbr['wapstyle']=$wapstyle;
- $ecmsvar_mbr['fbclassid']=$bclassid;
- $ecmsvar_mbr['fclassid']=$classid;
- $ecmsvar_mbr['fcpage']=0;
- $ecmsvar_mbr['urladdcs']=ewap_UrlAddCs();
- $waptempfile='template/'.$usewapstyle.'/c'.$classid.'.php';
- if(file_exists($waptempfile))
- {
- include($waptempfile);
- db_close();
- $empire=null;
- exit();
- }
- }
- else//列表
- {
- $waptempfile='template/'.$usewapstyle.'/list.temp.php';
- if(!file_exists($waptempfile))
- {
- db_close();
- $empire=null;
- exit();
- }
- }
- $search='';
- $add='';
- if($class_r[$classid]['islast'])
- {
- $add.="classid='$classid'";
- }
- else
- {
- $where=ReturnClass($class_r[$classid][sonclass]);
- $add.="(".$where.")";
- }
- $modid=$class_r[$classid][modid];
- //优化
- $yhid=$class_r[$classid][yhid];
- $yhvar='qlist';
- $yhadd='';
- if($yhid)
- {
- $yhadd=ReturnYhSql($yhid,$yhvar,1);
- }
- $search.="&classid=$classid&style=$wapstyle&bclassid=$bclassid";
- $page=intval($_GET['page']);
- $page=RepPIntvar($page);
- $line=$pr['waplistnum'];//每页显示记录数
- $offset=$page*$line;
- $query="select ".ReturnSqlListF($modid)." from {$dbtbpre}ecms_".$class_r[$classid]['tbname']." where ".$yhadd.$add;
- $totalnum=intval($_GET['totalnum']);
- if(!$public_r['usetotalnum'])
- {
- $totalnum=0;
- }
- if($totalnum<1)
- {
- $totalquery="select count(*) as total from {$dbtbpre}ecms_".$class_r[$classid]['tbname']." where ".$yhadd.$add;
- $num=$empire->gettotal($totalquery);//取得总条数
- }
- else
- {
- $num=$totalnum;
- }
- if($public_r['usetotalnum'])
- {
- $search.="&totalnum=$num";
- }
- //checkpageno
- eCheckListPageNo($page,$line,$num);
- //排序
- if(empty($class_r[$classid][reorder]))
- {
- $addorder="newstime desc";
- }
- else
- {
- $addorder=$class_r[$classid][reorder];
- }
- $query.=" order by ".ReturnSetTopSql('list').$addorder." limit $offset,$line";
- $sql=$empire->query($query);
- $returnpage=DoWapListPage($num,$line,$page,$search);
- //系统模型
- $ret_r=ReturnAddF($modid,2);
- //参数
- $ecmsvar_mbr=array();
- $ecmsvar_mbr['wapstyle']=$wapstyle;
- $ecmsvar_mbr['fbclassid']=$bclassid;
- $ecmsvar_mbr['fclassid']=$classid;
- $ecmsvar_mbr['fcpage']=$page;
- $ecmsvar_mbr['urladdcs']=ewap_UrlAddCs();
- require('template/'.$usewapstyle.'/list.temp.php');
- db_close();
- $empire=null;
- ?>
|