'; // 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() { 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 the helpful titlebar - generally. if ($context['display_mode'] != 1) echo '

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

'; // Show a few buttons if we are in conversation mode and outputting the first message. if ($context['display_mode'] == 2) { // Show the conversation buttons. echo '
'; template_button_strip($context['conversation_buttons'], 'right'); echo '
'; } while ($message = $context['get_pmessage']('message')) { $window_class = $message['alternate'] == 0 ? 'windowbg' : 'windowbg2'; echo '
  • '; // Show a link to the member's profile (but only if the sender isn't a guest). if (!$message['member']['is_guest']) echo ' '; echo ' ', $message['member']['name'], ''; // 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'], ''; if (!$message['member']['is_guest']) echo ' '; echo '

      '; // Show the member's custom title, if they have one. if (isset($message['member']['title']) && $message['member']['title'] != '') echo '
    • ', $message['member']['title'], '
    • '; // 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'], '
    • '; // Show how many posts they have made. if (!isset($context['disabled_fields']['posts'])) echo '
    • ', $txt['member_postcount'], ': ', $message['member']['posts'], '
    • '; // 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 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 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']['skype']) && !empty($message['member']['skype']['link']) ? '
      • ' . $message['member']['skype']['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'] . '
      • ' : '', '
    • '; // Stuff for the staff to wallop them with. echo '

    • '; if ($message['can_report']) echo ' '; // Can we issue a warning because of this post? Remember, we can't give guests warnings. if ($context['can_issue_warning'] && !$message['is_message_author'] && !$message['member']['is_guest']) echo '
    • ', $txt['issue_warning_post'], '
    • '; // Show the IP to this user for this post - because you can moderate? if (!empty($context['can_moderate_forum']) && !empty($message['member']['ip'])) echo '
    • ', $message['member']['ip'], ' (?)
    • '; // Or, should we show it because this is you? elseif ($message['can_see_ip']) echo '
    • ', $message['member']['ip'], '
    • '; // Okay, you are logged in, then we can show something about why IPs are logged... else echo '
    • ', $txt['logged'], '
    • '; // Show the profile, website, email address, and personal message buttons. if ($message['member']['show_profile_buttons']) { echo '
    • '; } // 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'], '
    • '; } // 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']], '
    • '; } echo '
  • '; if (!$message['member']['is_guest']) echo '
  • ', $message['member']['group_icons'], '
  • '; // Show the member's primary group (like 'Administrator') if they have one. if (isset($message['member']['group']) && $message['member']['group'] != '') echo '
  • ', $message['member']['group'], '
  • '; // Show online and offline buttons? PHP could do with a little bit of cleaning up here for brevity, but it works. // The plan is to make these buttons act sensibly, and link to your own inbox in your own posts (with new PM notification). // Still has a little bit of hard-coded text. This may be a place where translators should be able to write inclusive strings, // instead of dealing with $txt['by'] etc in the markup. Must be brief to work, anyway. Cannot ramble on at all. if ($context['can_send_pm'] && $message['is_message_author']) { echo '
  • ', $txt['pm_short'], ' ', $context['user']['unread_messages'] > 0 ? '['. $context['user']['unread_messages'] . ']' : '' , '
  • '; } elseif ($context['can_send_pm'] && !$message['is_message_author'] && !$message['member']['is_guest']) { if (!empty($modSettings['onlineEnable'])) echo '
  • ', $txt['send_message'], '
  • '; else echo '
  • ', $txt['send_message'], '
  • '; } elseif (!$context['can_send_pm'] && !empty($modSettings['onlineEnable'])) echo '
  • ', ($message['member']['online']['is_online']) ? $txt['online'] : $txt['offline'], '
  • '; // 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']) { // Is there than more than one recipient you can reply to? if ($message['number_recipients'] > 1) echo '
  • ', $txt['reply_to_all'], '
  • '; echo '
  • ', $txt['reply'], '
  • ', $txt['quote'], '
  • '; } // This is for "forwarding" - even if the member is gone. else echo '
  • ', $txt['reply_quote'], '
  • '; } echo '
  • ', $txt['delete'], '
  • '; if (empty($context['display_mode'])) echo '
  • '; echo '
', $message['body'], '
'; // 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 '
    '; } echo '
  • ', $custom['value'], '
  • '; } if ($shown) echo '
'; } // Show the member's signature? if (!empty($message['member']['signature']) && empty($options['show_no_signatures']) && $context['signature_enabled']) 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 '
'; } if (empty($context['display_mode'])) echo '
', $context['page_index'], '
'; // 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 '
'; } // 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 = false; 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['pm_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']))), '
', $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 '


'; // Some javascript for the advanced toggling echo ' '; } } echo '
'; } function template_search_results() { global $context, $settings, $options, $scripturl, $modSettings, $txt; echo '

', $txt['pm_search_results'], '

', $context['page_index'], '
'; // complete results ? if (empty($context['search_params']['show_complete']) && !empty($context['personal_messages'])) echo ' '; $alternate = true; // Print each message out... foreach ($context['personal_messages'] as $message) { // We showing it all? if (!empty($context['search_params']['show_complete'])) { echo '

', $txt['search_on'], ': ', $message['time'], ' ', $message['counter'], '  ', $message['subject'], '

', $txt['from'], ': ', $message['member']['link'], ', ', $txt['to'], ': '; // Show the recipients. // @todo 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.png', 'reply_quote', 'reply_quote', 'class="centericon"'); $reply_button = create_button('im_reply.png', 'reply', 'reply', 'class="centericon"'); // 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 { // @todo No context at all of the search? echo ' '; } $alternate = !$alternate; } // 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 '
', $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. echo ' '; // Main message editing box. echo '

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

'; echo '

'; // If there were errors for sending the PM, show them. echo ' '; 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'], ':

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


', template_control_richedit_buttons($context['post_box_name']), '
'; // If the admin enabled the pm drafts feature, show a draft selection box if (!empty($modSettings['drafts_enabled']) && !empty($context['drafts_pm_save']) && !empty($context['drafts']) && !empty($options['drafts_show_saved_enabled'])) { echo '

', $txt['draft_load'], '

', $txt['subject'], '
', $txt['draft_saved_on'], '
'; foreach ($context['drafts'] as $draft) echo '
', $draft['link'], '
', $draft['poster_time'], '
'; echo '
'; } 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, $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'], ' '; 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, $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. // @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, $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 '
'; 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 the PM drafts of the user. function template_showPMDrafts() { global $context, $settings, $options, $scripturl, $modSettings, $txt; echo '

', $txt['drafts_show'], '

', $context['page_index'], '
'; // Button shortcuts $edit_button = create_button('modify_inline.png', 'draft_edit', 'draft_edit', 'class="centericon"'); $remove_button = create_button('delete.png', 'draft_delete', 'draft_delete', 'class="centericon"'); // No drafts? Just show an informative message. if (empty($context['drafts'])) echo '
', $txt['draft_none'], '
'; else { // 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'], ' '; echo '
« ', $txt['draft_saved_on'], ': ', sprintf($txt['draft_days_ago'], $draft['age']), (!empty($draft['remaining']) ? ', ' . sprintf($txt['draft_retain'], $draft['remaining']) : ''), '»
« ', $txt['to'], ': ', implode(', ', $draft['recipients']['to']), ' »
« ', $txt['pm_bcc'], ': ', implode(', ', $draft['recipients']['bcc']), ' »
', $draft['body'], '
'; } } // Show page numbers. echo '
', $context['page_index'], '
'; } ?>