', $txt['report_sent'], ' '; } // 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 '

', $txt['poll'], '

', $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'], '
', $context['allow_poll_view'] ? $option['bar'] . ' ' . $option['votes'] . ' (' . $option['percent'] . '%)' : '', '
'; echo '
'; if ($context['allow_poll_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 '
'; // Build the poll moderation button array. $poll_buttons = array( 'vote' => array('test' => 'allow_return_vote', 'text' => 'poll_return_vote', 'image' => 'poll_options.gif', 'lang' => true, 'url' => $scripturl . '?topic=' . $context['current_topic'] . '.' . $context['start']), 'results' => array('test' => 'show_view_results_button', 'text' => 'poll_results', 'image' => 'poll_results.gif', 'lang' => true, 'url' => $scripturl . '?topic=' . $context['current_topic'] . '.' . $context['start'] . ';viewresults'), 'change_vote' => array('test' => 'allow_change_vote', 'text' => 'poll_change_vote', 'image' => 'poll_change_vote.gif', 'lang' => true, 'url' => $scripturl . '?action=vote;topic=' . $context['current_topic'] . '.' . $context['start'] . ';poll=' . $context['poll']['id'] . ';' . $context['session_var'] . '=' . $context['session_id']), 'lock' => array('test' => 'allow_lock_poll', 'text' => (!$context['poll']['is_locked'] ? 'poll_lock' : 'poll_unlock'), 'image' => 'poll_lock.gif', 'lang' => true, 'url' => $scripturl . '?action=lockvoting;topic=' . $context['current_topic'] . '.' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id']), 'edit' => array('test' => 'allow_edit_poll', 'text' => 'poll_edit', 'image' => 'poll_edit.gif', 'lang' => true, 'url' => $scripturl . '?action=editpoll;topic=' . $context['current_topic'] . '.' . $context['start']), 'remove_poll' => array('test' => 'can_remove_poll', 'text' => 'poll_remove', 'image' => 'admin_remove_poll.gif', 'lang' => true, 'custom' => 'onclick="return confirm(\'' . $txt['poll_remove_warn'] . '\');"', 'url' => $scripturl . '?action=removepoll;topic=' . $context['current_topic'] . '.' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id']), ); template_button_strip($poll_buttons); echo '

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

', $txt['calendar_linked_events'], '

'; } // Build the normal button array. $normal_buttons = array( 'reply' => array('test' => 'can_reply', 'text' => 'reply', 'image' => 'reply.gif', 'lang' => true, 'url' => $scripturl . '?action=post;topic=' . $context['current_topic'] . '.' . $context['start'] . ';last_msg=' . $context['topic_last_message']), 'add_poll' => array('test' => 'can_add_poll', 'text' => 'add_poll', 'image' => 'add_poll.gif', 'lang' => true, 'url' => $scripturl . '?action=editpoll;add;topic=' . $context['current_topic'] . '.' . $context['start']), 'notify' => array('test' => 'can_mark_notify', 'text' => ($context['is_marked_notify'] ? 'unnotify' : 'notify'), 'image' => ($context['is_marked_notify'] ? 'un' : ''). 'notify.gif', 'lang' => true, 'custom' => 'onclick="return confirm(\'' . ($context['is_marked_notify'] ? $txt['notification_disable_topic'] : $txt['notification_enable_topic']) . '\');"', 'url' => $scripturl . '?action=notify;sa=' . ($context['is_marked_notify'] ? 'off' : 'on') . ';topic=' . $context['current_topic'] . '.' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id']), 'mark_unread' => array('test' => 'can_mark_unread', 'text' => 'mark_unread', 'image' => 'markunread.gif', 'lang' => true, 'url' => $scripturl . '?action=markasread;sa=topic;t=' . $context['mark_unread_time'] . ';topic=' . $context['current_topic'] . '.' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id']), 'send' => array('test' => 'can_send_topic', 'text' => 'send_topic', 'image' => 'sendtopic.gif', 'lang' => true, 'url' => $scripturl . '?action=emailuser;sa=sendtopic;topic=' . $context['current_topic'] . '.0'), 'print' => array('text' => 'print', 'image' => 'print.gif', 'lang' => true, 'custom' => 'rel="new_win nofollow"', 'url' => $scripturl . '?action=printpage;topic=' . $context['current_topic'] . '.0'), ); // Allow adding new buttons easily. call_integration_hook('integrate_display_buttons', array(&$normal_buttons)); // Show the page index... "Pages: [1]". echo '
', $txt['pages'], ': ', $context['page_index'], !empty($modSettings['topbottomEnable']) ? $context['menu_separator'] . '   ' . $txt['go_down'] . '' : '', '
'; // Show the topic information - icon, subject, etc. echo '

', $txt['author'], ' ', $txt['topic'], ': ', $context['subject'], '  (', $txt['read'], ' ', $context['num_views'], ' ', $txt['times'], ')

'; 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'], '
'; } echo '
'; // These are some cache image buttons we may want. $reply_button = create_button('quote.gif', 'reply', 'quote', 'align="middle"'); $modify_button = create_button('modify.gif', 'modify', 'modify', 'align="middle"'); $remove_button = create_button('delete.gif', 'remove', 'remove', 'align="middle"'); $split_button = create_button('split.gif', 'split', 'split', 'align="middle"'); $approve_button = create_button('approve.gif', 'approve', 'approve', 'align="middle"'); $restore_message_button = create_button('restore_topic.gif', 'restore_message', 'restore_message', 'align="middle"'); $ignoredMsgs = array(); $removableMessageIDs = array(); // Get all the messages... while ($message = $context['get_message']()) { $is_first_post = !isset($is_first_post) ? true : false; $ignoring = false; if ($message['can_remove']) $removableMessageIDs[] = $message['id']; echo '
'; // Are we ignoring this message? if (!empty($message['is_ignored'])) { $ignoring = true; $ignoredMsgs[] = $message['id']; } // Show the message anchor and a "new" anchor if this message is new. if ($message['id'] != $context['first_message']) echo ' ', $message['first_new'] ? '' : ''; echo '
'; // 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']], '
  • '; } // Otherwise, show the guest's email. elseif (!empty($message['member']['email']) && in_array($message['member']['show_email'], array('yes', 'yes_permission_override', 'no_through_forum'))) echo '
  • ', ($settings['use_image_buttons'] ? '' . $txt['email'] . '' : $txt['email']), '
  • '; // Done with the information about the poster... on to the post itself. echo '
', $message['subject'], '
« ', !empty($message['counter']) ? $txt['reply_noun'] . ' #' . $message['counter'] : '', ' ', $txt['on'], ': ', $message['time'], ' »
'; // If this is the first post, (#0) just say when it was posted - otherwise give the reply #. if ($message['can_approve'] || $context['can_reply'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg']) echo '
    '; // Maybe we can approve it, maybe we should? if ($message['can_approve']) echo '
  • ', $approve_button, '
  • '; // Can they reply? Have they turned on quick reply? if ($context['can_quote'] && !empty($options['display_quick_reply'])) echo '
  • ', $reply_button, '
  • '; // So... quick reply is off, but they *can* reply? elseif ($context['can_quote']) echo '
  • ', $reply_button, '
  • '; // Can the user modify the contents of this post? if ($message['can_modify']) echo '
  • ', $modify_button, '
  • '; // How about... even... remove it entirely?! if ($message['can_remove']) echo '
  • ', $remove_button, '
  • '; // What about splitting it off the rest of the topic? if ($context['can_split'] && !empty($context['real_num_replies'])) echo '
  • ', $split_button, '
  • '; // Can we restore topics? if ($context['can_restore_msg']) echo '
  • ', $restore_message_button, '
  • '; // Show a checkbox for quick moderation? if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && $message['can_remove']) echo ' '; if ($message['can_approve'] || $context['can_reply'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg']) echo '
'; echo '
'; // 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 '
', $message['body'], '
', $message['can_modify'] ? ' ' : ''; // Assuming there are attachments... if (!empty($message['attachment'])) { // Now for the attachments, signature, ip logged, etc... echo ' '; } echo '
'; // Show "« Last Edit: Time by Person »" if this post was edited. if ($settings['show_modify'] && !empty($message['modified']['name'])) echo ' « ', $txt['last_edit'], ': ', $message['modified']['time'], ' ', $txt['by'], ' ', $message['modified']['name'], ' »'; echo '
'; // Maybe they want to report this post to the moderator(s)? if ($context['can_report_moderator']) echo ' ', $txt['report_to_mod'], '  '; // 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'], ''; echo ' '; // Show the IP to this user for this post - because you can moderate? if ($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, are you at least logged in? Then we can show something about why IPs are logged... elseif (!$context['user']['is_guest']) echo ' ', $txt['logged'], ''; // Otherwise, you see NOTHING! else echo ' ', $txt['logged']; 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 (empty($shown)) { $shown = true; echo '
    ', $message['member']['signature'], '
'; echo '
'; } echo '
'; echo '
'; echo '
', $txt['pages'], ': ', $context['page_index'], !empty($modSettings['topbottomEnable']) ? $context['menu_separator'] . '   ' . $txt['go_up'] . '' : '', '
', $context['previous_next'], '
'; // Tagging System echo '
', $txt['smftags_topic'], ''; foreach ($context['topic_tags'] as $i => $tag) { echo '' . $tag['tag'] . ' '; if(!$context['user']['is_guest'] && allowedTo('smftags_del')) echo '[X] '; } global $topic; if(!$context['user']['is_guest'] && allowedTo('smftags_add')) echo '  ' . $txt['smftags_addtag'] . ''; echo '
'; // End Tagging System // Show the lower breadcrumbs. theme_linktree(); $mod_buttons = array( 'move' => array('test' => 'can_move', 'text' => 'move_topic', 'image' => 'admin_move.gif', 'lang' => true, 'url' => $scripturl . '?action=movetopic;topic=' . $context['current_topic'] . '.0'), 'delete' => array('test' => 'can_delete', 'text' => 'remove_topic', 'image' => 'admin_rem.gif', 'lang' => true, 'custom' => 'onclick="return confirm(\'' . $txt['are_sure_remove_topic'] . '\');"', 'url' => $scripturl . '?action=removetopic2;topic=' . $context['current_topic'] . '.0;' . $context['session_var'] . '=' . $context['session_id']), 'lock' => array('test' => 'can_lock', 'text' => empty($context['is_locked']) ? 'set_lock' : 'set_unlock', 'image' => 'admin_lock.gif', 'lang' => true, 'url' => $scripturl . '?action=lock;topic=' . $context['current_topic'] . '.' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id']), 'sticky' => array('test' => 'can_sticky', 'text' => empty($context['is_sticky']) ? 'set_sticky' : 'set_nonsticky', 'image' => 'admin_sticky.gif', 'lang' => true, 'url' => $scripturl . '?action=sticky;topic=' . $context['current_topic'] . '.' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id']), 'merge' => array('test' => 'can_merge', 'text' => 'merge', 'image' => 'merge.gif', 'lang' => true, 'url' => $scripturl . '?action=mergetopics;board=' . $context['current_board'] . '.0;from=' . $context['current_topic']), 'calendar' => array('test' => 'calendar_post', 'text' => 'calendar_link', 'image' => 'linktocal.gif', 'lang' => true, 'url' => $scripturl . '?action=post;calendar;msg=' . $context['topic_first_message'] . ';topic=' . $context['current_topic'] . '.0'), ); // Restore topic. eh? No monkey business. if ($context['can_restore_topic']) $mod_buttons[] = array('text' => 'restore_topic', 'image' => '', 'lang' => true, 'url' => $scripturl . '?action=restoretopic;topics=' . $context['current_topic'] . ';' . $context['session_var'] . '=' . $context['session_id']); // Allow adding new mod buttons easily. call_integration_hook('integrate_mod_buttons', array(&$mod_buttons)); echo '
', template_button_strip($mod_buttons, 'bottom', array('id' => 'moderationbuttons_strip')), '
'; // Show the jumpto box, or actually...let Javascript do it. echo '
 

'; if ($context['can_reply'] && !empty($options['display_quick_reply'])) { echo '
'; echo '

+ ', $txt['quick_reply'], '

'; } if ($context['show_spellchecking']) echo '
'; echo ' '; } ?>