2000-03-20 05:41:28 +00:00
|
|
|
<?
|
|
|
|
function newsItem( $date, $user, $text )
|
|
|
|
{
|
2000-05-15 00:46:00 +00:00
|
|
|
if ($user == "Theoddone33") $user = "theoddone33";
|
2000-04-27 16:29:37 +00:00
|
|
|
echo '<TR><TD><DL><DT><FONT SIZE=-1>Posted on ' . $date . ' by ' . $user . '</FONT></DT>' .
|
2000-05-15 00:50:17 +00:00
|
|
|
' <DD><P>' . $text . '</DD>' .
|
2000-05-13 22:42:02 +00:00
|
|
|
'</DL></TD></TR>';
|
2000-03-20 05:41:28 +00:00
|
|
|
}
|
2000-05-15 17:46:34 +00:00
|
|
|
|
|
|
|
function listMonths ( )
|
|
|
|
{
|
|
|
|
$startyear = 2000;
|
|
|
|
$today = getdate ();
|
2000-05-15 18:52:59 +00:00
|
|
|
while ($startyear <= $today['year'])
|
2000-05-15 17:46:34 +00:00
|
|
|
{
|
2000-05-15 18:54:02 +00:00
|
|
|
for ($month = $today['mon']+1 ; $month > 1 ; $month--)
|
2000-05-15 17:46:34 +00:00
|
|
|
{
|
2000-05-15 20:58:46 +00:00
|
|
|
echo '<P><A HREF="old_news.php?mon=' .
|
|
|
|
date ("m", mktime (0,0,0,$month,0,0,0)) .
|
2000-05-15 19:06:57 +00:00
|
|
|
'&yr=' .
|
2000-05-15 19:18:58 +00:00
|
|
|
date ("Y", mktime (0,0,0,0,0,$today['year']+1,0)). '">' .
|
2000-05-15 19:06:57 +00:00
|
|
|
date ("F, Y", mktime (0,0,0,$month,0,$today['year'],0)) .
|
|
|
|
'</A>';
|
2000-05-15 17:46:34 +00:00
|
|
|
}
|
2000-05-15 18:52:59 +00:00
|
|
|
$today['year']--;
|
2000-05-15 17:46:34 +00:00
|
|
|
}
|
|
|
|
}
|
2000-06-13 02:44:18 +00:00
|
|
|
function searchNews ($string)
|
|
|
|
{
|
|
|
|
need ('date sql');
|
|
|
|
echo '<TABLE width="100%" cellSpacing="0" cellPadding="0" border="0"> <TR vAlign="top"> <TD colSpan="2">';
|
|
|
|
tableBoxHeader( 'black', tableHeadColor );
|
2000-06-13 02:59:45 +00:00
|
|
|
tableTitle( "Search Results", 1, tableHeadColor );
|
2000-06-13 02:44:18 +00:00
|
|
|
|
2000-06-13 03:03:45 +00:00
|
|
|
$search = "\'%$string%\'";
|
2000-06-13 02:44:18 +00:00
|
|
|
$conn = @mysql_pconnect (sqlHost, sqlUser, sqlPass);
|
|
|
|
if ($conn) {
|
|
|
|
$query = 'SELECT n_date, n_user, n_news FROM news_main WHERE '.
|
|
|
|
'n_news LIKE ' . $search . ' ORDER BY n_date DESC';
|
2000-06-13 03:03:45 +00:00
|
|
|
echo $query;
|
2000-06-13 02:44:18 +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);
|
|
|
|
newsItem (dateFromSQLDateTime ($n_date), $n_user, StripSlashes($n_news));
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
echo '<P>No news found matching "' . $string . '"\n';
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
echo '<P>No news found matching "' . $string . '"\n';
|
|
|
|
}
|
|
|
|
mysql_close ($conn);
|
|
|
|
} else {
|
|
|
|
echo '<P>SQL error, please contact the webmaster.';
|
|
|
|
}
|
2000-06-13 02:59:45 +00:00
|
|
|
tableBoxFooter();
|
2000-06-13 02:56:15 +00:00
|
|
|
echo '</TD></TR></TABLE>';
|
2000-06-13 02:44:18 +00:00
|
|
|
}
|
2000-03-20 05:41:28 +00:00
|
|
|
?>
|