', $txt['report_sent'], ' '; // Let them know why their message became unapproved. if ($context['becomesUnapproved']) echo '
', $txt['post_becomes_unapproved'], '
'; // Show new topic info here? echo '

', $context['subject'], '', ($context['is_locked']) ? ' ' : '', ($context['is_sticky']) ? ' ' : '', '

', $txt['started_by'], ' ', $context['topic_poster_name'], ', ', $context['topic_started_time'], '

'; // Next - Prev echo ' ', $context['previous_next'], ''; if (!empty($settings['display_who_viewing'])) { echo '

'; // Show just numbers...? if ($settings['display_who_viewing'] == 1) echo count($context['view_members']), ' ', count($context['view_members']) == 1 ? $txt['who_member'] : $txt['members']; // Or show the actual people viewing the topic? else echo empty($context['view_members_list']) ? '0 ' . $txt['members'] : implode(', ', $context['view_members_list']) . ((empty($context['view_num_hidden']) || $context['can_moderate_forum']) ? '' : ' (+ ' . $context['view_num_hidden'] . ' ' . $txt['hidden'] . ')'); // Now show how many guests are here too. echo $txt['who_and'], $context['view_num_guests'], ' ', $context['view_num_guests'] == 1 ? $txt['guest'] : $txt['guests'], $txt['who_viewing_topic'], '

'; } // Show the anchor for the top and for the first message. If the first message is new, say so. echo '
', $context['first_new_message'] ? '' : ''; // Is this topic also a poll? if ($context['is_poll']) { echo '

', $context['poll']['is_locked'] ? '' : '', ' ', $context['poll']['question'], '

'; // Are they not allowed to vote but allowed to view the options? if ($context['poll']['show_results'] || !$context['allow_vote']) { echo '
'; // Show each option with its corresponding percentage bar. foreach ($context['poll']['options'] as $option) { echo '
', $option['option'], '
'; if ($context['allow_results_view']) echo ' ', $option['bar_ndt'], ' ', $option['votes'], ' (', $option['percent'], '%)'; echo '
'; } echo '
'; if ($context['allow_results_view']) echo '

', $txt['poll_total_voters'], ': ', $context['poll']['total_votes'], '

'; } // They are allowed to vote! Go to it! else { echo '
'; // Show a warning if they are allowed more than one option. if ($context['poll']['allowed_warning']) echo '

', $context['poll']['allowed_warning'], '

'; echo '
    '; // Show each option with its button - a radio likely. foreach ($context['poll']['options'] as $option) echo '
  • ', $option['vote_button'], '
  • '; echo '
'; } // Is the clock ticking? if (!empty($context['poll']['expire_time'])) echo '

', ($context['poll']['is_expired'] ? $txt['poll_expired_on'] : $txt['poll_expires_on']), ': ', $context['poll']['expire_time'], '

'; echo '
'; template_button_strip($context['poll_buttons']); echo '
'; } // Does this topic have some events linked to it? if (!empty($context['linked_calendar_events'])) { echo '

', $txt['calendar_linked_events'], '

'; } // Show the page index... "Pages: [1]". echo '
', template_button_strip($context['normal_buttons'], 'right'), ' ', $context['menu_separator'], ' '; // Mobile action - moderation buttons (top) if (!empty($context['normal_buttons'])) echo '
', $txt['mobile_action'], ' ', !empty($context['mod_buttons']) ? '' . $txt['mobile_moderation'] . '' : '', '
'; echo '
'; // Show the topic information - icon, subject, etc. echo '
'; $context['ignoredMsgs'] = array(); $context['removableMessageIDs'] = array(); // Get all the messages... while ($message = $context['get_message']()) template_single_post($message); echo '
'; // Show the page index... "Pages: [1]". echo '
', template_button_strip($context['normal_buttons'], 'right'), ' ', $context['menu_separator'], ' '; // Mobile action - moderation buttons (bottom) if (!empty($context['normal_buttons'])) echo '
', $txt['mobile_action'], ' ', !empty($context['mod_buttons']) ? '' . $txt['mobile_moderation'] . '' : '', '
'; echo '
'; // Show the lower breadcrumbs. theme_linktree(); // Moderation buttons echo '
', template_button_strip($context['mod_buttons'], 'bottom', array('id' => 'moderationbuttons_strip')), '
'; // Show the jumpto box, or actually...let Javascript do it. echo '
'; // Show quickreply if ($context['can_reply']) template_quickreply(); // User action pop on mobile screen (or actually small screen), this uses responsive css does not check mobile device. echo ' '; // Show the moderation button & pop (if there is anything to show) if (!empty($context['mod_buttons'])) echo ' '; echo ' '; } /** * Template for displaying a single post. * * @param array $message An array of information about the message to display. Should have 'id' and 'member'. Can also have 'first_new', 'is_ignored' and 'css_class'. */ function template_single_post($message) { global $context, $settings, $options, $txt, $scripturl, $modSettings; $ignoring = false; if ($message['can_remove']) $context['removableMessageIDs'][] = $message['id']; // Are we ignoring this message? if (!empty($message['is_ignored'])) { $ignoring = true; $context['ignoredMsgs'][] = $message['id']; } // Show the message anchor and a "new" anchor if this message is new. echo '
', $message['id'] != $context['first_message'] ? ' ' . ($message['first_new'] ? '' : '') : '', '
'; // Show information about the poster of this message. 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 ' ', $context['can_send_pm'] ? '' : '', '', $context['can_send_pm'] ? '' : ''; // 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'], ''; // Begin display of user info echo '

'; // Some people don't want subject... The div is still required or quick edit breaks. echo '
', $message['link'], '
'; echo ' ', !empty($message['counter']) ? '#' . $message['counter'] . '' : '', '
'; // Ignoring this user? Hide the post. if ($ignoring) echo '
', $txt['ignoring_user'], '
'; // Show the post itself, finally! echo '
'; if (!$message['approved'] && $message['member']['id'] != 0 && $message['member']['id'] == $context['user']['id']) echo '
', $txt['post_awaiting_approval'], '
'; echo '
'; // Assuming there are attachments... if (!empty($message['attachment'])) { $last_approved_state = 1; // Don't output the div unless we actually have something to show... $div_output = false; foreach ($message['attachment'] as $attachment) { // Do we want this attachment to not be showed here? if ($attachment['is_approved'] && !empty($modSettings['dont_show_attach_under_post']) && !empty($context['show_attach_under_post'][$attachment['id']])) continue; elseif (!$div_output) { $div_output = true; echo ' '; } echo '
'; // What about likes? if (!empty($modSettings['enable_likes'])) { echo '
    '; if (!empty($message['likes']['can_like'])) { echo ' '; } if (!empty($message['likes']['count'])) { $context['some_likes'] = true; $count = $message['likes']['count']; $base = 'likes_'; if ($message['likes']['you']) { $base = 'you_' . $base; $count--; } $base .= (isset($txt[$base . $count])) ? $count : 'n'; echo ' '; } echo '
'; } // Show the quickbuttons, for various operations on posts. template_quickbuttons($message['quickbuttons'], 'post'); 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 ' '; // 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 '

'; } /** * The template for displaying the quick reply box. */ function template_quickreply() { global $context, $modSettings, $scripturl, $options, $txt; echo '

', $txt['quick_reply'], '

'; // Is the topic locked? if ($context['is_locked']) echo '

', $txt['quick_reply_warning'], '

'; // Show a warning if the topic is old if (!empty($context['oldTopicError'])) echo '

', sprintf($txt['error_old_topic'], $modSettings['oldTopicDays']), '

'; // Does the post need approval? if (!$context['can_reply_approved']) echo '

', $txt['wait_for_approval'], '

'; echo '
'; // Guests just need more. if ($context['user']['is_guest']) { echo '
', $txt['name'], ':
'; if (empty($modSettings['guest_post_no_email'])) { echo '
', $txt['email'], ':
'; } echo '
'; } echo ' ', template_control_richedit($context['post_box_name'], 'smileyBox_message', 'bbcBox_message'), ' '; // Is visual verification enabled? if ($context['require_verification']) echo '
', $txt['verification'], ': ', template_control_verification($context['visual_verification_id'], 'all'), '
'; // Finally, the submit buttons. echo ' ', template_control_richedit_buttons($context['post_box_name']), ' '; echo '

'; // Draft autosave available and the user has it enabled? if (!empty($context['drafts_autosave'])) echo ' '; if ($context['show_spellchecking']) echo '
'; echo ' '; } ?>