From: moodler Date: Mon, 28 Apr 2003 16:13:46 +0000 (+0000) Subject: I'm getting wierd numbers of records returned on moodle.org. X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=81f186b47a509e86aba36fa1dd1ecf6b9ac0969f;p=moodle.git I'm getting wierd numbers of records returned on moodle.org. This fix makes the page a bit more robust even if this is happening. --- diff --git a/user/index.php b/user/index.php index b92f058b65..7681e77507 100644 --- a/user/index.php +++ b/user/index.php @@ -68,6 +68,8 @@ $limit = ""; } + $numstudentsall = count_records("user_students", "course", $course->id); + if ($students = get_course_students($course->id, "$dsort $dir $limit")) { $numstudents = count($students); echo "

$numstudents $course->students

"; @@ -137,12 +139,11 @@ } print_table($table); - if ($numstudents == USER_LARGE_CLASS and !$showall) { - $numstudents = count_records("user_students", "course", $course->id); - $moreinfo->count = USER_LARGE_CLASS; + if ($numstudents < $numstudentsall and !$showall) { + $moreinfo->count = $numstudents; $moreinfo->things = strtolower($course->students); echo "

".get_string("displayingfirst", "", $moreinfo); - echo " (id&sort=$sort&dir=$dir&showall=1\">".get_string("showall", "", $numstudents).")"; + echo " (id&sort=$sort&dir=$dir&showall=1\">".get_string("showall", "", $numstudentsall).")"; echo "

"; }