', $context['first_new_message'] ? '' : ''; // Show the linktree echo '
', theme_linktree(), '
'; // Is this topic also a poll? if ($context['is_poll']) { echo '
', $txt['smf43'], '
', $txt['smf21'], ': ', $context['poll']['question']; if (!empty($context['poll']['expire_time'])) echo '  (', ($context['poll']['is_expired'] ? $txt['poll_expired_on'] : $txt['poll_expires_on']), ': ', $context['poll']['expire_time'], ')'; // Are they not allowed to vote but allowed to view the options? if ($context['poll']['show_results'] || !$context['allow_vote']) { echo ' ', $context['allow_poll_view'] ? ' ' : '', '
'; // Show each option with its corresponding percentage bar. foreach ($context['poll']['options'] as $option) echo ' ', $context['allow_poll_view'] ? ' ' : '', ' '; echo '
', $option['option'], '' . $option['bar'] . ' ' . $option['votes'] . ' (' . $option['percent'] . '%)
'; // If they are allowed to revote - show them a link! if ($context['allow_change_vote']) echo ' ', $txt['poll_change_vote'], '
'; // If we're viewing the results... maybe we want to go back and vote? if ($context['poll']['show_results'] && $context['allow_vote']) echo ' ', $txt['poll_return_vote'], '
'; // If they're allowed to lock the poll, show a link! if ($context['poll']['lock']) echo ' ', !$context['poll']['is_locked'] ? $txt['smf30'] : $txt['smf30b'], '
'; // If they're allowed to edit the poll... guess what... show a link! if ($context['poll']['edit']) echo ' ', $txt['smf39'], ''; echo '
' . $txt['smf24'] . ': ' . $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'], '
'; // Show each option with its button - a radio likely. foreach ($context['poll']['options'] as $option) echo ' ', $option['vote_button'], ' ', $option['option'], '
'; echo '
'; // Allowed to view the results? (without voting!) if ($context['allow_poll_view']) echo ' ', $txt['smf29'], '
'; // Show a link for locking the poll as well... if ($context['poll']['lock']) echo ' ', (!$context['poll']['is_locked'] ? $txt['smf30'] : $txt['smf30b']), '
'; // Want to edit it? Click right here...... if ($context['poll']['edit']) echo ' ', $txt['smf39'], ''; echo '
'; } echo '
'; } // Does this topic have some events linked to it? if (!empty($context['linked_calendar_events'])) { echo '
', $txt['calendar_linked_events'], '
    '; foreach ($context['linked_calendar_events'] as $event) echo '
  • ', ($event['can_edit'] ? '* ' : ''), '', $event['title'], ': ', $event['start_date'], ($event['start_date'] != $event['end_date'] ? ' - ' . $event['end_date'] : ''), '
  • '; echo '
'; } // Build the normal button array. $normal_buttons = array( 'reply' => array('test' => 'can_reply', 'text' => 146, 'image' => 'reply.gif', 'lang' => true, 'url' => $scripturl . '?action=post;topic=' . $context['current_topic'] . '.' . $context['start'] . ';num_replies=' . $context['num_replies']), 'notify' => array('test' => 'can_mark_notify', 'text' => 125, 'image' => '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'] . ';sesc=' . $context['session_id']), 'custom' => array(), 'send' => array('test' => 'can_send_topic', 'text' => 707, 'image' => 'sendtopic.gif', 'lang' => true, 'url' => $scripturl . '?action=sendtopic;topic=' . $context['current_topic'] . '.0'), 'print' => array('text' => 465, 'image' => 'print.gif', 'lang' => true, 'custom' => 'target="_blank"', 'url' => $scripturl . '?action=printpage;topic=' . $context['current_topic'] . '.0'), ); // Special case for the custom one. if ($context['user']['is_logged'] && $settings['show_mark_read']) $normal_buttons['custom'] = array('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'] . ';sesc=' . $context['session_id']); elseif ($context['can_add_poll']) $normal_buttons['custom'] = array('text' => 'add_poll', 'image' => 'add_poll.gif', 'lang' => true, 'url' => $scripturl . '?action=editpoll;add;topic=' . $context['current_topic'] . '.' . $context['start'] . ';sesc=' . $context['session_id']); else unset($normal_buttons['custom']); // Show the page index... "Pages: [1]". echo '
', $txt[139], ': ', $context['page_index'], !empty($modSettings['topbottomEnable']) ? $context['menu_separator'] . '   ' . $txt['topbottom5'] . '' : '', ' ', template_button_strip($normal_buttons, 'bottom'), '
'; // Show the topic information - icon, subject, etc. echo ' '; if (!empty($settings['display_who_viewing'])) { echo ' '; } echo '
', $txt[29], ' ', $txt[118], ': ', $context['subject'], '  (', $txt[641], ' ', $context['num_views'], ' ', $txt[642], ')
'; // Show just numbers...? if ($settings['display_who_viewing'] == 1) echo count($context['view_members']), ' ', count($context['view_members']) == 1 ? $txt['who_member'] : $txt[19]; // Or show the actual people viewing the topic? else echo empty($context['view_members_list']) ? '0 ' . $txt[19] : 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', 145, 'smf240', 'align="middle"'); $modify_button = create_button('modify.gif', 66, 17, 'align="middle"'); $remove_button = create_button('delete.gif', 121, 31, 'align="middle"'); $split_button = create_button('split.gif', 'smf251', 'smf251', 'align="middle"'); // Time to display all the posts echo ' '; // Get all the messages... while ($message = $context['get_message']()) { echo ' '; } echo '
'; // 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 ' '; // Now for the attachments, signature, ip logged, etc... 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']) && !$message['member']['is_guest']) 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'] != '') echo ' ', $txt[231], ': ', $message['member']['gender']['image'], '
'; // Show how many posts they have made. echo ' ', $txt[26], ': ', $message['member']['posts'], '

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

'; // This shows the popular messaging icons. echo ' ', $message['member']['icq']['link'], ' ', $message['member']['msn']['link'], ' ', $message['member']['aim']['link'], ' ', $message['member']['yim']['link'], '
'; // Show the profile, website, email address, and personal message buttons. if ($settings['show_profile_buttons']) { // Don't show the profile button if you're not allowed to view the profile. if ($message['member']['can_view_profile']) echo ' ', ($settings['use_image_buttons'] ? '' . $txt[27] . '' : $txt[27]), ''; // Don't show an icon if they haven't specified a website. if ($message['member']['website']['url'] != '') echo ' ', ($settings['use_image_buttons'] ? '' . $txt[515] . '' : $txt[515]), ''; // Don't show the email address if they want it hidden. if (empty($message['member']['hide_email'])) echo ' ', ($settings['use_image_buttons'] ? '' . $txt[69] . '' : $txt[69]), ''; // Since we know this person isn't a guest, you *can* message them. if ($context['can_send_pm']) echo ' ', $settings['use_image_buttons'] ? '' . $message['member']['online']['label'] . '' : $message['member']['online']['label'], ''; } } // Otherwise, show the guest's email. elseif (empty($message['member']['hide_email'])) echo '

', ($settings['use_image_buttons'] ? '' . $txt[69] . '' : $txt[69]), ''; // Done with the information about the poster... on to the post itself. echo '
'; // If this is the first post, (#0) just say when it was posted - otherwise give the reply #. echo '
« ', !empty($message['counter']) ? $txt[146] . ' #' . $message['counter'] : '', ' ', $txt[30], ': ', $message['time'], ' »
'; // Can they reply? Have they turned on quick reply? if ($context['can_reply'] && !empty($options['display_quick_reply'])) echo ' ', $reply_button, ''; // So... quick reply is off, but they *can* reply? elseif ($context['can_reply']) 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']) echo ' ', $split_button, ''; // Show a checkbox for quick moderation? if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && $message['can_remove']) echo ' '; // Show the post itself, finally! echo '

', $message['body'], '
', $message['can_modify'] ? ' ' : '' , '
'; // Assuming there are attachments... if (!empty($message['attachment'])) { echo '
'; foreach ($message['attachment'] as $attachment) { if ($attachment['is_image']) { if ($attachment['thumbnail']['has_thumb']) echo '
'; else echo '
'; } echo ' * ' . $attachment['name'] . ' (', $attachment['size'], ($attachment['is_image'] ? ', ' . $attachment['real_width'] . 'x' . $attachment['real_height'] . ' - ' . $txt['attach_viewed'] : ' - ' . $txt['attach_downloaded']) . ' ' . $attachment['downloads'] . ' ' . $txt['attach_times'] . '.)
'; } echo '
'; } echo '
'; // Show "« Last Edit: Time by Person »" if this post was edited. if ($settings['show_modify'] && !empty($message['modified']['name'])) echo ' « ', $txt[211], ': ', $message['modified']['time'], ' ', $txt[525], ' ', $message['modified']['name'], ' »'; echo ' '; // Maybe they want to report this post to the moderator(s)? if ($context['can_report_moderator']) echo ' ', $txt['rtm1'], '  '; 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[511], ''; // Otherwise, you see NOTHING! else echo ' ', $txt[511]; echo '
'; // Show the member's signature? if (!empty($message['member']['signature']) && empty($options['show_no_signatures'])) echo '
', $message['member']['signature'], '
'; echo '
'; // As before, build the custom button right. if ($context['can_add_poll']) $normal_buttons['custom'] = array('text' => 'add_poll', 'image' => 'add_poll.gif', 'lang' => true, 'url' => $scripturl . '?action=editpoll;add;topic=' . $context['current_topic'] . '.' . $context['start'] . ';sesc=' . $context['session_id']); elseif ($context['user']['is_logged'] && $settings['show_mark_read']) $normal_buttons['custom'] = array('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'] . ';sesc=' . $context['session_id']); echo '
', $txt[139], ': ', $context['page_index'], !empty($modSettings['topbottomEnable']) ? $context['menu_separator'] . '   ' . $txt['topbottom4'] . '' : '', ' ', template_button_strip($normal_buttons, 'top', true), '
'; if ($context['show_spellchecking']) echo ' '; echo ' '; if ($settings['linktree_inline']) echo ' '; echo '
', theme_linktree(), '
'; $mod_buttons = array( 'move' => array('test' => 'can_move', 'text' => 132, 'image' => 'admin_move.gif', 'lang' => true, 'url' => $scripturl . '?action=movetopic;topic=' . $context['current_topic'] . '.0'), 'delete' => array('test' => 'can_delete', 'text' => 63, 'image' => 'admin_rem.gif', 'lang' => true, 'custom' => 'onclick="return confirm(\'' . $txt[162] . '\');"', 'url' => $scripturl . '?action=removetopic2;topic=' . $context['current_topic'] . '.0;sesc=' . $context['session_id']), 'lock' => array('test' => 'can_lock', 'text' => empty($context['is_locked']) ? 'smf279' : 'smf280', 'image' => 'admin_lock.gif', 'lang' => true, 'url' => $scripturl . '?action=lock;topic=' . $context['current_topic'] . '.' . $context['start'] . ';sesc=' . $context['session_id']), 'sticky' => array('test' => 'can_sticky', 'text' => empty($context['is_sticky']) ? 'smf277' : 'smf278', 'image' => 'admin_sticky.gif', 'lang' => true, 'url' => $scripturl . '?action=sticky;topic=' . $context['current_topic'] . '.' . $context['start'] . ';sesc=' . $context['session_id']), 'merge' => array('test' => 'can_merge', 'text' => 'smf252', 'image' => 'merge.gif', 'lang' => true, 'url' => $scripturl . '?action=mergetopics;board=' . $context['current_board'] . '.0;from=' . $context['current_topic']), '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']), 'calendar' => array('test' => 'calendar_post', 'text' => 'calendar37', 'image' => 'linktocal.gif', 'lang' => true, 'url' => $scripturl . '?action=post;calendar;msg=' . $context['topic_first_message'] . ';topic=' . $context['current_topic'] . '.0;sesc=' . $context['session_id']), ); if ($context['can_remove_post'] && !empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1) $mod_buttons[] = array('text' => 'quickmod_delete_selected', 'image' => 'delete_selected.gif', 'lang' => true, 'custom' => 'onclick="return confirm(\'' . $txt['quickmod_confirm'] . '\');" id="quickmodSubmit"', 'url' => 'javascript:document.quickModForm.submit();'); echo ' ', template_button_strip($mod_buttons, 'bottom') , '
'; if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && $context['can_remove_post']) echo ' '; if (empty($settings['use_tabs'])) echo ' '; echo '
'; echo '
' . $txt[160] . ':  
'; echo '
'; if ($context['can_reply'] && !empty($options['display_quick_reply'])) { echo '
+ ', $txt['quick_reply_1'], '
'; } if ($context['show_spellchecking']) echo '
'; } ?>