foreach ($users as $user) {
$this->content->text .= '<div style="text-align: left; font-size: 0.75em; padding-top: 5px;">';
$timeago = format_time(time() - max($user->timeaccess, $user->lastaccess)); //bruno to calculate correctly on frontpage
- if ($user->picture==0) {
- $this->content->text .= '<img src="'.$CFG->pixpath.'/i/user.gif" style="height: 16px; width:16px; vertical-align: middle;" alt="" /> ';
- } else {
+ if ($user->picture) {
if ($CFG->slasharguments) {
$imgtag = '<img src="'.$CFG->wwwroot.'/user/pix.php/'.$user->id.'/f2.jpg" style="height: 16px; width:16px; vertical-align: middle;" alt="" /> ';
} else {
$imgtag = '<img src="'.$CFG->wwwroot.'/user/pix.php?file=/'.$user->id.'/f2.jpg" style="height: 16px; width:16px; vertical-align: middle;" alt="" /> ';
}
$this->content->text .= $imgtag;
+ } else {
+ $this->content->text .= '<img src="'.$CFG->pixpath.'/i/user.gif" style="height: 16px; width:16px; vertical-align: middle;" alt="" /> ';
}
- $this->content->text .= '<a href="'.$CFG->wwwroot.'/user/view.php?id='.$user->id.'&course='.$this->instance->pageid.'" title="'.$timeago.'">'.$user->fullname.'</a></div>';
- }
-/*
- $table->align = array("right","left");
- $table->cellpadding = 1;
- $table->cellspacing = 1;
- $table->data[] = array("<img src=\"$CFG->pixpath/i/user.gif\" height=\"16\" width=\"16\" alt=\"\" />",$user->fullname);
+ $this->content->text .= '<a href="'.$CFG->wwwroot.'/user/view.php?id='.$user->id.'&course='.$this->instance->pageid.'" title="'.$timeago.'">'.$user->fullname.'</a>';
+ $this->content->text .= ' <a target="message_'.$user->id.'" href="'.$CFG->wwwroot.'/message/user.php?id='.$user->id.'" onclick="return openpopup(\'/message/user.php?id='.$user->id.'\', \'message_'.$user->id.'\', \'menubar=0,location=0,scrollbars,status,resizable,width=400,height=500\', 0);"><img height="11" width="11" src="'.$CFG->pixpath.'/t/message.gif"></a>';
+ $this->content->text .= '</div>';
}
- // Slightly hacky way to do it but...
- ob_start();
- print_table($table);
- //$this->content->text .= "<br />".ob_get_contents();
- ob_end_clean();
-*/
} else {
$this->content->text .= "<center><font size=\"-1\">".get_string("none")."</font></center>";
}