news caching stuff

This commit is contained in:
Dan Olson 2000-06-22 00:30:50 +00:00
parent eb60c7044b
commit 231eb79fc2

View file

@ -126,10 +126,39 @@
}
mysql_close ($conn);
} else {
newsItem ('Now', 'Web Server', '<P>Error: Could not connect to SQL server to fetch news. Please notify the server administrator.');
include ('cache.php');
// newsItem ('Now', 'Web Server', '<P>Error: Could not connect to SQL server to fetch news. Please notify the server administrator.');
}
}
function fetchNewsEntry ($number)
{
need('date');
$conn = @mysql_pconnect (sqlHost, sqlUser, sqlPass);
if ($conn) {
$query = 'SELECT n_date, n_user, n_news FROM news_main' .
" ORDER BY n_date DESC LIMIT $number";
$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);
}
} else {
return 0;
}
} else {
return 0;
}
mysql_close ($conn);
} else {
return 0;
}
return array (dateFromSQLDateTime ($n_date), $n_user, StripSlashes($n_news));
}
function monthlyNews ($month, $year)
{
need('date');