id, $addcontact); message_add_contact($addcontact); } if ($removecontact and confirm_sesskey()) { add_to_log(SITEID, 'message', 'remove contact', 'history.php?user1='.$removecontact.'&user2='.$USER->id, $removecontact); message_remove_contact($removecontact); } if ($blockcontact and confirm_sesskey()) { add_to_log(SITEID, 'message', 'block contact', 'history.php?user1='.$blockcontact.'&user2='.$USER->id, $blockcontact); message_block_contact($blockcontact); } if ($unblockcontact and confirm_sesskey()) { add_to_log(SITEID, 'message', 'unblock contact', 'history.php?user1='.$unblockcontact.'&user2='.$USER->id, $unblockcontact); message_unblock_contact($unblockcontact); } /// By default, print frameset to contain all the various panes if (!$frame) { $USER->message_user_refresh[$user->id] = time(); ?>
'; echo print_user_picture($user->id, SITEID, $user->picture, true, true, true, 'userwindow').' | '; echo '';
echo fullname($user);
echo ' '; /// Print login status of this user if ($user->lastaccess) { if (time() - $user->lastaccess > $CFG->message_offline_time) { echo get_string('offline', 'message').': '.format_time(time() - $user->lastaccess); } else { echo get_string('lastaccess').': '.get_string('ago', 'message', format_time(time() - $user->lastaccess)); } } else { echo get_string("lastaccess").":". get_string("never"); } echo ''; echo ' '; echo ' '; echo ' |
'.$user->firstname.' ['.$time.']: '. $printmessage.'
'; echo '\n\n"; /// Move the entry to the other table $message->timeread = time(); $message->message = addslashes($message->message); $messageid = $message->id; unset($message->id); if (insert_record('message_read', $message)) { delete_records('message', 'id', $messageid); } } echo '\n\n"; } // Update the info pane, but only if the data there is getting too old $timenow = time(); if ($timenow - $user->lastaccess > $CFG->message_offline_time) { // Offline if ($timenow - $USER->message_user_refresh[$user->id] < 30) { // It's just happened so refresh $USER->message_user_refresh[$user->id] = $timenow - 30; // Prevent it happening again $refreshinfo = true; } } else { // Online if ($timenow - $USER->message_user_refresh[$user->id] > 30) { // Been a while $USER->message_user_refresh[$user->id] = $timenow; // Prevent it happening again $refreshinfo = true; } } if (!empty($refreshinfo)) { echo '\n\n"; } echo '