schalltemp.txt 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. <?php
  2. require("../class/connect.php");
  3. if(!defined('InEmpireCMS'))
  4. {
  5. exit();
  6. }
  7. require("../class/db_sql.php");
  8. require("../data/dbcache/class.php");
  9. require LoadLang("pub/fun.php");
  10. require("../class/schallfun.php");
  11. $link=db_connect();
  12. $empire=new mysqlquery();
  13. eCheckCloseMods('sch');//关闭模块
  14. $searchtime=time();
  15. $totalnum=(int)$_GET['totalnum'];
  16. $sear=(int)$_GET['sear'];
  17. if(!$public_r['usetotalnum'])
  18. {
  19. $totalnum=0;
  20. }
  21. $firstsearch=0;
  22. if($sear<1)
  23. {
  24. $firstsearch=1;
  25. //搜索间隔
  26. $lastsearchtime=(int)getcvar('lastschalltime');
  27. if($lastsearchtime)
  28. {
  29. if($searchtime-$lastsearchtime<$public_r[schalltime])
  30. {
  31. printerror('SchallOutTime','',1);
  32. }
  33. }
  34. //设置最后搜索时间
  35. esetcookie('lastschalltime',$searchtime,$searchtime+3600*24);
  36. }
  37. $page=(int)$_GET['page'];
  38. $page=RepPIntvar($page);
  39. $start=0;
  40. $page_line=$public_r['schallpagenum'];//每页显示链接数
  41. $line=$public_r['schallnum'];//每页显示记录数
  42. $offset=$start+$page*$line;//总偏移量
  43. //编码
  44. $iconv='';
  45. $char='';
  46. $targetchar='';
  47. if($ecms_config['sets']['pagechar']!='gb2312')
  48. {
  49. include_once(ECMS_PATH.'e/class/doiconv.php');
  50. $iconv=new Chinese('');
  51. $char=$ecms_config['sets']['pagechar']=='big5'?'BIG5':'UTF8';
  52. $targetchar='GB2312';
  53. }
  54. $schallr=ReturnSearchAllSql($_GET);
  55. require("../data/dbcache/SearchAllTb.php");
  56. $keyboard=$schallr['keyboard'];
  57. $query="select id,classid from {$dbtbpre}enewssearchall where ".$schallr['where'];
  58. if($totalnum<1)
  59. {
  60. $totalquery="select count(*) as total from {$dbtbpre}enewssearchall where ".$schallr['where'];
  61. $num=$empire->gettotal($totalquery);
  62. if(empty($num))
  63. {
  64. printerror('SchallNotRecord','',1);
  65. }
  66. }
  67. else
  68. {
  69. $num=$totalnum;
  70. }
  71. $search=$schallr['search'].'&sear=1';
  72. if($public_r['usetotalnum'])
  73. {
  74. $search.='&totalnum='.$num;
  75. }
  76. //checkpageno
  77. eCheckListPageNo($page,$line,$num);
  78. $query.=" order by infotime desc limit $offset,$line";
  79. $sql=$empire->query($query);
  80. $listpage=page1($num,$line,$page_line,$start,$page,$search);
  81. $url="<a href='".ReturnSiteIndexUrl()."'>".$fun_r['index']."</a>&nbsp;>&nbsp;".$fun_r['SearchAllNav'];
  82. ?>
  83. <!--empire.listtemp.top-->
  84. <?php
  85. $no=$offset;
  86. $subnum=<!--empire.listtemp.subnum-->;
  87. $formatdate="<!--empire.listtemp.formatdate-->";
  88. while($r=$empire->fetch($sql))
  89. {
  90. $tbname=$class_r[$r[classid]]['tbname'];
  91. if(empty($tbname))
  92. {
  93. continue;
  94. }
  95. $titlefield=$schalltb_r[$tbname]['titlefield'];
  96. $smalltextfield=$schalltb_r[$tbname]['smalltextfield'];
  97. $infor=$empire->fetch1("select id,classid,titlepic,newstime,isurl,titleurl,".$titlefield.",".$smalltextfield." from {$dbtbpre}ecms_".$tbname." where id='$r[id]' limit 1");
  98. if(empty($infor['id']))
  99. {
  100. continue;
  101. }
  102. $no++;
  103. $titleurl=sys_ReturnBqTitleLink($infor);
  104. $titlepic=$infor['titlepic']?$infor['titlepic']:$public_r['newsurl']."e/data/images/notimg.gif";
  105. $smalltext=SubSchallSmalltext($infor[$smalltextfield],$subnum);
  106. $title=DoReplaceFontRed($infor[$titlefield],$keyboard);
  107. $smalltext=DoReplaceFontRed($smalltext,$keyboard);
  108. $newstime=date($formatdate,$infor['newstime']);
  109. ?>
  110. <!--empire.listtemp.center-->
  111. <?php
  112. }
  113. db_close();
  114. $empire=null;
  115. ?>
  116. <!--empire.listtemp.footer-->