Display.template.php 43 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819
  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="infobox">
  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 id="poll">
  32. <div class="cat_bar">
  33. <h3 class="catbg">
  34. <span class="ie6_header floatleft"><img src="', $settings['images_url'], '/topic/', $context['poll']['is_locked'] ? 'normal_poll_locked' : 'normal_poll', '.png" alt="" class="icon" /> ', $txt['poll'], '</span>
  35. </h3>
  36. </div>
  37. <div class="windowbg">
  38. <span class="topslice"><span></span></span>
  39. <div class="content" id="poll_options">
  40. <h4 id="pollquestion">
  41. ', $context['poll']['question'], '
  42. </h4>';
  43. // Are they not allowed to vote but allowed to view the options?
  44. if ($context['poll']['show_results'] || !$context['allow_vote'])
  45. {
  46. echo '
  47. <dl class="options">';
  48. // Show each option with its corresponding percentage bar.
  49. foreach ($context['poll']['options'] as $option)
  50. {
  51. echo '
  52. <dt class="middletext', $option['voted_this'] ? ' voted' : '', '">', $option['option'], '</dt>
  53. <dd class="middletext statsbar', $option['voted_this'] ? ' voted' : '', '">';
  54. if ($context['allow_poll_view'])
  55. echo '
  56. ', $option['bar_ndt'], '
  57. <span class="percentage">', $option['votes'], ' (', $option['percent'], '%)</span>';
  58. echo '
  59. </dd>';
  60. }
  61. echo '
  62. </dl>';
  63. if ($context['allow_poll_view'])
  64. echo '
  65. <p><strong>', $txt['poll_total_voters'], ':</strong> ', $context['poll']['total_votes'], '</p>';
  66. }
  67. // They are allowed to vote! Go to it!
  68. else
  69. {
  70. echo '
  71. <form action="', $scripturl, '?action=vote;topic=', $context['current_topic'], '.', $context['start'], ';poll=', $context['poll']['id'], '" method="post" accept-charset="', $context['character_set'], '">';
  72. // Show a warning if they are allowed more than one option.
  73. if ($context['poll']['allowed_warning'])
  74. echo '
  75. <p class="smallpadding">', $context['poll']['allowed_warning'], '</p>';
  76. echo '
  77. <ul class="reset options">';
  78. // Show each option with its button - a radio likely.
  79. foreach ($context['poll']['options'] as $option)
  80. echo '
  81. <li class="middletext">', $option['vote_button'], ' <label for="', $option['id'], '">', $option['option'], '</label></li>';
  82. echo '
  83. </ul>
  84. <div class="submitbutton">
  85. <input type="submit" value="', $txt['poll_vote'], '" class="button_submit" />
  86. <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
  87. </div>
  88. </form>';
  89. }
  90. // Is the clock ticking?
  91. if (!empty($context['poll']['expire_time']))
  92. echo '
  93. <p><strong>', ($context['poll']['is_expired'] ? $txt['poll_expired_on'] : $txt['poll_expires_on']), ':</strong> ', $context['poll']['expire_time'], '</p>';
  94. echo '
  95. </div>
  96. <span class="botslice"><span></span></span>
  97. </div>
  98. </div>
  99. <div id="pollmoderation">';
  100. // Build the poll moderation button array.
  101. $poll_buttons = array(
  102. 'vote' => array('test' => 'allow_return_vote', 'text' => 'poll_return_vote', 'image' => 'poll_options.png', 'lang' => true, 'url' => $scripturl . '?topic=' . $context['current_topic'] . '.' . $context['start']),
  103. 'results' => array('test' => 'show_view_results_button', 'text' => 'poll_results', 'image' => 'poll_results.png', 'lang' => true, 'url' => $scripturl . '?topic=' . $context['current_topic'] . '.' . $context['start'] . ';viewresults'),
  104. 'change_vote' => array('test' => 'allow_change_vote', 'text' => 'poll_change_vote', 'image' => 'poll_change_vote.png', 'lang' => true, 'url' => $scripturl . '?action=vote;topic=' . $context['current_topic'] . '.' . $context['start'] . ';poll=' . $context['poll']['id'] . ';' . $context['session_var'] . '=' . $context['session_id']),
  105. 'lock' => array('test' => 'allow_lock_poll', 'text' => (!$context['poll']['is_locked'] ? 'poll_lock' : 'poll_unlock'), 'image' => 'poll_lock.png', 'lang' => true, 'url' => $scripturl . '?action=lockvoting;topic=' . $context['current_topic'] . '.' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id']),
  106. 'edit' => array('test' => 'allow_edit_poll', 'text' => 'poll_edit', 'image' => 'poll_edit.png', 'lang' => true, 'url' => $scripturl . '?action=editpoll;topic=' . $context['current_topic'] . '.' . $context['start']),
  107. 'remove_poll' => array('test' => 'can_remove_poll', 'text' => 'poll_remove', 'image' => 'admin_remove_poll.png', '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']),
  108. );
  109. template_button_strip($poll_buttons);
  110. echo '
  111. </div>';
  112. }
  113. // Does this topic have some events linked to it?
  114. if (!empty($context['linked_calendar_events']))
  115. {
  116. echo '
  117. <div class="linked_events">
  118. <div class="title_bar">
  119. <h3 class="titlebg headerpadding">', $txt['calendar_linked_events'], '</h3>
  120. </div>
  121. <div class="windowbg">
  122. <span class="topslice"><span></span></span>
  123. <div class="content">
  124. <ul class="reset">';
  125. foreach ($context['linked_calendar_events'] as $event)
  126. echo '
  127. <li>
  128. ', ($event['can_edit'] ? '<a href="' . $event['modify_href'] . '"> <img src="' . $settings['images_url'] . '/icons/modify_small.png" alt="" title="' . $txt['modify'] . '" class="edit_event" /></a> ' : ''), '<strong>', $event['title'], '</strong>: ', $event['start_date'], ($event['start_date'] != $event['end_date'] ? ' - ' . $event['end_date'] : ''), '
  129. </li>';
  130. echo '
  131. </ul>
  132. </div>
  133. <span class="botslice"><span></span></span>
  134. </div>
  135. </div>';
  136. }
  137. // Build the normal button array.
  138. $normal_buttons = array(
  139. 'print' => array('text' => 'print', 'image' => 'print.png', 'lang' => true, 'custom' => 'rel="new_win nofollow"', 'url' => $scripturl . '?action=printpage;topic=' . $context['current_topic'] . '.0'),
  140. 'send' => array('test' => 'can_send_topic', 'text' => 'send_topic', 'image' => 'sendtopic.png', 'lang' => true, 'url' => $scripturl . '?action=emailuser;sa=sendtopic;topic=' . $context['current_topic'] . '.0'),
  141. 'mark_unread' => array('test' => 'can_mark_unread', 'text' => 'mark_unread', 'image' => 'markunread.png', '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']),
  142. 'notify' => array('test' => 'can_mark_notify', 'text' => $context['is_marked_notify'] ? 'unnotify' : 'notify', 'image' => ($context['is_marked_notify'] ? 'un' : '') . 'notify.png', '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']),
  143. 'add_poll' => array('test' => 'can_add_poll', 'text' => 'add_poll', 'image' => 'add_poll.png', 'lang' => true, 'url' => $scripturl . '?action=editpoll;add;topic=' . $context['current_topic'] . '.' . $context['start']),
  144. );
  145. // Build the reply button array.
  146. $reply_button = array(
  147. 'reply' => array('test' => 'can_reply', 'text' => 'reply', 'image' => 'reply.png', 'lang' => true, 'url' => $scripturl . '?action=post;topic=' . $context['current_topic'] . '.' . $context['start'] . ';last_msg=' . $context['topic_last_message'], 'active' => true),
  148. );
  149. // Allow adding new buttons easily.
  150. call_integration_hook('integrate_display_buttons', array(&$normal_buttons));
  151. // Show the page index... "Pages: [1]".
  152. // Show the topic information - icon, subject, etc.
  153. echo '
  154. <div id="forumposts">
  155. <div class="cat_bar">
  156. <h3 class="catbg">
  157. <img src="', $settings['images_url'], '/topic/', $context['class'], '.png" align="bottom" alt="" />', $txt['topic'], ':&nbsp;', $context['subject'], ' &nbsp;(', $context['num_views'], ' ', $txt['views'], ')
  158. </h3>
  159. </div>
  160. <div class="windowbg">
  161. <div class="title_bar" style="margin: 0 11px 10px 11px; border-radius: 4px; overflow: auto;">
  162. <div class="pagelinks floatleft">', $txt['pages'], ': ', $context['page_index'],'</div>
  163. <div class="nextlinks_bottom floatright" style="padding: 4px 8px;">', $context['previous_next'], '</div>
  164. </div>
  165. ', template_button_strip($normal_buttons, 'left'), '', template_button_strip($reply_button, 'right'), '
  166. </div><a href="#" id="skipnav_target"></a>';
  167. if (!empty($settings['display_who_viewing']))
  168. {
  169. echo '
  170. <p id="whoisviewing" class="smalltext flow_auto">';
  171. // Show just numbers...?
  172. if ($settings['display_who_viewing'] == 1)
  173. echo count($context['view_members']), ' ', count($context['view_members']) == 1 ? $txt['who_member'] : $txt['members'];
  174. // Or show the actual people viewing the topic?
  175. else
  176. 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'] . ')');
  177. // Now show how many guests are here too.
  178. echo $txt['who_and'], $context['view_num_guests'], ' ', $context['view_num_guests'] == 1 ? $txt['guest'] : $txt['guests'], $txt['who_viewing_topic'], '
  179. </p>';
  180. }
  181. echo '
  182. <form action="', $scripturl, '?action=quickmod2;topic=', $context['current_topic'], '.', $context['start'], '" method="post" accept-charset="', $context['character_set'], '" name="quickModForm" id="quickModForm" onsubmit="return oQuickModify.bInEditMode ? oQuickModify.modifySave(\'' . $context['session_id'] . '\', \'' . $context['session_var'] . '\') : false">';
  183. $ignoredMsgs = array();
  184. $removableMessageIDs = array();
  185. $alternate = false;
  186. // Get all the messages...
  187. while ($message = $context['get_message']())
  188. {
  189. $ignoring = false;
  190. $alternate = !$alternate;
  191. if ($message['can_remove'])
  192. $removableMessageIDs[] = $message['id'];
  193. // Are we ignoring this message?
  194. if (!empty($message['is_ignored']))
  195. {
  196. $ignoring = true;
  197. $ignoredMsgs[] = $message['id'];
  198. }
  199. // Show the message anchor and a "new" anchor if this message is new.
  200. if ($message['id'] != $context['first_message'])
  201. echo '
  202. <a id="msg', $message['id'], '"></a>', $message['first_new'] ? '<a id="new"></a>' : '';
  203. echo '
  204. <div class="', $message['approved'] ? ($message['alternate'] == 0 ? 'windowbg' : 'windowbg2') : 'approvebg', '">';
  205. // Ignore user?
  206. //if($ignoring)
  207. // echo '
  208. // <a href="', $scripturl, '?action=ignoreuser;u=', $message['member']['id'], ';rt=', $context['current_topic'], ';rm=', $message['id'], '" class="ignore_button floatleft" title="Don\'t do it. You\'ll be sorry.">Resume viewing</a>
  209. // <div style="padding: 1em 1.7em 1em 15em;">You really do not want to see this post. This person drives you crazy.</div>';
  210. echo '
  211. <div class="post_wrapper"', $ignoring ? 'style="display:none;"' : '', '>';
  212. // Show information about the poster of this message.
  213. echo '
  214. <div class="poster">';
  215. // Show a link to the member's profile.
  216. echo '
  217. <ul class="reset smalltext" id="msg_', $message['id'], '_extra_info">';
  218. // Show the member's primary group (like 'Administrator') if they have one.
  219. //if (!empty($message['member']['group']))
  220. // echo '
  221. // <li class="membergroup">', $message['member']['group'], '</li>';
  222. // echo '
  223. // <li class="icons">', $message['member']['group_icons'], '</li>';
  224. // Show avatars, images, etc.?
  225. if (!empty($settings['show_user_images']) && empty($options['show_no_avatars']) && !empty($message['member']['avatar']['image']))
  226. {
  227. echo '
  228. <li class="avatar">
  229. <a href="', $scripturl, '?action=profile;u=', $message['member']['id'], '" class="', $message['member']['online']['is_online'] ?'online':'offline','">
  230. ', $message['member']['avatar']['image'], '
  231. </a>
  232. <ul class="reset">';
  233. // 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.
  234. if ((empty($settings['hide_post_group']) || $message['member']['group'] == '') && $message['member']['post_group'] != '')
  235. echo '
  236. <li class="postgroup">', $message['member']['post_group'], '</li>';
  237. // Show how many posts they have made.
  238. if (!isset($context['disabled_fields']['posts']))
  239. echo '
  240. <li class="postcount">', $txt['member_postcount'], ': ', $message['member']['posts'], '</li>';
  241. // Are we showing the warning status?
  242. if ($message['member']['can_see_warning'])
  243. echo '
  244. <li class="warning">', $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'], '.png" alt="', $txt['user_warn_' . $message['member']['warning_status']], '" /><span class="warn_', $message['member']['warning_status'], '">', $txt['warn_' . $message['member']['warning_status']], '</span>', $context['can_issue_warning'] ? '</a>' : '', '</li>';
  245. // Show the member's signature?
  246. if (!empty($message['member']['signature']) && empty($options['show_no_signatures']) && $context['signature_enabled'])
  247. echo '
  248. <li class="signature" id="msg_', $message['id'], '_signature"><hr />', $message['member']['signature'], '</li>';
  249. echo '
  250. </ul>
  251. </li>';
  252. }
  253. // Don't show these things for guests.
  254. if (!$message['member']['is_guest'])
  255. {
  256. // Show online and offline buttons?
  257. if (!empty($modSettings['onlineEnable']) && ($context['can_send_pm']))
  258. {
  259. if(!$message['is_message_author'])
  260. {
  261. echo '
  262. <li class="online_button"><a href="', $scripturl,'?action=pm;sa=send;u=', $message['member']['id'], '" title="', $message['member']['online']['is_online'] ? $message['member']['name']. ' is online' : $message['member']['name']. ' is offline', '"><img src="', $message['member']['online']['image_href'], '" style="vertical-align: middle; margin-top: -0.1em;" alt="', $message['member']['online']['text'], '" />&nbsp;Send message</a></li>';
  263. }
  264. else
  265. {
  266. echo '
  267. <li class="online_button"><a href="', $scripturl,'?action=pm" title="Check my inbox">', $txt['pm_short'], ' ', $context['user']['unread_messages'] > 0 ? '[<strong>'. $context['user']['unread_messages'] . '</strong>]' : '' , '</a></li>';
  268. }
  269. }
  270. }
  271. echo '
  272. <li class="icons">', $message['member']['group_icons'], '</li>';
  273. // Show the member's primary group (like 'Administrator') if they have one.
  274. if (!empty($message['member']['group']))
  275. echo '
  276. <li class="membergroup">', $message['member']['group'], '</li>';
  277. // Show the post group if they have no other group or the option is on, and they are in a post group.
  278. elseif (($message['member']['group'] == '') && $message['member']['post_group'] != '')
  279. echo '
  280. <li class="membergroup">', $message['member']['post_group'], '</li>';
  281. // Show the member's custom title, if they have one.
  282. //if (!empty($message['member']['title']))
  283. // echo '
  284. // <li class="title">', $message['member']['title'], '</li>';
  285. // if(!$message['is_message_author'] && $context['user']['is_logged'])
  286. // {
  287. // echo'
  288. // <li class="floatleft" style="width: 58px; border-radius: 4px; margin: 0 0 0.4em 1.1em; padding: 0.2em;"><a href="', $scripturl, '?action=ignoreuser;u=', $message['member']['id'], ';rt=', $context['current_topic'], ';rm=', $message['id'], '">', $txt['ignore_link'], '</a></li>
  289. // <li class="floatright" style="width: 58px; border-radius: 4px; margin: 0 1.1em 0.4em 0; padding: 0.2em;"><a href="', $scripturl, '?action=reporttm;topic=', $context['current_topic'], '.', $message['counter'], ';msg=', $message['id'], '" title="', $txt['report_to_mod'], '">Report</a></li>';
  290. // }
  291. // Done with the information about the poster... on to the post itself.
  292. echo '
  293. </ul>
  294. </div><!--/poster-->
  295. <div class="postarea">
  296. <div class="keyinfo">
  297. <div class="messageicon">
  298. <img src="', $message['icon_url'] . '" alt=""', $message['can_modify'] ? ' id="msg_icon_' . $message['id'] . '"' : '', ' />
  299. </div>
  300. <h5 id="subject_', $message['id'], '" class="smalltext">
  301. <a href="', $message['href'], '" rel="nofollow" class="topic_reply_title" title="', $context['subject'], '">', !empty($message['counter']) ? $txt['reply_noun'] . ' ' . $message['counter'] : 'Opening Post', '</a>&nbsp;by <strong>', $message['member']['link'], '</strong>', (!empty($message['member']['title'])) ? '&nbsp;('. $message['member']['title']. ')' : '','&nbsp;-&nbsp;<time>', $message['time'], '</time>
  302. </h5>
  303. <a href="#top_most" class="go_up"><img src="', $settings['images_url'], '/go_up.png" alt="', $txt['go_up'], '" /></a>
  304. <a href="#bottom_most" class="go_down"><img src="', $settings['images_url'], '/go_down.png" alt="', $txt['go_down'], '" /></a>
  305. <div id="msg_', $message['id'], '_quick_mod"></div>
  306. </div>';
  307. // Show "� Last Edit: Time by Person �" if this post was edited.
  308. if ($settings['show_modify'] && !empty($message['modified']['name']))
  309. echo '
  310. <div class="smalltext" style="padding: 2px 0 0 10px; margin: 0 0 -4px 125px;">
  311. <em>', $txt['last_edit'], ': ', $message['modified']['time'], ' ', $txt['by'], ' ', $message['modified']['name'], '</em>
  312. </div>';
  313. // Show the post itself, finally!
  314. echo '
  315. <div class="post" style="',$ignoring?'display:none;':'','"><hr />';
  316. if (!$message['approved'] && $message['member']['id'] != 0 && $message['member']['id'] == $context['user']['id'])
  317. echo '
  318. <div class="approve_post">
  319. ', $txt['post_awaiting_approval'], '
  320. </div>';
  321. echo '
  322. <div class="inner" id="msg_', $message['id'], '"', ' style="padding-bottom: 0.6em;">', $message['body'], '</div>';
  323. // Assuming there are attachments...
  324. if (!empty($message['attachment']))
  325. {
  326. echo '
  327. <div id="msg_', $message['id'], '_footer" class="attachments smalltext">
  328. <div style="overflow: ', isBrowser('is_firefox') ? 'visible' : 'auto', ';">';
  329. $last_approved_state = 1;
  330. $attachments_per_line = 4;
  331. $i = 0;
  332. foreach ($message['attachment'] as $attachment)
  333. {
  334. // Show a special box for unapproved attachments...
  335. if ($attachment['is_approved'] != $last_approved_state)
  336. {
  337. $last_approved_state = 0;
  338. echo '
  339. <fieldset>
  340. <legend>', $txt['attach_awaiting_approve'];
  341. if ($context['can_approve'])
  342. echo '
  343. &nbsp;[<a href="', $scripturl, '?action=attachapprove;sa=all;mid=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $txt['approve_all'], '</a>]';
  344. echo '
  345. </legend>';
  346. }
  347. echo '
  348. <div class="floatleft padding">
  349. <div class="attachments_top">';
  350. if ($attachment['is_image'])
  351. {
  352. if ($attachment['thumbnail']['has_thumb'])
  353. echo '
  354. <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 />';
  355. else
  356. echo '
  357. <img src="' . $attachment['href'] . ';image" alt="" width="' . $attachment['width'] . '" height="' . $attachment['height'] . '"/><br />';
  358. }
  359. echo '
  360. </div>
  361. <div class="attachments_bot">
  362. <a href="' . $attachment['href'] . '"><img src="' . $settings['images_url'] . '/icons/clip.png" class="centericon" alt="*" />&nbsp;' . $attachment['name'] . '</a> ';
  363. if (!$attachment['is_approved'] && $context['can_approve'])
  364. echo '
  365. [<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>] ';
  366. echo '
  367. <br />', $attachment['size'], ($attachment['is_image'] ? ', ' . $attachment['real_width'] . 'x' . $attachment['real_height'] . '<br />' . $txt['attach_viewed'] : '<br />' . $txt['attach_downloaded']) . ' ' . $attachment['downloads'] . ' ' . $txt['attach_times'] . '
  368. </div>';
  369. echo '
  370. </div>';
  371. // Next attachment line ?
  372. if (++$i % $attachments_per_line === 0)
  373. echo '
  374. <br class="clear" />';
  375. }
  376. // no more attachments, clear the float if its open
  377. if ($i % $attachments_per_line !== 0)
  378. echo '
  379. <br class="clear" />';
  380. // If we had unapproved attachments clean up.
  381. if ($last_approved_state == 0)
  382. echo '
  383. </fieldset>';
  384. echo '
  385. </div>
  386. </div>';
  387. }
  388. echo '
  389. </div>';
  390. if ($message['can_approve'] || $context['can_reply'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg'])
  391. echo '
  392. <ul class="reset quickbuttons">';
  393. // Show their personal text?
  394. if (!empty($settings['show_blurb']) && $message['member']['blurb'] != '')
  395. echo '
  396. <li class="blurb">', $message['member']['blurb'], '</li>';
  397. // Can they reply? Have they turned on quick reply?
  398. //if ($context['can_quote'] && !empty($options['display_quick_reply']))
  399. // echo '
  400. // <li><a href="', $scripturl, '?action=post;quote=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], ';last_msg=', $context['topic_last_message'], '" title="', $txt['quote'], '&nbsp;', $message['member']['name'], '\'s post" onclick="return oQuickReply.quote(', $message['id'], ');" class="quote_button">', $txt['quote'], '</a></li>';
  401. // So... quick reply is off, but they *can* reply?
  402. //elseif ($context['can_quote'])
  403. // echo '
  404. // <li><a href="', $scripturl, '?action=post;quote=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], ';last_msg=', $context['topic_last_message'], '" title="', $txt['quote'], '&nbsp;', $message['member']['name'], '\'s post" class="quote_button">', $txt['quote'], '</a></li>';
  405. // Can the user modify the contents of this post?
  406. if ($message['can_modify'])
  407. echo '
  408. <li><a href="', $scripturl, '?action=post;msg=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], '" title="', $txt['fulledit'], '" class="modify_button">', $txt['fulledit'], '</a></li>';
  409. // Can the user modify the contents of this post? Show the modify inline image.
  410. if ($message['can_modify'])
  411. echo '
  412. <li><a href="#" class="modify_inline" title="', $txt['quick_edit'], '">', $txt['edit'], '<img src="', $settings['images_url'], '/icons/modify_inline.png" alt="', $txt['modify_msg'], '" title="', $txt['quick_edit'] ,'" id="modify_button_', $message['id'], '" style="cursor: pointer; display: none;" onclick="oQuickModify.modifyMsg(\'', $message['id'], '\')" /></a></li>';
  413. if ($context['can_moderate_forum'])
  414. {
  415. echo '
  416. <li class="moderation_button"><a href="#">', $txt['post_options'], '</a>
  417. <ul>';
  418. // Maybe they want to report this post to the moderator(s)?
  419. if ($context['can_report_moderator'])
  420. echo '
  421. <li><a href="', $scripturl, '?action=reporttm;topic=', $context['current_topic'], '.', $message['counter'], ';msg=', $message['id'], '">', $txt['report_to_mod'], '</a></li>';
  422. echo '
  423. <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'], '?\');" class="remove_button">', $txt['remove'], '</a></li>
  424. <li><a href="', $scripturl, '?action=splittopics;topic=', $context['current_topic'], '.0;at=', $message['id'], '" class="split_button">', $txt['split'], '</a></li>';
  425. // Maybe we can approve it, maybe we should?
  426. if ($message['can_approve'])
  427. echo '
  428. <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'], '" class="approve_button">', $txt['approve'], '</a></li>';
  429. // Can we restore topics?
  430. if ($context['can_restore_msg'])
  431. echo '
  432. <li><a href="', $scripturl, '?action=restoretopic;msgs=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '" class="restore_button">', $txt['restore_message'], '</a></li>';
  433. // Can we issue a warning because of this post? Remember, we can't give guests warnings.
  434. if ($context['can_issue_warning'] && !$message['is_message_author'] && !$message['member']['is_guest'])
  435. echo '
  436. <li><a href="', $scripturl, '?action=profile;area=issuewarning;u=', $message['member']['id'], ';msg=', $message['id'], '" title="', $txt['issue_warning_post'], '" class="issue_warning">Issue warning</a></li>';
  437. // Show a checkbox for quick moderation?
  438. if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && $message['can_remove'])
  439. echo '
  440. <li class="inline_mod_check" style="display: none;" id="in_topic_mod_check_', $message['id'], '"><label for="fukn_pita_bastard_', $message['id'], '">Select post&nbsp;</label></li>';
  441. echo '
  442. <li><a href="', $scripturl, '?action=', !empty($message['member']['is_guest']) ? 'trackip' : 'profile;area=tracking;sa=ip;u=' . $message['member']['id'], ';searchip=', $message['member']['ip'], '" class="ip_link">', $message['member']['ip'], '</a></li>
  443. </ul>
  444. </li>';
  445. }
  446. // Can they reply? Have they turned on quick reply?
  447. if ($context['can_quote'] && !empty($options['display_quick_reply']))
  448. echo '
  449. <li><a href="', $scripturl, '?action=post;quote=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], ';last_msg=', $context['topic_last_message'], '" title="', $txt['quote'], '&nbsp;', $message['member']['name'], '\'s post" onclick="return oQuickReply.quote(', $message['id'], ');" class="quote_button">', $txt['quote'], '</a></li>';
  450. // So... quick reply is off, but they *can* reply?
  451. elseif ($context['can_quote'])
  452. echo '
  453. <li><a href="', $scripturl, '?action=post;quote=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], ';last_msg=', $context['topic_last_message'], '" title="', $txt['quote'], '&nbsp;', $message['member']['name'], '\'s post" class="quote_button">', $txt['quote'], '</a></li>';
  454. if ($message['can_approve'] || $context['can_reply'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg'])
  455. echo '
  456. </ul>';
  457. // // Show the member's signature?
  458. // if (!empty($message['member']['signature']) && empty($options['show_no_signatures']) && $context['signature_enabled'])
  459. // echo '
  460. // <div class="signature" id="msg_', $message['id'], '_signature"><hr />', $message['member']['signature'], '</div>';
  461. echo '
  462. </div><!--/postarea-->
  463. </div><!--/post_wrapper-->
  464. </div>
  465. <hr class="post_separator" />';
  466. }
  467. echo '
  468. </form>
  469. </div>
  470. <a id="lastPost"></a>';
  471. $mod_buttons = array(
  472. 'move' => array('test' => 'can_move', 'text' => 'move_topic', 'image' => 'admin_move.png', 'lang' => true, 'url' => $scripturl . '?action=movetopic;current_board=' . $context['current_board'] . ';topic=' . $context['current_topic'] . '.0'),
  473. 'delete' => array('test' => 'can_delete', 'text' => 'remove_topic', 'image' => 'admin_rem.png', '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']),
  474. 'lock' => array('test' => 'can_lock', 'text' => empty($context['is_locked']) ? 'set_lock' : 'set_unlock', 'image' => 'admin_lock.png', 'lang' => true, 'url' => $scripturl . '?action=lock;topic=' . $context['current_topic'] . '.' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id']),
  475. 'sticky' => array('test' => 'can_sticky', 'text' => empty($context['is_sticky']) ? 'set_sticky' : 'set_nonsticky', 'image' => 'admin_sticky.png', 'lang' => true, 'url' => $scripturl . '?action=sticky;topic=' . $context['current_topic'] . '.' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id']),
  476. 'merge' => array('test' => 'can_merge', 'text' => 'merge', 'image' => 'merge.png', 'lang' => true, 'url' => $scripturl . '?action=mergetopics;board=' . $context['current_board'] . '.0;from=' . $context['current_topic']),
  477. 'calendar' => array('test' => 'calendar_post', 'text' => 'calendar_link', 'image' => 'linktocal.png', 'lang' => true, 'url' => $scripturl . '?action=post;calendar;msg=' . $context['topic_first_message'] . ';topic=' . $context['current_topic'] . '.0'),
  478. );
  479. // Restore topic. eh? No monkey business.
  480. if ($context['can_restore_topic'])
  481. $mod_buttons[] = array('text' => 'restore_topic', 'image' => '', 'lang' => true, 'url' => $scripturl . '?action=restoretopic;topics=' . $context['current_topic'] . ';' . $context['session_var'] . '=' . $context['session_id']);
  482. // Allow adding new mod buttons easily.
  483. call_integration_hook('integrate_mod_buttons', array(&$mod_buttons));
  484. echo '
  485. <div class="windowbg" id="display_lower_buttons">
  486. ', template_button_strip($normal_buttons, 'left'), '', template_button_strip($reply_button, 'right'), '
  487. <div id="moderationbuttons">', template_button_strip($mod_buttons, 'bottom', array('id' => 'moderationbuttons_strip')), '</div>
  488. <div class="title_bar" style="margin: 10px 11px 10px 11px; border-radius: 4px; clear: both;">
  489. <div class="pagelinks floatleft" style="font-weight: bold;">', $txt['pages'], ': ', $context['page_index'],'</div>
  490. <div class="nextlinks_bottom floatright" style="padding: 4px 8px;">', $context['previous_next'], '</div>
  491. </div>';
  492. // Show the page index... "Pages: [1]".
  493. // Show the jumpto box, or actually...let Javascript do it.
  494. echo '
  495. <div class="navigate_section">',theme_linktree(),'</div>
  496. <div class="title_bar" style="margin: 10px 11px 0 11px; border-radius: 4px;">
  497. <div class="nextlinks_bottom floatleft" style="display: none; margin-bottom: 0; clear: none; padding: 4px 8px;">', $context['previous_next'], '</div>
  498. <div class="floatright" style="margin-top: 0; clear: none;" id="display_jump_to">&nbsp;</div>
  499. </div>
  500. </div><br class="clear" />';
  501. // Show the lower breadcrumbs.
  502. if ($context['can_reply'] && !empty($options['display_quick_reply']))
  503. {
  504. echo '
  505. <a id="quickreply"></a><br />
  506. <div class="tborder" id="quickreplybox">
  507. <div class="cat_bar">
  508. <h3 class="catbg">
  509. <a href="javascript:oQuickReply.swap();" id="QuickReply_swap">
  510. <img src="', $settings['images_url'], '/', $options['display_quick_reply'] == 2 ? 'upshrink' : 'upshrink2', '.png" alt="+" id="quickReplyExpand" class="icon floatright" />
  511. </a>
  512. <a href="javascript:oQuickReply.swap();">', $txt['quick_reply'], '</a>
  513. </h3>
  514. </div>
  515. <div id="quickReplyOptions"', $options['display_quick_reply'] == 2 ? '' : ' style="display: none"', '>
  516. <div class="roundframe">
  517. <p class="smalltext lefttext">', $txt['quick_reply_desc'], '</p>
  518. ', $context['is_locked'] ? '<p class="alert smalltext">' . $txt['quick_reply_warning'] . '</p>' : '',
  519. $context['oldTopicError'] ? '<p class="alert smalltext">' . sprintf($txt['error_old_topic'], $modSettings['oldTopicDays']) . '</p>' : '', '
  520. ', $context['can_reply_approved'] ? '' : '<em>' . $txt['wait_for_approval'] . '</em>', '
  521. ', !$context['can_reply_approved'] && $context['require_verification'] ? '<br />' : '', '
  522. <form action="', $scripturl, '?board=', $context['current_board'], ';action=post2" method="post" accept-charset="', $context['character_set'], '" name="postmodify" id="postmodify" class="flow_auto" onsubmit="submitonce(this);">
  523. <input type="hidden" name="topic" value="', $context['current_topic'], '" />
  524. <input type="hidden" name="subject" value="', $context['response_prefix'], $context['subject'], '" />
  525. <input type="hidden" name="icon" value="xx" />
  526. <input type="hidden" name="from_qr" value="1" />
  527. <input type="hidden" name="notify" value="', $context['is_marked_notify'] || !empty($options['auto_notify']) ? '1' : '0', '" />
  528. <input type="hidden" name="not_approved" value="', !$context['can_reply_approved'], '" />
  529. <input type="hidden" name="goback" value="', empty($options['return_to_post']) ? '0' : '1', '" />
  530. <input type="hidden" name="last_msg" value="', $context['topic_last_message'], '" />
  531. <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
  532. <input type="hidden" name="seqnum" value="', $context['form_sequence_number'], '" />';
  533. // Guests just need more.
  534. if ($context['user']['is_guest'])
  535. echo '
  536. <strong>', $txt['name'], ':</strong> <input type="text" name="guestname" value="', $context['name'], '" size="25" class="input_text" tabindex="', $context['tabindex']++, '" />
  537. <strong>', $txt['email'], ':</strong> <input type="text" name="email" value="', $context['email'], '" size="25" class="input_text" tabindex="', $context['tabindex']++, '" /><br />';
  538. // Is visual verification enabled?
  539. if ($context['require_verification'])
  540. echo '
  541. <strong>', $txt['verification'], ':</strong>', template_control_verification($context['visual_verification_id'], 'quick_reply'), '<br />';
  542. echo '
  543. <div class="quickReplyContent">
  544. <textarea class ="expand_test" cols="" rows="" name="message" tabindex="', $context['tabindex']++, '"></textarea>
  545. </div>
  546. <input type="submit" name="post" value="', $txt['post'], '" onclick="return submitThisOnce(this);" accesskey="s" tabindex="', $context['tabindex']++, '" class="button_submit" />
  547. <input type="submit" name="preview" value="', $txt['preview'], '" onclick="return submitThisOnce(this);" accesskey="p" tabindex="', $context['tabindex']++, '" class="button_submit" />';
  548. if ($context['show_spellchecking'])
  549. echo '
  550. <input type="button" value="', $txt['spell_check'], '" onclick="spellCheck(\'postmodify\', \'message\');" tabindex="', $context['tabindex']++, '" class="button_submit" />';
  551. echo '
  552. </form>
  553. </div>
  554. </div>
  555. </div>';
  556. }
  557. else
  558. echo '
  559. <br class="clear" />';
  560. if ($context['show_spellchecking'])
  561. echo '
  562. <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>
  563. <script type="text/javascript" src="' . $settings['default_theme_url'] . '/scripts/spellcheck.js"></script>';
  564. echo '
  565. <script type="text/javascript" src="' . $settings['default_theme_url'] . '/scripts/topic.js"></script>
  566. <script type="text/javascript"><!-- // --><![CDATA[';
  567. /* if (!empty($options['display_quick_reply']))
  568. echo '
  569. var oQuickReply = new QuickReply({
  570. bDefaultCollapsed: ', !empty($options['display_quick_reply']) && $options['display_quick_reply'] == 2 ? 'false' : 'true', ',
  571. iTopicId: ', $context['current_topic'], ',
  572. iStart: ', $context['start'], ',
  573. sScriptUrl: smf_scripturl,
  574. sImagesUrl: smf_images_url,
  575. sContainerId: "quickReplyOptions",
  576. sImageId: "quickReplyExpand",
  577. sImageCollapsed: "upshrink.png",
  578. sImageExpanded: "upshrink2.png",
  579. sJumpAnchor: "quickreply"
  580. });';
  581. */
  582. if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && $context['can_remove_post'])
  583. echo '
  584. var oInTopicModeration = new InTopicModeration({
  585. sSelf: \'oInTopicModeration\',
  586. sCheckboxContainerMask: \'in_topic_mod_check_\',
  587. aMessageIds: [\'', implode('\', \'', $removableMessageIDs), '\'],
  588. sSessionId: smf_session_id,
  589. sSessionVar: smf_session_var,
  590. sButtonStrip: \'moderationbuttons\',
  591. sButtonStripDisplay: \'moderationbuttons_strip\',
  592. bUseImageButton: false,
  593. bCanRemove: ', $context['can_remove_post'] ? 'true' : 'false', ',
  594. sRemoveButtonLabel: \'', $txt['quickmod_delete_selected'], '\',
  595. sRemoveButtonImage: \'delete_selected.png\',
  596. sRemoveButtonConfirm: \'', $txt['quickmod_confirm'], '\',
  597. bCanRestore: ', $context['can_restore_msg'] ? 'true' : 'false', ',
  598. sRestoreButtonLabel: \'', $txt['quick_mod_restore'], '\',
  599. sRestoreButtonImage: \'restore_selected.png\',
  600. sRestoreButtonConfirm: \'', $txt['quickmod_confirm'], '\',
  601. bCanSplit: ', $context['can_split'] ? 'true' : 'false', ',
  602. sSplitButtonLabel: \'', $txt['quickmod_split_selected'], '\',
  603. sSplitButtonImage: \'split_selected.png\',
  604. sSplitButtonConfirm: \'', $txt['quickmod_confirm'], '\',
  605. sFormId: \'quickModForm\'
  606. });';
  607. echo '
  608. if (\'XMLHttpRequest\' in window)
  609. {
  610. var oQuickModify = new QuickModify({
  611. sScriptUrl: smf_scripturl,
  612. bShowModify: ', $settings['show_modify'] ? 'true' : 'false', ',
  613. iTopicId: ', $context['current_topic'], ',
  614. sTemplateBodyEdit: ', JavaScriptEscape('
  615. <div id="quick_edit_body_container" style="width: 90%">
  616. <div id="error_box" style="padding: 4px;" class="error"></div>
  617. <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 />
  618. <input type="hidden" name="\' + smf_session_var + \'" value="\' + smf_session_id + \'" />
  619. <input type="hidden" name="topic" value="' . $context['current_topic'] . '" />
  620. <input type="hidden" name="msg" value="%msg_id%" />
  621. <div class="righttext">
  622. <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" />
  623. </div>
  624. </div>'), ',
  625. sTemplateSubjectEdit: ', JavaScriptEscape('<input type="text" style="width: 90%;" name="subject" value="%subject%" size="80" maxlength="80" tabindex="' . $context['tabindex']++ . '" class="input_text" />'), ',
  626. sTemplateBodyNormal: ', JavaScriptEscape('%body%'), ',
  627. sTemplateSubjectNormal: ', JavaScriptEscape('<a href="' . $scripturl . '?topic=' . $context['current_topic'] . '.msg%msg_id%#msg%msg_id%" rel="nofollow" class="topic_reply_title" title="%subject%"><strong>', !empty($message['counter']) ? $txt['reply_noun'] . ' ' . $message['counter'] : 'Opening Post', ':</a></strong><time> ', $message['time'], '</time>'), ',
  628. sTemplateTopSubject: ', JavaScriptEscape($txt['topic'] . ':&nbsp; %subject% &nbsp;(', $context['num_views'], ' ', $txt['views'], ')'), ',
  629. sErrorBorderStyle: ', JavaScriptEscape('1px solid red'), '
  630. });
  631. aJumpTo[aJumpTo.length] = new JumpTo({
  632. sContainerId: "display_jump_to",
  633. sJumpToTemplate: "<label class=\"smalltext\" for=\"%select_id%\">', $context['jump_to']['label'], ':<" + "/label> %dropdown_list%",
  634. iCurBoardId: ', $context['current_board'], ',
  635. iCurBoardChildLevel: ', $context['jump_to']['child_level'], ',
  636. sCurBoardName: "', $context['jump_to']['board_name'], '",
  637. sBoardChildLevelIndicator: "->",
  638. sBoardPrefix: "",
  639. sCatSeparator: "-----------------------------",
  640. sCatPrefix: "",
  641. sGoButtonLabel: "', $txt['go'], '"
  642. });
  643. aIconLists[aIconLists.length] = new IconList({
  644. sBackReference: "aIconLists[" + aIconLists.length + "]",
  645. sIconIdPrefix: "msg_icon_",
  646. sScriptUrl: smf_scripturl,
  647. bShowModify: ', $settings['show_modify'] ? 'true' : 'false', ',
  648. iBoardId: ', $context['current_board'], ',
  649. iTopicId: ', $context['current_topic'], ',
  650. sSessionId: smf_session_id,
  651. sSessionVar: smf_session_var,
  652. sLabelIconList: "', $txt['message_icon'], '",
  653. sBoxBackground: "transparent",
  654. sBoxBackgroundHover: "#ffffff",
  655. iBoxBorderWidthHover: 1,
  656. sBoxBorderColorHover: "#adadad" ,
  657. sContainerBackground: "#ffffff",
  658. sContainerBorder: "1px solid #adadad",
  659. sItemBorder: "1px solid #ffffff",
  660. sItemBorderHover: "1px dotted gray",
  661. sItemBackground: "transparent",
  662. sItemBackgroundHover: "#e0e0f0"
  663. });
  664. }';
  665. if (!empty($ignoredMsgs))
  666. {
  667. echo '
  668. var aIgnoreToggles = new Array();';
  669. foreach ($ignoredMsgs as $msgid)
  670. {
  671. echo '
  672. aIgnoreToggles[', $msgid, '] = new smc_Toggle({
  673. bToggleEnabled: true,
  674. bCurrentlyCollapsed: true,
  675. aSwappableContainers: [
  676. \'msg_', $msgid, '_extra_info\',
  677. \'msg_', $msgid, '\',
  678. \'msg_', $msgid, '_footer\',
  679. \'msg_', $msgid, '_quick_mod\',
  680. \'modify_button_', $msgid, '\',
  681. \'msg_', $msgid, '_signature\'
  682. ],
  683. aSwapLinks: [
  684. {
  685. sId: \'msg_', $msgid, '_ignored_link\',
  686. msgExpanded: \'\',
  687. msgCollapsed: ', JavaScriptEscape($txt['show_ignore_user_post']), '
  688. }
  689. ]
  690. });';
  691. }
  692. }
  693. echo '
  694. $(document).ready(function(){
  695. $("#quickReplyOptions").hide();
  696. $("#QuickReply_swap").show();
  697. $("#QuickReply_swap").click(function(){
  698. $("#quickReplyOptions").slideToggle();
  699. });
  700. $("li a.quote_button, li a.modify_button, li a.modify_inline, a.topic_reply_title").bt(jQuery.bt.options = {positions: "top, bottom"});
  701. });
  702. // ]]></script>';
  703. }
  704. ?>