'; // Show the capacity bar, if available. if (!empty($context['limit_bar'])) echo '

', $txt['pm_capacity'], ': ', $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() { echo ' '; } /** * Displays a popup with information about your personal messages */ function template_pm_popup() { global $context, $txt, $scripturl; // Unlike almost every other template, this is designed to be included into the HTML directly via $().load() echo '
', $context['can_send_pm'] ? '' . $txt['pm_new_short'] . '' : '', ' ', $context['can_draft'] ? ' | ' . $txt['pm_drafts_short'] . '' : '', ' ', $txt['pm_settings_short'], '
', $txt['inbox'], ' ', $txt['sent_items'], '
'; if (empty($context['unread_pms'])) echo '
', $txt['pm_no_unread'], '
'; else { foreach ($context['unread_pms'] as $id_pm => $pm_details) echo '
', !empty($pm_details['member']) ? $pm_details['member']['avatar']['image'] : '', '
', $pm_details['pm_link'], '
', $pm_details['replied_to_you'] ? '' : '', !empty($pm_details['member']) ? $pm_details['member']['link'] : $pm_details['member_from'], ' - ', $pm_details['time'], '
'; } echo '
'; } /** * Shows a particular folder (eg inbox or outbox), all the PMs in it, etc. */ function template_folder() { global $context, $scripturl, $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) { // This bit uses info set in template_subject_list, so it's wrapped // in an if just in case a mod or custom theme breaks it. if (!empty($context['current_pm_subject'])) { echo '

', $txt['conversation'], '

', $context['current_pm_subject'], '

', $txt['started_by'], ' ', $context['current_pm_author'], ', ', $context['current_pm_time'], '

'; } else { echo '
'; } // Show the conversation buttons. template_button_strip($context['conversation_buttons'], 'right'); echo '
'; } while ($message = $context['get_pmessage']('message')) template_single_pm($message); if (empty($context['display_mode'])) echo '
'; // Show a few buttons if we are in conversation mode and outputting the first message. elseif ($context['display_mode'] == 2 && isset($context['conversation_buttons'])) { echo '
'; template_button_strip($context['conversation_buttons'], 'right'); echo '
'; } echo '
'; } // Individual messages = buttom list! if ($context['display_mode'] == 1) { template_subject_list(); echo '
'; } echo ' '; } /** * Template for displaying a single personal message. * * @param array $message An array of information about the message to display. */ function template_single_pm($message) { global $context, $scripturl, $txt, $settings, $options, $modSettings; echo '
'; // Are there any custom fields above the member name? if (!empty($message['custom_fields']['above_member'])) { echo '
    '; foreach ($message['custom_fields']['above_member'] as $custom) echo '
  • ', $custom['value'], '
  • '; echo '
'; } echo '

'; // Show online and offline buttons? if (!empty($modSettings['onlineEnable']) && !$message['member']['is_guest']) echo ' '; // Custom fields BEFORE the username? if (!empty($message['custom_fields']['before_member'])) foreach ($message['custom_fields']['before_member'] as $custom) echo ' ', $custom['value'], ''; // Show a link to the member's profile. echo ' ', $message['member']['link']; // Custom fields AFTER the username? if (!empty($message['custom_fields']['after_member'])) foreach ($message['custom_fields']['after_member'] as $custom) echo ' ', $custom['value'], ''; echo '

'; echo '
', $message['subject'], '
', $message['body'], '
'; // 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 '
'; } // Message options template_quickbuttons($message['quickbuttons'], 'pm'); echo '
'; // Are there any custom profile fields for above the signature? if (!empty($message['custom_fields']['above_signature'])) { echo '
    '; foreach ($message['custom_fields']['above_signature'] as $custom) echo '
  • ', $custom['value'], '
  • '; echo '
'; } // Show the member's signature? if (!empty($message['member']['signature']) && empty($options['show_no_signatures']) && $context['signature_enabled']) echo '
', $message['member']['signature'], '
'; // Are there any custom profile fields for below the signature? if (!empty($message['custom_fields']['below_signature'])) { echo '
    '; foreach ($message['custom_fields']['below_signature'] as $custom) echo '
  • ', $custom['value'], '
  • '; echo '
'; } echo '
'; } /** * Just list all the personal message subjects - to make templates easier. */ function template_subject_list() { global $context, $settings, $txt, $scripturl; echo '

', $context['folder'] == 'sent' ? $txt['sent_items'] : $context['current_label'], '

'; if (!$context['show_delete']) echo ' '; while ($message = $context['get_pmessage']('subject')) { // Used for giving extra info in conversation view if ($context['current_pm'] == $message['id']) { $context['current_pm_subject'] = $message['subject']; $context['current_pm_time'] = $message['time']; $context['current_pm_author'] = $message['member']['link']; } echo ' '; } echo '
', $txt['date'], $context['sort_by'] == 'date' ? ' ' : '', ' ', $txt['subject'], $context['sort_by'] == 'subject' ? ' ' : '', ' ', ($context['from_or_to'] == 'from' ? $txt['from'] : $txt['pm_to']), $context['sort_by'] == 'name' ? ' ' : '', '
', $txt['pm_alert_none'], '
', $message['is_replied_to'] ? '' : '', ' ', $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']))), ' ', $message['time'], ' ', ($context['from_or_to'] == 'from' ? $message['member']['link'] : (empty($message['recipients']['to']) ? '' : implode(', ', $message['recipients']['to']))), '
 '; if ($context['show_delete']) { if (!empty($context['currently_using_labels']) && $context['folder'] != 'sent') { echo ' '; } echo ' '; } echo '
'; } /** * The form for the PM search feature */ function template_search() { global $context, $scripturl, $txt; if (!empty($context['search_errors'])) echo '
', implode('
', $context['search_errors']['messages']), '
'; echo '

', $txt['pm_search_title'], '

'; // 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 '

'; // Some javascript for the advanced toggling echo ' '; } echo '
'; } /** * Displays results from a PM search */ function template_search_results() { global $context, $txt; echo '

', $txt['pm_search_results'], '

', sprintf($txt['pm_search_results_info'], $context['num_results'], sentence_list($context['search_in'])), '
'; // Complete results? if (empty($context['search_params']['show_complete']) && !empty($context['personal_messages'])) echo ' '; // Print each message out... foreach ($context['personal_messages'] as $message) { // Are we showing it all? if (!empty($context['search_params']['show_complete'])) template_single_pm($message); // Otherwise just a simple list! // @todo No context at all of the search? else echo ' '; } // Finish off the page... if (empty($context['search_params']['show_complete']) && !empty($context['personal_messages'])) echo '
', $txt['date'], ' ', $txt['subject'], ' ', $txt['from'], '
', $message['time'], ' ', $message['link'], ' ', $message['member']['link'], '
'; // No results? if (empty($context['personal_messages'])) echo '

', $txt['pm_search_none_found'], '

'; echo '
'; } /** * The form for sending a new PM */ function template_send() { global $context, $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. echo ' '; // Main message editing box. echo '

', $txt['new_message'], '

'; // If there were errors for sending the PM, show them. echo '
', $txt['error_while_submitting'], '
', empty($context['post_error']['messages']) ? '' : implode('
', $context['post_error']['messages']), '
'; if (!empty($modSettings['drafts_pm_enabled'])) 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'], ':
'; // Show BBC buttons, smileys and textbox. echo ' ', template_control_richedit($context['post_box_name'], 'smileyBox_message', 'bbcBox_message'); // If the admin enabled the pm drafts feature, show a draft selection box if (!empty($context['drafts_pm_save']) && !empty($context['drafts']) && !empty($options['drafts_show_saved_enabled'])) { echo '

', $txt['drafts_show'], '

', $txt['subject'], '
', $txt['draft_saved_on'], '
'; foreach ($context['drafts'] as $draft) echo '
', $draft['link'], '
', $draft['poster_time'], '
'; echo '
'; } // 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 ' ', template_control_richedit_buttons($context['post_box_name']), '
'; echo ' '; // Show the message you're replying to. if ($context['reply']) echo '

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

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

', $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, $scripturl, $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, $scripturl, $txt; echo '

', $txt['pm_prune'], '

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

', $txt['pm_remove_all'], '

'; } /** * 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, $scripturl, $txt; echo '

', $txt['pm_manage_labels'], '

', $txt['pm_labels_desc'], '
'; if (count($context['labels']) < 2) echo ' '; else { foreach ($context['labels'] as $label) { if ($label['id'] == -1) continue; echo ' '; } } echo '
', $txt['pm_label_name'], ' '; if (count($context['labels']) > 2) echo ' '; echo '
', $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, $txt, $scripturl; echo '
', $txt['pm_report_desc'], '

', $txt['pm_report_title'], '

'; // If there is more than one admin on the forum, allow the user to choose the one they want to direct to. // @todo 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, $txt, $scripturl; echo '

', $txt['pm_report_title'], '

', $txt['pm_report_done'], '

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

', $txt['pm_manage_rules'], '

', $txt['pm_manage_rules_desc'], '
'; if (empty($context['rules'])) echo ' '; foreach ($context['rules'] as $rule) echo ' '; 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, $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 '
'; elseif (!$isFirst) 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 '
'; elseif (!$isFirst) 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 ' '; } /** * Template for showing all of a user's PM drafts. */ function template_showPMDrafts() { global $context, $scripturl, $txt; echo '

', $txt['drafts_show'], '

', $txt['drafts_show_desc'], '

'; // No drafts? Just show an informative message. if (empty($context['drafts'])) echo '
', $txt['draft_none'], '
'; else { echo '
'; // For every draft to be displayed, give it its own div, and show the important details of the draft. foreach ($context['drafts'] as $draft) { echo '
#', $draft['counter'], '
', $draft['subject'], '
', $txt['pm_to'], ': ', implode(', ', $draft['recipients']['to']), '
'; if(!empty($draft['recipients']['bcc'])) echo'
', $txt['pm_bcc'], ': ', implode(', ', $draft['recipients']['bcc']), '
'; echo '
', $txt['draft_saved_on'], ': ', sprintf($txt['draft_days_ago'], $draft['age']), (!empty($draft['remaining']) ? ', ' . sprintf($txt['draft_retain'], $draft['remaining']) : ''), '
', $draft['body'], '
'; // Draft buttons template_quickbuttons($draft['quickbuttons'], 'pm_drafts'); echo '
'; } // Show page numbers. echo '
'; } } ?>