Performance enhancement for user listing (caching of language strings)

This commit is contained in:
martin 2002-08-06 09:21:14 +00:00
parent 1ebede32c2
commit cd052f8ccc
2 changed files with 47 additions and 44 deletions

View file

@ -45,5 +45,43 @@ function ImageCopyBicubic ($dst_img, $src_img, $dst_x, $dst_y, $src_x, $src_y, $
}
}
function print_user($user, $course, $string) {
global $USER, $COUNTRIES;
echo "<TABLE WIDTH=80% ALIGN=CENTER BORDER=0 CELLPADDING=1 CELLSPACING=1><TR><TD BGCOLOR=#888888>";
echo "<TABLE WIDTH=100% BORDER=0 CELLPADDING=0 CELLSPACING=0><TR>";
echo "<TD WIDTH=100 BGCOLOR=#FFFFFF VALIGN=top>";
echo "<A HREF=\"view.php?id=$user->id&course=$course->id\">";
if ($user->picture) {
echo "<IMG BORDER=0 ALIGN=left WIDTH=100 SRC=\"pix.php/$user->id/f1.jpg\">";
} else {
echo "<IMG BORDER=0 ALIGN=left WIDTH=100 SRC=\"default/f1.jpg\">";
}
echo "</A>";
echo "</TD><TD WIDTH=100% BGCOLOR=#FFFFFF VALIGN=top>";
echo "<FONT SIZE=-1>";
echo "<FONT SIZE=3><B>$user->firstname $user->lastname</B></FONT>";
echo "<P>";
echo "$string->email: <A HREF=\"mailto:$user->email\">$user->email</A><BR>";
echo "$string->location: $user->city, ".$COUNTRIES["$user->country"]."<BR>";
echo "$string->lastaccess: ".userdate($user->lastaccess);
echo "&nbsp (".format_time(time() - $user->lastaccess).")";
echo "</TD><TD VALIGN=bottom BGCOLOR=#FFFFFF NOWRAP>";
echo "<FONT SIZE=1>";
if (isteacher($course->id)) {
$timemidnight = usergetmidnight(time());
echo "<A HREF=\"../course/user.php?id=$course->id&user=$user->id\">$string->activity</A><BR>";
echo "<A HREF=\"../course/unenrol.php?id=$course->id&user=$user->id\">$string->unenrol</A><BR>";
if (isstudent($course->id, $user->id)) {
echo "<A HREF=\"../course/loginas.php?id=$course->id&user=$user->id\">$string->loginas</A><BR>";
}
}
echo "<A HREF=\"view.php?id=$user->id&course=$course->id\">$string->fullprofile...</A>";
echo "</FONT>";
echo "</TD></TR></TABLE></TD></TR></TABLE>";
}
?>