Skip to content

Commit

Permalink
Cleaned up the remaining images:
Browse files Browse the repository at this point in the history
 - moved user images to /pix/u folder, and changed format to .png to allow
   transparent images etc.  These can now be customised in themes.

 - removed legacy madewithmoodle logos
  • Loading branch information
moodler committed Jul 28, 2003
1 parent 250e71d commit 67a63a3
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 11 deletions.
27 changes: 18 additions & 9 deletions lib/weblib.php
Expand Up @@ -718,7 +718,7 @@ function print_footer ($course=NULL) {
if ($course) {
if ($course == "home") { // special case for site home page - please do not remove
$homelink = "<p align=\"center\"><a title=\"moodle $CFG->release ($CFG->version)\" href=\"http://moodle.org/\" target=\"_blank\">";
$homelink .= "<br><img width=\"130\" height=\"19\" src=\"pix/madewithmoodle2.gif\" border=0></a></p>";
$homelink .= "<br><img width=\"130\" height=\"19\" src=\"pix/madewithmoodle.gif\" border=0></a></p>";
$course = get_site();
$homepage = true;
} else {
Expand Down Expand Up @@ -873,28 +873,37 @@ function print_file_picture($path, $courseid=0, $height="", $width="", $link="")
}

function print_user_picture($userid, $courseid, $picture, $large=false, $returnstring=false, $link=true) {
global $CFG;
global $CFG, $THEME;

if ($link) {
$output = "<a href=\"$CFG->wwwroot/user/view.php?id=$userid&course=$courseid\">";
} else {
$output = "";
}
if ($large) {
$file = "f1.jpg";
$file = "f1";
$size = 100;
} else {
$file = "f2.jpg";
$file = "f2";
$size = 35;
}
if ($picture) {
if ($picture) { // Print custom user picture
if ($CFG->slasharguments) { // Use this method if possible for better caching
$output .= "<img align=absmiddle src=\"$CFG->wwwroot/user/pix.php/$userid/$file\" border=0 width=$size height=$size alt=\"\">";
$output .= "<img align=\"absmiddle\" src=\"$CFG->wwwroot/user/pix.php/$userid/$file.jpg\"".
" border=\"0\" width=\"$size\" height=\"$size\" alt=\"\">";
} else {
$output .= "<img align=absmiddle src=\"$CFG->wwwroot/user/pix.php?file=/$userid/$file\" border=0 width=$size height=$size alt=\"\">";
$output .= "<img align=\"absmiddle\" src=\"$CFG->wwwroot/user/pix.php?file=/$userid/$file.jpg\"".
" border=\"0\" width=\"$size\" height=\"$size\" alt=\"\">";
}
} else {
$output .= "<img align=absmiddle src=\"$CFG->wwwroot/user/default/$file\" border=0 width=$size height=$size alt=\"\">";
} else { // Print default user pictures (use theme version if available)
if (empty($THEME->custompix)) {
$output .= "<img align=\"absmiddle\" src=\"$CFG->wwwroot/pix/u/$file.png\"".
" border=\"0\" width=\"$size\" height=\"$size\" alt=\"\">";
} else {
$output .= "<img align=\"absmiddle\" src=\"$CFG->wwwroot/theme/$CFG->theme/pix/u/$file.png\"".
" border=\"0\" width=\"$size\" height=\"$size\" alt=\"\">";
}

}
if ($link) {
$output .= "</a>";
Expand Down
Binary file removed pix/madewithmoodle2.gif
Binary file not shown.
Binary file removed pix/madewithmoodle3.gif
Binary file not shown.
Binary file added pix/u/f1.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pix/u/f2.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added theme/cordoroyblue/pix/u/f1.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added theme/cordoroyblue/pix/u/f2.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed user/default/f1.jpg
Binary file not shown.
Binary file removed user/default/f2.jpg
Binary file not shown.
6 changes: 4 additions & 2 deletions user/pix.php
Expand Up @@ -24,8 +24,10 @@
$userid = (integer)$args[0];
$image = $args[1];
$pathname = "$CFG->dataroot/users/$userid/$image";
$filetype = "image/jpeg";
} else {
$pathname = "$CFG->dirroot/user/default/f1.jpg";
$pathname = "$CFG->dirroot/pix/u/f1.png";
$filetype = "image/png";
}

$lastmodified = filemtime($pathname);
Expand All @@ -37,7 +39,7 @@
header("Pragma: ");
header("Content-disposition: inline; filename=$image");
header("Content-length: ".filesize($pathname));
header("Content-type: image/jpeg");
header("Content-type: $filetype");
readfile("$pathname");
}

Expand Down

0 comments on commit 67a63a3

Please sign in to comment.