mirror of
https://git.code.sf.net/p/quake/website
synced 2025-02-17 17:31:39 +00:00
54 lines
1.6 KiB
PHP
54 lines
1.6 KiB
PHP
<? // Preamble
|
|
$pageName = "News";
|
|
$focused = "home"; // Dock icon name to get a border
|
|
require("parts/preamble.php"); // Load most of document
|
|
?>
|
|
<!--SEARCHME-->
|
|
<TABLE width="100%" cellSpacing="0" cellPadding="0" border="0">
|
|
<TR vAlign="top">
|
|
<TD colSpan="2"><? // News display
|
|
tableBoxHeader( 'black', tableHeadColor );
|
|
tableTitle( 'Latest News', 1, tableHeadColor );
|
|
require("news_funcs.php");
|
|
$conn = @mysql_pconnect (sqlHost, sqlUser, sqlPass);
|
|
if ($conn) {
|
|
$query = 'SELECT n_date, n_user, n_news FROM news_main' .
|
|
" WHERE n_date > DATE_SUB(NOW(), INTERVAL $length)" .
|
|
' 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 {
|
|
newsItem ('now', 'Web Server', '<P>No current news!');
|
|
}
|
|
} 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.');
|
|
}
|
|
tableBoxFooter();
|
|
?></TD>
|
|
</TR>
|
|
<TR vAlign=top>
|
|
<? tableSpacer(9, 9, 1, "black"); ?>
|
|
</TR>
|
|
<TR vAlign=top>
|
|
<TD align="center">
|
|
<? include("sponsor_incl.html"); ?>
|
|
</TD>
|
|
</TR>
|
|
<TR vAlign=top>
|
|
<? tableSpacer(9, 9, 1, "black"); ?>
|
|
</TR>
|
|
</TABLE>
|
|
<!--NOSEARCH-->
|
|
<?
|
|
require("parts/postamble.php"); // Finish this sucker up
|
|
?>
|