function newsItem( $date, $user, $text ) { if ($user == "Theoddone33") $user = "theoddone33"; echo '
' . $text . '
' . date ("F, Y", mktime (0,0,0,$month,0,$today['year'],0)) . ''; } $today['year']--; } } function searchNews ($string) { need ('date sql'); echo '
';
tableBoxHeader( 'black', tableHeadColor );
tableTitle( "Search Results", 1, tableHeadColor );
$search = "\'%$string%\'";
$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';
$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 ' No news found matching "' . $string . '"\n'; } } else { echo ' No news found matching "' . $string . '"\n'; } mysql_close ($conn); } else { echo ' SQL error, please contact the webmaster.'; } tableBoxFooter(); echo ' |