Moodle中个人资料图片的路径?

I was programming something in moodle web-application and was looking into retrieving the path of the user profile images.

I assumed I could find the path somewhere in the database but I only got to mdl_user.picture and mdl_user.imagealt, so practically I know who has uploaded a picture but can't get to which picture he/she uploaded.

Is there a way to get it from the database?

Thanks for your help,

OM

If you want the image tag you can use print_user_picture() and pass the user object that you got from the database. You can also specify the size of the image. So to print the full size user picture for the current user you could do

global $USER, $COURSE;

print_user_picture($USER, $COURSE->id, null, true);

Otherwise if you need just the url you have do do something like this

require_once($CFG->libdir.'/filelib.php');

$size = array('large' => 'f1', 'small' => 'f2');

$src = false;
if ($user->picture) {
   $src = get_file_url($user->id.'/'.$size['large'].'.jpg', null, 'user');
}

in moodle 2.0 you can use this

global $USER,$PAGE; 
$user_picture=new user_picture($USER);
$src=$user_picture->get_url($PAGE);

To get the User profile pic simply you can use the following path:

NOTE: used userid = 3 and appended with number 2

Path : http://moodleservername/moodle/pluginfile.php/23/user/icon/clean/f1

this one works for me in 3.4 version

<?php echo new moodle_url('/user/pix.php/'.$USER->id.'/f1.jpg')?>