mirror of
https://git.code.sf.net/p/quake/website
synced 2024-11-10 07:11:43 +00:00
fix the results of Palisade's (Nelson Rush) temper tantrum
This commit is contained in:
parent
6f2c5fae5f
commit
4a5067f2f6
1 changed files with 23 additions and 2 deletions
25
cur_news.php
25
cur_news.php
|
@ -1,4 +1,25 @@
|
|||
<?
|
||||
|
||||
Do not screw with other memeber's news entries, it is not appreciated.
|
||||
$conn = mysql_pconnect( "moby", "quakeforge", "6ef/HNvv" );
|
||||
if ( $conn ) {
|
||||
$query = 'SELECT n_date, n_user, n_news FROM news_main ' .
|
||||
'WHERE n_date > DATE_SUB(NOW(), INTERVAL 1 MONTH) ' .
|
||||
'ORDER BY n_date DESC';
|
||||
$result = mysql_db_query( "quakeforge", $query, $conn );
|
||||
if ( $result > 0 ) {
|
||||
$numRows = mysql_num_rows( $result );
|
||||
if ( $numRows > 0 ) {
|
||||
for ( $i = 0 ; $i < $numRows ; $i++ ) {
|
||||
list( $n_date, $n_user, $n_news ) = mysql_fetch_row( $result );
|
||||
newsItem( $n_date, $n_user, $n_news );
|
||||
}
|
||||
} else {
|
||||
newsItem( 'now', 'Web Server', '<P>No current news!' );
|
||||
}
|
||||
} else {
|
||||
newsItem( 'now', 'Web Server', '<P>No news in database!' );
|
||||
}
|
||||
$result = mysql_close( $conn );
|
||||
} else {
|
||||
newsItem( 'Now', 'Web Server', '<P>Error: Could not connect to SQL server to fetch news. Please notify the server administrator.' );
|
||||
}
|
||||
?>
|
||||
|
|
Loading…
Reference in a new issue