category) {
require_login($course->id);
}
add_to_log($course->id, "user", "view", "view.php?id=$user->id&course=$course->id", "$user->id");
$fullname = "$user->firstname $user->lastname";
$personalprofile = get_string("personalprofile");
$participants = get_string("participants");
if ($course->category) {
print_header("$personalprofile: $fullname", "$personalprofile: $fullname",
"id\">$course->shortname ->
id\">$participants -> $fullname", "");
} else {
print_header("$course->fullname: $personalprofile: $fullname", "$course->fullname", "$fullname", "");
}
if ($course->category and ! isguest() ) {
if (!isstudent($course->id, $user->id) && !isteacher($course->id, $user->id)) {
print_heading(get_string("notenrolled", "", $fullname));
print_footer($course);
die;
}
}
if ($user->deleted) {
print_heading(get_string("userdeleted"));
}
echo "
";
echo "";
echo "body\" VALIGN=top>";
print_user_picture($user->id, $course->id, $user->picture, true, false, false);
echo " | ";
// Print name and edit button across top
echo "";
echo "$fullname";
echo " | ";
if (empty($USER->id)) {
$currentuser = false;
} else {
$currentuser = ($user->id == $USER->id);
}
if (($currentuser and !isguest()) or isadmin()) {
echo "";
}
echo " | ";
// Print the description
if ($user->description) {
echo "".text_to_html($user->description)." ";
}
// Print all the little details in a list
echo "city or $user->country) {
print_row(get_string("location").":", "$user->city, ".$COUNTRIES["$user->country"]);
}
if (isteacher($course->id)) {
if ($user->address) {
print_row(get_string("address").":", "$user->address");
}
if ($user->phone1) {
print_row(get_string("phone").":", "$user->phone1");
}
if ($user->phone2) {
print_row(get_string("phone").":", "$user->phone2");
}
}
if ($user->maildisplay == 1 or ($user->maildisplay == 2 and $course->category) or isteacher($course->id)) {
print_row(get_string("email").":", "email\">$user->email");
}
if ($user->url) {
print_row(get_string("webpage").":", "url\">$user->url");
}
if ($user->icq) {
print_row("ICQ:","icq\">$user->icq icq&img=5\" WIDTH=18 HEIGHT=18 BORDER=0>");
}
if ($user->lastaccess) {
$datestring = userdate($user->lastaccess)."  (".format_time(time() - $user->lastaccess).")";
} else {
$datestring = "-";
}
print_row(get_string("lastaccess").":", $datestring);
echo " ";
echo " |
|
";
$internalpassword = false;
if ($CFG->auth == "email" or $CFG->auth == "none") {
$internalpassword = "$CFG->wwwroot/login/change_password.php";
}
// Print other functions
echo "";
if ($currentuser and !isguest()) {
if ($CFG->auth == "email" or $CFG->auth == "none") {
echo " | ";
} else if ($CFG->changepassword) {
echo " | ";
}
}
if ($course->category and
((isstudent($course->id) and ($user->id == $USER->id) and !isguest()) or
(isteacher($course->id) and isstudent($course->id, $user->id))) ) {
echo " | ";
}
if (isteacher($course->id)) {
echo " | ";
if ($user->id != $USER->id) {
echo " | ";
}
}
echo "
\n";
forum_print_user_discussions($course->id, $user->id);
print_footer($course);
/// Functions ///////
function print_row($left, $right) {
echo "$left | $right |
";
}
?>