MessageIndex.template.php 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433
  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, $scripturl, $modSettings, $txt;
  15. if (!empty($context['boards']) && (!empty($options['show_children']) || $context['start'] == 0))
  16. {
  17. echo '
  18. <div id="board_', $context['current_board'], '_childboards" class="boardindex_table">
  19. <table class="table_list">
  20. <tbody class="header">
  21. <tr>
  22. <td colspan="4">
  23. <div class="cat_bar">
  24. <h3 class="catbg">', $txt['parent_boards'], '</h3>
  25. </div>
  26. </td>
  27. </tr>
  28. </tbody>
  29. <tbody id="board_', $context['current_board'], '_children" class="content">';
  30. foreach ($context['boards'] as $board)
  31. {
  32. echo '
  33. <tr id="board_', $board['id'], '" class="windowbg2">
  34. <td class="windowbg icon"', !empty($board['children']) ? ' rowspan="2"' : '', '>
  35. <a href="', ($board['is_redirect'] || $context['user']['is_guest'] ? $board['href'] : $scripturl . '?action=unread;board=' . $board['id'] . '.0;children'), '">';
  36. // If the board or children is new, show an indicator.
  37. if ($board['new'] || $board['children_new'])
  38. echo '
  39. <img src="', $settings['images_url'], '/' .$context['theme_variant_url'], 'on', $board['new'] ? '' : '2', '.png" alt="', $txt['new_posts'], '" title="', $txt['new_posts'], '" />';
  40. // Is it a redirection board?
  41. elseif ($board['is_redirect'])
  42. echo '
  43. <img src="', $settings['images_url'], '/' .$context['theme_variant_url'], 'redirect.png" alt="*" title="*" />';
  44. // No new posts at all! The agony!!
  45. else
  46. echo '
  47. <img src="', $settings['images_url'], '/' .$context['theme_variant_url'], 'off.png" alt="', $txt['old_posts'], '" title="', $txt['old_posts'], '" />';
  48. echo '
  49. </a>
  50. </td>
  51. <td class="info">
  52. <a class="subject" href="', $board['href'], '" name="b', $board['id'], '">', $board['name'], '</a>';
  53. // Has it outstanding posts for approval?
  54. if ($board['can_approve_posts'] && ($board['unapproved_posts'] || $board['unapproved_topics']))
  55. echo '
  56. <a href="', $scripturl, '?action=moderate;area=postmod;sa=', ($board['unapproved_topics'] > 0 ? 'topics' : 'posts'), ';brd=', $board['id'], ';', $context['session_var'], '=', $context['session_id'], '" title="', sprintf($txt['unapproved_posts'], $board['unapproved_topics'], $board['unapproved_posts']), '" class="moderation_link">(!)</a>';
  57. echo '
  58. <p>', $board['description'] , '</p>';
  59. // Show the "Moderators: ". Each has name, href, link, and id. (but we're gonna use link_moderators.)
  60. if (!empty($board['moderators']))
  61. echo '
  62. <p class="moderators">', count($board['moderators']) === 1 ? $txt['moderator'] : $txt['moderators'], ': ', implode(', ', $board['link_moderators']), '</p>';
  63. // Show some basic information about the number of posts, etc.
  64. echo '
  65. </td>
  66. <td class="windowbg stats">
  67. <p>', comma_format($board['posts']), ' ', $board['is_redirect'] ? $txt['redirects'] : $txt['posts'], ' <br />
  68. ', $board['is_redirect'] ? '' : comma_format($board['topics']) . ' ' . $txt['board_topics'], '
  69. </p>
  70. </td>
  71. <td class="lastpost">';
  72. if (!empty($board['last_post']['id']))
  73. echo '
  74. <p>', $board['last_post']['last_post_message'], '</p>';
  75. echo '
  76. </td>
  77. </tr>';
  78. // Show the "Child Boards: ". (there's a link_children but we're going to bold the new ones...)
  79. if (!empty($board['children']))
  80. {
  81. // Sort the links into an array with new boards bold so it can be imploded.
  82. $children = array();
  83. /* Each child in each board's children has:
  84. id, name, description, new (is it new?), topics (#), posts (#), href, link, and last_post. */
  85. foreach ($board['children'] as $child)
  86. {
  87. if (!$child['is_redirect'])
  88. $child['link'] = '<a href="' . $child['href'] . '" ' . ($child['new'] ? 'class="board_new_posts" ' : '') . 'title="' . ($child['new'] ? $txt['new_posts'] : $txt['old_posts']) . ' (' . $txt['board_topics'] . ': ' . comma_format($child['topics']) . ', ' . $txt['posts'] . ': ' . comma_format($child['posts']) . ')">' . $child['name'] . ($child['new'] ? '</a> <a ' . ($child['new'] ? 'class="new_posts" ' : '') . 'href="' . $scripturl . '?action=unread;board=' . $child['id'] . '" title="' . $txt['new_posts'] . ' (' . $txt['board_topics'] . ': ' . comma_format($child['topics']) . ', ' . $txt['posts'] . ': ' . comma_format($child['posts']) . ')"><span class="new_posts">' . $txt['new'] . '</span>' : '') . '</a>';
  89. else
  90. $child['link'] = '<a href="' . $child['href'] . '" title="' . comma_format($child['posts']) . ' ' . $txt['redirects'] . '">' . $child['name'] . '</a>';
  91. // Has it posts awaiting approval?
  92. if ($child['can_approve_posts'] && ($child['unapproved_posts'] | $child['unapproved_topics']))
  93. $child['link'] .= ' <a href="' . $scripturl . '?action=moderate;area=postmod;sa=' . ($child['unapproved_topics'] > 0 ? 'topics' : 'posts') . ';brd=' . $child['id'] . ';' . $context['session_var'] . '=' . $context['session_id'] . '" title="' . sprintf($txt['unapproved_posts'], $child['unapproved_topics'], $child['unapproved_posts']) . '" class="moderation_link">(!)</a>';
  94. $children[] = $child['new'] ? '<strong>' . $child['link'] . '</strong>' : $child['link'];
  95. }
  96. echo '
  97. <tr id="board_', $board['id'], '_children" class="windowbg2">
  98. <td colspan="3" class="windowbg children">
  99. <p><strong>', $txt['parent_boards'], '</strong>: ', implode(', ', $children), '</p>
  100. </td>
  101. </tr>';
  102. }
  103. }
  104. echo '
  105. </tbody>
  106. </table>
  107. </div>';
  108. }
  109. // They can only mark read if they are logged in and it's enabled!
  110. if (!$context['user']['is_logged'] || !$settings['show_mark_read'])
  111. unset($context['normal_buttons']['markread']);
  112. if (!$context['no_topic_listing'])
  113. {
  114. echo '
  115. <div class="pagesection">
  116. ', !empty($modSettings['topbottomEnable']) ? $context['menu_separator'] . '<a href="#bot" class="topbottom floatleft">' . $txt['go_down'] . '</a>' : '', '
  117. <div class="pagelinks floatleft">', $context['page_index'], '</div>
  118. ', template_button_strip($context['normal_buttons'], 'right'), '
  119. </div>';
  120. if (!empty($options['show_board_desc']) && $context['description'] != '')
  121. echo '
  122. <div class="cat_bar description_header">
  123. <h3 class="catbg">', $context['name'], '</h3>
  124. </div>
  125. <p class="description_board">
  126. ', $context['description'], '<br/>';
  127. if (!empty($context['moderators']))
  128. echo '
  129. ', count($context['moderators']) === 1 ? $txt['moderator'] : $txt['moderators'], ': ', implode(', ', $context['link_moderators']), '.&nbsp;&nbsp;';
  130. if (!empty($settings['display_who_viewing']))
  131. {
  132. if ($settings['display_who_viewing'] == 1)
  133. echo count($context['view_members']), ' ', count($context['view_members']) === 1 ? $txt['who_member'] : $txt['members'];
  134. else
  135. echo empty($context['view_members_list']) ? '0 ' . $txt['members'] : implode(', ', $context['view_members_list']) . ((empty($context['view_num_hidden']) or $context['can_moderate_forum']) ? '' : ' (+ ' . $context['view_num_hidden'] . ' ' . $txt['hidden'] . ')');
  136. echo $txt['who_and'], $context['view_num_guests'], ' ', $context['view_num_guests'] == 1 ? $txt['guest'] : $txt['guests'], $txt['who_viewing_board'], '';
  137. }
  138. echo '
  139. </p>';
  140. // If Quick Moderation is enabled start the form.
  141. if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] > 0 && !empty($context['topics']))
  142. echo '
  143. <form action="', $scripturl, '?action=quickmod;board=', $context['current_board'], '.', $context['start'], '" method="post" accept-charset="', $context['character_set'], '" class="clear" name="quickModForm" id="quickModForm">';
  144. echo '
  145. <div class="tborder topic_table" id="messageindex">
  146. <table class="table_grid" cellspacing="0">
  147. <thead>
  148. <tr class="catbg">';
  149. // Are there actually any topics to show?
  150. // [WIP] There is trial code here to hide the topic icon column. Colspan can be cleaned up later.
  151. if (!empty($context['topics']))
  152. {
  153. echo '
  154. <th scope="col" class="first_th" width="6%" colspan="1">&nbsp;</th>
  155. <th scope="col" class="lefttext"><a href="', $scripturl, '?board=', $context['current_board'], '.', $context['start'], ';sort=subject', $context['sort_by'] == 'subject' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt['subject'], $context['sort_by'] == 'subject' ? '<img class="sort" src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.png" alt="" />' : '', '</a> / <a href="', $scripturl, '?board=', $context['current_board'], '.', $context['start'], ';sort=starter', $context['sort_by'] == 'starter' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt['started_by'], $context['sort_by'] == 'starter' ? '<img class="sort" src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.png" alt="" />' : '', '</a></th>
  156. <th scope="col" width="14%"><a href="', $scripturl, '?board=', $context['current_board'], '.', $context['start'], ';sort=replies', $context['sort_by'] == 'replies' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt['replies'], $context['sort_by'] == 'replies' ? '<img class="sort" src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.png" alt="" />' : '', '</a> / <a href="', $scripturl, '?board=', $context['current_board'], '.', $context['start'], ';sort=views', $context['sort_by'] == 'views' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt['views'], $context['sort_by'] == 'views' ? '<img class="sort" src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.png" alt="" />' : '', '</a></th>';
  157. // Show a "select all" box for quick moderation?
  158. if (empty($context['can_quick_mod']))
  159. echo '
  160. <th scope="col" class="lefttext last_th" width="22%"><a href="', $scripturl, '?board=', $context['current_board'], '.', $context['start'], ';sort=last_post', $context['sort_by'] == 'last_post' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt['last_post'], $context['sort_by'] == 'last_post' ? '<img class="sort" src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.png" alt="" />' : '', '</a></th>';
  161. else
  162. echo '
  163. <th scope="col" class="lefttext" width="22%"><a href="', $scripturl, '?board=', $context['current_board'], '.', $context['start'], ';sort=last_post', $context['sort_by'] == 'last_post' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt['last_post'], $context['sort_by'] == 'last_post' ? '<img class="sort" src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.png" alt="" />' : '', '</a></th>';
  164. // Show a "select all" box for quick moderation?
  165. if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] == 1)
  166. echo '
  167. <th scope="col" class="last_th" width="24"><input type="checkbox" onclick="invertAll(this, this.form, \'topics[]\');" class="input_check" /></th>';
  168. // If it's on in "image" mode, don't show anything but the column.
  169. elseif (!empty($context['can_quick_mod']))
  170. echo '
  171. <th class="last_th" width="4%">&nbsp;</th>';
  172. }
  173. // No topics.... just say, "sorry bub".
  174. else
  175. echo '
  176. <th scope="col" class="first_th" width="8%">&nbsp;</th>
  177. <th colspan="3"><strong>', $txt['msg_alert_none'], '</strong></th>
  178. <th scope="col" class="last_th" width="8%">&nbsp;</th>';
  179. echo '
  180. </tr>
  181. </thead>
  182. <tbody>';
  183. // If this person can approve items and we have some awaiting approval tell them.
  184. if (!empty($context['unapproved_posts_message']))
  185. {
  186. echo '
  187. <tr class="windowbg2">
  188. <td colspan="', !empty($context['can_quick_mod']) ? '6' : '5', '">
  189. <span class="alert">!</span> ', $context['unapproved_posts_message'], '
  190. </td>
  191. </tr>';
  192. }
  193. foreach ($context['topics'] as $topic)
  194. {
  195. // Is this topic pending approval, or does it have any posts pending approval?
  196. if ($context['can_approve_posts'] && $topic['unapproved_posts'])
  197. $color_class = !$topic['approved'] ? 'approvetbg' : 'approvebg';
  198. // We start with locked and sticky topics.
  199. elseif ($topic['is_sticky'] && $topic['is_locked'])
  200. $color_class = 'stickybg locked_sticky';
  201. // Sticky topics should get a different color, too.
  202. elseif ($topic['is_sticky'])
  203. $color_class = 'stickybg';
  204. // Locked topics get special treatment as well.
  205. elseif ($topic['is_locked'])
  206. $color_class = 'lockedbg';
  207. // Last, but not least: regular topics.
  208. else
  209. $color_class = 'windowbg';
  210. // Some columns require a different shade of the color class.
  211. $alternate_class = $color_class . '2';
  212. // [WIP] There is trial code here to hide the topic icon column. Hardly anyone will miss it.
  213. // [WIP] Markup can be cleaned up later. CSS can go in the CSS files later.
  214. echo '
  215. <tr>
  216. <td class="', $color_class, ' icon1" style="display: none;">
  217. <img src="', $settings['images_url'], '/topic/', $topic['class'], '.png" alt="" />
  218. </td>
  219. <td class="', $color_class, ' icon2">
  220. <div style="position: relative; width: 40px; margin: auto;">
  221. <img src="', $topic['first_post']['icon_url'], '" alt="" />
  222. ', $topic['is_posted_in'] ? '<img src="'. $settings['images_url']. '/icons/profile_sm.png" alt="" style="position: absolute; z-index: 5; right: 4px; bottom: -3px;" />' : '','
  223. </div>
  224. </td>
  225. <td class="', $alternate_class, ' subject">
  226. <div ', (!empty($topic['quick_mod']['modify']) ? 'id="topic_' . $topic['first_post']['id'] . '" onmouseout="mouse_on_div = 0;" onmouseover="mouse_on_div = 1;" ondblclick="modify_topic(\'' . $topic['id'] . '\', \'' . $topic['first_post']['id'] . '\');"' : ''), '>';
  227. // [WIP] Methinks the orange icons look better if they aren't all over the page.
  228. // Is this topic new? (assuming they are logged in!)
  229. if ($topic['new'] && $context['user']['is_logged'])
  230. echo '
  231. <a href="', $topic['new_href'], '" id="newicon' . $topic['first_post']['id'] . '"><span class="new_posts">' . $txt['new'] . '</span></a>';
  232. echo '
  233. ', $topic['is_sticky'] ? '<strong>' : '', '<span class="preview" title="', $topic[(empty($settings['message_index_preview_first']) ? 'last_post' : 'first_post')]['preview'], '"><span id="msg_' . $topic['first_post']['id'] . '">', $topic['first_post']['link'], ($context['can_approve_posts'] && !$topic['approved'] ? '&nbsp;<em>(' . $txt['awaiting_approval'] . ')</em>' : ''), '</span></span>', $topic['is_sticky'] ? '</strong>' : '', '
  234. <p>', $txt['started_by'], ' ', $topic['first_post']['member']['link'], '
  235. <small id="pages' . $topic['first_post']['id'] . '">', $topic['pages'], '</small>
  236. </p>
  237. </div>
  238. </td>
  239. <td class="', $color_class, ' stats">
  240. ', $topic['replies'], ' ', $txt['replies'], '
  241. <br />
  242. ', $topic['views'], ' ', $txt['views'], '
  243. </td>
  244. <td class="', $alternate_class, ' lastpost">
  245. <a href="', $topic['last_post']['href'], '"><img src="', $settings['images_url'], '/icons/last_post.png" alt="', $txt['last_post'], '" title="', $txt['last_post'], '" /></a>
  246. ', $topic['last_post']['time'], '<br />
  247. ', $txt['by'], ' ', $topic['last_post']['member']['link'], '
  248. </td>';
  249. // Show the quick moderation options?
  250. if (!empty($context['can_quick_mod']))
  251. {
  252. echo '
  253. <td class="', $color_class, ' moderation" align="center">';
  254. if ($options['display_quick_mod'] == 1)
  255. echo '
  256. <input type="checkbox" name="topics[]" value="', $topic['id'], '" class="input_check" />';
  257. else
  258. {
  259. // Check permissions on each and show only the ones they are allowed to use.
  260. if ($topic['quick_mod']['remove'])
  261. echo '<a href="', $scripturl, '?action=quickmod;board=', $context['current_board'], '.', $context['start'], ';actions[', $topic['id'], ']=remove;', $context['session_var'], '=', $context['session_id'], '" onclick="return confirm(\'', $txt['quickmod_confirm'], '\');"><img src="', $settings['images_url'], '/icons/quick_remove.png" width="16" alt="', $txt['remove_topic'], '" title="', $txt['remove_topic'], '" /></a>';
  262. if ($topic['quick_mod']['lock'])
  263. echo '<a href="', $scripturl, '?action=quickmod;board=', $context['current_board'], '.', $context['start'], ';actions[', $topic['id'], ']=lock;', $context['session_var'], '=', $context['session_id'], '" onclick="return confirm(\'', $txt['quickmod_confirm'], '\');"><img src="', $settings['images_url'], '/icons/quick_lock.png" width="16" alt="', $txt['set_lock'], '" title="', $txt['set_lock'], '" /></a>';
  264. if ($topic['quick_mod']['lock'] || $topic['quick_mod']['remove'])
  265. echo '<br />';
  266. if ($topic['quick_mod']['sticky'])
  267. echo '<a href="', $scripturl, '?action=quickmod;board=', $context['current_board'], '.', $context['start'], ';actions[', $topic['id'], ']=sticky;', $context['session_var'], '=', $context['session_id'], '" onclick="return confirm(\'', $txt['quickmod_confirm'], '\');"><img src="', $settings['images_url'], '/icons/quick_sticky.png" width="16" alt="', $txt['set_sticky'], '" title="', $txt['set_sticky'], '" /></a>';
  268. if ($topic['quick_mod']['move'])
  269. echo '<a href="', $scripturl, '?action=movetopic;current_board=', $context['current_board'], ';board=', $context['current_board'], '.', $context['start'], ';topic=', $topic['id'], '.0"><img src="', $settings['images_url'], '/icons/quick_move.png" width="16" alt="', $txt['move_topic'], '" title="', $txt['move_topic'], '" /></a>';
  270. }
  271. echo '
  272. </td>';
  273. }
  274. echo '
  275. </tr>';
  276. }
  277. if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] == 1 && !empty($context['topics']))
  278. {
  279. echo '
  280. <tr class="titlebg">
  281. <td colspan="6" align="right">
  282. <select class="qaction" name="qaction"', $context['can_move'] ? ' onchange="this.form.moveItTo.disabled = (this.options[this.selectedIndex].value != \'move\');"' : '', '>
  283. <option value="">--------</option>';
  284. foreach ($context['qmod_actions'] as $qmod_action)
  285. if ($context['can_' . $qmod_action])
  286. echo '
  287. <option value="' . $qmod_action . '">' . $txt['quick_mod_' . $qmod_action] . '</option>';
  288. echo '
  289. </select>';
  290. // Show a list of boards they can move the topic to.
  291. if ($context['can_move'])
  292. {
  293. echo '
  294. <select class="qaction" id="moveItTo" name="move_to" disabled="disabled">';
  295. foreach ($context['move_to_boards'] as $category)
  296. {
  297. echo '
  298. <optgroup label="', $category['name'], '">';
  299. foreach ($category['boards'] as $board)
  300. echo '
  301. <option value="', $board['id'], '"', $board['selected'] ? ' selected="selected"' : '', '>', $board['child_level'] > 0 ? str_repeat('==', $board['child_level'] - 1) . '=&gt;' : '', ' ', $board['name'], '</option>';
  302. echo '
  303. </optgroup>';
  304. }
  305. echo '
  306. </select>';
  307. }
  308. echo '
  309. <input type="submit" value="', $txt['quick_mod_go'], '" onclick="return document.forms.quickModForm.qaction.value != \'\' &amp;&amp; confirm(\'', $txt['quickmod_confirm'], '\');" class="button_submit qaction" />
  310. </td>
  311. </tr>';
  312. }
  313. echo '
  314. </tbody>
  315. </table>
  316. </div>';
  317. // Finish off the form - again.
  318. if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] > 0 && !empty($context['topics']))
  319. echo '
  320. <input type="hidden" name="' . $context['session_var'] . '" value="' . $context['session_id'] . '" />
  321. </form>';
  322. echo '
  323. <div class="pagesection">
  324. ', template_button_strip($context['normal_buttons'], 'right'), '
  325. ', !empty($modSettings['topbottomEnable']) ? $context['menu_separator'] . '<a href="#top" class="topbottom floatleft">' . $txt['go_up'] . '</a>' : '', '
  326. <div class="pagelinks">', $context['page_index'], '</div>
  327. </div>';
  328. }
  329. // Show breadcrumbs at the bottom too.
  330. theme_linktree();
  331. echo '
  332. <div class="tborder" id="topic_icons">
  333. <div class="description">
  334. <p class="floatright" id="message_index_jump_to">&nbsp;</p>';
  335. if (!$context['no_topic_listing'])
  336. echo '
  337. <p class="floatleft">', !empty($modSettings['enableParticipation']) && $context['user']['is_logged'] ? '
  338. <img src="' . $settings['images_url'] . '/icons/profile_sm.png" alt="" class="centericon" /> ' . $txt['participation_caption'] . '<br />' : '', '
  339. <img src="' . $settings['images_url'] . '/topic/normal_post.png" alt="" class="centericon" /> ' . $txt['normal_topic'] . '<br />
  340. <img src="' . $settings['images_url'] . '/topic/hot_post.png" alt="" class="centericon" /> ' . sprintf($txt['hot_topics'], $modSettings['hotTopicPosts']) . '<br />
  341. <img src="' . $settings['images_url'] . '/topic/veryhot_post.png" alt="" class="centericon" /> ' . sprintf($txt['very_hot_topics'], $modSettings['hotTopicVeryPosts']) . '
  342. </p>
  343. <p>
  344. <img src="' . $settings['images_url'] . '/icons/quick_lock.png" alt="" class="centericon" /> ' . $txt['locked_topic'] . '<br />' . ($modSettings['enableStickyTopics'] == '1' ? '
  345. <img src="' . $settings['images_url'] . '/icons/quick_sticky.png" alt="" class="centericon" /> ' . $txt['sticky_topic'] . '<br />' : '') . ($modSettings['pollMode'] == '1' ? '
  346. <img src="' . $settings['images_url'] . '/topic/normal_poll.png" alt="" class="centericon" /> ' . $txt['poll'] : '') . '
  347. </p>';
  348. echo '
  349. <script type="text/javascript"><!-- // --><![CDATA[
  350. if (typeof(window.XMLHttpRequest) != "undefined")
  351. aJumpTo[aJumpTo.length] = new JumpTo({
  352. sContainerId: "message_index_jump_to",
  353. sJumpToTemplate: "<label class=\"smalltext\" for=\"%select_id%\">', $context['jump_to']['label'], ':<" + "/label> %dropdown_list%",
  354. iCurBoardId: ', $context['current_board'], ',
  355. iCurBoardChildLevel: ', $context['jump_to']['child_level'], ',
  356. sCurBoardName: "', $context['jump_to']['board_name'], '",
  357. sBoardChildLevelIndicator: "==",
  358. sBoardPrefix: "=> ",
  359. sCatSeparator: "-----------------------------",
  360. sCatPrefix: "",
  361. sGoButtonLabel: "', $txt['quick_mod_go'], '"
  362. });
  363. // ]]></script>
  364. <br class="clear" />
  365. </div>
  366. </div>';
  367. // Javascript for inline editing.
  368. echo '
  369. <script type="text/javascript" src="' . $settings['default_theme_url'] . '/scripts/topic.js"></script>
  370. <script type="text/javascript"><!-- // --><![CDATA[
  371. // Hide certain bits during topic edit.
  372. hide_prefixes.push("lockicon", "stickyicon", "pages", "newicon");
  373. // Use it to detect when we\'ve stopped editing.
  374. document.onclick = modify_topic_click;
  375. var mouse_on_div;
  376. // ]]></script>';
  377. }
  378. ?>