'$Y/$M/$D 06:00:00' ORDER BY g.regdate DESC"; $result = mysql_db_query(DBNAME,$sql,DBC); while($l = mysql_fetch_array($result)){ $list[]=$l; } $sm->assign("LIST",$list); } if($mode=="info"){ $list=Array(); $sql = "SELECT i.*,s.name,s.url FROM `".DBHEADER."info` i INNER JOIN `".DBHEADER."shop` s ON(i.shopid=s.shopid) WHERE i.lastdate>'$Y/$M/$D 06:00:00' ORDER BY i.regdate DESC"; $result = mysql_db_query(DBNAME,$sql,DBC); while($l = mysql_fetch_array($result)){ $list[]=$l; } $sm->assign("LIST",$list); } if($mode=="shop"){ /* $D=date("d"); $d=file_get_contents(DOCUMENT_ROOT."shopdate"); if($D<>$d){ $sql = "UPDATE `".DBHEADER."shop` SET orderby=rand() WHERE enabled=1"; @mysql_db_query(DBNAME,$sql,DBC); file_put_contents("./shopdate",$D); } */ $list=Array(); $sql = "SELECT *,rand() AS rands FROM `".DBHEADER."shop` WHERE enabled=1 ORDER BY rands"; $result = @mysql_db_query(DBNAME,$sql,DBC); while($l=@mysql_fetch_array($result)){ $list[]=$l; } $sm->assign("LIST",$list); } $sm->Display($tpl); ?>