Skip to content

Commit

Permalink
rolling back some functionality changes I made to user image routine,…
Browse files Browse the repository at this point in the history
… but

 keeping the clean up of code that makes it clearer what's happening.
  • Loading branch information
bawjaws committed Jul 22, 2005
1 parent 8b5e8ea commit 113a79e
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions lib/weblib.php
Expand Up @@ -2479,7 +2479,6 @@ function print_user_picture($userid, $courseid, $picture, $size=0, $returnstring
}
if (empty($size)) {
$file = 'f2';
$size = 35;
} else if ($size === true or $size == 1) {
$file = 'f1';
$size = 100;
Expand All @@ -2488,18 +2487,19 @@ function print_user_picture($userid, $courseid, $picture, $size=0, $returnstring
} else {
$file = 'f2';
}
$class = "userpicture";
if ($picture) { // Print custom user picture
if ($CFG->slasharguments) { // Use this method if possible for better caching
$output .= '<img class="userpicture defaultuserpic" align="middle" src="'. $CFG->wwwroot .'/user/pix.php/'. $userid .'/'. $file .'.jpg"'.
' border="0" width="'. $size .'" height="'. $size .'" alt="" />';
$src = $CFG->wwwroot .'/user/pix.php/'. $userid .'/'. $file .'.jpg"';
} else {
$output .= '<img class="userpicture defaultuserpic" align="middle" src="'. $CFG->wwwroot .'/user/pix.php?file=/'. $userid .'/'. $file .'.jpg"'.
' border="0" width="'. $size .'" height="'. $size .'" alt="" />';
$src = $CFG->wwwroot .'/user/pix.php?file=/'. $userid .'/'. $file .'.jpg"';
}
} else { // Print default user pictures (use theme version if available)
$output .= "<img class=\"userpicture defaultuserpic\" align=\"middle\" src=\"$CFG->pixpath/u/$file.png\"".
" border=\"0\" width=\"$size\" height=\"$size\" alt=\"\" />";
$class .= " defaultuserpic";
$src = "$CFG->pixpath/u/$file.png\"";
}
$output .= "<img class=\"$class\" align=\"middle\" src=\"$src".
" border=\"0\" width=\"$size\" height=\"$size\" alt=\"\" />";
if ($link) {
$output .= '</a>';
}
Expand Down

0 comments on commit 113a79e

Please sign in to comment.