query("SELECT Subject, UserID, Level, AssignedToUser, Unread, Status FROM staff_pm_conversations WHERE ID=$ConvID"); list($Subject, $UserID, $Level, $AssignedToUser, $Unread, $Status) = $DB->next_record(); $DB->query("SELECT Subject, UserID, Level, AssignedToUser, Unread, Status FROM staff_pm_conversations WHERE ID=$ConvID"); list($Subject, $UserID, $Level, $AssignedToUser, $Unread, $Status) = $DB->next_record(); if (!(($UserID == $LoggedUser['ID']) || ($AssignedToUser == $LoggedUser['ID']) || (($Level > 0 && $Level <= $LoggedUser['Class']) || ($Level == 0 && $IsFLS)))) { // User is trying to view someone else's conversation error(403); } // User is trying to view their own unread conversation, set it to read if ($UserID == $LoggedUser['ID'] && $Unread) { $DB->query("UPDATE staff_pm_conversations SET Unread=false WHERE ID=$ConvID"); // Clear cache for user $Cache->delete_value('staff_pm_new_'.$LoggedUser['ID']); } show_header('Staff PM', 'staffpm,bbcode'); $UserInfo = user_info($UserID); $UserStr = format_username($UserID, $UserInfo['Username'], $UserInfo['Donor'], $UserInfo['Warned'], $UserInfo['Enabled'], $UserInfo['PermissionID']); $OwnerID = $UserID; ?>

Staff PM -

query("SELECT UserID, SentDate, Message FROM staff_pm_messages WHERE ConvID=$ConvID"); while(list($UserID, $SentDate, $Message) = $DB->next_record()) { // Set user string if ($UserID == $OwnerID) { // User, use prepared string $UserString = $UserStr; } else { // Staff/FLS $UserInfo = user_info($UserID); $UserString = format_username($UserID, $UserInfo['Username'], $UserInfo['Donor'], $UserInfo['Warned'], $UserInfo['Enabled'], $UserInfo['PermissionID']); } ?>
full_format($Message)?>
set_query_id($StaffPMs); } // Common responses if ($IsFLS && $Status != 'Resolved') { ?>

Reply