]> git.mjollnir.org Git - moodle.git/commitdiff
user/index: make use of the smarter print_user_picture() -
authormartinlanghoff <martinlanghoff>
Wed, 19 Sep 2007 07:20:01 +0000 (07:20 +0000)
committermartinlanghoff <martinlanghoff>
Wed, 19 Sep 2007 07:20:01 +0000 (07:20 +0000)
Switch to using the smarter codepath in print_user_picture. Saves
20 DB queries in the normal page. One per user acct.

user/index.php

index c2104ab6faa215e793c46514d3c307e1c1e5026b..3e8f4e877edf7586734fe328d3bd3bbe8ae5588d 100644 (file)
     } else {
         $selectrole = " ";
     }
-    $select = 'SELECT u.id, u.username, u.firstname, u.lastname, u.email, u.city, u.country, u.picture, u.lang, u.timezone, u.emailstop, u.maildisplay, COALESCE(ul.timeaccess, 0) AS lastaccess, r.hidden '; // s.lastaccess
+    $select = 'SELECT u.id, u.username, u.firstname, u.lastname, u.email, u.city, u.country, u.picture, u.lang, u.timezone, u.emailstop, u.maildisplay, u.imagealt, COALESCE(ul.timeaccess, 0) AS lastaccess, r.hidden '; // s.lastaccess
     $select .= $course->enrolperiod?', r.timeend ':'';
 
     $from   = "FROM {$CFG->prefix}user u INNER JOIN
                 }
 
                 $data = array (
-                        print_user_picture($user->id, $course->id, $user->picture, false, true, $piclink),
+                        print_user_picture($user, $course->id, $user->picture, false, true, $piclink),
                         $profilelink);
 
                 if (!isset($hiddenfields['city'])) {