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(); ?>
'.$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 '