mirror of
https://git.code.sf.net/p/quake/website
synced 2024-11-10 07:11:43 +00:00
9e6f75ccbd
PHP 7 doesn't like the old short tags we were using (it's possible to re-enable them, but won't be for version 8, so we might as well switch now), and the old MySQL APIs are now gone entirely, replaced with something different. This should make everything work at least as well as it used to. Also, one file used to be checked in with CRLF line endings. ??
26 lines
941 B
PHP
26 lines
941 B
PHP
<?php
|
|
need('date sql');
|
|
|
|
$conn = @mysqli_pconnect (sqlHost, sqlUser, sqlPass, sqlDB);
|
|
if ($conn) {
|
|
$query = 'SELECT p_date, p_user, p_plan FROM devel_plans ' .
|
|
'WHERE p_plan != \'None\' ORDER BY p_date DESC, p_user';
|
|
$result = @mysqli_query ($conn, $query);
|
|
if ($result) {
|
|
$numRows = @mysqli_num_rows ($result);
|
|
if ($numRows) {
|
|
for ($i = 0 ; $i < $numRows ; $i++) {
|
|
list ($p_date, $p_user, $p_plan) = mysqli_fetch_row ($result);
|
|
newsItem (dateFromSQLDateTime ($p_date), ucfirst($p_user), StripSlashes($p_plan));
|
|
}
|
|
} else {
|
|
newsItem ('now', 'Web Server', '<P>An error occoured, please contact the webmaster');
|
|
}
|
|
} else {
|
|
newsItem ('now', 'Web Server', '<P>Can\'t find any plans! Please contact the webmaster');
|
|
}
|
|
mysqli_close ($conn);
|
|
} else {
|
|
newsItem ('Now', 'Web Server', '<P>Error: Could not connect to SQL server to fetch plans. Please notify the server administrator.');
|
|
}
|
|
?>
|