category) { require_login($course->id); } add_to_log($course->id, "user", "view", "view.php?id=$user->id&course=$course->id", "$user->id"); if ($student = get_record("user_students", "userid", $user->id, "course", $course->id)) { $user->lastaccess = $student->timeaccess; } else if ($teacher = get_record("user_teachers", "userid", $user->id, "course", $course->id)) { $user->lastaccess = $teacher->timeaccess; } $fullname = fullname($user, isteacher($course->id)); $personalprofile = get_string("personalprofile"); $participants = get_string("participants"); $loggedinas = "

".user_login_string($course, $USER)."

"; if ($course->category) { print_header("$personalprofile: $fullname", "$personalprofile: $fullname", "id\">$course->shortname -> id\">$participants -> $fullname", "", "", true, " ", $loggedinas); } else { print_header("$course->fullname: $personalprofile: $fullname", "$course->fullname", "$fullname", "", "", true, " ", $loggedinas); } 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 "
"; print_user_picture($user->id, $course->id, $user->picture, true, false, false); echo "cellcontent\" class=\"userinfoboxcontent\">"; // 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 ""; echo "id\">"; echo ""; 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) { $countries = get_list_of_countries(); 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").":", obfuscate_mailto($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 (isteacher($course->id)) { if ($mycourses = get_my_courses($user->id)) { $courselisting = ''; foreach ($mycourses as $mycourse) { if ($mycourse->visible) { $courselisting .= "wwwroot/course/view.php?id=$mycourse->id\">$mycourse->fullname, "; } } print_row(get_string('courses').':', rtrim($courselisting,', ')); } } if ($user->lastaccess) { $datestring = userdate($user->lastaccess)."  (".format_time(time() - $user->lastaccess).")"; } else { $datestring = get_string("never"); } print_row(get_string("lastaccess").":", $datestring); echo "
"; echo "
"; $internalpassword = false; if (is_internal_auth()) { $internalpassword = "$CFG->wwwroot/login/change_password.php"; } // Print other functions echo "
"; if ($currentuser and !isguest()) { if ($internalpassword) { echo ""; } else if (strlen($CFG->changepassword) > 1) { echo ""; } } if ($course->category and ((isstudent($course->id) and ($user->id == $USER->id) and !isguest() and $CFG->allowunenroll) or (isteacher($course->id) and isstudent($course->id, $user->id))) ) { echo ""; } if (isteacher($course->id) or ($course->showreports and $USER->id == $user->id)) { echo ""; } if (isteacher($course->id) and ($USER->id != $user->id) and !iscreator($user->id)) { echo ""; } echo "

"; echo "id\">"; echo ""; echo "

changepassword\" method=get>"; echo ""; echo "

"; echo "id\">"; echo "id\">"; echo "shortname)."\">"; echo "

"; echo "id\">"; echo "id\">"; echo ""; echo "

"; echo "id\">"; echo "id\">"; echo ""; echo "

\n"; forum_print_user_discussions($course->id, $user->id); print_footer($course); /// Functions /////// function print_row($left, $right) { echo "

$left

$right

"; } ?>