if (((!is_int($yr)) || $yr < 2000)) $yr = date('Y',time()); if ($mon < 1 || $mon > 12) $mon = date('m',time()); $pageName = 'News: '. date("F, Y", mktime(0,0,0,$mon+1,0,$yr,0)); $focused = "none"; require("parts/preamble.php"); // Load most of document need ('date sql'); require ("news_funcs.php"); echo '
';
tableBoxHeader( 'black', tableHeadColor );
tableTitle( $pageName, 1, tableHeadColor );
$mydate = $yr . '-' . $mon;
$conn = mysql_pconnect (sqlHost, sqlUser, sqlPass);
if ($conn) {
$query = 'SELECT n_date, n_user, n_news FROM news_main WHERE '.
'n_date BETWEEN \'' . $mydate . '-00 00:00:00\' AND '.
'\'' . $mydate . '-31 23:59:59\'' .
' ORDER BY n_date DESC';
$result = mysql_db_query (sqlDB, $query, $conn);
if ($result) {
$numRows = mysql_num_rows ($result);
if ($numRows) {
for ($i = 0 ; $i < $numRows ; $i++) {
list ($n_date, $n_user, $n_news) = mysql_fetch_row ($result);
newsItem (dateFromSQLDateTime ($n_date), $n_user, StripSlashes($n_news));
}
} else {
newsItem ('now', 'Web Server', ' No news for this month!'); } } else { newsItem ('now', 'Web Server', ' No news in database!'); } mysql_close ($conn); } else { newsItem ('Now', 'Web Server', ' Error: Could not connect to SQL server to fetch news. Please notify the server administrator.'); } tableBoxFooter(); echo ' |