'; // Show the capacity bar, if available. if (!empty($context['limit_bar'])) { echo '
', $txt['pm_capacity'], ':
90 ? ' class="alert"' : '', '> ', $context['limit_bar']['text'], '
'; } // Message sent? Show a small indication. if (isset($context['pm_sent'])) echo '
', $txt['pm_sent'], '
'; } // Just the end of the index bar, nothing special. function template_pm_below() { global $context, $settings, $options; echo ' '; } function template_folder() { global $context, $settings, $options, $scripturl, $modSettings, $txt; // The every helpful javascript! echo ' '; echo '
'; // If we are not in single display mode show the subjects on the top! if ($context['display_mode'] != 1) { template_subject_list(); echo '
'; } // Got some messages to display? if ($context['get_pmessage']('message', true)) { // Show a few buttons if we are in conversation mode and outputting the first message. if ($context['display_mode'] == 2) { // Build the normal button array. $conversation_buttons = array( 'reply' => array('text' => 'reply_to_all', 'image' => 'reply.gif', 'lang' => true, 'url' => $scripturl . '?action=pm;sa=send;f=' . $context['folder'] . ($context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '') . ';pmsg=' . $context['current_pm'] . ';u=all'), 'delete' => array('text' => 'delete_conversation', 'image' => 'delete.gif', 'lang' => true, 'url' => $scripturl . '?action=pm;sa=pmactions;pm_actions[' . $context['current_pm'] . ']=delete;conversation;f=' . $context['folder'] . ';start=' . $context['start'] . ($context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '') . ';' . $context['session_var'] . '=' . $context['session_id'], 'custom' => 'onclick="return confirm(\'' . addslashes($txt['remove_message']) . '?\');"'), ); // Show the conversation buttons. echo '
'; template_button_strip($conversation_buttons, 'right'); echo '
'; } echo '
'; // Show the helpful titlebar - generally. if ($context['display_mode'] != 1) echo '

', $txt['author'], ' ', $txt[$context['display_mode'] == 0 ? 'messages' : 'conversation'], '

'; // Cache some handy buttons. $quote_button = create_button('quote.gif', 'reply_quote', 'quote', 'align="middle"'); $reply_button = create_button('im_reply.gif', 'reply', 'reply', 'align="middle"'); $reply_all_button = create_button('im_reply_all.gif', 'reply_to_all', 'reply_to_all', 'align="middle"'); $forward_button = create_button('quote.gif', 'reply_quote', 'reply_quote', 'align="middle"'); $delete_button = create_button('delete.gif', 'remove_message', 'remove', 'align="middle"'); while ($message = $context['get_pmessage']('message')) { $is_first_post = !isset($is_first_post) ? true : false; // Show information about the poster of this message. echo '

', $message['member']['link'], '

    '; // Show the member's custom title, if they have one. if (isset($message['member']['title']) && $message['member']['title'] != '') echo '
  • ', $message['member']['title'], '
  • '; // Show the member's primary group (like 'Administrator') if they have one. if (isset($message['member']['group']) && $message['member']['group'] != '') echo '
  • ', $message['member']['group'], '
  • '; // Don't show these things for guests. if (!$message['member']['is_guest']) { // Show the post group if and only if they have no other group or the option is on, and they are in a post group. if ((empty($settings['hide_post_group']) || $message['member']['group'] == '') && $message['member']['post_group'] != '') echo '
  • ', $message['member']['post_group'], '
  • '; echo '
  • ', $message['member']['group_stars'], '
  • '; // Is karma display enabled? Total or +/-? if ($modSettings['karmaMode'] == '1') echo '
  • ', $modSettings['karmaLabel'], ' ', $message['member']['karma']['good'] - $message['member']['karma']['bad'], '
  • '; elseif ($modSettings['karmaMode'] == '2') echo '
  • ', $modSettings['karmaLabel'], ' +', $message['member']['karma']['good'], '/-', $message['member']['karma']['bad'], '
  • '; // Is this user allowed to modify this member's karma? if ($message['member']['karma']['allow']) echo '
  • ', $modSettings['karmaApplaudLabel'], ' ', $modSettings['karmaSmiteLabel'], '
  • '; // Show online and offline buttons? if (!empty($modSettings['onlineEnable'])) echo '
  • ', $context['can_send_pm'] ? '' : '', $settings['use_image_buttons'] ? '' . $message['member']['online']['text'] . '' : $message['member']['online']['text'], $context['can_send_pm'] ? '' : '', $settings['use_image_buttons'] ? ' ' . $message['member']['online']['text'] . '' : '', '
  • '; // Show the member's gender icon? if (!empty($settings['show_gender']) && $message['member']['gender']['image'] != '' && !isset($context['disabled_fields']['gender'])) echo '
  • ', $txt['gender'], ': ', $message['member']['gender']['image'], '
  • '; // Show how many posts they have made. if (!isset($context['disabled_fields']['posts'])) echo '
  • ', $txt['member_postcount'], ': ', $message['member']['posts'], '
  • '; // Any custom fields for standard placement? if (!empty($message['member']['custom_fields'])) { foreach ($message['member']['custom_fields'] as $custom) if (empty($custom['placement']) && !empty($custom['value'])) echo '
  • ', $custom['title'], ': ', $custom['value'], '
  • '; } // Show avatars, images, etc.? if (!empty($settings['show_user_images']) && empty($options['show_no_avatars']) && !empty($message['member']['avatar']['image'])) echo '
  • ', $message['member']['avatar']['image'], '
  • '; // Show their personal text? if (!empty($settings['show_blurb']) && $message['member']['blurb'] != '') echo '
  • ', $message['member']['blurb'], '
  • '; // Any custom fields to show as icons? if (!empty($message['member']['custom_fields'])) { $shown = false; foreach ($message['member']['custom_fields'] as $custom) { if ($custom['placement'] != 1 || empty($custom['value'])) continue; if (empty($shown)) { $shown = true; echo '
    • '; } echo '
    • ', $custom['value'], '
    • '; } if ($shown) echo '
  • '; } // This shows the popular messaging icons. if ($message['member']['has_messenger'] && $message['member']['can_view_profile']) echo '
    • ', !isset($context['disabled_fields']['icq']) && !empty($message['member']['icq']['link']) ? '
    • ' . $message['member']['icq']['link'] . '
    • ' : '', ' ', !isset($context['disabled_fields']['msn']) && !empty($message['member']['msn']['link']) ? '
    • ' . $message['member']['msn']['link'] . '
    • ' : '', ' ', !isset($context['disabled_fields']['aim']) && !empty($message['member']['aim']['link']) ? '
    • ' . $message['member']['aim']['link'] . '
    • ' : '', ' ', !isset($context['disabled_fields']['yim']) && !empty($message['member']['yim']['link']) ? '
    • ' . $message['member']['yim']['link'] . '
    • ' : '', '
  • '; // Show the profile, website, email address, and personal message buttons. if ($settings['show_profile_buttons']) { echo '
  • '; } // Are we showing the warning status? if ($message['member']['can_see_warning']) echo '
  • ', $context['can_issue_warning'] ? '' : '', '', $txt['user_warn_' . $message['member']['warning_status']], '', $context['can_issue_warning'] ? '' : '', '', $txt['warn_' . $message['member']['warning_status']], '
  • '; } // Done with the information about the poster... on to the post itself. echo '
', $message['subject'], '
'; // Show who the message was sent to. echo '
« ', $txt['sent_to'], ': '; // People it was sent directly to.... if (!empty($message['recipients']['to'])) echo implode(', ', $message['recipients']['to']); // Otherwise, we're just going to say "some people"... elseif ($context['folder'] != 'sent') echo '(', $txt['pm_undisclosed_recipients'], ')'; echo ' ', $txt['on'], ': ', $message['time'], ' »
'; // If we're in the sent items, show who it was sent to besides the "To:" people. if (!empty($message['recipients']['bcc'])) echo '
« ', $txt['pm_bcc'], ': ', implode(', ', $message['recipients']['bcc']), ' »
'; if (!empty($message['is_replied_to'])) echo '
« ', $txt['pm_is_replied_to'], ' »
'; echo '
    '; // Show reply buttons if you have the permission to send PMs. if ($context['can_send_pm']) { // You can't really reply if the member is gone. if (!$message['member']['is_guest']) { // Were than more than one recipient you can reply to? (Only shown when not in conversation mode.) if ($message['number_recipients'] > 1 && $context['display_mode'] != 2) echo '
  • ', $reply_all_button, '
  • '; echo '
  • ', $reply_button, '
  • ', $quote_button, '
  • '; } // This is for "forwarding" - even if the member is gone. else echo '
  • ', $forward_button, '
  • '; } echo '
  • ', $delete_button, '
  • '; if (empty($context['display_mode'])) echo '
  • '; echo '

', $message['body'], '
'; if (!empty($modSettings['enableReportPM']) && $context['folder'] != 'sent') echo ' '; // Are there any custom profile fields for above the signature? if (!empty($message['member']['custom_fields'])) { $shown = false; foreach ($message['member']['custom_fields'] as $custom) { if ($custom['placement'] != 2 || empty($custom['value'])) continue; if (!$shown) { $shown = true; echo '
    ', $message['member']['signature'], '
'; // Add an extra line at the bottom if we have labels enabled. if ($context['folder'] != 'sent' && !empty($context['currently_using_labels']) && $context['display_mode'] != 2) { echo '
'; // Add the label drop down box. if (!empty($context['currently_using_labels'])) { echo ' '; } echo '
'; } echo '
'; } echo '
'; if (empty($context['display_mode'])) echo '
', $txt['pages'], ': ', $context['page_index'], '
'; // Show a few buttons if we are in conversation mode and outputting the first message. elseif ($context['display_mode'] == 2 && isset($conversation_buttons)) template_button_strip($conversation_buttons); echo '
'; } // Individual messages = buttom list! if ($context['display_mode'] == 1) { template_subject_list(); echo '
'; } echo '
'; } // Just list all the personal message subjects - to make templates easier. function template_subject_list() { global $context, $options, $settings, $modSettings, $txt, $scripturl; echo ' '; if (!$context['show_delete']) echo ' '; $next_alternate = 0; while ($message = $context['get_pmessage']('subject')) { echo ' '; $next_alternate = !$next_alternate; } echo '
', $txt['pm_change_view'], ' ', $txt['date'], $context['sort_by'] == 'date' ? ' ' : '', ' ', $txt['subject'], $context['sort_by'] == 'subject' ? ' ' : '', ' ', ($context['from_or_to'] == 'from' ? $txt['from'] : $txt['to']), $context['sort_by'] == 'name' ? ' ' : '', '
', $txt['msg_alert_none'], '
', $message['is_replied_to'] ? '' . $txt['pm_replied'] . '' : '' . $txt['pm_read'] . '', ' ', $message['time'], ' ', ($context['display_mode'] != 0 && $context['current_pm'] == $message['id'] ? '*' : ''), '', $message['subject'], '', $message['is_unread'] ? ' ' . $txt['new'] . '' : '', ' ', ($context['from_or_to'] == 'from' ? $message['member']['link'] : (empty($message['recipients']['to']) ? '' : implode(', ', $message['recipients']['to']))), '
', $txt['pages'], ': ', $context['page_index'], '
 '; if ($context['show_delete']) { if (!empty($context['currently_using_labels']) && $context['folder'] != 'sent') { echo ' '; } echo ' '; } echo '
'; } function template_search() { global $context, $settings, $options, $scripturl, $modSettings, $txt; echo '

', $txt['pm_search_title'], '

'; if (!empty($context['search_errors'])) { echo '
', implode('
', $context['search_errors']['messages']), '
'; } if ($context['simple_search']) { echo ' '; } // Advanced search! else { echo ' '; // Do we have some labels setup? If so offer to search by them! if ($context['currently_using_labels']) { echo '
    '; foreach ($context['search_labels'] as $label) echo '
  • '; echo '

'; } echo '
'; } echo '
'; } function template_search_results() { global $context, $settings, $options, $scripturl, $modSettings, $txt; // This splits broadly into two types of template... complete results first. if (!empty($context['search_params']['show_complete'])) { echo '
', $txt['pm_search_results'], '
', $txt['pages'], ': ', $context['page_index'], '
'; } else { echo ' '; } $alternate = true; // Print each message out... foreach ($context['personal_messages'] as $message) { // We showing it all? if (!empty($context['search_params']['show_complete'])) { // !!! This still needs to be made pretty. echo '
', $txt['pm_search_results'], '
', $txt['pages'], ': ', $context['page_index'], '
', $txt['date'], ' ', $txt['subject'], ' ', $txt['from'], '
', $message['counter'], '  ', $message['subject'], '
', $txt['search_on'], ': ', $message['time'], '
', $txt['from'], ': ', $message['member']['link'], ', ', $txt['to'], ': '; // Show the recipients. // !!! This doesn't deal with the sent item searching quite right for bcc. if (!empty($message['recipients']['to'])) echo implode(', ', $message['recipients']['to']); // Otherwise, we're just going to say "some people"... elseif ($context['folder'] != 'sent') echo '(', $txt['pm_undisclosed_recipients'], ')'; echo '
', $message['body'], '
'; if ($context['can_send_pm']) { $quote_button = create_button('quote.gif', 'reply_quote', 'reply_quote', 'align="middle"'); $reply_button = create_button('im_reply.gif', 'reply', 'reply', 'align="middle"'); // You can only reply if they are not a guest... if (!$message['member']['is_guest']) echo ' ', $quote_button , '', $context['menu_separator'], ' ', $reply_button , ' ', $context['menu_separator']; // This is for "forwarding" - even if the member is gone. else echo ' ', $quote_button , '', $context['menu_separator']; } echo '
'; } // Otherwise just a simple list! else { // !!! No context at all of the search? echo ' ', $message['time'], ' ', $message['link'], ' ', $message['member']['link'], ' '; } $alternate = !$alternate; } // Finish off the page... if (!empty($context['search_params']['show_complete'])) { // No results? if (empty($context['personal_messages'])) echo '
', $txt['pm_search_none_found'], '
'; else echo '
'; echo '
', $txt['pages'], ': ', $context['page_index'], '
'; } else { if (empty($context['personal_messages'])) echo ' ', $txt['pm_search_none_found'], ' '; echo ' ', $txt['pages'], ': ', $context['page_index'], ' '; } } function template_send() { global $context, $settings, $options, $scripturl, $modSettings, $txt; // Show which messages were sent successfully and which failed. if (!empty($context['send_log'])) { echo '

', $txt['pm_send_report'], '

'; if (!empty($context['send_log']['sent'])) foreach ($context['send_log']['sent'] as $log_entry) echo '', $log_entry, '
'; if (!empty($context['send_log']['failed'])) foreach ($context['send_log']['failed'] as $log_entry) echo '', $log_entry, '
'; echo '

'; } // Show the preview of the personal message. if (isset($context['preview_message'])) echo '

', $context['preview_subject'], '

', $context['preview_message'], '

'; // Main message editing box. echo '

', $txt['new_message'], ' ', $txt['new_message'], '

'; echo '
'; // If there were errors for sending the PM, show them. if (!empty($context['post_error']['messages'])) { echo '
', $txt['error_while_submitting'], '
    '; foreach ($context['post_error']['messages'] as $error) echo '
  • ', $error, '
  • '; echo '
'; } echo '
'; // To and bcc. Include a button to search for members. echo '
', $txt['pm_to'], ':
'; // Autosuggest will be added by the JavaScript later on. echo '
'; // A link to add BCC, only visible with JavaScript enabled. echo ' '; // A div that'll contain the items found by the autosuggest. echo '
'; echo '
'; // This BCC row will be hidden by default if JavaScript is enabled. echo '
', $txt['pm_bcc'], ':
'; // The subject of the PM. echo '
', $txt['subject'], ':
'; // Showing BBC? if ($context['show_bbc']) { echo '
'; } // What about smileys? if (!empty($context['smileys']['postform']) || !empty($context['smileys']['popup'])) echo '
'; // Show BBC buttons, smileys and textbox. echo ' ', template_control_richedit($context['post_box_name'], 'smileyBox_message', 'bbcBox_message'); // Require an image to be typed to save spamming? if ($context['require_verification']) { echo '
', $txt['pm_visual_verification_label'], ': ', template_control_verification($context['visual_verification_id'], 'all'), '
'; } // Send, Preview, spellcheck buttons. echo '

', $context['browser']['is_firefox'] ? $txt['shortcuts_firefox'] : $txt['shortcuts'], '

', template_control_richedit_buttons($context['post_box_name']), '

'; // Show the message you're replying to. if ($context['reply']) echo '

', $txt['subject'], ': ', $context['quoted_message']['subject'], '

', $txt['from'], ': ', $context['quoted_message']['member']['name'], ' ', $txt['on'], ': ', $context['quoted_message']['time'], '

', $context['quoted_message']['body'], '
'; echo ' '; } // This template asks the user whether they wish to empty out their folder/messages. function template_ask_delete() { global $context, $settings, $options, $scripturl, $modSettings, $txt; echo '

', ($context['delete_all'] ? $txt['delete_message'] : $txt['delete_all']), '

', $txt['delete_all_confirm'], '


', $txt['yes'], ' - ', $txt['no'], '
'; } // This template asks the user what messages they want to prune. function template_prune() { global $context, $settings, $options, $scripturl, $txt; echo '

', $txt['pm_prune'], '

', $txt['pm_prune_desc1'], ' ', $txt['pm_prune_desc2'], '

'; } // Here we allow the user to setup labels, remove labels and change rules for labels (i.e, do quite a bit) function template_labels() { global $context, $settings, $options, $scripturl, $txt; echo '

', $txt['pm_manage_labels'], '

', $txt['pm_labels_desc'], '
'; if (count($context['labels']) < 2) echo ' '; else { $alternate = true; foreach ($context['labels'] as $label) { if ($label['id'] == -1) continue; echo ' '; $alternate = !$alternate; } } echo '
', $txt['pm_label_name'], '
', $txt['pm_labels_no_exist'], '
'; if (!count($context['labels']) < 2) echo '
'; echo '

', $txt['pm_label_add_new'], '

:
'; } // Template for reporting a personal message. function template_report_message() { global $context, $settings, $options, $txt, $scripturl; echo '

', $txt['pm_report_title'], '

', $txt['pm_report_desc'], '
'; // If there is more than one admin on the forum, allow the user to choose the one they want to direct to. // !!! Why? if ($context['admin_count'] > 1) { echo '
', $txt['pm_report_admins'], ':
'; } echo '
', $txt['pm_report_reason'], ':
'; } // Little template just to say "Yep, it's been submitted" function template_report_message_complete() { global $context, $settings, $options, $txt, $scripturl; echo '

', $txt['pm_report_title'], '

', $txt['pm_report_done'], '

', $txt['pm_report_return'], '
'; } // Manage rules. function template_rules() { global $context, $settings, $options, $txt, $scripturl; echo '

', $txt['pm_manage_rules'], '

', $txt['pm_manage_rules_desc'], '
'; if (empty($context['rules'])) echo ' '; $alternate = false; foreach ($context['rules'] as $rule) { echo ' '; $alternate = !$alternate; } echo '
', $txt['pm_rule_title'], ' '; if (!empty($context['rules'])) echo ' '; echo '
', $txt['pm_rules_none'], '
', $rule['name'], '
[', $txt['pm_add_rule'], ']'; if (!empty($context['rules'])) echo ' [', $txt['pm_apply_rules'], ']'; if (!empty($context['rules'])) echo ' '; echo '
'; } // Template for adding/editing a rule. function template_add_rule() { global $context, $settings, $options, $txt, $scripturl; echo ' '; echo '

', $context['rid'] == 0 ? $txt['pm_add_rule'] : $txt['pm_edit_rule'], '

', $txt['pm_rule_name'], ':
', $txt['pm_rule_name_desc'], '
', $txt['pm_rule_criteria'], ''; // Add a dummy criteria to allow expansion for none js users. $context['rule']['criteria'][] = array('t' => '', 'v' => ''); // For each criteria print it out. $isFirst = true; foreach ($context['rule']['criteria'] as $k => $criteria) { if (!$isFirst && $criteria['t'] == '') echo '
'; else echo '
'; echo ' '; // If this is the dummy we add a means to hide for non js users. if ($isFirst) $isFirst = false; elseif ($criteria['t'] == '') echo '
'; } echo '


', $txt['pm_rule_logic'], ':
', $txt['pm_rule_actions'], ''; // As with criteria - add a dummy action for "expansion". $context['rule']['actions'][] = array('t' => '', 'v' => ''); // Print each action. $isFirst = true; foreach ($context['rule']['actions'] as $k => $action) { if (!$isFirst && $action['t'] == '') echo '
'; else echo '
'; echo ' '; if ($isFirst) $isFirst = false; elseif ($action['t'] == '') echo '
'; } echo '

', $txt['pm_rule_description'], '

', $txt['pm_rule_js_disabled'], '
'; // Now setup all the bits! echo ' '; } ?>