//查询当前日期的信息 function ret_info($time) { global $empire,$dbtbpre; //格式化为当前0点 $this_0=strtotime(date('Y-m-d',$time)); //当天 23:59:59 $this_23=strtotime(date('Y-m-d',$time))+3600*23+60*59+59;
$sql=$empire->fetch1("select * from {$dbtbpre}ecms_news where newstime between '{$this_0}' and '{$this_23}'"); if(!$sql) { $time=$time-3600*24*7; ret_info(); } $str='<ul>'; $str_no=1; $sql2=$empire->query("select * from {$dbtbpre}ecms_news where newstime between '{$this_0}' and '{$this_23}' order by onclick desc limit 8"); while($r2=$empire->fetch($sql2)) { //查关联标题