From e5953e0daee45d4be54611bf5e70de943f8da4cb Mon Sep 17 00:00:00 2001 From: Yannick Warnier Date: Thu, 19 Jul 2007 07:27:21 +0200 Subject: [PATCH] [svn r12758] Fixed bug whereby if only one category exists (can be white spaces) and most courses belong to this category, they are shown on the anonymous homepage although they are not "visible to the world". --- index.php | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/index.php b/index.php index a1fa758d57..6e12ce10c6 100644 --- a/index.php +++ b/index.php @@ -20,7 +20,7 @@ /** * @package dokeos.main * @author Patrick Cool , Ghent University, Refactoring -* @version $Id: index.php 12708 2007-07-05 20:46:47Z yannoo $ +* @version $Id: index.php 12758 2007-07-19 05:27:21Z yannoo $ * @todo check the different @todos in this page and really do them * @todo check if the news management works as expected */ @@ -603,30 +603,40 @@ function display_anonymous_course_list() echo "

", $categoryName['name'], "

\n"; } $numrows = mysql_num_rows($sql_result_courses); + $courses_list_string = ''; + $courses_shown = 0; if ($numrows > 0) { if ($thereIsSubCat) { - echo "
\n"; + $courses_list_string .= "
\n"; } - echo "

", get_lang("CourseList"), "

\n", "\n"; } else { // echo "
",get_lang('_No_course_publicly_available'),"
\n"; } + if($courses_shown > 0) + { //only display the list of courses and categories if there was more than + // 0 courses visible to the world (we're in the anonymous list here) + echo $courses_list_string; + } if ($category != "") { echo "

", "<< ", get_lang("BackToHomePage"), "", "

\n";