From e15ef2602d01e69545a74e5758c2dd10114fcdaf Mon Sep 17 00:00:00 2001 From: moodler Date: Fri, 21 Apr 2006 05:39:20 +0000 Subject: [PATCH] Some performance improvements see bug 5032 --- course/lib.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/course/lib.php b/course/lib.php index 0a22a2e058..9d68ae9a5c 100644 --- a/course/lib.php +++ b/course/lib.php @@ -281,13 +281,14 @@ function print_log($course, $user=0, $date=0, $order="l.time ASC", $page=0, $per $joins = array(); - if ($course->category) { + if ($course->id != SITEID || $modid != 0) { $joins[] = "l.course='$course->id'"; - } else { + } + if ($course->id == SITEID) { $courses[0] = ''; - if ($ccc = get_courses("all", "c.id ASC", "c.id,c.shortname")) { + if ($ccc = get_courses('all', 'c.id ASC', 'c.id,c.shortname')) { foreach ($ccc as $cc) { - $courses[$cc->id] = "$cc->shortname"; + $courses[$cc->id] = $cc->shortname; } } } -- 2.39.5