Display.template.php 44 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969
  1. <?php
  2. /**
  3. * Simple Machines Forum (SMF)
  4. *
  5. * @package SMF
  6. * @author Simple Machines
  7. * @copyright 2013 Simple Machines and individual contributors
  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. // Topic was sent successfully
  24. elseif ($context['topic_sent'])
  25. {
  26. echo '
  27. <div class="infobox">
  28. ', $txt['topic_sent'], '
  29. </div>';
  30. }
  31. // Show the anchor for the top and for the first message. If the first message is new, say so.
  32. echo '
  33. <a id="msg', $context['first_message'], '"></a>', $context['first_new_message'] ? '<a id="new"></a>' : '';
  34. // Is this topic also a poll?
  35. if ($context['is_poll'])
  36. {
  37. echo '
  38. <div id="poll">
  39. <div class="cat_bar">
  40. <h3 class="catbg">
  41. <img src="', $settings['images_url'], '/topic/', $context['poll']['is_locked'] ? 'normal_poll_locked' : 'normal_poll', '.png" alt="" class="icon" /> ', $txt['poll'], '
  42. </h3>
  43. </div>
  44. <div class="windowbg">
  45. <div class="content" id="poll_options">
  46. <h4 id="pollquestion">
  47. ', $context['poll']['question'], '
  48. </h4>';
  49. // Are they not allowed to vote but allowed to view the options?
  50. if ($context['poll']['show_results'] || !$context['allow_vote'])
  51. {
  52. echo '
  53. <dl class="options">';
  54. // Show each option with its corresponding percentage bar.
  55. foreach ($context['poll']['options'] as $option)
  56. {
  57. echo '
  58. <dt class="', $option['voted_this'] ? ' voted' : '', '">', $option['option'], '</dt>
  59. <dd class="statsbar', $option['voted_this'] ? ' voted' : '', '">';
  60. if ($context['allow_poll_view'])
  61. echo '
  62. ', $option['bar_ndt'], '
  63. <span class="percentage">', $option['votes'], ' (', $option['percent'], '%)</span>';
  64. echo '
  65. </dd>';
  66. }
  67. echo '
  68. </dl>';
  69. if ($context['allow_poll_view'])
  70. echo '
  71. <p><strong>', $txt['poll_total_voters'], ':</strong> ', $context['poll']['total_votes'], '</p>';
  72. }
  73. // They are allowed to vote! Go to it!
  74. else
  75. {
  76. echo '
  77. <form action="', $scripturl, '?action=vote;topic=', $context['current_topic'], '.', $context['start'], ';poll=', $context['poll']['id'], '" method="post" accept-charset="', $context['character_set'], '">';
  78. // Show a warning if they are allowed more than one option.
  79. if ($context['poll']['allowed_warning'])
  80. echo '
  81. <p class="smallpadding">', $context['poll']['allowed_warning'], '</p>';
  82. echo '
  83. <ul class="reset options">';
  84. // Show each option with its button - a radio likely.
  85. foreach ($context['poll']['options'] as $option)
  86. echo '
  87. <li>', $option['vote_button'], ' <label for="', $option['id'], '">', $option['option'], '</label></li>';
  88. echo '
  89. </ul>
  90. <div class="submitbutton">
  91. <input type="submit" value="', $txt['poll_vote'], '" class="button_submit" />
  92. <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
  93. </div>
  94. </form>';
  95. }
  96. // Is the clock ticking?
  97. if (!empty($context['poll']['expire_time']))
  98. echo '
  99. <p><strong>', ($context['poll']['is_expired'] ? $txt['poll_expired_on'] : $txt['poll_expires_on']), ':</strong> ', $context['poll']['expire_time'], '</p>';
  100. echo '
  101. </div>
  102. </div>
  103. </div>
  104. <div id="pollmoderation">';
  105. template_button_strip($context['poll_buttons']);
  106. echo '
  107. </div>';
  108. }
  109. // Does this topic have some events linked to it?
  110. if (!empty($context['linked_calendar_events']))
  111. {
  112. echo '
  113. <div class="linked_events">
  114. <div class="title_bar">
  115. <h3 class="titlebg headerpadding">', $txt['calendar_linked_events'], '</h3>
  116. </div>
  117. <div class="windowbg">
  118. <div class="content">
  119. <ul class="reset">';
  120. foreach ($context['linked_calendar_events'] as $event)
  121. echo '
  122. <li>
  123. ', ($event['can_edit'] ? '<a href="' . $event['modify_href'] . '"> <img src="' . $settings['images_url'] . '/icons/calendar_modify.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'] : ''), '
  124. </li>';
  125. echo '
  126. </ul>
  127. </div>
  128. </div>
  129. </div>';
  130. }
  131. // Show the page index... "Pages: [1]".
  132. echo '
  133. <div class="pagesection">
  134. ', template_button_strip($context['normal_buttons'], 'right'), '
  135. ', !empty($modSettings['topbottomEnable']) ? $context['menu_separator'] . '<a href="#bot" class="topbottom floatleft">' . $txt['go_down'] . '</a>' : '', '
  136. <div class="pagelinks floatleft">
  137. ', $context['page_index'], '
  138. </div>
  139. </div>';
  140. // Show the topic information - icon, subject, etc.
  141. echo '
  142. <div id="forumposts">
  143. <div class="cat_bar">
  144. <h3 class="catbg">
  145. <img src="', $settings['images_url'], '/topic/', $context['class'], '.png" alt="" />
  146. <span id="top_subject">', $txt['topic'], ': ', $context['subject'], '&nbsp;<span>(', $context['num_views_text'], ')</span></span>
  147. <span class="nextlinks floatright">', $context['previous_next'], '</span>
  148. </h3>
  149. </div>';
  150. if (!empty($settings['display_who_viewing']))
  151. {
  152. echo '
  153. <p id="whoisviewing">';
  154. // Show just numbers...?
  155. if ($settings['display_who_viewing'] == 1)
  156. echo count($context['view_members']), ' ', count($context['view_members']) == 1 ? $txt['who_member'] : $txt['members'];
  157. // Or show the actual people viewing the topic?
  158. else
  159. 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'] . ')');
  160. // Now show how many guests are here too.
  161. echo $txt['who_and'], $context['view_num_guests'], ' ', $context['view_num_guests'] == 1 ? $txt['guest'] : $txt['guests'], $txt['who_viewing_topic'], '
  162. </p>';
  163. }
  164. echo '
  165. <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">';
  166. $ignoredMsgs = array();
  167. $removableMessageIDs = array();
  168. $alternate = false;
  169. // Get all the messages...
  170. while ($message = $context['get_message']())
  171. {
  172. $ignoring = false;
  173. $alternate = !$alternate;
  174. if ($message['can_remove'])
  175. $removableMessageIDs[] = $message['id'];
  176. // Are we ignoring this message?
  177. if (!empty($message['is_ignored']))
  178. {
  179. $ignoring = true;
  180. $ignoredMsgs[] = $message['id'];
  181. }
  182. // Show the message anchor and a "new" anchor if this message is new.
  183. echo '
  184. <div class="', $message['approved'] ? ($message['alternate'] == 0 ? 'windowbg' : 'windowbg2') : 'approvebg', '">', $message['id'] != $context['first_message'] ? '
  185. <a id="msg' . $message['id'] . '"></a>' . ($message['first_new'] ? '<a id="new"></a>' : '') : '', '
  186. <div class="post_wrapper">';
  187. // Show information about the poster of this message.
  188. echo '
  189. <div class="poster">
  190. <ul class="dropmenu">
  191. <li>
  192. <h4>';
  193. // Show a link to the member's profile.
  194. echo '
  195. <a href="', $scripturl, '?action=profile;u=', $message['member']['id'], '">
  196. <span style="padding: 6px; display: block;">', $message['member']['name'], '</span>';
  197. // Show avatars, images, etc.?
  198. if (!empty($settings['show_user_images']) && empty($options['show_no_avatars']) && !empty($message['member']['avatar']['image']))
  199. echo '
  200. ', $message['member']['avatar']['image'], '';
  201. echo '
  202. </a>
  203. </h4>';
  204. // [WIP] The new member info dropdown starts here. Note that conditionals have not been fully checked yet.
  205. echo '
  206. <ul class="smalltext" id="msg_', $message['id'], '_extra_info"', $ignoring ? ' style="display:none;"' : '', '>';
  207. // Don't show these things for guests.
  208. if (!$message['member']['is_guest'])
  209. {
  210. // 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.
  211. if ((empty($settings['hide_post_group']) || $message['member']['group'] == '') && $message['member']['post_group'] != '')
  212. echo '
  213. <li class="postgroup">', $message['member']['post_group'], '</li>';
  214. // Show how many posts they have made.
  215. if (!isset($context['disabled_fields']['posts']))
  216. echo '
  217. <li class="postcount">', $txt['member_postcount'], ': ', $message['member']['posts'], '</li>';
  218. // Is karma display enabled? Total or +/-?
  219. if ($modSettings['karmaMode'] == '1')
  220. echo '
  221. <li class="karma">', $modSettings['karmaLabel'], ' ', $message['member']['karma']['good'] - $message['member']['karma']['bad'], '</li>';
  222. elseif ($modSettings['karmaMode'] == '2')
  223. echo '
  224. <li class="karma">', $modSettings['karmaLabel'], ' +', $message['member']['karma']['good'], '/-', $message['member']['karma']['bad'], '</li>';
  225. // Is this user allowed to modify this member's karma?
  226. if ($message['member']['karma']['allow'])
  227. echo '
  228. <li class="karma_allow">
  229. <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>
  230. <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>
  231. </li>';
  232. // Show the member's gender icon?
  233. if (!empty($settings['show_gender']) && $message['member']['gender']['image'] != '' && !isset($context['disabled_fields']['gender']))
  234. echo '
  235. <li class="gender">', $txt['gender'], ': ', $message['member']['gender']['image'], '</li>';
  236. // Show their personal text?
  237. if (!empty($settings['show_blurb']) && $message['member']['blurb'] != '')
  238. echo '
  239. <li class="blurb">', $message['member']['blurb'], '</li>';
  240. // Any custom fields to show as icons?
  241. if (!empty($message['member']['custom_fields']))
  242. {
  243. $shown = false;
  244. foreach ($message['member']['custom_fields'] as $custom)
  245. {
  246. if ($custom['placement'] != 1 || empty($custom['value']))
  247. continue;
  248. if (empty($shown))
  249. {
  250. $shown = true;
  251. echo '
  252. <li class="im_icons">
  253. <ol>';
  254. }
  255. echo '
  256. <li>', $custom['value'], '</li>';
  257. }
  258. if ($shown)
  259. echo '
  260. </ol>
  261. </li>';
  262. }
  263. // This shows the popular messaging icons.
  264. if ($message['member']['has_messenger'] && $message['member']['can_view_profile'])
  265. echo '
  266. <li class="im_icons">
  267. <hr />
  268. <ol>
  269. ', !empty($message['member']['icq']['link']) ? '<li>' . $message['member']['icq']['link'] . '</li>' : '', '
  270. ', !empty($message['member']['skype']['link']) ? '<li>' . $message['member']['skype']['link'] . '</li>' : '', '
  271. ', !empty($message['member']['aim']['link']) ? '<li>' . $message['member']['aim']['link'] . '</li>' : '', '
  272. ', !empty($message['member']['yim']['link']) ? '<li>' . $message['member']['yim']['link'] . '</li>' : '', '
  273. </ol>
  274. </li>';
  275. // Show the website and email address buttons.
  276. if ($message['member']['show_profile_buttons'])
  277. {
  278. echo '
  279. <li class="profile">
  280. <ol>';
  281. // Don't show an icon if they haven't specified a website.
  282. if ($message['member']['website']['url'] != '' && !isset($context['disabled_fields']['website']))
  283. echo '
  284. <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.png" alt="' . $message['member']['website']['title'] . '" />' : $txt['www']), '</a></li>';
  285. // Don't show the email address if they want it hidden.
  286. if (in_array($message['member']['show_email'], array('yes', 'yes_permission_override', 'no_through_forum')) && $context['can_send_email'])
  287. echo '
  288. <li><a href="', $scripturl, '?action=emailuser;sa=email;msg=', $message['id'], '" rel="nofollow">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/email_sm.png" alt="' . $txt['email'] . '" title="' . $txt['email'] . '" />' : $txt['email']), '</a></li>';
  289. echo '
  290. </ol>
  291. </li>';
  292. }
  293. // Any custom fields for standard placement?
  294. if (!empty($message['member']['custom_fields']))
  295. {
  296. foreach ($message['member']['custom_fields'] as $custom)
  297. if (empty($custom['placement']) || empty($custom['value']))
  298. echo '
  299. <li class="custom">', $custom['title'], ': ', $custom['value'], '</li>';
  300. }
  301. }
  302. // Otherwise, show the guest's email.
  303. elseif (!empty($message['member']['email']) && in_array($message['member']['show_email'], array('yes', 'yes_permission_override', 'no_through_forum')) && $context['can_send_email'])
  304. echo '
  305. <li class="email"><a href="', $scripturl, '?action=emailuser;sa=email;msg=', $message['id'], '" rel="nofollow">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/email_sm.png" alt="' . $txt['email'] . '" title="' . $txt['email'] . '" />' : $txt['email']), '</a></li>';
  306. // Stuff for the staff to wallop them with.
  307. echo '
  308. <li style="height: 2px; background: #ccc; box-shadow: 0 -1px 0 #fff inset;"></li>';
  309. // Can we issue a warning because of this post? Remember, we can't give guests warnings.
  310. if ($context['can_issue_warning'] && !$message['is_message_author'] && !$message['member']['is_guest'])
  311. echo '
  312. <li class="issue_warning"><a href="', $scripturl, '?action=profile;area=issuewarning;u=', $message['member']['id'], ';msg=', $message['id'], '"><img src="', $settings['images_url'], '/warn.png" alt="', $txt['issue_warning_post'], '" title="', $txt['issue_warning_post'], '" /></a></li>';
  313. //echo '
  314. // <img class="centericon" src="', $settings['images_url'], '/ip.png" alt="" />';
  315. // Show the IP to this user for this post - because you can moderate?
  316. if (!empty($context['can_moderate_forum']) && !empty($message['member']['ip']))
  317. echo '
  318. <li class="poster_ip"><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 reqOverlayDiv(this.href);" class="help">(?)</a></li>';
  319. // Or, should we show it because this is you?
  320. elseif ($message['can_see_ip'])
  321. echo '
  322. <li class="poster_ip"><a href="', $scripturl, '?action=helpadmin;help=see_member_ip" onclick="return reqOverlayDiv(this.href);" class="help">', $message['member']['ip'], '</a></li>';
  323. // Okay, are you at least logged in? Then we can show something about why IPs are logged...
  324. elseif (!$context['user']['is_guest'])
  325. echo '
  326. <li class="poster_ip"><a href="', $scripturl, '?action=helpadmin;help=see_member_ip" onclick="return reqOverlayDiv(this.href);" class="help">', $txt['logged'], '</a></li>';
  327. // Otherwise, you see NOTHING!
  328. else
  329. echo '
  330. <li class="poster_ip">', $txt['logged'], '</li>';
  331. // Done with the information about the poster... on to the post itself.
  332. echo '
  333. </ul>
  334. </li>';
  335. // Show the post group icons, but not for guests.
  336. if (!$message['member']['is_guest'])
  337. echo '
  338. <li class="icons">', $message['member']['group_icons'], '</li>';
  339. // Show the member's primary group (like 'Administrator') if they have one.
  340. if (!empty($message['member']['group']))
  341. echo '
  342. <li class="membergroup">', $message['member']['group'], '</li>';
  343. // Show the member's custom title, if they have one.
  344. if (!empty($message['member']['title']))
  345. echo '
  346. <li class="title">', $message['member']['title'], '</li>';
  347. // Show online and offline buttons? PHP could do with a little bit of cleaning up here for brevity, but it works.
  348. // The plan is to make these buttons act sensibly, and link to your own inbox in your own posts (with new PM notification).
  349. // Still has a little bit of hard-coded text. This may be a place where translators should be able to write inclusive strings,
  350. // instead of dealing with $txt['by'] etc in the markup. Must be brief to work, anyway. Cannot ramble on at all.
  351. if ($context['can_send_pm'] && $message['is_message_author'])
  352. {
  353. echo '
  354. <li class="poster_online"><a href="', $scripturl,'?action=pm">', $txt['pm_short'], ' ', $context['user']['unread_messages'] > 0 ? '[<strong>'. $context['user']['unread_messages'] . '</strong>]' : '' , '</a></li>';
  355. }
  356. elseif ($context['can_send_pm'] && !$message['is_message_author'] && !$message['member']['is_guest'])
  357. {
  358. if (!empty($modSettings['onlineEnable']))
  359. echo '
  360. <li class="poster_online"><a href="', $scripturl,'?action=pm;sa=send;u=', $message['member']['id'], '" title="', $message['member']['online']['member_online_text'], '">', $txt['send_message'], ' <img src="'. $message['member']['online']['image_href']. '" alt="" /></a></li>';
  361. else
  362. echo '
  363. <li class="poster_online"><a href="', $scripturl,'?action=pm;sa=send;u=', $message['member']['id'], '">', $txt['send_message'], ' </a></li>';
  364. }
  365. elseif (!$context['can_send_pm'] && !empty($modSettings['onlineEnable']))
  366. echo '
  367. <li class="poster_online">', ($message['member']['online']['is_online']) ? $txt['online'] : $txt['offline'], ' <img src="'. $message['member']['online']['image_href']. '" alt="" /></li>';
  368. // Are we showing the warning status?
  369. // Don't show these things for guests.
  370. if (!$message['member']['is_guest'] && $message['member']['can_see_warning'])
  371. echo '
  372. <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']], '" />', $context['can_issue_warning'] ? '</a>' : '', '<span class="warn_', $message['member']['warning_status'], '">', $txt['warn_' . $message['member']['warning_status']], '</span></li>';
  373. echo '
  374. </ul>';
  375. echo '
  376. </div>
  377. <div class="postarea">
  378. <div class="keyinfo">
  379. <div class="messageicon" ', ($message['icon_url'] !== $settings['images_url'] . '/post/xx.png') ? '' : 'style="position: absolute; z-index: -1;"', '>
  380. <img src="', $message['icon_url'] . '" alt=""', $message['can_modify'] ? ' id="msg_icon_' . $message['id'] . '"' : '', ' />
  381. </div>';
  382. //Some people dont want subject ... The div is still required or quick edit breaks...
  383. echo'
  384. <div id="subject_', $message['id'], '" class="subject_title">', (empty($settiongs['subject_toggle']) ? '' : '<a href="' . $message['href'] . '" rel="nofollow">' . $message['subject'] . '</a>'), '</div>';
  385. echo'
  386. <div class="page_number floatright">
  387. ', !empty($message['counter']) ? ' #' . $message['counter'] : '', ' ', '
  388. </div>
  389. <h5>
  390. <a href="', $message['href'], '" rel="nofollow" title="', !empty($message['counter']) ? sprintf($txt['reply_number'], $message['counter']) : '', ' - ', $message['subject'], '" class="smalltext">', $message['time'], '</a>';
  391. // Show "<< Last Edit: Time by Person >>" if this post was edited.
  392. if ($settings['show_modify'] && !empty($message['modified']['name']))
  393. echo '
  394. <span class="smalltext modified" id="modified_', $message['id'], '">
  395. ', $message['modified']['last_edit_text'], '
  396. </span>';
  397. echo '
  398. </h5>
  399. <div id="msg_', $message['id'], '_quick_mod"', $ignoring ? ' style="display:none;"' : '', '></div>
  400. </div>';
  401. // Ignoring this user? Hide the post.
  402. if ($ignoring)
  403. echo '
  404. <div id="msg_', $message['id'], '_ignored_prompt">
  405. ', $txt['ignoring_user'], '
  406. <a href="#" id="msg_', $message['id'], '_ignored_link" style="display: none;">', $txt['show_ignore_user_post'], '</a>
  407. </div>';
  408. // Show the post itself, finally!
  409. echo '
  410. <div class="post">';
  411. if (!$message['approved'] && $message['member']['id'] != 0 && $message['member']['id'] == $context['user']['id'])
  412. echo '
  413. <div class="approve_post">
  414. ', $txt['post_awaiting_approval'], '
  415. </div>';
  416. echo '
  417. <div class="inner" id="msg_', $message['id'], '"', $ignoring ? ' style="display:none;"' : '', '>', $message['body'], '</div>
  418. </div>';
  419. // Assuming there are attachments...
  420. if (!empty($message['attachment']))
  421. {
  422. echo '
  423. <div id="msg_', $message['id'], '_footer" class="attachments"', $ignoring ? ' style="display:none;"' : '', '>';
  424. $last_approved_state = 1;
  425. $attachments_per_line = 4;
  426. $i = 0;
  427. foreach ($message['attachment'] as $attachment)
  428. {
  429. // Show a special box for unapproved attachments...
  430. if ($attachment['is_approved'] != $last_approved_state)
  431. {
  432. $last_approved_state = 0;
  433. echo '
  434. <fieldset>
  435. <legend>', $txt['attach_awaiting_approve'];
  436. if ($context['can_approve'])
  437. echo '
  438. &nbsp;[<a href="', $scripturl, '?action=attachapprove;sa=all;mid=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $txt['approve_all'], '</a>]';
  439. echo '
  440. </legend>';
  441. }
  442. echo '
  443. <div class="floatleft">';
  444. if ($attachment['is_image'])
  445. {
  446. echo '
  447. <div class="attachments_top">';
  448. if ($attachment['thumbnail']['has_thumb'])
  449. echo '
  450. <a href="', $attachment['href'], ';image" id="link_', $attachment['id'], '" onclick="', $attachment['thumbnail']['javascript'], '"><img src="', $attachment['thumbnail']['href'], '" alt="" id="thumb_', $attachment['id'], '" /></a>';
  451. else
  452. echo '
  453. <img src="' . $attachment['href'] . ';image" alt="" width="' . $attachment['width'] . '" height="' . $attachment['height'] . '"/>';
  454. echo '
  455. </div>';
  456. }
  457. echo '
  458. <div class="attachments_bot">
  459. <a href="' . $attachment['href'] . '"><img src="' . $settings['images_url'] . '/icons/clip.png" class="centericon" alt="*" />&nbsp;' . $attachment['name'] . '</a> ';
  460. if (!$attachment['is_approved'] && $context['can_approve'])
  461. echo '
  462. [<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>] ';
  463. echo '
  464. <br />', $attachment['size'], ($attachment['is_image'] ? ', ' . $attachment['real_width'] . 'x' . $attachment['real_height'] . '<br />' . sprintf($txt['attach_viewed'], $attachment['downloads']) : '<br />' . sprintf($txt['attach_downloaded'], $attachment['downloads'])), '
  465. </div>';
  466. echo '
  467. </div>';
  468. // Next attachment line ?
  469. if (++$i % $attachments_per_line === 0)
  470. echo '
  471. <hr />';
  472. }
  473. // If we had unapproved attachments clean up.
  474. if ($last_approved_state == 0)
  475. echo '
  476. </fieldset>';
  477. echo '
  478. </div>';
  479. }
  480. echo '
  481. </div>';
  482. // Maybe they want to report this post to the moderator(s)?
  483. if ($context['can_report_moderator'])
  484. echo '
  485. <ul class="floatright smalltext">
  486. <li class="report_link"><a href="', $scripturl, '?action=reporttm;topic=', $context['current_topic'], '.', $message['counter'], ';msg=', $message['id'], '">', $txt['report_to_mod'], '</a></li>
  487. </ul>';
  488. // Show the quickbuttons, for various operations on posts.
  489. if ($message['can_approve'] || $message['can_unapprove'] || $context['can_reply'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg'] || $context['can_quote'])
  490. {
  491. echo '
  492. <ul class="quickbuttons">';
  493. // Can they reply? Have they turned on quick reply?
  494. if ($context['can_quote'] && !empty($options['display_quick_reply']))
  495. echo '
  496. <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'], ');" class="quote_button">', $txt['quote_action'], '</a></li>';
  497. // So... quick reply is off, but they *can* reply?
  498. elseif ($context['can_quote'])
  499. echo '
  500. <li><a href="', $scripturl, '?action=post;quote=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], ';last_msg=', $context['topic_last_message'], '" class="quote_button">', $txt['quote_action'], '</a></li>';
  501. // Can the user modify the contents of this post? Show the modify inline image.
  502. if ($message['can_modify'])
  503. echo '
  504. <li class="quick_edit"><img src="', $settings['images_url'], '/icons/modify_inline.png" alt="', $txt['modify_msg'], '" title="', $txt['modify_msg'], '" class="modifybutton" id="modify_button_', $message['id'], '" style="cursor: pointer; margin: 0;" onclick="oQuickModify.modifyMsg(\'', $message['id'], '\')" />', $txt['quick_edit'], '</li>';
  505. if ($message['can_approve'] || $message['can_unapprove'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg'])
  506. echo '
  507. <li class="post_options">', $txt['post_options'];
  508. echo '
  509. <ul>';
  510. // Can the user modify the contents of this post?
  511. if ($message['can_modify'])
  512. echo '
  513. <li><a href="', $scripturl, '?action=post;msg=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], '" class="modify_button">', $txt['modify'], '</a></li>';
  514. // How about... even... remove it entirely?!
  515. if ($message['can_remove'])
  516. echo '
  517. <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>';
  518. // What about splitting it off the rest of the topic?
  519. if ($context['can_split'] && !empty($context['real_num_replies']))
  520. echo '
  521. <li><a href="', $scripturl, '?action=splittopics;topic=', $context['current_topic'], '.0;at=', $message['id'], '" class="split_button">', $txt['split'], '</a></li>';
  522. // Can we restore topics?
  523. if ($context['can_restore_msg'])
  524. echo '
  525. <li><a href="', $scripturl, '?action=restoretopic;msgs=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '" class="restore_button">', $txt['restore_message'], '</a></li>';
  526. // Maybe we can approve it, maybe we should?
  527. if ($message['can_approve'])
  528. echo '
  529. <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>';
  530. // Maybe we can unapprove it?
  531. if ($message['can_unapprove'])
  532. echo '
  533. <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="unapprove_button">', $txt['unapprove'], '</a></li>';
  534. echo '
  535. </ul>
  536. </li>';
  537. // Show a checkbox for quick moderation?
  538. if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && $message['can_remove'])
  539. echo '
  540. <li class="inline_mod_check" style="display: none;" id="in_topic_mod_check_', $message['id'], '"></li>';
  541. if ($message['can_approve'] || $context['can_reply'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg'])
  542. echo '
  543. </ul>';
  544. }
  545. echo '
  546. <div class="moderatorbar">';
  547. // Are there any custom profile fields for above the signature?
  548. if (!empty($message['member']['custom_fields']))
  549. {
  550. $shown = false;
  551. foreach ($message['member']['custom_fields'] as $custom)
  552. {
  553. if ($custom['placement'] != 2 || empty($custom['value']))
  554. continue;
  555. if (empty($shown))
  556. {
  557. $shown = true;
  558. echo '
  559. <div class="custom_fields_above_signature">
  560. <ul class="reset nolist">';
  561. }
  562. echo '
  563. <li>', $custom['value'], '</li>';
  564. }
  565. if ($shown)
  566. echo '
  567. </ul>
  568. </div>';
  569. }
  570. // Show the member's signature?
  571. if (!empty($message['member']['signature']) && empty($options['show_no_signatures']) && $context['signature_enabled'])
  572. echo '
  573. <div class="signature" id="msg_', $message['id'], '_signature"', $ignoring ? ' style="display:none;"' : '', '>', $message['member']['signature'], '</div>';
  574. echo '
  575. </div>
  576. </div>
  577. </div>
  578. <hr class="post_separator" />';
  579. }
  580. echo '
  581. </form>
  582. </div>';
  583. // Show the page index... "Pages: [1]".
  584. echo '
  585. <div class="pagesection">
  586. ', template_button_strip($context['normal_buttons'], 'right'), '
  587. ', !empty($modSettings['topbottomEnable']) ? $context['menu_separator'] . '<a href="#top" class="topbottom floatleft">' . $txt['go_up'] . '</a>' : '', '
  588. <div class="pagelinks floatleft">
  589. ', $context['page_index'], '
  590. </div>
  591. </div>';
  592. // Show the lower breadcrumbs.
  593. theme_linktree();
  594. echo '
  595. <div id="moderationbuttons">', template_button_strip($context['mod_buttons'], 'bottom', array('id' => 'moderationbuttons_strip')), '</div>';
  596. // Show the jumpto box, or actually...let Javascript do it.
  597. echo '
  598. <div class="plainbox" id="display_jump_to">&nbsp;</div>';
  599. if ($context['can_reply'] && !empty($options['display_quick_reply']))
  600. {
  601. echo '
  602. <a id="quickreply"></a>
  603. <div class="tborder" id="quickreplybox">
  604. <div class="cat_bar">
  605. <h3 class="catbg">
  606. <a href="javascript:oQuickReply.swap();"><img src="', $settings['images_url'], '/', $options['display_quick_reply'] > 1 ? 'collapse' : 'expand', '.png" alt="+" id="quickReplyExpand" class="icon" /></a>
  607. <a href="javascript:oQuickReply.swap();">', $txt['quick_reply'], '</a>
  608. </h3>
  609. </div>
  610. <div id="quickReplyOptions"', $options['display_quick_reply'] > 1 ? '' : ' style="display: none"', '>
  611. <div class="roundframe">
  612. <p class="smalltext lefttext">', $txt['quick_reply_desc'], '</p>
  613. ', $context['is_locked'] ? '<p class="alert smalltext">' . $txt['quick_reply_warning'] . '</p>' : '',
  614. $context['oldTopicError'] ? '<p class="alert smalltext">' . sprintf($txt['error_old_topic'], $modSettings['oldTopicDays']) . '</p>' : '', '
  615. ', $context['can_reply_approved'] ? '' : '<em>' . $txt['wait_for_approval'] . '</em>', '
  616. ', !$context['can_reply_approved'] && $context['require_verification'] ? '<br />' : '', '
  617. <form action="', $scripturl, '?board=', $context['current_board'], ';action=post2" method="post" accept-charset="', $context['character_set'], '" name="postmodify" id="postmodify" onsubmit="submitonce(this);" style="margin: 0;">
  618. <input type="hidden" name="topic" value="', $context['current_topic'], '" />
  619. <input type="hidden" name="subject" value="', $context['response_prefix'], $context['subject'], '" />
  620. <input type="hidden" name="icon" value="xx" />
  621. <input type="hidden" name="from_qr" value="1" />
  622. <input type="hidden" name="notify" value="', $context['is_marked_notify'] || !empty($options['auto_notify']) ? '1' : '0', '" />
  623. <input type="hidden" name="not_approved" value="', !$context['can_reply_approved'], '" />
  624. <input type="hidden" name="goback" value="', empty($options['return_to_post']) ? '0' : '1', '" />
  625. <input type="hidden" name="last_msg" value="', $context['topic_last_message'], '" />
  626. <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
  627. <input type="hidden" name="seqnum" value="', $context['form_sequence_number'], '" />';
  628. // Guests just need more.
  629. if ($context['user']['is_guest'])
  630. echo '
  631. <strong>', $txt['name'], ':</strong> <input type="text" name="guestname" value="', $context['name'], '" size="25" class="input_text" tabindex="', $context['tabindex']++, '" />
  632. <strong>', $txt['email'], ':</strong> <input type="text" name="email" value="', $context['email'], '" size="25" class="input_text" tabindex="', $context['tabindex']++, '" /><br />';
  633. // Is visual verification enabled?
  634. if ($context['require_verification'])
  635. echo '
  636. <strong>', $txt['verification'], ':</strong>', template_control_verification($context['visual_verification_id'], 'quick_reply'), '<br />';
  637. // Using the full editor
  638. if (empty($options['use_editor_quick_reply']))
  639. {
  640. echo '
  641. <div class="quickReplyContent">
  642. <textarea cols="600" rows="7" name="message" tabindex="', $context['tabindex']++, '"></textarea>
  643. </div>';
  644. }
  645. else
  646. {
  647. // Show the actual posting area...
  648. if ($context['show_bbc'])
  649. {
  650. echo '
  651. <div id="bbcBox_message"></div>';
  652. }
  653. // What about smileys?
  654. if (!empty($context['smileys']['postform']) || !empty($context['smileys']['popup']))
  655. echo '
  656. <div id="smileyBox_message"></div>';
  657. echo '
  658. ', template_control_richedit($context['post_box_name'], 'smileyBox_message', 'bbcBox_message'), '
  659. <script type="text/javascript"><!-- // --><![CDATA[
  660. function insertQuoteFast(messageid)
  661. {
  662. if (window.XMLHttpRequest)
  663. getXMLDocument(smf_prepareScriptUrl(smf_scripturl) + \'action=quotefast;quote=\' + messageid + \';xml;pb=', $context['post_box_name'], ';mode=\' + (oEditorHandle_', $context['post_box_name'], '.bRichTextEnabled ? 1 : 0), onDocReceived);
  664. else
  665. reqWin(smf_prepareScriptUrl(smf_scripturl) + \'action=quotefast;quote=\' + messageid + \';pb=', $context['post_box_name'], ';mode=\' + (oEditorHandle_', $context['post_box_name'], '.bRichTextEnabled ? 1 : 0), 240, 90);
  666. return false;
  667. }
  668. function onDocReceived(XMLDoc)
  669. {
  670. var text = \'\';
  671. for (var i = 0, n = XMLDoc.getElementsByTagName(\'quote\')[0].childNodes.length; i < n; i++)
  672. text += XMLDoc.getElementsByTagName(\'quote\')[0].childNodes[i].nodeValue;
  673. oEditorHandle_', $context['post_box_name'], '.insertText(text, false, true);
  674. ajax_indicator(false);
  675. }
  676. // ]]></script>';
  677. }
  678. echo '
  679. <div class="padding">
  680. <input type="submit" name="post" value="', $txt['post'], '" onclick="return submitThisOnce(this);" accesskey="s" tabindex="', $context['tabindex']++, '" class="button_submit" />
  681. <input type="submit" name="preview" value="', $txt['preview'], '" onclick="return submitThisOnce(this);" accesskey="p" tabindex="', $context['tabindex']++, '" class="button_submit" />';
  682. if ($context['show_spellchecking'])
  683. echo '
  684. <input type="button" value="', $txt['spell_check'], '" onclick="spellCheck(\'postmodify\', \'message\');" tabindex="', $context['tabindex']++, '" class="button_submit" />';
  685. if ($context['drafts_save'] && !empty($options['drafts_show_saved_enabled']))
  686. echo '
  687. <input type="submit" name="save_draft" value="', $txt['draft_save'], '" onclick="return confirm(' . JavaScriptEscape($txt['draft_save_note']) . ') && submitThisOnce(this);" accesskey="d" tabindex="', $context['tabindex']++, '" class="button_submit" />
  688. <input type="hidden" id="id_draft" name="id_draft" value="', empty($context['id_draft']) ? 0 : $context['id_draft'], '" />';
  689. if (!empty($context['drafts_autosave']) && !empty($options['drafts_autosave_enabled']))
  690. echo '
  691. <div class="clear righttext padding"><span id="throbber" style="display:none"><img src="' . $settings['images_url'] . '/loading_sm.gif" alt="" class="centericon" />&nbsp;</span><span id="draft_lastautosave" ></span></div>';
  692. echo '
  693. </div>
  694. </form>
  695. </div>
  696. </div>
  697. </div>';
  698. }
  699. else
  700. echo '
  701. <br class="clear" />';
  702. // draft autosave available and the user has it enabled?
  703. if (!empty($context['drafts_autosave']) && !empty($options['drafts_autosave_enabled']))
  704. echo '
  705. <script type="text/javascript" src="', $settings['default_theme_url'], '/scripts/drafts.js?alp21"></script>
  706. <script type="text/javascript"><!-- // --><![CDATA[
  707. var oDraftAutoSave = new smf_DraftAutoSave({
  708. sSelf: \'oDraftAutoSave\',
  709. sLastNote: \'draft_lastautosave\',
  710. sLastID: \'id_draft\',', !empty($context['post_box_name']) ? '
  711. sSceditorID: \'' . $context['post_box_name'] . '\',' : '', '
  712. sType: \'', !empty($options['display_quick_reply']) && $options['display_quick_reply'] > 2 ? 'quick' : 'quick', '\',
  713. iBoard: ', (empty($context['current_board']) ? 0 : $context['current_board']), ',
  714. iFreq: ', (empty($modSettings['masterAutoSaveDraftsDelay']) ? 60000 : $modSettings['masterAutoSaveDraftsDelay'] * 1000), '
  715. });
  716. // ]]></script>';
  717. if ($context['show_spellchecking'])
  718. echo '
  719. <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>
  720. <script type="text/javascript" src="', $settings['default_theme_url'], '/scripts/spellcheck.js"></script>';
  721. echo '
  722. <script type="text/javascript" src="', $settings['default_theme_url'], '/scripts/topic.js"></script>
  723. <script type="text/javascript"><!-- // --><![CDATA[';
  724. if (!empty($options['display_quick_reply']))
  725. echo '
  726. var oQuickReply = new QuickReply({
  727. bDefaultCollapsed: ', !empty($options['display_quick_reply']) && $options['display_quick_reply'] > 1 ? 'false' : 'true', ',
  728. iTopicId: ', $context['current_topic'], ',
  729. iStart: ', $context['start'], ',
  730. sScriptUrl: smf_scripturl,
  731. sImagesUrl: smf_images_url,
  732. sContainerId: "quickReplyOptions",
  733. sImageId: "quickReplyExpand",
  734. sImageCollapsed: "collapse.png",
  735. sImageExpanded: "expand.png",
  736. sJumpAnchor: "quickreply",
  737. bIsFull: ', !empty($options['use_editor_quick_reply']) ? 'true' : 'false', '
  738. });';
  739. if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && $context['can_remove_post'])
  740. echo '
  741. var oInTopicModeration = new InTopicModeration({
  742. sSelf: \'oInTopicModeration\',
  743. sCheckboxContainerMask: \'in_topic_mod_check_\',
  744. aMessageIds: [\'', implode('\', \'', $removableMessageIDs), '\'],
  745. sSessionId: smf_session_id,
  746. sSessionVar: smf_session_var,
  747. sButtonStrip: \'moderationbuttons\',
  748. sButtonStripDisplay: \'moderationbuttons_strip\',
  749. bUseImageButton: false,
  750. bCanRemove: ', $context['can_remove_post'] ? 'true' : 'false', ',
  751. sRemoveButtonLabel: \'', $txt['quickmod_delete_selected'], '\',
  752. sRemoveButtonImage: \'delete_selected.png\',
  753. sRemoveButtonConfirm: \'', $txt['quickmod_confirm'], '\',
  754. bCanRestore: ', $context['can_restore_msg'] ? 'true' : 'false', ',
  755. sRestoreButtonLabel: \'', $txt['quick_mod_restore'], '\',
  756. sRestoreButtonImage: \'restore_selected.png\',
  757. sRestoreButtonConfirm: \'', $txt['quickmod_confirm'], '\',
  758. bCanSplit: ', $context['can_split'] ? 'true' : 'false', ',
  759. sSplitButtonLabel: \'', $txt['quickmod_split_selected'], '\',
  760. sSplitButtonImage: \'split_selected.png\',
  761. sSplitButtonConfirm: \'', $txt['quickmod_confirm'], '\',
  762. sFormId: \'quickModForm\'
  763. });';
  764. echo '
  765. if (\'XMLHttpRequest\' in window)
  766. {
  767. var oQuickModify = new QuickModify({
  768. sScriptUrl: smf_scripturl,
  769. sClassName: \'quick_edit\',
  770. bShowModify: ', $settings['show_modify'] ? 'true' : 'false', ',
  771. iTopicId: ', $context['current_topic'], ',
  772. sTemplateBodyEdit: ', JavaScriptEscape('
  773. <div id="quick_edit_body_container" style="width: 90%">
  774. <div id="error_box" style="padding: 4px;" class="error"></div>
  775. <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 />
  776. <input type="hidden" name="' . $context['session_var'] . '" value="' . $context['session_id'] . '" />
  777. <input type="hidden" name="topic" value="' . $context['current_topic'] . '" />
  778. <input type="hidden" name="msg" value="%msg_id%" />
  779. <div class="righttext">
  780. <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" />
  781. </div>
  782. </div>'), ',
  783. sTemplateSubjectEdit: ', JavaScriptEscape('<input type="text" style="width: 90%;" name="subject" value="%subject%" size="80" maxlength="80" tabindex="' . $context['tabindex']++ . '" class="input_text" />'), ',
  784. sTemplateBodyNormal: ', JavaScriptEscape('%body%'), ',
  785. sTemplateSubjectNormal: ', JavaScriptEscape('<a href="' . $scripturl . '?topic=' . $context['current_topic'] . '.msg%msg_id%#msg%msg_id%" rel="nofollow">%subject%</a>'), ',
  786. sTemplateTopSubject: ', JavaScriptEscape($txt['topic'] . ': %subject% &nbsp;(' . $context['num_views_text'] . ')'), ',
  787. sErrorBorderStyle: ', JavaScriptEscape('1px solid red'), ($context['can_reply'] && !empty($options['display_quick_reply'])) ? ',
  788. sFormRemoveAccessKeys: \'postmodify\'' : '', '
  789. });
  790. aJumpTo[aJumpTo.length] = new JumpTo({
  791. sContainerId: "display_jump_to",
  792. sJumpToTemplate: "<label class=\"smalltext\" for=\"%select_id%\">', $context['jump_to']['label'], ':<" + "/label> %dropdown_list%",
  793. iCurBoardId: ', $context['current_board'], ',
  794. iCurBoardChildLevel: ', $context['jump_to']['child_level'], ',
  795. sCurBoardName: "', $context['jump_to']['board_name'], '",
  796. sBoardChildLevelIndicator: "==",
  797. sBoardPrefix: "=> ",
  798. sCatSeparator: "-----------------------------",
  799. sCatPrefix: "",
  800. sGoButtonLabel: "', $txt['go'], '"
  801. });
  802. aIconLists[aIconLists.length] = new IconList({
  803. sBackReference: "aIconLists[" + aIconLists.length + "]",
  804. sIconIdPrefix: "msg_icon_",
  805. sScriptUrl: smf_scripturl,
  806. bShowModify: ', $settings['show_modify'] ? 'true' : 'false', ',
  807. iBoardId: ', $context['current_board'], ',
  808. iTopicId: ', $context['current_topic'], ',
  809. sSessionId: smf_session_id,
  810. sSessionVar: smf_session_var,
  811. sLabelIconList: "', $txt['message_icon'], '",
  812. sBoxBackground: "transparent",
  813. sBoxBackgroundHover: "#ffffff",
  814. iBoxBorderWidthHover: 1,
  815. sBoxBorderColorHover: "#adadad" ,
  816. sContainerBackground: "#ffffff",
  817. sContainerBorder: "1px solid #adadad",
  818. sItemBorder: "1px solid #ffffff",
  819. sItemBorderHover: "1px dotted gray",
  820. sItemBackground: "transparent",
  821. sItemBackgroundHover: "#e0e0f0"
  822. });
  823. }';
  824. if (!empty($ignoredMsgs))
  825. echo '
  826. ignore_toggles([', implode(', ', $ignoredMsgs), '], ', JavaScriptEscape($txt['show_ignore_user_post']), ');';
  827. echo '
  828. // ]]></script>';
  829. }
  830. ?>