mirror of
https://git.code.sf.net/p/quake/website
synced 2024-11-24 05:01:23 +00:00
Update SotC page to exit gracefully when there are no SotC announcements
for the current year.
This commit is contained in:
parent
61053ca04f
commit
ad8a68e795
1 changed files with 5 additions and 3 deletions
|
@ -20,12 +20,12 @@ necessary - contrary to popular (with him) belief, Knghtbrd has in fact been
|
||||||
known to be wrong sometimes. He isn't afraid to admit it either (most of the
|
known to be wrong sometimes. He isn't afraid to admit it either (most of the
|
||||||
time..)
|
time..)
|
||||||
<? // Display latest update
|
<? // Display latest update
|
||||||
function sotcShowLatest($year) {
|
function sotcShowLatest ($year) {
|
||||||
$i = 0;
|
$i = 0;
|
||||||
|
|
||||||
$dirHandle = opendir ($year);
|
$dirHandle = @opendir ($year);
|
||||||
if ($dirHandle) {
|
if ($dirHandle) {
|
||||||
while ($fileName = readdir($dirHandle)) {
|
while ($fileName = readdir ($dirHandle)) {
|
||||||
if ($fileName != '.' && $fileName != '..' && $fileName != 'CVS') {
|
if ($fileName != '.' && $fileName != '..' && $fileName != 'CVS') {
|
||||||
$sotcList[$i++] = $fileName;
|
$sotcList[$i++] = $fileName;
|
||||||
}
|
}
|
||||||
|
@ -33,6 +33,8 @@ time..)
|
||||||
closedir ($dirHandle);
|
closedir ($dirHandle);
|
||||||
rsort ($sotcList);
|
rsort ($sotcList);
|
||||||
include ($year . '/' . $sotcList[0]);
|
include ($year . '/' . $sotcList[0]);
|
||||||
|
} else {
|
||||||
|
echo 'There are no State of the Code announcements for this year.';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue