2000-03-20 05:30:19 +00:00
|
|
|
<?
|
2000-05-15 20:58:46 +00:00
|
|
|
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
|
|
|
|
|
2000-05-10 22:38:21 +00:00
|
|
|
need ('date sql');
|
2000-05-15 20:58:46 +00:00
|
|
|
require ("news_funcs.php");
|
|
|
|
echo '<TABLE width="100%" cellSpacing="0" cellPadding="0" border="0"> <TR vAlign="top"> <TD colSpan="2">';
|
|
|
|
tableBoxHeader( 'black', tableHeadColor );
|
|
|
|
tableTitle( $pageName, 1, tableHeadColor );
|
2000-05-10 22:38:21 +00:00
|
|
|
|
2000-05-15 20:58:46 +00:00
|
|
|
$mydate = $yr . '-' . $mon;
|
2000-05-10 22:38:21 +00:00
|
|
|
$conn = mysql_pconnect (sqlHost, sqlUser, sqlPass);
|
|
|
|
if ($conn) {
|
2000-05-15 20:58:46 +00:00
|
|
|
$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';
|
2000-05-10 22:38:21 +00:00
|
|
|
$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);
|
2000-05-13 22:08:03 +00:00
|
|
|
newsItem (dateFromSQLDateTime ($n_date), $n_user, StripSlashes($n_news));
|
2000-05-06 03:11:24 +00:00
|
|
|
}
|
|
|
|
} else {
|
2000-05-15 20:58:46 +00:00
|
|
|
newsItem ('now', 'Web Server', '<P>No news for this month!');
|
2000-05-06 03:11:24 +00:00
|
|
|
}
|
|
|
|
} else {
|
2000-05-10 22:38:21 +00:00
|
|
|
newsItem ('now', 'Web Server', '<P>No news in database!');
|
2000-05-06 03:11:24 +00:00
|
|
|
}
|
2000-05-10 22:38:21 +00:00
|
|
|
mysql_close ($conn);
|
2000-05-06 03:11:24 +00:00
|
|
|
} else {
|
2000-05-10 22:38:21 +00:00
|
|
|
newsItem ('Now', 'Web Server', '<P>Error: Could not connect to SQL server to fetch news. Please notify the server administrator.');
|
2000-05-06 03:11:24 +00:00
|
|
|
}
|
2000-05-15 20:58:46 +00:00
|
|
|
tableBoxFooter();
|
|
|
|
echo '</TD></TR></TABLE>';
|
|
|
|
require("parts/postamble.php");
|
2000-03-20 05:30:19 +00:00
|
|
|
?>
|