Chris@76:
Chris@76: ', $txt['report_sent'], '
Chris@76: ';
Chris@76: }
Chris@76:
Chris@76: // Show the anchor for the top and for the first message. If the first message is new, say so.
Chris@76: echo '
Chris@76:
Chris@76: ', $context['first_new_message'] ? ' ' : '';
Chris@76:
Chris@76: // Is this topic also a poll?
Chris@76: if ($context['is_poll'])
Chris@76: {
Chris@76: echo '
Chris@76:
Chris@76:
Chris@76: ', $txt['poll'], '
Chris@76:
Chris@76:
Chris@76:
';
Chris@76:
Chris@76: // Are they not allowed to vote but allowed to view the options?
Chris@76: if ($context['poll']['show_results'] || !$context['allow_vote'])
Chris@76: {
Chris@76: echo '
Chris@76:
';
Chris@76:
Chris@76: // Show each option with its corresponding percentage bar.
Chris@76: foreach ($context['poll']['options'] as $option)
Chris@76: echo '
Chris@76: ', $option['option'], '
Chris@76: ', $context['allow_poll_view'] ? $option['bar'] . ' ' . $option['votes'] . ' (' . $option['percent'] . '%)' : '', ' ';
Chris@76:
Chris@76: echo '
Chris@76: ';
Chris@76:
Chris@76: if ($context['allow_poll_view'])
Chris@76: echo '
Chris@76:
', $txt['poll_total_voters'], ': ', $context['poll']['total_votes'], '
';
Chris@76:
Chris@76: }
Chris@76: // They are allowed to vote! Go to it!
Chris@76: else
Chris@76: {
Chris@76: echo '
Chris@76:
';
Chris@76: }
Chris@76:
Chris@76: // Is the clock ticking?
Chris@76: if (!empty($context['poll']['expire_time']))
Chris@76: echo '
Chris@76:
', ($context['poll']['is_expired'] ? $txt['poll_expired_on'] : $txt['poll_expires_on']), ': ', $context['poll']['expire_time'], '
';
Chris@76:
Chris@76: echo '
Chris@76:
Chris@76:
Chris@76: ';
Chris@76:
Chris@76: // Build the poll moderation button array.
Chris@76: $poll_buttons = array(
Chris@76: 'vote' => array('test' => 'allow_return_vote', 'text' => 'poll_return_vote', 'image' => 'poll_options.gif', 'lang' => true, 'url' => $scripturl . '?topic=' . $context['current_topic'] . '.' . $context['start']),
Chris@76: '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'),
Chris@76: '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']),
Chris@76: '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']),
Chris@76: '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']),
Chris@76: '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']),
Chris@76: );
Chris@76:
Chris@76: template_button_strip($poll_buttons);
Chris@76:
Chris@76: echo '
Chris@76:
';
Chris@76: }
Chris@76:
Chris@76: // Does this topic have some events linked to it?
Chris@76: if (!empty($context['linked_calendar_events']))
Chris@76: {
Chris@76: echo '
Chris@76:
Chris@76:
Chris@76:
Chris@76:
';
Chris@76:
Chris@76: foreach ($context['linked_calendar_events'] as $event)
Chris@76: echo '
Chris@76:
Chris@76: ', ($event['can_edit'] ? '* ' : ''), '', $event['title'], ' : ', $event['start_date'], ($event['start_date'] != $event['end_date'] ? ' - ' . $event['end_date'] : ''), '
Chris@76: ';
Chris@76:
Chris@76: echo '
Chris@76:
Chris@76:
Chris@76:
';
Chris@76: }
Chris@76:
Chris@76: // Build the normal button array.
Chris@76: $normal_buttons = array(
Chris@76: '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']),
Chris@76: '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']),
Chris@76: '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']),
Chris@76: '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']),
Chris@76: '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'),
Chris@76: 'print' => array('text' => 'print', 'image' => 'print.gif', 'lang' => true, 'custom' => 'rel="new_win nofollow"', 'url' => $scripturl . '?action=printpage;topic=' . $context['current_topic'] . '.0'),
Chris@76: );
Chris@76:
Chris@76: // Allow adding new buttons easily.
Chris@76: call_integration_hook('integrate_display_buttons', array(&$normal_buttons));
Chris@76:
Chris@76: // Show the page index... "Pages: [1]".
Chris@76: echo '
Chris@76:
Chris@76:
', $context['previous_next'], '
Chris@76:
', $txt['pages'], ': ', $context['page_index'], !empty($modSettings['topbottomEnable']) ? $context['menu_separator'] . '
' . $txt['go_down'] . ' ' : '', '
Chris@76:
', template_button_strip($normal_buttons, 'bottom'), '
Chris@76:
';
Chris@76:
Chris@76: // Show the topic information - icon, subject, etc.
Chris@76: echo '
Chris@76:
Chris@76:
Chris@76:
Chris@76: ', $txt['author'], '
Chris@76: ', $txt['topic'], ': ', $context['subject'], ' (', $txt['read'], ' ', $context['num_views'], ' ', $txt['times'], ')
Chris@76: ';
Chris@76:
Chris@76: if (!empty($settings['display_who_viewing']))
Chris@76: {
Chris@76: echo '
Chris@76: ';
Chris@76: }
Chris@76:
Chris@76: echo '
Chris@76:
';
Chris@76: echo '
Chris@76:
Chris@76: ';
Chris@76:
Chris@76: echo '
Chris@76:
Chris@76:
', template_button_strip($normal_buttons, 'top'), '
Chris@76:
', $txt['pages'], ': ', $context['page_index'], !empty($modSettings['topbottomEnable']) ? $context['menu_separator'] . '
' . $txt['go_up'] . ' ' : '', '
Chris@76:
', $context['previous_next'], '
Chris@76:
';
Chris@76:
Chris@76: // Show the lower breadcrumbs.
Chris@76: theme_linktree();
Chris@76:
Chris@76: $mod_buttons = array(
Chris@76: 'move' => array('test' => 'can_move', 'text' => 'move_topic', 'image' => 'admin_move.gif', 'lang' => true, 'url' => $scripturl . '?action=movetopic;topic=' . $context['current_topic'] . '.0'),
Chris@76: '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']),
Chris@76: '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']),
Chris@76: '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']),
Chris@76: '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']),
Chris@76: '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'),
Chris@76: );
Chris@76:
Chris@76: // Restore topic. eh? No monkey business.
Chris@76: if ($context['can_restore_topic'])
Chris@76: $mod_buttons[] = array('text' => 'restore_topic', 'image' => '', 'lang' => true, 'url' => $scripturl . '?action=restoretopic;topics=' . $context['current_topic'] . ';' . $context['session_var'] . '=' . $context['session_id']);
Chris@76:
Chris@76: // Allow adding new mod buttons easily.
Chris@76: call_integration_hook('integrate_mod_buttons', array(&$mod_buttons));
Chris@76:
Chris@76: echo '
Chris@76: ', template_button_strip($mod_buttons, 'bottom', array('id' => 'moderationbuttons_strip')), '
';
Chris@76:
Chris@76: // Show the jumpto box, or actually...let Javascript do it.
Chris@76: echo '
Chris@76: ';
Chris@76:
Chris@76: if ($context['can_reply'] && !empty($options['display_quick_reply']))
Chris@76: {
Chris@76: echo '
Chris@76:
Chris@76: ';
Chris@76:
Chris@76: echo '
Chris@76:
Chris@76:
Chris@76:
Chris@76: ', $txt['quick_reply_desc'], $context['is_locked'] ? '
' . $txt['quick_reply_warning'] . '
' : '', $context['oldTopicError'] ? '
' . sprintf($txt['error_old_topic'], $modSettings['oldTopicDays']) . '
' : '', '
Chris@76:
Chris@76:
', $context['can_reply_approved'] ? '' : '' . $txt['wait_for_approval'] . ' ', '
Chris@76: ', !$context['can_reply_approved'] && $context['require_verification'] ? ' ' : '', '
Chris@76:
Chris@76:
Chris@76:
Chris@76:
Chris@76:
';
Chris@76: }
Chris@76:
Chris@76: if ($context['show_spellchecking'])
Chris@76: echo '
Chris@76:
Chris@76: ';
Chris@76:
Chris@76: echo '
Chris@76:
Chris@76: ';
Chris@76: }
Chris@76:
Chris@76: ?>