include("/home/onebee/porter/phplib/connect.inc"); include_once("$libdir/log.inc"); include("$incdir/site-top.inc"); if($_GET["id"]){ $sql = "select a.id,a.title,b.body from article a left join articlevar b on b.id=a.id left join articletosection a2s on a2s.articleid=a.id where a.id='$_GET[id]' and a.date <= curdate() and a.date <= curdate() and a2s.sectionid=1"; } else { $sql = "select a.id,a.title,b.body from article a left join articlevar b on b.id=a.id left join articletosection a2s on a2s.articleid=a.id where a.date <= curdate() and a2s.sectionid=1 order by a.date desc limit 1"; } $res = mysql_query($sql); if(mysql_numrows($res)){ $_ARTICLE = mysql_fetch_array($res); logWrite('art',$_ARTICLE["id"]); } else { print "Error."; exit; } ?>
|
|