From 538ceece1757357aca404fb92ead11963fdb10bd Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Mon, 21 Jun 2010 21:20:45 -0400 Subject: [PATCH] Merged 'no entry' fix to printSectionDocs --- html/php/section_docs.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/html/php/section_docs.php b/html/php/section_docs.php index ab20df1..92d8395 100644 --- a/html/php/section_docs.php +++ b/html/php/section_docs.php @@ -7,7 +7,7 @@ * printSectionDocs('Recitation', 'doc/rec', 'rec', 20); */ function printSectionDocs($title, $directory, $startswith, $maxnum){ - $i = 1; + $count = 0; for ($i=$maxnum; $i>=0; $i-=1) { $front = "$directory/$startswith".$i."_"; $frontlen = strlen($front); @@ -20,6 +20,7 @@ function printSectionDocs($title, $directory, $startswith, $maxnum){ } } if ($num_readable > 0 or is_readable($comment_file)) { + $count += 1; echo "

$title $i

\n"; } // 's' b/c id attributes must begin with a letter, not a digit. if (is_readable($comment_file)) { @@ -40,5 +41,8 @@ function printSectionDocs($title, $directory, $startswith, $maxnum){ echo "\n"; } } + if ($count == 0) { + echo "

No entries yet

\n"; + } } ?> -- 2.26.2