Display.template.php 44 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843
  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.1 Alpha 1
  11. */
  12. function template_main()
  13. {
  14. global $context, $settings, $options, $txt, $scripturl, $modSettings;
  15. // Let them know, if their report was a success!
  16. if ($context['report_sent'])
  17. {
  18. echo '
  19. <div class="windowbg" id="profile_success">
  20. ', $txt['report_sent'], '
  21. </div>';
  22. }
  23. // Show the anchor for the top and for the first message. If the first message is new, say so.
  24. echo '
  25. <a id="top"></a>
  26. <a id="msg', $context['first_message'], '"></a>', $context['first_new_message'] ? '<a id="new"></a>' : '';
  27. // Is this topic also a poll?
  28. if ($context['is_poll'])
  29. {
  30. echo '
  31. <div class="tborder marginbottom" id="poll">
  32. <h3 class="titlebg">
  33. <img src="', $settings['images_url'], '/topic/', $context['poll']['is_locked'] ? 'normal_poll_locked' : 'normal_poll', '.gif" alt="" align="bottom" /> ', $txt['poll'], '
  34. </h3>
  35. <h4 class="windowbg headerpadding" id="pollquestion">
  36. ', $context['poll']['question'], '
  37. </h4>
  38. <div class="windowbg clearfix" id="poll_options">';
  39. // Are they not allowed to vote but allowed to view the options?
  40. if ($context['poll']['show_results'] || !$context['allow_vote'])
  41. {
  42. echo '
  43. <dl class="options">';
  44. // Show each option with its corresponding percentage bar.
  45. foreach ($context['poll']['options'] as $option)
  46. echo '
  47. <dt class="middletext', $option['voted_this'] ? ' voted' : '', '">', $option['option'], '</dt>
  48. <dd class="middletext">', $context['allow_poll_view'] ? $option['bar'] . ' ' . $option['votes'] . ' (' . $option['percent'] . '%)' : '', '</dd>';
  49. echo '
  50. </dl>';
  51. if ($context['allow_poll_view'])
  52. echo '
  53. <p><strong>', $txt['poll_total_voters'], ':</strong> ', $context['poll']['total_votes'], '</p>';
  54. }
  55. // They are allowed to vote! Go to it!
  56. else
  57. {
  58. echo '
  59. <form action="', $scripturl, '?action=vote;topic=', $context['current_topic'], '.', $context['start'], ';poll=', $context['poll']['id'], '" method="post" accept-charset="', $context['character_set'], '">';
  60. // Show a warning if they are allowed more than one option.
  61. if ($context['poll']['allowed_warning'])
  62. echo '
  63. <p class="smallpadding">', $context['poll']['allowed_warning'], '</p>';
  64. echo '
  65. <ul class="reset options">';
  66. // Show each option with its button - a radio likely.
  67. foreach ($context['poll']['options'] as $option)
  68. echo '
  69. <li class="middletext">', $option['vote_button'], ' <label for="', $option['id'], '">', $option['option'], '</label></li>';
  70. echo '
  71. </ul>
  72. <div class="submitbutton', !empty($context['poll']['expire_time']) ? ' border' : '', '">
  73. <input type="submit" value="', $txt['poll_vote'], '" class="button_submit" />
  74. <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
  75. </div>
  76. </form>';
  77. }
  78. // Is the clock ticking?
  79. if (!empty($context['poll']['expire_time']))
  80. echo '
  81. <p><strong>', ($context['poll']['is_expired'] ? $txt['poll_expired_on'] : $txt['poll_expires_on']), ':</strong> ', $context['poll']['expire_time'], '</p>';
  82. echo '
  83. </div>
  84. </div>
  85. <div id="pollmoderation" class="clearfix">';
  86. // Build the poll moderation button array.
  87. $poll_buttons = array(
  88. 'vote' => array('test' => 'allow_return_vote', 'text' => 'poll_return_vote', 'image' => 'poll_options.gif', 'lang' => true, 'url' => $scripturl . '?topic=' . $context['current_topic'] . '.' . $context['start']),
  89. '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'),
  90. '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']),
  91. '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']),
  92. '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']),
  93. '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']),
  94. );
  95. template_button_strip($poll_buttons);
  96. echo '
  97. </div><br class="clear" />';
  98. }
  99. // Does this topic have some events linked to it?
  100. if (!empty($context['linked_calendar_events']))
  101. {
  102. echo '
  103. <div class="linked_events">
  104. <h3 class="titlebg headerpadding">', $txt['calendar_linked_events'], '</h3>
  105. <div class="content windowbg">
  106. <ul class="reset">';
  107. foreach ($context['linked_calendar_events'] as $event)
  108. echo '
  109. <li>
  110. ', ($event['can_edit'] ? '<a href="' . $event['modify_href'] . '" class="edit_event">*</a> ' : ''), '<strong>', $event['title'], '</strong>: ', $event['start_date'], ($event['start_date'] != $event['end_date'] ? ' - ' . $event['end_date'] : ''), '
  111. </li>';
  112. echo '
  113. </ul>
  114. </div>
  115. </div>';
  116. }
  117. // Build the normal button array.
  118. $normal_buttons = array(
  119. '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']),
  120. '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']),
  121. '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']),
  122. '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']),
  123. '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'),
  124. 'print' => array('text' => 'print', 'image' => 'print.gif', 'lang' => true, 'custom' => 'rel="new_win nofollow"', 'url' => $scripturl . '?action=printpage;topic=' . $context['current_topic'] . '.0'),
  125. );
  126. // Allow adding new buttons easily.
  127. call_integration_hook('integrate_display_buttons', array(&$normal_buttons));
  128. // Show the page index... "Pages: [1]".
  129. echo '
  130. <div class="clearfix margintop" id="postbuttons">
  131. <div class="next">', $context['previous_next'], '</div>
  132. <div class="margintop middletext floatleft">', $txt['pages'], ': ', $context['page_index'], !empty($modSettings['topbottomEnable']) ? $context['menu_separator'] . ' &nbsp;&nbsp;<a href="#lastPost"><strong>' . $txt['go_down'] . '</strong></a>' : '', '</div>
  133. <div class="nav floatright">', template_button_strip($normal_buttons, 'bottom'), '</div>
  134. </div>';
  135. // Show the topic information - icon, subject, etc.
  136. echo '
  137. <div id="forumposts" class="tborder">
  138. <h3 class="catbg3">
  139. <img src="', $settings['images_url'], '/topic/', $context['class'], '.gif" align="bottom" alt="" />
  140. <span>', $txt['author'], '</span>
  141. <span id="top_subject">', $txt['topic'], ': ', $context['subject'], ' &nbsp;(', $txt['read'], ' ', $context['num_views'], ' ', $txt['times'], ')</span>
  142. </h3>';
  143. if (!empty($settings['display_who_viewing']))
  144. {
  145. echo '
  146. <div id="whoisviewing" class="smalltext headerpadding windowbg2">';
  147. // Show just numbers...?
  148. if ($settings['display_who_viewing'] == 1)
  149. echo count($context['view_members']), ' ', count($context['view_members']) == 1 ? $txt['who_member'] : $txt['members'];
  150. // Or show the actual people viewing the topic?
  151. else
  152. 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'] . ')');
  153. // Now show how many guests are here too.
  154. echo $txt['who_and'], $context['view_num_guests'], ' ', $context['view_num_guests'] == 1 ? $txt['guest'] : $txt['guests'], $txt['who_viewing_topic'], '
  155. </div>';
  156. }
  157. echo '
  158. <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">';
  159. // These are some cache image buttons we may want.
  160. $reply_button = create_button('quote.gif', 'reply', 'quote', 'align="middle"');
  161. $modify_button = create_button('modify.gif', 'modify', 'modify', 'align="middle"');
  162. $remove_button = create_button('delete.gif', 'remove', 'remove', 'align="middle"');
  163. $split_button = create_button('split.gif', 'split', 'split', 'align="middle"');
  164. $approve_button = create_button('approve.gif', 'approve', 'approve', 'align="middle"');
  165. $restore_message_button = create_button('restore_topic.gif', 'restore_message', 'restore_message', 'align="middle"');
  166. $ignoredMsgs = array();
  167. $removableMessageIDs = array();
  168. // Get all the messages...
  169. while ($message = $context['get_message']())
  170. {
  171. $is_first_post = !isset($is_first_post) ? true : false;
  172. $ignoring = false;
  173. if ($message['can_remove'])
  174. $removableMessageIDs[] = $message['id'];
  175. echo '
  176. <div class="bordercolor">';
  177. // Are we ignoring this message?
  178. if (!empty($message['is_ignored']))
  179. {
  180. $ignoring = true;
  181. $ignoredMsgs[] = $message['id'];
  182. }
  183. // Show the message anchor and a "new" anchor if this message is new.
  184. if ($message['id'] != $context['first_message'])
  185. echo '
  186. <a id="msg', $message['id'], '"></a>', $message['first_new'] ? '<a id="new"></a>' : '';
  187. echo '
  188. <div class="clearfix ', !$is_first_post ? 'topborder ' : '', $message['approved'] ? ($message['alternate'] == 0 ? 'windowbg' : 'windowbg2') : 'approvebg', ' largepadding">';
  189. // Show information about the poster of this message.
  190. echo '
  191. <div class="floatleft poster">
  192. <h4>', $message['member']['link'], '</h4>
  193. <ul class="reset smalltext" id="msg_', $message['id'], '_extra_info">';
  194. // Show the member's custom title, if they have one.
  195. if (isset($message['member']['title']) && $message['member']['title'] != '')
  196. echo '
  197. <li>', $message['member']['title'], '</li>';
  198. // Show the member's primary group (like 'Administrator') if they have one.
  199. if (isset($message['member']['group']) && $message['member']['group'] != '')
  200. echo '
  201. <li>', $message['member']['group'], '</li>';
  202. // Don't show these things for guests.
  203. if (!$message['member']['is_guest'])
  204. {
  205. // 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.
  206. if ((empty($settings['hide_post_group']) || $message['member']['group'] == '') && $message['member']['post_group'] != '')
  207. echo '
  208. <li>', $message['member']['post_group'], '</li>';
  209. echo '
  210. <li>', $message['member']['group_stars'], '</li>';
  211. // Is karma display enabled? Total or +/-?
  212. if ($modSettings['karmaMode'] == '1')
  213. echo '
  214. <li class="margintop">', $modSettings['karmaLabel'], ' ', $message['member']['karma']['good'] - $message['member']['karma']['bad'], '</li>';
  215. elseif ($modSettings['karmaMode'] == '2')
  216. echo '
  217. <li class="margintop">', $modSettings['karmaLabel'], ' +', $message['member']['karma']['good'], '/-', $message['member']['karma']['bad'], '</li>';
  218. // Is this user allowed to modify this member's karma?
  219. if ($message['member']['karma']['allow'])
  220. echo '
  221. <li>
  222. <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'], '">', $modSettings['karmaApplaudLabel'], '</a>
  223. <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'], '">', $modSettings['karmaSmiteLabel'], '</a>
  224. </li>';
  225. // Show online and offline buttons?
  226. if (!empty($modSettings['onlineEnable']))
  227. echo '
  228. <li>', $context['can_send_pm'] ? '<a href="' . $message['member']['online']['href'] . '" title="' . $message['member']['online']['label'] . '">' : '', $settings['use_image_buttons'] ? '<img src="' . $message['member']['online']['image_href'] . '" alt="' . $message['member']['online']['text'] . '" border="0" style="margin-top: 2px;" />' : $message['member']['online']['text'], $context['can_send_pm'] ? '</a>' : '', $settings['use_image_buttons'] ? '<span class="smalltext"> ' . $message['member']['online']['text'] . '</span>' : '', '</li>';
  229. // Show the member's gender icon?
  230. if (!empty($settings['show_gender']) && $message['member']['gender']['image'] != '' && !isset($context['disabled_fields']['gender']))
  231. echo '
  232. <li>', $txt['gender'], ': ', $message['member']['gender']['image'], '</li>';
  233. // Show how many posts they have made.
  234. if (!isset($context['disabled_fields']['posts']))
  235. echo '
  236. <li>', $txt['member_postcount'], ': ', $message['member']['posts'], '</li>';
  237. // Any custom fields for standard placement?
  238. if (!empty($message['member']['custom_fields']))
  239. {
  240. foreach ($message['member']['custom_fields'] as $custom)
  241. if (empty($custom['placement']) && !empty($custom['value']))
  242. echo '
  243. <li>', $custom['title'], ': ', $custom['value'], '</li>';
  244. }
  245. // Show avatars, images, etc.?
  246. if (!empty($settings['show_user_images']) && empty($options['show_no_avatars']) && !empty($message['member']['avatar']['image']))
  247. echo '
  248. <li class="margintop" style="overflow: auto;">', $message['member']['avatar']['image'], '</li>';
  249. // Show their personal text?
  250. if (!empty($settings['show_blurb']) && $message['member']['blurb'] != '')
  251. echo '
  252. <li class="margintop">', $message['member']['blurb'], '</li>';
  253. // Any custom fields to show as icons?
  254. if (!empty($message['member']['custom_fields']))
  255. {
  256. $shown = false;
  257. foreach ($message['member']['custom_fields'] as $custom)
  258. {
  259. if ($custom['placement'] != 1 || empty($custom['value']))
  260. continue;
  261. if (empty($shown))
  262. {
  263. $shown = true;
  264. echo '
  265. <li class="margintop">
  266. <ul class="reset nolist">';
  267. }
  268. echo '
  269. <li>', $custom['value'], '</li>';
  270. }
  271. if ($shown)
  272. echo '
  273. </ul>
  274. </li>';
  275. }
  276. // This shows the popular messaging icons.
  277. if ($message['member']['has_messenger'] && $message['member']['can_view_profile'])
  278. echo '
  279. <li class="margintop">
  280. <ul class="reset nolist">
  281. ', !isset($context['disabled_fields']['icq']) && !empty($message['member']['icq']['link']) ? '<li>' . $message['member']['icq']['link'] . '</li>' : '', '
  282. ', !isset($context['disabled_fields']['msn']) && !empty($message['member']['msn']['link']) ? '<li>' . $message['member']['msn']['link'] . '</li>' : '', '
  283. ', !isset($context['disabled_fields']['aim']) && !empty($message['member']['aim']['link']) ? '<li>' . $message['member']['aim']['link'] . '</li>' : '', '
  284. ', !isset($context['disabled_fields']['yim']) && !empty($message['member']['yim']['link']) ? '<li>' . $message['member']['yim']['link'] . '</li>' : '', '
  285. </ul>
  286. </li>';
  287. // Show the profile, website, email address, and personal message buttons.
  288. if ($settings['show_profile_buttons'])
  289. {
  290. echo '
  291. <li class="margintop">
  292. <ul class="reset nolist">';
  293. // Don't show the profile button if you're not allowed to view the profile.
  294. if ($message['member']['can_view_profile'])
  295. echo '
  296. <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'] . '" border="0" />' : $txt['view_profile']), '</a></li>';
  297. // Don't show an icon if they haven't specified a website.
  298. if ($message['member']['website']['url'] != '' && !isset($context['disabled_fields']['website']))
  299. echo '
  300. <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'] . '" border="0" />' : $txt['www']), '</a></li>';
  301. // Don't show the email address if they want it hidden.
  302. if (in_array($message['member']['show_email'], array('yes', 'yes_permission_override', 'no_through_forum')))
  303. echo '
  304. <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>';
  305. // Since we know this person isn't a guest, you *can* message them.
  306. if ($context['can_send_pm'])
  307. echo '
  308. <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']) . '" border="0" />' : ($message['member']['online']['is_online'] ? $txt['pm_online'] : $txt['pm_offline']), '</a></li>';
  309. echo '
  310. </ul>
  311. </li>';
  312. }
  313. // Are we showing the warning status?
  314. if ($message['member']['can_see_warning'])
  315. echo '
  316. <li>', $context['can_issue_warning'] ? '<a href="' . $scripturl . '?action=profile;area=issuewarning;u=' . $message['member']['id'] . '">' : '', '<img src="', $settings['images_url'], '/warning_', $message['member']['warning_status'], '.gif" alt="', $txt['user_warn_' . $message['member']['warning_status']], '" />', $context['can_issue_warning'] ? '</a>' : '', '<span class="warn_', $message['member']['warning_status'], '">', $txt['warn_' . $message['member']['warning_status']], '</span></li>';
  317. }
  318. // Otherwise, show the guest's email.
  319. elseif (!empty($message['member']['email']) && in_array($message['member']['show_email'], array('yes', 'yes_permission_override', 'no_through_forum')))
  320. echo '
  321. <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'] . '" border="0" />' : $txt['email']), '</a></li>';
  322. // Done with the information about the poster... on to the post itself.
  323. echo '
  324. </ul>
  325. </div>
  326. <div class="postarea">
  327. <div class="flow_hidden">
  328. <div class="keyinfo">
  329. <div class="messageicon"><img src="', $message['icon_url'] . '" alt="" border="0"', $message['can_modify'] ? ' id="msg_icon_' . $message['id'] . '"' : '', ' /></div>
  330. <h5 id="subject_', $message['id'], '">
  331. <a href="', $message['href'], '" rel="nofollow">', $message['subject'], '</a>
  332. </h5>
  333. <div class="smalltext">&#171; <strong>', !empty($message['counter']) ? $txt['reply_noun'] . ' #' . $message['counter'] : '', ' ', $txt['on'], ':</strong> ', $message['time'], ' &#187;</div>
  334. <div id="msg_', $message['id'], '_quick_mod"></div>
  335. </div>';
  336. // If this is the first post, (#0) just say when it was posted - otherwise give the reply #.
  337. if ($message['can_approve'] || $context['can_reply'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg'])
  338. echo '
  339. <ul class="reset smalltext postingbuttons">';
  340. // Maybe we can approve it, maybe we should?
  341. if ($message['can_approve'])
  342. echo '
  343. <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'], '">', $approve_button, '</a></li>';
  344. // Can they reply? Have they turned on quick reply?
  345. if ($context['can_quote'] && !empty($options['display_quick_reply']))
  346. echo '
  347. <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'], ');">', $reply_button, '</a></li>';
  348. // So... quick reply is off, but they *can* reply?
  349. elseif ($context['can_quote'])
  350. echo '
  351. <li><a href="', $scripturl, '?action=post;quote=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], ';last_msg=', $context['topic_last_message'], '">', $reply_button, '</a></li>';
  352. // Can the user modify the contents of this post?
  353. if ($message['can_modify'])
  354. echo '
  355. <li><a href="', $scripturl, '?action=post;msg=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], '">', $modify_button, '</a></li>';
  356. // How about... even... remove it entirely?!
  357. if ($message['can_remove'])
  358. echo '
  359. <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'], '?\');">', $remove_button, '</a></li>';
  360. // What about splitting it off the rest of the topic?
  361. if ($context['can_split'] && !empty($context['real_num_replies']))
  362. echo '
  363. <li><a href="', $scripturl, '?action=splittopics;topic=', $context['current_topic'], '.0;at=', $message['id'], '">', $split_button, '</a></li>';
  364. // Can we restore topics?
  365. if ($context['can_restore_msg'])
  366. echo '
  367. <li><a href="', $scripturl, '?action=restoretopic;msgs=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $restore_message_button, '</a></li>';
  368. // Show a checkbox for quick moderation?
  369. if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && $message['can_remove'])
  370. echo '
  371. <li style="display: none;" id="in_topic_mod_check_', $message['id'], '"></li>';
  372. if ($message['can_approve'] || $context['can_reply'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg'])
  373. echo '
  374. </ul>';
  375. echo '
  376. </div>';
  377. // Ignoring this user? Hide the post.
  378. if ($ignoring)
  379. echo '
  380. <div class="ignored" id="msg_', $message['id'], '_ignored_prompt">
  381. ', $txt['ignoring_user'], '
  382. <a href="#" id="msg_', $message['id'], '_ignored_link" style="display: none;">', $txt['show_ignore_user_post'], '</a>
  383. </div>';
  384. // Show the post itself, finally!
  385. echo '
  386. <div class="post">
  387. <hr class="hrcolor" width="100%" size="1" />';
  388. if (!$message['approved'] && $message['member']['id'] != 0 && $message['member']['id'] == $context['user']['id'])
  389. echo '
  390. <div class="approve_post">
  391. ', $txt['post_awaiting_approval'], '
  392. </div>';
  393. echo '
  394. <div class="inner" id="msg_', $message['id'], '"', '>', $message['body'], '</div>
  395. </div>', $message['can_modify'] ? '
  396. <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: ' . (isBrowser('is_ie5') || isBrowser('is_ie5.5') ? 'hand' : 'pointer') . '; display: none;" onclick="oQuickModify.modifyMsg(\'' . $message['id'] . '\')" />' : '';
  397. // Assuming there are attachments...
  398. if (!empty($message['attachment']))
  399. {
  400. // Now for the attachments, signature, ip logged, etc...
  401. echo '
  402. <div id="msg_', $message['id'], '_footer" class="attachments smalltext">';
  403. $last_approved_state = 1;
  404. foreach ($message['attachment'] as $attachment)
  405. {
  406. // Show a special box for unapproved attachments...
  407. if ($attachment['is_approved'] != $last_approved_state)
  408. {
  409. $last_approved_state = 0;
  410. echo '
  411. <fieldset>
  412. <legend>', $txt['attach_awaiting_approve'];
  413. if ($context['can_approve'])
  414. echo '&nbsp;[<a href="', $scripturl, '?action=attachapprove;sa=all;mid=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $txt['approve_all'], '</a>]';
  415. echo '</legend>';
  416. }
  417. if ($attachment['is_image'])
  418. {
  419. if ($attachment['thumbnail']['has_thumb'])
  420. echo '
  421. <a href="', $attachment['href'], ';image" id="link_', $attachment['id'], '" onclick="', $attachment['thumbnail']['javascript'], '"><img src="', $attachment['thumbnail']['href'], '" alt="" id="thumb_', $attachment['id'], '" border="0" /></a><br />';
  422. else
  423. echo '
  424. <img src="' . $attachment['href'] . ';image" alt="" width="' . $attachment['width'] . '" height="' . $attachment['height'] . '" border="0" /><br />';
  425. }
  426. echo '
  427. <a href="' . $attachment['href'] . '"><img src="' . $settings['images_url'] . '/icons/clip.gif" align="middle" alt="*" border="0" />&nbsp;' . $attachment['name'] . '</a> ';
  428. if (!$attachment['is_approved'] && $context['can_approve'])
  429. echo '
  430. [<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>] ';
  431. echo '
  432. (', $attachment['size'], ($attachment['is_image'] ? ', ' . $attachment['real_width'] . 'x' . $attachment['real_height'] . ' - ' . $txt['attach_viewed'] : ' - ' . $txt['attach_downloaded']) . ' ' . $attachment['downloads'] . ' ' . $txt['attach_times'] . '.)<br />';
  433. }
  434. // If we had unapproved attachments clean up.
  435. if ($last_approved_state == 0)
  436. echo '
  437. </fieldset>';
  438. echo '
  439. </div>';
  440. }
  441. echo '
  442. </div>
  443. <div class="moderatorbar">
  444. <div class="smalltext floatleft" id="modified_', $message['id'], '">';
  445. // Show "« Last Edit: Time by Person »" if this post was edited.
  446. if ($settings['show_modify'] && !empty($message['modified']['name']))
  447. echo '
  448. &#171; <em>', $txt['last_edit'], ': ', $message['modified']['time'], ' ', $txt['by'], ' ', $message['modified']['name'], '</em> &#187;';
  449. echo '
  450. </div>
  451. <div class="smalltext largepadding floatright">';
  452. // Maybe they want to report this post to the moderator(s)?
  453. if ($context['can_report_moderator'])
  454. echo '
  455. <a href="', $scripturl, '?action=reporttm;topic=', $context['current_topic'], '.', $message['counter'], ';msg=', $message['id'], '">', $txt['report_to_mod'], '</a> &nbsp;';
  456. // Can we issue a warning because of this post? Remember, we can't give guests warnings.
  457. if ($context['can_issue_warning'] && !$message['is_message_author'] && !$message['member']['is_guest'])
  458. echo '
  459. <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'], '" border="0" /></a>';
  460. echo '
  461. <img src="', $settings['images_url'], '/ip.gif" alt="" border="0" />';
  462. // Show the IP to this user for this post - because you can moderate?
  463. if ($context['can_moderate_forum'] && !empty($message['member']['ip']))
  464. echo '
  465. <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>';
  466. // Or, should we show it because this is you?
  467. elseif ($message['can_see_ip'])
  468. echo '
  469. <a href="', $scripturl, '?action=helpadmin;help=see_member_ip" onclick="return reqWin(this.href);" class="help">', $message['member']['ip'], '</a>';
  470. // Okay, are you at least logged in? Then we can show something about why IPs are logged...
  471. elseif (!$context['user']['is_guest'])
  472. echo '
  473. <a href="', $scripturl, '?action=helpadmin;help=see_member_ip" onclick="return reqWin(this.href);" class="help">', $txt['logged'], '</a>';
  474. // Otherwise, you see NOTHING!
  475. else
  476. echo '
  477. ', $txt['logged'];
  478. echo '
  479. </div>';
  480. // Are there any custom profile fields for above the signature?
  481. if (!empty($message['member']['custom_fields']))
  482. {
  483. $shown = false;
  484. foreach ($message['member']['custom_fields'] as $custom)
  485. {
  486. if ($custom['placement'] != 2 || empty($custom['value']))
  487. continue;
  488. if (empty($shown))
  489. {
  490. $shown = true;
  491. echo '
  492. <div class="custom_fields_above_signature">
  493. <ul class="reset nolist>';
  494. }
  495. echo '
  496. <li>', $custom['value'], '</li>';
  497. }
  498. if ($shown)
  499. echo '
  500. </ul>
  501. </div>';
  502. }
  503. // Show the member's signature?
  504. if (!empty($message['member']['signature']) && empty($options['show_no_signatures']) && $context['signature_enabled'])
  505. echo '
  506. <div class="signature" id="msg_', $message['id'], '_signature">', $message['member']['signature'], '</div>';
  507. echo '
  508. </div>
  509. </div>
  510. </div>';
  511. }
  512. echo '
  513. </form>';
  514. echo '
  515. </div>
  516. <a id="lastPost"></a>';
  517. echo '
  518. <div class="clearfix marginbottom" id="postbuttons_lower">
  519. <div class="nav floatright">', template_button_strip($normal_buttons, 'top'), '</div>
  520. <div class="middletext floatleft">', $txt['pages'], ': ', $context['page_index'], !empty($modSettings['topbottomEnable']) ? $context['menu_separator'] . ' &nbsp;&nbsp;<a href="#top"><strong>' . $txt['go_up'] . '</strong></a>' : '', '</div>
  521. <div class="clear">', $context['previous_next'], '</div>
  522. </div>';
  523. // Show the lower breadcrumbs.
  524. theme_linktree();
  525. $mod_buttons = array(
  526. 'move' => array('test' => 'can_move', 'text' => 'move_topic', 'image' => 'admin_move.gif', 'lang' => true, 'url' => $scripturl . '?action=movetopic;topic=' . $context['current_topic'] . '.0'),
  527. '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']),
  528. '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']),
  529. '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']),
  530. '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']),
  531. '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'),
  532. );
  533. // Restore topic. eh? No monkey business.
  534. if ($context['can_restore_topic'])
  535. $mod_buttons[] = array('text' => 'restore_topic', 'image' => '', 'lang' => true, 'url' => $scripturl . '?action=restoretopic;topics=' . $context['current_topic'] . ';' . $context['session_var'] . '=' . $context['session_id']);
  536. // Allow adding new mod buttons easily.
  537. call_integration_hook('integrate_mod_buttons', array(&$mod_buttons));
  538. echo '
  539. <div id="moderationbuttons" class="clearfix">', template_button_strip($mod_buttons, 'bottom', array('id' => 'moderationbuttons_strip')), '</div>';
  540. // Show the jumpto box, or actually...let Javascript do it.
  541. echo '
  542. <div class="tborder">
  543. <div class="titlebg2" style="padding: 4px;" align="', !$context['right_to_left'] ? 'right' : 'left', '" id="display_jump_to">&nbsp;</div>
  544. </div><br />';
  545. if ($context['can_reply'] && !empty($options['display_quick_reply']))
  546. {
  547. echo '
  548. <a id="quickreply"></a>
  549. <div class="tborder" id="quickreplybox">';
  550. echo '
  551. <h3 class="catbg">
  552. <a href="javascript:oQuickReply.swap();">
  553. <img src="', $settings['images_url'], '/', $options['display_quick_reply'] == 2 ? 'collapse' : 'expand', '.gif" alt="+" id="quickReplyExpand" />
  554. </a>
  555. <a href="javascript:oQuickReply.swap();">', $txt['quick_reply'], '</a>
  556. </h3>
  557. <div class="windowbg" id="quickReplyOptions"', $options['display_quick_reply'] == 2 ? '' : ' style="display: none"', '>
  558. <div class="floatleft" id="quickReplyWarning">
  559. ', $txt['quick_reply_desc'], $context['is_locked'] ? '<p><strong>' . $txt['quick_reply_warning'] . '</strong></p>' : '', $context['oldTopicError'] ? '<p><strong>' . sprintf($txt['error_old_topic'], $modSettings['oldTopicDays']) . '</strong></p>' : '', '
  560. </div>
  561. <div id="quickReplyContent">', $context['can_reply_approved'] ? '' : '<em>' . $txt['wait_for_approval'] . '</em>', '
  562. ', !$context['can_reply_approved'] && $context['require_verification'] ? '<br />' : '', '
  563. <form action="', $scripturl, '?action=post2', empty($context['current_board']) ? '' : ';board=' . $context['current_board'], '" method="post" accept-charset="', $context['character_set'], '" name="postmodify" id="postmodify" onsubmit="submitonce(this);smc_saveEntities(\'postmodify\', [\'subject\', \'message\', \'guestname\', \'evtitle\', \'question\']);" style="margin: 0;">
  564. <input type="hidden" name="topic" value="', $context['current_topic'], '" />
  565. <input type="hidden" name="subject" value="', $context['response_prefix'], $context['subject'], '" />
  566. <input type="hidden" name="icon" value="xx" />
  567. <input type="hidden" name="from_qr" value="1" />
  568. <input type="hidden" name="notify" value="', $context['is_marked_notify'] || !empty($options['auto_notify']) ? '1' : '0', '" />
  569. <input type="hidden" name="not_approved" value="', !$context['can_reply_approved'], '" />
  570. <input type="hidden" name="goback" value="', empty($options['return_to_post']) ? '0' : '1', '" />
  571. <input type="hidden" name="last_msg" value="', $context['topic_last_message'], '" />';
  572. // Guests just need more.
  573. if ($context['user']['is_guest'])
  574. echo '
  575. <strong>', $txt['name'], ':</strong> <input type="text" name="guestname" value="', $context['name'], '" size="25" class="input_text" tabindex="', $context['tabindex']++, '" />
  576. <strong>', $txt['email'], ':</strong> <input type="text" name="email" value="', $context['email'], '" size="25" class="input_text" tabindex="', $context['tabindex']++, '" /><br />';
  577. // Is visual verification enabled?
  578. if ($context['require_verification'])
  579. echo '
  580. <strong>', $txt['verification'], ':</strong>', template_control_verification($context['visual_verification_id'], 'quick_reply'), '<br />';
  581. echo '
  582. <textarea cols="600" rows="7" name="message" tabindex="', $context['tabindex']++, '"></textarea><br />
  583. <input type="submit" name="post" value="', $txt['post'], '" onclick="return submitThisOnce(this);" accesskey="s" tabindex="', $context['tabindex']++, '" class="button_submit" />
  584. <input type="submit" name="preview" value="', $txt['preview'], '" onclick="return submitThisOnce(this);" accesskey="p" tabindex="', $context['tabindex']++, '" class="button_submit" />';
  585. if ($context['show_spellchecking'])
  586. echo '
  587. <input type="button" value="', $txt['spell_check'], '" onclick="spellCheck(\'postmodify\', \'message\');" tabindex="', $context['tabindex']++, '" class="button_submit" />';
  588. echo '
  589. <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
  590. <input type="hidden" name="seqnum" value="', $context['form_sequence_number'], '" />
  591. </form>
  592. </div>
  593. <div class="clear"></div>
  594. </div>
  595. </div>';
  596. }
  597. if ($context['show_spellchecking'])
  598. echo '
  599. <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>
  600. <script type="text/javascript" src="' . $settings['default_theme_url'] . '/scripts/spellcheck.js"></script>';
  601. echo '
  602. <script type="text/javascript" src="' . $settings['default_theme_url'] . '/scripts/topic.js"></script>
  603. <script type="text/javascript"><!-- // --><![CDATA[';
  604. if (!empty($options['display_quick_reply']))
  605. echo '
  606. var oQuickReply = new QuickReply({
  607. bDefaultCollapsed: ', !empty($options['display_quick_reply']) && $options['display_quick_reply'] == 2 ? 'false' : 'true', ',
  608. iTopicId: ', $context['current_topic'], ',
  609. iStart: ', $context['start'], ',
  610. sScriptUrl: smf_scripturl,
  611. sImagesUrl: "', $settings['images_url'], '",
  612. sContainerId: "quickReplyOptions",
  613. sImageId: "quickReplyExpand",
  614. sImageCollapsed: "collapse.gif",
  615. sImageExpanded: "expand.gif",
  616. sJumpAnchor: "quickreply"
  617. });';
  618. if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && $context['can_remove_post'])
  619. echo '
  620. var oInTopicModeration = new InTopicModeration({
  621. sSelf: \'oInTopicModeration\',
  622. sCheckboxContainerMask: \'in_topic_mod_check_\',
  623. aMessageIds: [\'', implode('\', \'', $removableMessageIDs), '\'],
  624. sSessionId: \'', $context['session_id'], '\',
  625. sSessionVar: \'', $context['session_var'], '\',
  626. sButtonStrip: \'moderationbuttons\',
  627. sButtonStripDisplay: \'moderationbuttons_strip\',
  628. bUseImageButton: false,
  629. bCanRemove: ', $context['can_remove_post'] ? 'true' : 'false', ',
  630. sRemoveButtonLabel: \'', $txt['quickmod_delete_selected'], '\',
  631. sRemoveButtonImage: \'delete_selected.gif\',
  632. sRemoveButtonConfirm: \'', $txt['quickmod_confirm'], '\',
  633. bCanRestore: ', $context['can_restore_msg'] ? 'true' : 'false', ',
  634. sRestoreButtonLabel: \'', $txt['quick_mod_restore'], '\',
  635. sRestoreButtonImage: \'restore_selected.gif\',
  636. sRestoreButtonConfirm: \'', $txt['quickmod_confirm'], '\',
  637. sFormId: \'quickModForm\'
  638. });';
  639. echo '
  640. if (\'XMLHttpRequest\' in window)
  641. {
  642. var oQuickModify = new QuickModify({
  643. sScriptUrl: smf_scripturl,
  644. bShowModify: ', $settings['show_modify'] ? 'true' : 'false', ',
  645. iTopicId: ', $context['current_topic'], ',
  646. sTemplateBodyEdit: ', JavaScriptEscape('
  647. <div id="quick_edit_body_container" style="width: 90%">
  648. <div id="error_box" style="padding: 4px;" class="error"></div>
  649. <textarea class="editor" name="message" rows="12" style="' . (isBrowser('is_ie8') ? 'width: 635px; max-width: 100%; min-width: 100%' : 'width: 100%') . '; margin-bottom: 10px;" tabindex="' . $context['tabindex']++ . '">%body%</textarea><br />
  650. <input type="hidden" name="' . $context['session_var'] . '" value="' . $context['session_id'] . '" />
  651. <input type="hidden" name="topic" value="' . $context['current_topic'] . '" />
  652. <input type="hidden" name="msg" value="%msg_id%" />
  653. <div class="righttext">
  654. <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" />
  655. </div>
  656. </div>'), ',
  657. sTemplateSubjectEdit: ', JavaScriptEscape('<input type="text" style="width: 90%" name="subject" value="%subject%" size="80" maxlength="80" tabindex="' . $context['tabindex']++ . '" class="input_text" />'), ',
  658. sTemplateBodyNormal: ', JavaScriptEscape('%body%'), ',
  659. sTemplateSubjectNormal: ', JavaScriptEscape('<a href="' . $scripturl . '?topic=' . $context['current_topic'] . '.msg%msg_id%#msg%msg_id%" rel="nofollow">%subject%</a>'), ',
  660. sTemplateTopSubject: ', JavaScriptEscape($txt['topic'] . ': %subject% &nbsp;(' . $txt['read'] . ' ' . $context['num_views'] . ' ' . $txt['times'] . ')'), ',
  661. sErrorBorderStyle: ', JavaScriptEscape('1px solid red'), '
  662. });
  663. aJumpTo[aJumpTo.length] = new JumpTo({
  664. sContainerId: "display_jump_to",
  665. sJumpToTemplate: "<label class=\"smalltext\" for=\"%select_id%\">', $context['jump_to']['label'], ':<" + "/label> %dropdown_list%",
  666. iCurBoardId: ', $context['current_board'], ',
  667. iCurBoardChildLevel: ', $context['jump_to']['child_level'], ',
  668. sCurBoardName: "', $context['jump_to']['board_name'], '",
  669. sBoardChildLevelIndicator: "==",
  670. sBoardPrefix: "=> ",
  671. sCatSeparator: "-----------------------------",
  672. sCatPrefix: "",
  673. sGoButtonLabel: "', $txt['go'], '"
  674. });
  675. aIconLists[aIconLists.length] = new IconList({
  676. sBackReference: "aIconLists[" + aIconLists.length + "]",
  677. sIconIdPrefix: "msg_icon_",
  678. sScriptUrl: smf_scripturl,
  679. bShowModify: ', $settings['show_modify'] ? 'true' : 'false', ',
  680. iBoardId: ', $context['current_board'], ',
  681. iTopicId: ', $context['current_topic'], ',
  682. sSessionId: "', $context['session_id'], '",
  683. sSessionVar: "', $context['session_var'], '",
  684. sLabelIconList: "', $txt['message_icon'], '",
  685. sBoxBackground: "transparent",
  686. sBoxBackgroundHover: "#ffffff",
  687. iBoxBorderWidthHover: 1,
  688. sBoxBorderColorHover: "#adadad" ,
  689. sContainerBackground: "#ffffff",
  690. sContainerBorder: "1px solid #adadad",
  691. sItemBorder: "1px solid #ffffff",
  692. sItemBorderHover: "1px dotted gray",
  693. sItemBackground: "transparent",
  694. sItemBackgroundHover: "#e0e0f0"
  695. });
  696. }';
  697. if (!empty($ignoredMsgs))
  698. {
  699. echo '
  700. var aIgnoreToggles = new Array();';
  701. foreach ($ignoredMsgs as $msgid)
  702. {
  703. echo '
  704. aIgnoreToggles[', $msgid, '] = new smc_Toggle({
  705. bToggleEnabled: true,
  706. bCurrentlyCollapsed: true,
  707. aSwappableContainers: [
  708. \'msg_', $msgid, '_extra_info\',
  709. \'msg_', $msgid, '\',
  710. \'msg_', $msgid, '_footer\',
  711. \'msg_', $msgid, '_quick_mod\',
  712. \'modify_button_', $msgid, '\',
  713. \'msg_', $msgid, '_signature\'
  714. ],
  715. aSwapLinks: [
  716. {
  717. sId: \'msg_', $msgid, '_ignored_link\',
  718. msgExpanded: \'\',
  719. msgCollapsed: ', JavaScriptEscape($txt['show_ignore_user_post']), '
  720. }
  721. ]
  722. });';
  723. }
  724. }
  725. echo '
  726. // ]]></script>';
  727. }
  728. ?>