website/old_news.php

43 lines
1.5 KiB
PHP
Raw Normal View History

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
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-15 20:58:46 +00:00
$mydate = $yr . '-' . $mon;
$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';
$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));
}
} else {
2000-05-15 20:58:46 +00:00
newsItem ('now', 'Web Server', '<P>No news for this month!');
}
} else {
newsItem ('now', 'Web Server', '<P>No news in database!');
}
mysql_close ($conn);
} else {
newsItem ('Now', 'Web Server', '<P>Error: Could not connect to SQL server to fetch news. Please notify the server administrator.');
}
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
?>