Hi. I'm trying to extract the user's moodle user icon if given the user id. It was fairly easy in Moodle 1.9, but in Moodle 2.x the user pix structure is different. Actually, I can't find the user pix themselves.
Can anyone help? To be frank (my name's Frankie!), I've created a super-duper wall for Moodle 1.9, and have ported the code over to Moodle 2.2. You can see it here.
http://moodurian.com/m2/mod/page/view.php?id=59
Username: student
Password: student
The Wall works, but the user'sMoodle user icon does not show up. So can someone, anyone, anybody(!?!) tell me how to get the code right?
Here's some attempt by me to extract the user's Moodle icon in Moodle 2.2:
$face="http://www.moodurian.com/user/profile.php/".$USER->id."/f2.jpg";
Nope it doesn't vork, Professor!
//Avatar Image
public function Gravatar($uid)
{
//$query = mysql_query("SELECT email FROM `users` WHERE uid='$uid'") or die(mysql_error());
$query = mysql_query("SELECT email FROM `mdl_m22_user` WHERE id = '$uid'") or die(mysql_error());
$row=mysql_fetch_array($query);
if(!empty($row))
{
...
$data = "../user/profile.php/".$uid."/f2.jpg";
...
return $data;
}
else {
$data="default.jpg";
return $data;
}
Nein. It doesn't vork either, Professor.
Regards
Frankie Kam