Advertisement
PaulCastellano

Display.template.php

Oct 27th, 2018
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 47.57 KB | None | 0 0
  1. <?php
  2. /**
  3.  * Simple Machines Forum (SMF)
  4.  *
  5.  * @package SMF
  6.  * @author Simple Machines
  7.  * @copyright 2011 Simple Machines
  8.  * @license http://www.simplemachines.org/about/smf/license.php BSD
  9.  *
  10.  * @version 2.0
  11.  */
  12.  
  13. function template_main()
  14. {
  15.     global $context, $settings, $options, $txt, $scripturl, $modSettings;
  16.  
  17.     // Let them know, if their report was a success!
  18.     if ($context['report_sent'])
  19.     {
  20.         echo '
  21.             <div class="windowbg" id="profile_success">
  22.                 ', $txt['report_sent'], '
  23.             </div>';
  24.     }
  25.  
  26.     // Show the anchor for the top and for the first message. If the first message is new, say so.
  27.     echo '
  28.             <a id="top"></a>
  29.             <a id="msg', $context['first_message'], '"></a>', $context['first_new_message'] ? '<a id="new"></a>' : '';
  30.  
  31.     // Is this topic also a poll?
  32.     if ($context['is_poll'])
  33.     {
  34.         echo '
  35.             <div id="poll">
  36.                 <div class="cat_bar">
  37.                     <h3 class="catbg">
  38.                         <span class="ie6_header floatleft"><img src="', $settings['images_url'], '/topic/', $context['poll']['is_locked'] ? 'normal_poll_locked' : 'normal_poll', '.gif" alt="" class="icon" /> ', $txt['poll'], '</span>
  39.                     </h3>
  40.                 </div>
  41.                 <div class="windowbg">
  42.                     <span class="topslice"><span></span></span>
  43.                     <div class="content" id="poll_options">
  44.                         <h4 id="pollquestion">
  45.                             ', $context['poll']['question'], '
  46.                         </h4>';
  47.  
  48.         // Are they not allowed to vote but allowed to view the options?
  49.         if ($context['poll']['show_results'] || !$context['allow_vote'])
  50.         {
  51.             echo '
  52.                     <dl class="options">';
  53.  
  54.             // Show each option with its corresponding percentage bar.
  55.             foreach ($context['poll']['options'] as $option)
  56.             {
  57.                 echo '
  58.                         <dt class="middletext', $option['voted_this'] ? ' voted' : '', '">', $option['option'], '</dt>
  59.                         <dd class="middletext statsbar', $option['voted_this'] ? ' voted' : '', '">';
  60.  
  61.                 if ($context['allow_poll_view'])
  62.                     echo '
  63.                             ', $option['bar_ndt'], '
  64.                             <span class="percentage">', $option['votes'], ' (', $option['percent'], '%)</span>';
  65.  
  66.                 echo '
  67.                         </dd>';
  68.             }
  69.  
  70.             echo '
  71.                     </dl>';
  72.  
  73.             if ($context['allow_poll_view'])
  74.                 echo '
  75.                         <p><strong>', $txt['poll_total_voters'], ':</strong> ', $context['poll']['total_votes'], '</p>';
  76.         }
  77.         // They are allowed to vote! Go to it!
  78.         else
  79.         {
  80.             echo '
  81.                         <form action="', $scripturl, '?action=vote;topic=', $context['current_topic'], '.', $context['start'], ';poll=', $context['poll']['id'], '" method="post" accept-charset="', $context['character_set'], '">';
  82.  
  83.             // Show a warning if they are allowed more than one option.
  84.             if ($context['poll']['allowed_warning'])
  85.                 echo '
  86.                             <p class="smallpadding">', $context['poll']['allowed_warning'], '</p>';
  87.  
  88.             echo '
  89.                             <ul class="reset options">';
  90.  
  91.             // Show each option with its button - a radio likely.
  92.             foreach ($context['poll']['options'] as $option)
  93.                 echo '
  94.                                 <li class="middletext">', $option['vote_button'], ' <label for="', $option['id'], '">', $option['option'], '</label></li>';
  95.  
  96.             echo '
  97.                             </ul>
  98.                             <div class="submitbutton">
  99.                                 <input type="submit" value="', $txt['poll_vote'], '" class="button_submit" />
  100.                                 <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
  101.                             </div>
  102.                         </form>';
  103.         }
  104.  
  105.         // Is the clock ticking?
  106.         if (!empty($context['poll']['expire_time']))
  107.             echo '
  108.                         <p><strong>', ($context['poll']['is_expired'] ? $txt['poll_expired_on'] : $txt['poll_expires_on']), ':</strong> ', $context['poll']['expire_time'], '</p>';
  109.  
  110.         echo '
  111.                     </div>
  112.                     <span class="botslice"><span></span></span>
  113.                 </div>
  114.             </div>
  115.             <div id="pollmoderation">';
  116.  
  117.         // Build the poll moderation button array.
  118.         $poll_buttons = array(
  119.             'vote' => array('test' => 'allow_return_vote', 'text' => 'poll_return_vote', 'image' => 'poll_options.gif', 'lang' => true, 'url' => $scripturl . '?topic=' . $context['current_topic'] . '.' . $context['start']),
  120.             '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'),
  121.             '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']),
  122.             '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']),
  123.             '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']),
  124.             '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']),
  125.         );
  126.  
  127.         template_button_strip($poll_buttons);
  128.  
  129.         echo '
  130.             </div>';
  131.     }
  132.  
  133.     // Does this topic have some events linked to it?
  134.     if (!empty($context['linked_calendar_events']))
  135.     {
  136.         echo '
  137.             <div class="linked_events">
  138.                 <div class="title_bar">
  139.                     <h3 class="titlebg headerpadding">', $txt['calendar_linked_events'], '</h3>
  140.                 </div>
  141.                 <div class="windowbg">
  142.                     <span class="topslice"><span></span></span>
  143.                     <div class="content">
  144.                         <ul class="reset">';
  145.  
  146.         foreach ($context['linked_calendar_events'] as $event)
  147.             echo '
  148.                             <li>
  149.                                 ', ($event['can_edit'] ? '<a href="' . $event['modify_href'] . '"> <img src="' . $settings['images_url'] . '/icons/modify_small.gif" alt="" title="' . $txt['modify'] . '" class="edit_event" /></a> ' : ''), '<strong>', $event['title'], '</strong>: ', $event['start_date'], ($event['start_date'] != $event['end_date'] ? ' - ' . $event['end_date'] : ''), '
  150.                             </li>';
  151.  
  152.         echo '
  153.                         </ul>
  154.                     </div>
  155.                     <span class="botslice"><span></span></span>
  156.                 </div>
  157.             </div>';
  158.     }
  159.  
  160.     // Build the normal button array.
  161.     $normal_buttons = array(
  162.         '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'], 'active' => true),
  163.         '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']),
  164.         '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']),
  165.         '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']),
  166.         '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'),
  167.         'print' => array('text' => 'print', 'image' => 'print.gif', 'lang' => true, 'custom' => 'rel="new_win nofollow"', 'url' => $scripturl . '?action=printpage;topic=' . $context['current_topic'] . '.0'),
  168.     );
  169.  
  170.     // Allow adding new buttons easily.
  171.     call_integration_hook('integrate_display_buttons', array(&$normal_buttons));
  172.  
  173.     // Article related buttons...
  174.     if (!empty($modSettings['articleactive']))
  175.     {
  176.         if ($context['can_add_article'] && !$context['topic_is_article'])
  177.             $normal_buttons['add_article'] = array('text' => 'sp-add_article', 'image' => 'addarticle.gif', 'lang' => true, 'url' => $scripturl . '?action=portal;sa=addarticle;message=' . $context['topic_first_message'] . ';return=' . $context['current_topic'] . '.' . $context['start'] . ';sesc=' . $context['session_id']);
  178.         if ($context['can_remove_article'] && $context['topic_is_article'])
  179.             $normal_buttons['remove_article'] = array('text' => 'sp-remove_article', 'image' => 'removearticle.gif', 'lang' => true, 'url' => $scripturl . '?action=portal;sa=removearticle;message=' . $context['topic_first_message'] . ';return=' . $context['current_topic'] . '.' . $context['start'] . ';sesc=' . $context['session_id']);
  180.     }
  181.  
  182.     // Show the page index... "Pages: [1]".
  183.     echo '
  184.             <div class="pagesection">
  185.                 <div class="nextlinks">', $context['previous_next'], '</div>', template_button_strip($normal_buttons, 'right'), '
  186.                 <div class="pagelinks floatleft">', $txt['pages'], ': ', $context['page_index'], !empty($modSettings['topbottomEnable']) ? $context['menu_separator'] . ' &nbsp;&nbsp;<a href="#lastPost"><strong><i class="fa fa-chevron-down"></i></strong></a>' : '', '</div>
  187.             </div>';
  188.  
  189.     // Show the topic information - icon, subject, etc.
  190.     echo '
  191.             <div id="forumposts">
  192.                 <div class="cat_bar">
  193.                     <h3 class="catbg">
  194.                         <img src="', $settings['images_url'], '/topic/', $context['class'], '.gif" align="bottom" alt="" />
  195.                         <span id="author">', $txt['author'], '</span>
  196.                         ', $txt['topic'], ': ', $context['subject'], ' &nbsp;(', $txt['read'], ' ', $context['num_views'], ' ', $txt['times'], ')
  197.                     </h3>
  198.                 </div>';
  199.  
  200.     if (!empty($settings['display_who_viewing']))
  201.     {
  202.         echo '
  203.                 <p id="whoisviewing" class="smalltext">';
  204.  
  205.         // Show just numbers...?
  206.         if ($settings['display_who_viewing'] == 1)
  207.                 echo count($context['view_members']), ' ', count($context['view_members']) == 1 ? $txt['who_member'] : $txt['members'];
  208.         // Or show the actual people viewing the topic?
  209.         else
  210.             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'] . ')');
  211.  
  212.         // Now show how many guests are here too.
  213.         echo $txt['who_and'], $context['view_num_guests'], ' ', $context['view_num_guests'] == 1 ? $txt['guest'] : $txt['guests'], $txt['who_viewing_topic'], '
  214.                 </p>';
  215.     }
  216.  
  217.     echo '
  218.                 <form action="', $scripturl, '?action=quickmod2;topic=', $context['current_topic'], '.', $context['start'], '" method="post" accept-charset="', $context['character_set'], '" name="quickModForm" id="quickModForm" style="margin: 0;" onsubmit="return oQuickModify.bInEditMode ? oQuickModify.modifySave(\'' . $context['session_id'] . '\', \'' . $context['session_var'] . '\') : false">';
  219.  
  220.     $ignoredMsgs = array();
  221.     $removableMessageIDs = array();
  222.     $alternate = false;
  223.  
  224.     // Get all the messages...
  225.     while ($message = $context['get_message']())
  226.     {
  227.         $ignoring = false;
  228.         $alternate = !$alternate;
  229.         if ($message['can_remove'])
  230.             $removableMessageIDs[] = $message['id'];
  231.  
  232.         // Are we ignoring this message?
  233.         if (!empty($message['is_ignored']))
  234.         {
  235.             $ignoring = true;
  236.             $ignoredMsgs[] = $message['id'];
  237.         }
  238.  
  239.         // Show the message anchor and a "new" anchor if this message is new.
  240.         if ($message['id'] != $context['first_message'])
  241.             echo '
  242.                 <a id="msg', $message['id'], '"></a>', $message['first_new'] ? '<a id="new"></a>' : '';
  243.  
  244.         echo '
  245.                 <div class="', $message['approved'] ? ($message['alternate'] == 0 ? 'windowbg' : 'windowbg2') : 'approvebg', '">
  246.                     <span class="topslice"><span></span></span>
  247.                     <div class="post_wrapper">';
  248.  
  249.         // Show information about the poster of this message.
  250.         echo '
  251.                         <div class="poster">
  252.                             <div class="poster-link">
  253.                                 ', $txt['author'], ' Info
  254.                             </div>
  255.                             <h4>';
  256.  
  257.         // Show a link to the member's profile.
  258.         echo '
  259.                                 ', $message['member']['link'], '
  260.                                 <img src="', $settings['images_url'], '/custom/strelica-poster.png" />
  261.                             </h4>
  262.                             <ul class="reset smalltext" id="msg_', $message['id'], '_extra_info">';
  263.  
  264.         // Show the member's primary group (like 'Administrator') if they have one.
  265.             echo '
  266.                                 <li class="membergroup"><span style="color: ',$message['member']['group_color'], '">', (!empty($message['member']['group']) ? $message['member']['group'] : $message['member']['post_group']), '</li>';
  267.                                 // Show the member's custom title, if they have one.
  268.                                 if (!empty($message['member']['title']))
  269.                                     echo '
  270.                                         <li>', $message['member']['title'], '</li>';
  271.  
  272.             // Show avatars, images, etc.?
  273.             if (!empty($settings['show_user_images']) && empty($options['show_no_avatars']) && !empty($message['member']['avatar']['image']))
  274.                 echo '
  275.                                 <li class="avatar">
  276.                                     <a href="', $scripturl, '?action=profile;u=', $message['member']['id'], '">
  277.                                         ', $message['member']['avatar']['image'], '
  278.                                     </a>
  279.                                 </li>';
  280.                                 else {
  281.                                     echo'
  282.                                     <li class="avatar">
  283.                                     <a href="', $scripturl, '?action=profile;u=', $message['member']['id'], '">
  284.                                         <img src="', $settings['images_url'], '/default-avatar.png" alt="*" />
  285.                                     </a>
  286.                                 </li>';
  287.                                 }
  288.                                
  289.         // Don't show these things for guests.
  290.         if (!$message['member']['is_guest'])
  291.         {
  292.                     echo '
  293.                                 <li>
  294.                                     <dl>';
  295.                                     // Show online and offline buttons?
  296.                                         echo '
  297.                                         <dt>', $txt['status'], ':</dt>
  298.                                         <dd>';
  299.                                             if ($message['member']['online']['is_online']){
  300.                                                 echo '<span class="display-on">', $txt['online'] ,'</span>';
  301.                                             } else {
  302.                                                 echo '<span class="display-off">', $txt['offline'] ,'</span>';
  303.                                             }
  304.                                         echo '
  305.                                         </dd>';
  306.                                                
  307.                                     // Show how many posts they have made.
  308.                                         if (!isset($context['disabled_fields']['posts']))
  309.                                             echo '
  310.                                                 <dt>', $txt['member_postcount'], ':</dt>
  311.                                                 <dd>', $message['member']['posts'], '</dd>';
  312.                                    
  313.                                     // Show the member's gender icon?
  314.                                         if (!empty($settings['show_gender']) && $message['member']['gender']['image'] != '' && !isset($context['disabled_fields']['gender']))
  315.                                             echo '
  316.                                                 <dt>', $txt['gender'], ':</dt>
  317.                                                 <dd>', $message['member']['gender']['image'], '</dd>';
  318.                                         if (!isset($context['disabled_fields']['location']) && !empty($message['member']['location']))
  319.                                             echo '
  320.                                                 <dt>', $txt['location'], ':</dt>
  321.                                                 <dd>', $message['member']['location'], '</dd>';
  322.  
  323.                                     // Is karma display enabled?  Total or +/-?
  324.                                         if ($modSettings['karmaMode'] == '1')
  325.                                             echo '
  326.                                                 <dt>', $modSettings['karmaLabel'], '</dt>
  327.                                                 <dd>', $message['member']['karma']['good'] - $message['member']['karma']['bad'], '</dd>';
  328.                                         elseif ($modSettings['karmaMode'] == '2')
  329.                                             echo '
  330.                                                 <dt>', $modSettings['karmaLabel'], '</dt>
  331.                                                 <dd>+', $message['member']['karma']['good'], '/-', $message['member']['karma']['bad'], '</dd>';
  332.                                        
  333.                                     // Is this user allowed to modify this member's karma?
  334.                                         if ($message['member']['karma']['allow'])
  335.                                             echo '
  336.                                                 <dt><a href="', $scripturl, '?action=modifykarma;sa=applaud;uid=', $message['member']['id'], ';topic=', $context['current_topic'], '.' . $context['start'], ';m=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '"><i class="fa fa-angle-double-up"></i></a></dt>
  337.                                                 <dd><a href="', $scripturl, '?action=modifykarma;sa=smite;uid=', $message['member']['id'], ';topic=', $context['current_topic'], '.', $context['start'], ';m=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '"><i class="fa fa-angle-double-down"></i></a></dd>';
  338.                                         echo '
  339.                                     </dl>
  340.                                 </li>';
  341.                         // Banned.
  342.                         if ($message['member']['is_banned']){
  343.                             echo '
  344.                                 <li style="padding: 0;">
  345.                                     <div class="poster-ban">
  346.                                         ', $txt['ban'], '
  347.                                     </div>
  348.                                 </li>';
  349.                         }
  350.                                
  351.             // Show their personal text?
  352.             if (!empty($settings['show_blurb']) && $message['member']['blurb'] != '')
  353.                 echo '
  354.                                 <li class="blurb">', $message['member']['blurb'], '</li>';
  355.  
  356.             // Any custom fields to show as icons?
  357.             if (!empty($message['member']['custom_fields']))
  358.             {
  359.                 $shown = false;
  360.                 foreach ($message['member']['custom_fields'] as $custom)
  361.                 {
  362.                     if ($custom['placement'] != 1 || empty($custom['value']))
  363.                         continue;
  364.                     if (empty($shown))
  365.                     {
  366.                         $shown = true;
  367.                         echo '
  368.                                 <li class="im_icons">
  369.                                     <ul>';
  370.                     }
  371.                     echo '
  372.                                         <li>', $custom['value'], '</li>';
  373.                 }
  374.                 if ($shown)
  375.                     echo '
  376.                                     </ul>
  377.                                 </li>';
  378.             }
  379.  
  380.             // This shows the popular messaging icons.
  381.             if ($message['member']['has_messenger'] && $message['member']['can_view_profile'])
  382.                 echo '
  383.                                 <li class="im_icons">
  384.                                     <ul>
  385.                                         ', !empty($message['member']['icq']['link']) ? '<li>' . $message['member']['icq']['link'] . '</li>' : '', '
  386.                                         ', !empty($message['member']['msn']['link']) ? '<li>' . $message['member']['msn']['link'] . '</li>' : '', '
  387.                                         ', !empty($message['member']['aim']['link']) ? '<li>' . $message['member']['aim']['link'] . '</li>' : '', '
  388.                                         ', !empty($message['member']['yim']['link']) ? '<li>' . $message['member']['yim']['link'] . '</li>' : '', '
  389.                                     </ul>
  390.                                 </li>';
  391.  
  392.             // Show the profile, website, email address, and personal message buttons.
  393.             if ($settings['show_profile_buttons'])
  394.             {
  395.                 echo '
  396.                                 <li class="profile">
  397.                                     <ul>';
  398.                 // Don't show the profile button if you're not allowed to view the profile.
  399.                 if ($message['member']['can_view_profile'])
  400.                     echo '
  401.                                         <li><a href="', $message['member']['href'], '">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/icons/profile_sm.gif" alt="' . $txt['view_profile'] . '" title="' . $txt['view_profile'] . '" />' : $txt['view_profile']), '</a></li>';
  402.  
  403.                 // Don't show an icon if they haven't specified a website.
  404.                 if ($message['member']['website']['url'] != '' && !isset($context['disabled_fields']['website']))
  405.                     echo '
  406.                                         <li><a href="', $message['member']['website']['url'], '" title="' . $message['member']['website']['title'] . '" target="_blank" class="new_win">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/www_sm.gif" alt="' . $message['member']['website']['title'] . '" />' : $txt['www']), '</a></li>';
  407.  
  408.                 // Don't show the email address if they want it hidden.
  409.                 if (in_array($message['member']['show_email'], array('yes', 'yes_permission_override', 'no_through_forum')))
  410.                     echo '
  411.                                         <li><a href="', $scripturl, '?action=emailuser;sa=email;msg=', $message['id'], '" rel="nofollow">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/email_sm.gif" alt="' . $txt['email'] . '" title="' . $txt['email'] . '" />' : $txt['email']), '</a></li>';
  412.  
  413.                 // Since we know this person isn't a guest, you *can* message them.
  414.                 if ($context['can_send_pm'])
  415.                     echo '
  416.                                         <li><a href="', $scripturl, '?action=pm;sa=send;u=', $message['member']['id'], '" title="', $message['member']['online']['is_online'] ? $txt['pm_online'] : $txt['pm_offline'], '">', $settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/im_' . ($message['member']['online']['is_online'] ? 'on' : 'off') . '.gif" alt="' . ($message['member']['online']['is_online'] ? $txt['pm_online'] : $txt['pm_offline']) . '" />' : ($message['member']['online']['is_online'] ? $txt['pm_online'] : $txt['pm_offline']), '</a></li>';
  417.  
  418.                 echo '
  419.                                     </ul>
  420.                                 </li>';
  421.             }
  422.  
  423.             // Any custom fields for standard placement?
  424.             if (!empty($message['member']['custom_fields']))
  425.             {
  426.                 foreach ($message['member']['custom_fields'] as $custom)
  427.                     if (empty($custom['placement']) || empty($custom['value']))
  428.                         echo '
  429.                                 <li class="custom">', $custom['title'], ': ', $custom['value'], '</li>';
  430.             }
  431.  
  432.                     // Are we showing the warning status?
  433.                     if ($message['member']['can_see_warning'])
  434.                         echo '
  435.                             <div class="warn_', $message['member']['warning_status'], '" style="text-align: center;">
  436.                                 ', $context['can_issue_warning'] ? '<a href="' . $scripturl . '?action=profile;area=issuewarning;u=' . $message['member']['id'] . '">' : '', '<i class="fa fa-warning"></i>', $context['can_issue_warning'] ? '</a>' : '', '', $txt['warn_' . $message['member']['warning_status']], '
  437.                             </div>';
  438.         }
  439.         // Otherwise, show the guest's email.
  440.         elseif (!empty($message['member']['email']) && in_array($message['member']['show_email'], array('yes', 'yes_permission_override', 'no_through_forum')))
  441.             echo '
  442.                         <li class="poster-email">
  443.                             <br />
  444.                             <a href="', $scripturl, '?action=emailuser;sa=email;msg=', $message['id'], '" rel="nofollow">', ($settings['use_image_buttons'] ? '<i class="fa fa-envelope"></i>' : $txt['email']), '</a>
  445.                         </li>';
  446.                        
  447.         // Done with the information about the poster... on to the post itself.
  448.         echo '
  449.                             </ul>
  450.                         </div>
  451.                         <div class="postarea">
  452.                             <div class="flow_hidden">
  453.                                 <div class="display-date">
  454.                                     <span class="hidden-xs" style="float: left">
  455.                                     ', empty($message['counter']) ? $context['real_num_replies'] .' '.$txt['replies'] .' ' .$txt['on'] .' '.$context['subject'] : '', '
  456.                                         ', !empty($message['counter']) ? $txt['reply_noun'] . ' #' . $message['counter'] : '', '
  457.                                     </span>
  458.                                     <span style="float: right">
  459.                                         <strong>', $txt['on'], ':</strong>&nbsp;', $message['time'], '
  460.                                     </span>
  461.                                 </div>
  462.                                 <div class="display-title">
  463.                                     <div class="arrow-left"></div>
  464.                                     <h5 id="subject_', $message['id'], '" style="padding: 1px;">
  465.                                         <a href="', $message['href'], '" rel="nofollow">', $message['subject'], '</a>
  466.                                     </h5>
  467.                                     <div class="messageicon">
  468.                                         <img src="', $message['icon_url'] . '" alt=""', $message['can_modify'] ? ' id="msg_icon_' . $message['id'] . '"' : '', ' />
  469.                                     </div>
  470.                                 </div>
  471.                             </div>';
  472.  
  473.         // Ignoring this user? Hide the post.
  474.         if ($ignoring)
  475.             echo '
  476.                             <div id="msg_', $message['id'], '_ignored_prompt">
  477.                                 ', $txt['ignoring_user'], '
  478.                                 <a href="#" id="msg_', $message['id'], '_ignored_link" style="display: none;">', $txt['show_ignore_user_post'], '</a>
  479.                             </div>';
  480.  
  481.         // Show the post itself, finally!
  482.         echo '
  483.                             <div class="post">';
  484.  
  485.         if (!$message['approved'] && $message['member']['id'] != 0 && $message['member']['id'] == $context['user']['id'])
  486.             echo '
  487.                                 <div class="approve_post">
  488.                                     ', $txt['post_awaiting_approval'], '
  489.                                 </div>';
  490.         echo '
  491.                                 <div class="inner" id="msg_', $message['id'], '"', '>', $message['body'], '</div>
  492.                             </div>';
  493.  
  494.         // Can the user modify the contents of this post?  Show the modify inline image.
  495.         if ($message['can_modify'])
  496.             echo '
  497.                             <img src="', $settings['images_url'], '/icons/modify_inline.gif" alt="', $txt['modify_msg'], '" title="', $txt['modify_msg'], '" class="modifybutton" id="modify_button_', $message['id'], '" style="cursor: ', ($context['browser']['is_ie5'] || $context['browser']['is_ie5.5'] ? 'hand' : 'pointer'), '; display: none;" onclick="oQuickModify.modifyMsg(\'', $message['id'], '\')" />';
  498.  
  499.         // Assuming there are attachments...
  500.         if (!empty($message['attachment']))
  501.         {
  502.             echo '
  503.                             <div id="msg_', $message['id'], '_footer" class="attachments smalltext">
  504.                                 <div style="overflow: ', $context['browser']['is_firefox'] ? 'visible' : 'auto', ';">';
  505.  
  506.             $last_approved_state = 1;
  507.             foreach ($message['attachment'] as $attachment)
  508.             {
  509.                 // Show a special box for unapproved attachments...
  510.                 if ($attachment['is_approved'] != $last_approved_state)
  511.                 {
  512.                     $last_approved_state = 0;
  513.                     echo '
  514.                                     <fieldset>
  515.                                         <legend>', $txt['attach_awaiting_approve'];
  516.  
  517.                     if ($context['can_approve'])
  518.                         echo '&nbsp;[<a href="', $scripturl, '?action=attachapprove;sa=all;mid=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $txt['approve_all'], '</a>]';
  519.  
  520.                     echo '</legend>';
  521.                 }
  522.  
  523.                 if ($attachment['is_image'])
  524.                 {
  525.                     if ($attachment['thumbnail']['has_thumb'])
  526.                         echo '
  527.                                         <a href="', $attachment['href'], ';image" id="link_', $attachment['id'], '" onclick="', $attachment['thumbnail']['javascript'], '"><img src="', $attachment['thumbnail']['href'], '" alt="" id="thumb_', $attachment['id'], '" /></a><br />';
  528.                     else
  529.                         echo '
  530.                                         <img src="' . $attachment['href'] . ';image" alt="" width="' . $attachment['width'] . '" height="' . $attachment['height'] . '"/><br />';
  531.                 }
  532.                 echo '
  533.                                         <a href="' . $attachment['href'] . '"><img src="' . $settings['images_url'] . '/icons/clip.gif" align="middle" alt="*" />&nbsp;' . $attachment['name'] . '</a> ';
  534.  
  535.                 if (!$attachment['is_approved'] && $context['can_approve'])
  536.                     echo '
  537.                                         [<a href="', $scripturl, '?action=attachapprove;sa=approve;aid=', $attachment['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $txt['approve'], '</a>]&nbsp;|&nbsp;[<a href="', $scripturl, '?action=attachapprove;sa=reject;aid=', $attachment['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $txt['delete'], '</a>] ';
  538.                 echo '
  539.                                         (', $attachment['size'], ($attachment['is_image'] ? ', ' . $attachment['real_width'] . 'x' . $attachment['real_height'] . ' - ' . $txt['attach_viewed'] : ' - ' . $txt['attach_downloaded']) . ' ' . $attachment['downloads'] . ' ' . $txt['attach_times'] . '.)<br />';
  540.             }
  541.  
  542.             // If we had unapproved attachments clean up.
  543.             if ($last_approved_state == 0)
  544.                 echo '
  545.                                     </fieldset>';
  546.  
  547.             echo '
  548.                                 </div>
  549.                             </div>';
  550.         }
  551.  
  552.         echo '
  553.                         </div>
  554.                         <div class="moderatorbar">
  555.                             <div class="smalltext modified" id="modified_', $message['id'], '">';
  556.  
  557.         // Show "� Last Edit: Time by Person �" if this post was edited.
  558.         if ($settings['show_modify'] && !empty($message['modified']['name']))
  559.             echo '
  560.                                 <span>&#171; <em>', $txt['last_edit'], ': ', $message['modified']['time'], ' ', $txt['by'], ' ', $message['modified']['name'], '</em> &#187;</span>';
  561.  
  562.         echo '
  563.                             </div>
  564.                             <div class="smalltext reportlinks">';
  565.  
  566.         // Maybe they want to report this post to the moderator(s)?
  567.         if ($context['can_report_moderator'])
  568.             echo '
  569.                                 <span><a href="', $scripturl, '?action=reporttm;topic=', $context['current_topic'], '.', $message['counter'], ';msg=', $message['id'], '">', $txt['report_to_mod'], '</a> &nbsp;</span>';
  570.  
  571.         // Can we issue a warning because of this post?  Remember, we can't give guests warnings.
  572.         if ($context['can_issue_warning'] && !$message['is_message_author'] && !$message['member']['is_guest'])
  573.             echo '
  574.                                 <span><a href="', $scripturl, '?action=profile;area=issuewarning;u=', $message['member']['id'], ';msg=', $message['id'], '"><img src="', $settings['images_url'], '/warn.gif" alt="', $txt['issue_warning_post'], '" title="', $txt['issue_warning_post'], '" /></a></span>';
  575.         echo '
  576.                                 <span><img src="', $settings['images_url'], '/ip.gif" alt="" /></span>';
  577.  
  578.         // Show the IP to this user for this post - because you can moderate?
  579.         if ($context['can_moderate_forum'] && !empty($message['member']['ip']))
  580.             echo '
  581.                                 <span><a href="', $scripturl, '?action=', !empty($message['member']['is_guest']) ? 'trackip' : 'profile;area=tracking;sa=ip;u=' . $message['member']['id'], ';searchip=', $message['member']['ip'], '">', $message['member']['ip'], '</a> <a href="', $scripturl, '?action=helpadmin;help=see_admin_ip" onclick="return reqWin(this.href);" class="help">(?)</a></span>';
  582.         // Or, should we show it because this is you?
  583.         elseif ($message['can_see_ip'])
  584.             echo '
  585.                                 <span><a href="', $scripturl, '?action=helpadmin;help=see_member_ip" onclick="return reqWin(this.href);" class="help">', $message['member']['ip'], '</a></span>';
  586.         // Okay, are you at least logged in?  Then we can show something about why IPs are logged...
  587.         elseif (!$context['user']['is_guest'])
  588.             echo '
  589.                                 <span><a href="', $scripturl, '?action=helpadmin;help=see_member_ip" onclick="return reqWin(this.href);" class="help">', $txt['logged'], '</a></span>';
  590.         // Otherwise, you see NOTHING!
  591.         else
  592.             echo '
  593.                                 ', $txt['logged'];
  594.  
  595.         echo '
  596.                             </div>';
  597.  
  598.         // Are there any custom profile fields for above the signature?
  599.         if (!empty($message['member']['custom_fields']))
  600.         {
  601.             $shown = false;
  602.             foreach ($message['member']['custom_fields'] as $custom)
  603.             {
  604.                 if ($custom['placement'] != 2 || empty($custom['value']))
  605.                     continue;
  606.                 if (empty($shown))
  607.                 {
  608.                     $shown = true;
  609.                     echo '
  610.                             <div class="custom_fields_above_signature">
  611.                                 <ul class="reset nolist">';
  612.                 }
  613.                 echo '
  614.                                     <li>', $custom['value'], '</li>';
  615.             }
  616.             if ($shown)
  617.                 echo '
  618.                                 </ul>
  619.                             </div>';
  620.         }
  621.  
  622.         // Show the member's signature?
  623.         if (!empty($message['member']['signature']) && empty($options['show_no_signatures']) && $context['signature_enabled'])
  624.             echo '
  625.                             <div class="signature" id="msg_', $message['id'], '_signature">', $message['member']['signature'], '</div>';
  626.  
  627.         echo '
  628.                         </div>
  629.                     </div>
  630.                     <span class="botslice"><span></span></span>
  631.                     <div class="poster-buttons">';
  632.                         // If this is the first post, (#0) just say when it was posted - otherwise give the reply #.
  633.                         if ($message['can_approve'] || $context['can_reply'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg'])
  634.                             echo '
  635.                                 <ul>';
  636.  
  637.                         // Maybe we can approve it, maybe we should?
  638.                         if ($message['can_approve'])
  639.                             echo '
  640.                                                     <li><a href="', $scripturl, '?action=moderate;area=postmod;sa=approve;topic=', $context['current_topic'], '.', $context['start'], ';msg=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '"><i class="fa fa-check"></i><span>', $txt['approve'], '</span></a></li>';
  641.  
  642.                         // Can they reply? Have they turned on quick reply?
  643.                         if ($context['can_quote'] && !empty($options['display_quick_reply']))
  644.                             echo '
  645.                                                     <li><a href="', $scripturl, '?action=post;quote=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], ';last_msg=', $context['topic_last_message'], '" onclick="return oQuickReply.quote(', $message['id'], ');"><i class="fa fa-quote-right"></i><span>', $txt['quote'], '</span></a></li>';
  646.  
  647.                         // So... quick reply is off, but they *can* reply?
  648.                         elseif ($context['can_quote'])
  649.                             echo '
  650.                                                     <li><a href="', $scripturl, '?action=post;quote=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], ';last_msg=', $context['topic_last_message'], '"><i class="fa fa-quote-right"></i><span>', $txt['quote'], '</span></a></li>';
  651.  
  652.                         // Can the user modify the contents of this post?
  653.                         if ($message['can_modify'])
  654.                             echo '
  655.                                                     <li><a href="', $scripturl, '?action=post;msg=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], '"><i class="fa fa-pencil"></i><span>', $txt['modify'], '</span></a></li>';
  656.  
  657.                         // How about... even... remove it entirely?!
  658.                         if ($message['can_remove'])
  659.                             echo '
  660.                                                     <li><a href="', $scripturl, '?action=deletemsg;topic=', $context['current_topic'], '.', $context['start'], ';msg=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '" onclick="return confirm(\'', $txt['remove_message'], '?\');"><i class="fa fa-trash"></i><span>', $txt['remove'], '</span></a></li>';
  661.  
  662.                         // What about splitting it off the rest of the topic?
  663.                         if ($context['can_split'] && !empty($context['real_num_replies']))
  664.                             echo '
  665.                                                     <li><a href="', $scripturl, '?action=splittopics;topic=', $context['current_topic'], '.0;at=', $message['id'], '"><i class="fa fa-arrows-alt"></i><span>', $txt['split'], '</span></a></li>';
  666.  
  667.                         // Can we restore topics?
  668.                         if ($context['can_restore_msg'])
  669.                             echo '
  670.                                                     <li><a href="', $scripturl, '?action=restoretopic;msgs=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '"><span>', $txt['restore_message'], '</span></a></li>';
  671.  
  672.                         // Show a checkbox for quick moderation?
  673.                         if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && $message['can_remove'])
  674.                             echo '
  675.                                                     <li class="inline_mod_check" style="display: none;" id="in_topic_mod_check_', $message['id'], '"></li>';
  676.  
  677.                         if ($message['can_approve'] || $context['can_reply'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg'])
  678.                             echo '
  679.                                 </ul>';
  680.                     echo '
  681.                     </div>
  682.                 </div>
  683.             <br /><br />
  684.                 <hr class="post_separator" />';
  685.     }
  686.  
  687.     echo '
  688.                 </form>
  689.             </div>
  690.             <a id="lastPost"></a>';
  691.  
  692.     // Show the page index... "Pages: [1]".
  693.     echo '
  694.             <div class="pagesection">
  695.                 ', template_button_strip($normal_buttons, 'right'), '
  696.                 <div class="pagelinks floatleft">', $txt['pages'], ': ', $context['page_index'], !empty($modSettings['topbottomEnable']) ? $context['menu_separator'] . ' &nbsp;&nbsp;<a href="#top"><strong><i class="fa fa-chevron-up"></i></strong></a>' : '', '</div>
  697.                 <div class="nextlinks_bottom">', $context['previous_next'], '</div>
  698.             </div>';
  699.  
  700.     // Show the lower breadcrumbs.
  701.     theme_linktree();
  702.     echo '<br />';
  703.  
  704.     $mod_buttons = array(
  705.         'move' => array('test' => 'can_move', 'text' => 'move_topic', 'image' => 'admin_move.gif', 'lang' => true, 'url' => $scripturl . '?action=movetopic;topic=' . $context['current_topic'] . '.0'),
  706.         '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']),
  707.         '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']),
  708.         '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']),
  709.         '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']),
  710.         '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'),
  711.     );
  712.  
  713.     // Restore topic. eh?  No monkey business.
  714.     if ($context['can_restore_topic'])
  715.         $mod_buttons[] = array('text' => 'restore_topic', 'image' => '', 'lang' => true, 'url' => $scripturl . '?action=restoretopic;topics=' . $context['current_topic'] . ';' . $context['session_var'] . '=' . $context['session_id']);
  716.  
  717.     // Allow adding new mod buttons easily.
  718.     call_integration_hook('integrate_mod_buttons', array(&$mod_buttons));
  719.  
  720.     echo '
  721.             <div id="moderationbuttons">', template_button_strip($mod_buttons, 'bottom', array('id' => 'moderationbuttons_strip')), '</div>';
  722.  
  723.     // Show the jumpto box, or actually...let Javascript do it.
  724.     echo '
  725.             <div class="plainbox" id="display_jump_to">&nbsp;</div>';
  726.  
  727.     if ($context['can_reply'] && !empty($options['display_quick_reply']))
  728.     {
  729.         echo '
  730.             <a id="quickreply"></a>
  731.             <div class="tborder" id="quickreplybox">
  732.                 <div class="cat_bar">
  733.                     <h3 class="catbg">
  734.                         <span class="ie6_header floatleft"><a href="javascript:oQuickReply.swap();">
  735.                             <img src="', $settings['images_url'], '/', $options['display_quick_reply'] == 2 ? 'collapse' : 'expand', '.gif" alt="+" id="quickReplyExpand" class="icon" />
  736.                         </a>
  737.                         <a href="javascript:oQuickReply.swap();">', $txt['quick_reply'], '</a>
  738.                         </span>
  739.                     </h3>
  740.                 </div>
  741.                 <div id="quickReplyOptions"', $options['display_quick_reply'] == 2 ? '' : ' style="display: none"', '>
  742.                     <span class="upperframe"><span></span></span>
  743.                     <div class="roundframe">
  744.                         <p class="smalltext lefttext">', $txt['quick_reply_desc'], '</p>
  745.                         ', $context['is_locked'] ? '<p class="alert smalltext">' . $txt['quick_reply_warning'] . '</p>' : '',
  746.                         $context['oldTopicError'] ? '<p class="alert smalltext">' . sprintf($txt['error_old_topic'], $modSettings['oldTopicDays']) . '</p>' : '', '
  747.                         ', $context['can_reply_approved'] ? '' : '<em>' . $txt['wait_for_approval'] . '</em>', '
  748.                         ', !$context['can_reply_approved'] && $context['require_verification'] ? '<br />' : '', '
  749.                         <form action="', $scripturl, '?board=', $context['current_board'], ';action=post2" method="post" accept-charset="', $context['character_set'], '" name="postmodify" id="postmodify" onsubmit="submitonce(this);" style="margin: 0;">
  750.                             <input type="hidden" name="topic" value="', $context['current_topic'], '" />
  751.                             <input type="hidden" name="subject" value="', $context['response_prefix'], $context['subject'], '" />
  752.                             <input type="hidden" name="icon" value="xx" />
  753.                             <input type="hidden" name="from_qr" value="1" />
  754.                             <input type="hidden" name="notify" value="', $context['is_marked_notify'] || !empty($options['auto_notify']) ? '1' : '0', '" />
  755.                             <input type="hidden" name="not_approved" value="', !$context['can_reply_approved'], '" />
  756.                             <input type="hidden" name="goback" value="', empty($options['return_to_post']) ? '0' : '1', '" />
  757.                             <input type="hidden" name="last_msg" value="', $context['topic_last_message'], '" />
  758.                             <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
  759.                             <input type="hidden" name="seqnum" value="', $context['form_sequence_number'], '" />';
  760.  
  761.             // Guests just need more.
  762.             if ($context['user']['is_guest'])
  763.                 echo '
  764.                             <strong>', $txt['name'], ':</strong> <input type="text" name="guestname" value="', $context['name'], '" size="25" class="input_text" tabindex="', $context['tabindex']++, '" />
  765.                             <strong>', $txt['email'], ':</strong> <input type="text" name="email" value="', $context['email'], '" size="25" class="input_text" tabindex="', $context['tabindex']++, '" /><br />';
  766.  
  767.             // Is visual verification enabled?
  768.             if ($context['require_verification'])
  769.                 echo '
  770.                             <strong>', $txt['verification'], ':</strong>', template_control_verification($context['visual_verification_id'], 'quick_reply'), '<br />';
  771.  
  772.             echo '
  773.                             <div class="quickReplyContent">
  774.                                 <textarea cols="600" rows="7" name="message" tabindex="', $context['tabindex']++, '"></textarea>
  775.                             </div>
  776.                             <div class="righttext padding">
  777.                                 <input type="submit" name="post" value="', $txt['post'], '" onclick="return submitThisOnce(this);" accesskey="s" tabindex="', $context['tabindex']++, '" class="button_submit" />
  778.                                 <input type="submit" name="preview" value="', $txt['preview'], '" onclick="return submitThisOnce(this);" accesskey="p" tabindex="', $context['tabindex']++, '" class="button_submit" />';
  779.  
  780.             if ($context['show_spellchecking'])
  781.                 echo '
  782.                                 <input type="button" value="', $txt['spell_check'], '" onclick="spellCheck(\'postmodify\', \'message\');" tabindex="', $context['tabindex']++, '" class="button_submit" />';
  783.  
  784.             echo '
  785.                             </div>
  786.                         </form>
  787.                     </div>
  788.                     <span class="lowerframe"><span></span></span>
  789.                 </div>
  790.             </div>';
  791.     }
  792.     else
  793.         echo '
  794.         <br class="clear" />';
  795.  
  796.     if ($context['show_spellchecking'])
  797.         echo '
  798.             <form action="', $scripturl, '?action=spellcheck" method="post" accept-charset="', $context['character_set'], '" name="spell_form" id="spell_form" target="spellWindow"><input type="hidden" name="spellstring" value="" /></form>
  799.                 <script type="text/javascript" src="' . $settings['default_theme_url'] . '/scripts/spellcheck.js"></script>';
  800.  
  801.     echo '
  802.                 <script type="text/javascript" src="' . $settings['default_theme_url'] . '/scripts/topic.js"></script>
  803.                 <script type="text/javascript"><!-- // --><![CDATA[';
  804.  
  805.     if (!empty($options['display_quick_reply']))
  806.         echo '
  807.                     var oQuickReply = new QuickReply({
  808.                         bDefaultCollapsed: ', !empty($options['display_quick_reply']) && $options['display_quick_reply'] == 2 ? 'false' : 'true', ',
  809.                         iTopicId: ', $context['current_topic'], ',
  810.                         iStart: ', $context['start'], ',
  811.                         sScriptUrl: smf_scripturl,
  812.                         sImagesUrl: "', $settings['images_url'], '",
  813.                         sContainerId: "quickReplyOptions",
  814.                         sImageId: "quickReplyExpand",
  815.                         sImageCollapsed: "collapse.gif",
  816.                         sImageExpanded: "expand.gif",
  817.                         sJumpAnchor: "quickreply"
  818.                     });';
  819.  
  820.     if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && $context['can_remove_post'])
  821.         echo '
  822.                     var oInTopicModeration = new InTopicModeration({
  823.                         sSelf: \'oInTopicModeration\',
  824.                         sCheckboxContainerMask: \'in_topic_mod_check_\',
  825.                         aMessageIds: [\'', implode('\', \'', $removableMessageIDs), '\'],
  826.                         sSessionId: \'', $context['session_id'], '\',
  827.                         sSessionVar: \'', $context['session_var'], '\',
  828.                         sButtonStrip: \'moderationbuttons\',
  829.                         sButtonStripDisplay: \'moderationbuttons_strip\',
  830.                         bUseImageButton: false,
  831.                         bCanRemove: ', $context['can_remove_post'] ? 'true' : 'false', ',
  832.                         sRemoveButtonLabel: \'', $txt['quickmod_delete_selected'], '\',
  833.                         sRemoveButtonImage: \'delete_selected.gif\',
  834.                         sRemoveButtonConfirm: \'', $txt['quickmod_confirm'], '\',
  835.                         bCanRestore: ', $context['can_restore_msg'] ? 'true' : 'false', ',
  836.                         sRestoreButtonLabel: \'', $txt['quick_mod_restore'], '\',
  837.                         sRestoreButtonImage: \'restore_selected.gif\',
  838.                         sRestoreButtonConfirm: \'', $txt['quickmod_confirm'], '\',
  839.                         sFormId: \'quickModForm\'
  840.                     });';
  841.  
  842.     echo '
  843.                     if (\'XMLHttpRequest\' in window)
  844.                     {
  845.                         var oQuickModify = new QuickModify({
  846.                             sScriptUrl: smf_scripturl,
  847.                             bShowModify: ', $settings['show_modify'] ? 'true' : 'false', ',
  848.                             iTopicId: ', $context['current_topic'], ',
  849.                             sTemplateBodyEdit: ', JavaScriptEscape('
  850.                                 <div id="quick_edit_body_container" style="width: 90%">
  851.                                     <div id="error_box" style="padding: 4px;" class="error"></div>
  852.                                     <textarea class="editor" name="message" rows="12" style="' . ($context['browser']['is_ie8'] ? 'width: 635px; max-width: 100%; min-width: 100%' : 'width: 100%') . '; margin-bottom: 10px;" tabindex="' . $context['tabindex']++ . '">%body%</textarea><br />
  853.                                     <input type="hidden" name="' . $context['session_var'] . '" value="' . $context['session_id'] . '" />
  854.                                     <input type="hidden" name="topic" value="' . $context['current_topic'] . '" />
  855.                                     <input type="hidden" name="msg" value="%msg_id%" />
  856.                                     <div class="righttext">
  857.                                         <input type="submit" name="post" value="' . $txt['save'] . '" tabindex="' . $context['tabindex']++ . '" onclick="return oQuickModify.modifySave(\'' . $context['session_id'] . '\', \'' . $context['session_var'] . '\');" accesskey="s" class="button_submit" />&nbsp;&nbsp;' . ($context['show_spellchecking'] ? '<input type="button" value="' . $txt['spell_check'] . '" tabindex="' . $context['tabindex']++ . '" onclick="spellCheck(\'quickModForm\', \'message\');" class="button_submit" />&nbsp;&nbsp;' : '') . '<input type="submit" name="cancel" value="' . $txt['modify_cancel'] . '" tabindex="' . $context['tabindex']++ . '" onclick="return oQuickModify.modifyCancel();" class="button_submit" />
  858.                                     </div>
  859.                                 </div>'), ',
  860.                             sTemplateSubjectEdit: ', JavaScriptEscape('<input type="text" style="width: 90%;" name="subject" value="%subject%" size="80" maxlength="80" tabindex="' . $context['tabindex']++ . '" class="input_text" />'), ',
  861.                             sTemplateBodyNormal: ', JavaScriptEscape('%body%'), ',
  862.                             sTemplateSubjectNormal: ', JavaScriptEscape('<a href="' . $scripturl . '?topic=' . $context['current_topic'] . '.msg%msg_id%#msg%msg_id%" rel="nofollow">%subject%</a>'), ',
  863.                             sTemplateTopSubject: ', JavaScriptEscape($txt['topic'] . ': %subject% &nbsp;(' . $txt['read'] . ' ' . $context['num_views'] . ' ' . $txt['times'] . ')'), ',
  864.                             sErrorBorderStyle: ', JavaScriptEscape('1px solid red'), '
  865.                         });
  866.  
  867.                         aJumpTo[aJumpTo.length] = new JumpTo({
  868.                             sContainerId: "display_jump_to",
  869.                             sJumpToTemplate: "<label class=\"smalltext\" for=\"%select_id%\">', $context['jump_to']['label'], ':<" + "/label> %dropdown_list%",
  870.                             iCurBoardId: ', $context['current_board'], ',
  871.                             iCurBoardChildLevel: ', $context['jump_to']['child_level'], ',
  872.                             sCurBoardName: "', $context['jump_to']['board_name'], '",
  873.                             sBoardChildLevelIndicator: "==",
  874.                             sBoardPrefix: "=> ",
  875.                             sCatSeparator: "-----------------------------",
  876.                             sCatPrefix: "",
  877.                             sGoButtonLabel: "', $txt['go'], '"
  878.                         });
  879.  
  880.                         aIconLists[aIconLists.length] = new IconList({
  881.                             sBackReference: "aIconLists[" + aIconLists.length + "]",
  882.                             sIconIdPrefix: "msg_icon_",
  883.                             sScriptUrl: smf_scripturl,
  884.                             bShowModify: ', $settings['show_modify'] ? 'true' : 'false', ',
  885.                             iBoardId: ', $context['current_board'], ',
  886.                             iTopicId: ', $context['current_topic'], ',
  887.                             sSessionId: "', $context['session_id'], '",
  888.                             sSessionVar: "', $context['session_var'], '",
  889.                             sLabelIconList: "', $txt['message_icon'], '",
  890.                             sBoxBackground: "transparent",
  891.                             sBoxBackgroundHover: "#ffffff",
  892.                             iBoxBorderWidthHover: 1,
  893.                             sBoxBorderColorHover: "#adadad" ,
  894.                             sContainerBackground: "#ffffff",
  895.                             sContainerBorder: "1px solid #adadad",
  896.                             sItemBorder: "1px solid #ffffff",
  897.                             sItemBorderHover: "1px dotted gray",
  898.                             sItemBackground: "transparent",
  899.                             sItemBackgroundHover: "#e0e0f0"
  900.                         });
  901.                     }';
  902.  
  903.     if (!empty($ignoredMsgs))
  904.     {
  905.         echo '
  906.                     var aIgnoreToggles = new Array();';
  907.  
  908.         foreach ($ignoredMsgs as $msgid)
  909.         {
  910.             echo '
  911.                     aIgnoreToggles[', $msgid, '] = new smc_Toggle({
  912.                         bToggleEnabled: true,
  913.                         bCurrentlyCollapsed: true,
  914.                         aSwappableContainers: [
  915.                             \'msg_', $msgid, '_extra_info\',
  916.                             \'msg_', $msgid, '\',
  917.                             \'msg_', $msgid, '_footer\',
  918.                             \'msg_', $msgid, '_quick_mod\',
  919.                             \'modify_button_', $msgid, '\',
  920.                             \'msg_', $msgid, '_signature\'
  921.  
  922.                         ],
  923.                         aSwapLinks: [
  924.                             {
  925.                                 sId: \'msg_', $msgid, '_ignored_link\',
  926.                                 msgExpanded: \'\',
  927.                                 msgCollapsed: ', JavaScriptEscape($txt['show_ignore_user_post']), '
  928.                             }
  929.                         ]
  930.                     });';
  931.         }
  932.     }
  933.  
  934.     echo '
  935.                 // ]]></script>';
  936. }
  937.  
  938. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement