]> git.mjollnir.org Git - moodle.git/commitdiff
Merged small speed improvements from STABLE
authormoodler <moodler>
Mon, 18 Oct 2004 06:00:26 +0000 (06:00 +0000)
committermoodler <moodler>
Mon, 18 Oct 2004 06:00:26 +0000 (06:00 +0000)
course/category.php
lib/datalib.php

index 060d45f513089481a604b374276c699fc852f137..4a5e1c46cbb580f0e23e7829eb81baa487c5cabe 100644 (file)
 /// Print out all the courses
     unset($course);    // To avoid unwanted language effects later
 
-    $courses = get_courses_page($category->id, "c.sortorder ASC", "c.*", $totalcount, $page*$perpage, $perpage);
+    $courses = get_courses_page($category->id, 'c.sortorder ASC', 
+                                'c.id,c.sortorder,c.shortname,c.fullname,c.summary,c.visible', 
+                                $totalcount, $page*$perpage, $perpage);
     $numcourses = count($courses);
 
     if (!$courses) {
index b2b30adf2f5f5735e6a23121166231af9402bbc5..70d96479f2d92a28a72e1f3e2b4ac0738a0bcdf2 100644 (file)
@@ -1972,7 +1972,7 @@ function get_courses($categoryid='all', $sort='c.sortorder ASC', $fields='c.*')
         $selectsql = $CFG->prefix .'course c ';
     }
 
-    $courses = get_records_sql('SELECT DISTINCT '. $fields .' FROM '. $selectsql .' ORDER BY '. $sort);
+    $courses = get_records_sql('SELECT '. $fields .' FROM '. $selectsql .' ORDER BY '. $sort);
 
     if ($courses and (!$hideallinvisible) and (!$showallinvisible)) { // For ordinary users we need to check visibility
         foreach ($courses as $key => $course) {
@@ -2038,7 +2038,7 @@ function get_courses_page($categoryid='all', $sort='c.sortorder ASC', $fields='c
         $selectsql = $CFG->prefix .'course c ';
     }
 
-    $courses = get_records_sql('SELECT DISTINCT '. $fields .' FROM '. $selectsql .' ORDER BY '. $sort);
+    $courses = get_records_sql('SELECT '. $fields .' FROM '. $selectsql .' ORDER BY '. $sort);
 
     if ($courses and (!$hideallinvisible) and (!$showallinvisible)) { // For ordinary users we need to check visibility
         foreach ($courses as $key => $course) {