rolling back some functionality changes I made to user image routine, but

keeping the clean up of code that makes it clearer what's happening.
This commit is contained in:
bawjaws 2005-07-22 14:10:07 +00:00
parent 8b5e8ea943
commit 113a79e2b3

View file

@ -2479,7 +2479,6 @@ function print_user_picture($userid, $courseid, $picture, $size=0, $returnstring
} }
if (empty($size)) { if (empty($size)) {
$file = 'f2'; $file = 'f2';
$size = 35;
} else if ($size === true or $size == 1) { } else if ($size === true or $size == 1) {
$file = 'f1'; $file = 'f1';
$size = 100; $size = 100;
@ -2488,18 +2487,19 @@ function print_user_picture($userid, $courseid, $picture, $size=0, $returnstring
} else { } else {
$file = 'f2'; $file = 'f2';
} }
$class = "userpicture";
if ($picture) { // Print custom user picture if ($picture) { // Print custom user picture
if ($CFG->slasharguments) { // Use this method if possible for better caching 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"'. $src = $CFG->wwwroot .'/user/pix.php/'. $userid .'/'. $file .'.jpg"';
' border="0" width="'. $size .'" height="'. $size .'" alt="" />';
} else { } else {
$output .= '<img class="userpicture defaultuserpic" align="middle" src="'. $CFG->wwwroot .'/user/pix.php?file=/'. $userid .'/'. $file .'.jpg"'. $src = $CFG->wwwroot .'/user/pix.php?file=/'. $userid .'/'. $file .'.jpg"';
' border="0" width="'. $size .'" height="'. $size .'" alt="" />';
} }
} else { // Print default user pictures (use theme version if available) } else { // Print default user pictures (use theme version if available)
$output .= "<img class=\"userpicture defaultuserpic\" align=\"middle\" src=\"$CFG->pixpath/u/$file.png\"". $class .= " defaultuserpic";
" border=\"0\" width=\"$size\" height=\"$size\" alt=\"\" />"; $src = "$CFG->pixpath/u/$file.png\"";
} }
$output .= "<img class=\"$class\" align=\"middle\" src=\"$src".
" border=\"0\" width=\"$size\" height=\"$size\" alt=\"\" />";
if ($link) { if ($link) {
$output .= '</a>'; $output .= '</a>';
} }