2
0

Search.template.php 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567
  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. echo '
  16. <form action="', $scripturl, '?action=search2" method="post" accept-charset="', $context['character_set'], '" name="searchform" id="searchform">
  17. <div class="cat_bar">
  18. <h3 class="catbg">
  19. ', !empty($settings['use_buttons']) ? '<img src="' . $settings['images_url'] . '/buttons/search_hd.png" alt="" class="icon" />' : ' ', $txt['set_parameters'], '
  20. </h3>
  21. </div>';
  22. if (!empty($context['search_errors']))
  23. echo '
  24. <p class="errorbox">', implode('<br />', $context['search_errors']['messages']), '</p>';
  25. if (!empty($context['search_ignored']))
  26. echo '
  27. <p class="noticebox">', $txt['search_warning_ignored_word' . (count($context['search_ignored']) == 1 ? '' : 's')], ': ', implode(', ', $context['search_ignored']), '</p>';
  28. // Simple Search?
  29. if ($context['simple_search'])
  30. {
  31. echo '
  32. <fieldset id="simple_search">
  33. <div class="roundframe">
  34. <div id="search_term_input">
  35. <strong>', $txt['search_for'], ':</strong>
  36. <input type="text" name="search"', !empty($context['search_params']['search']) ? ' value="' . $context['search_params']['search'] . '"' : '', ' maxlength="', $context['search_string_limit'], '" size="40" class="input_text" />
  37. ', $context['require_verification'] ? '' : '&nbsp;<input type="submit" name="s_search" value="' . $txt['search'] . '" class="button_submit" />
  38. </div>';
  39. if (empty($modSettings['search_simple_fulltext']))
  40. echo '
  41. <p class="smalltext">', $txt['search_example'], '</p>';
  42. if ($context['require_verification'])
  43. echo '
  44. <div class="verification>
  45. <strong>', $txt['search_visual_verification_label'], ':</strong>
  46. <br />', template_control_verification($context['visual_verification_id'], 'all'), '<br />
  47. <input id="submit" type="submit" name="s_search" value="' . $txt['search'] . '" class="button_submit" />
  48. </div>';
  49. echo '
  50. <a href="', $scripturl, '?action=search;advanced" onclick="this.href += \';search=\' + escape(document.forms.searchform.search.value);">', $txt['search_advanced'], '</a>
  51. <input type="hidden" name="advanced" value="0" />
  52. </div>
  53. </fieldset>';
  54. }
  55. // Advanced search!
  56. else
  57. {
  58. echo '
  59. <fieldset id="advanced_search">
  60. <div class="roundframe">
  61. <dl class="settings" id="search_options">
  62. <dt class="righttext">
  63. <strong><label for="searchfor">', $txt['search_for'], ':</label></strong>
  64. </dt>
  65. <dd>
  66. <input type="text" name="search" id="searchfor" ', !empty($context['search_params']['search']) ? ' value="' . $context['search_params']['search'] . '"' : '', ' maxlength="', $context['search_string_limit'], '" size="40" class="input_text" />';
  67. if (empty($modSettings['search_simple_fulltext']))
  68. echo '
  69. <em class="smalltext">', $txt['search_example'], '</em>';
  70. echo '
  71. </dd>
  72. <dt class="righttext"><label for="searchtype">',
  73. $txt['search_match'], ':</label>
  74. </dt>
  75. <dd>
  76. <select name="searchtype" id="searchtype">
  77. <option value="1"', empty($context['search_params']['searchtype']) ? ' selected="selected"' : '', '>', $txt['all_words'], '</option>
  78. <option value="2"', !empty($context['search_params']['searchtype']) ? ' selected="selected"' : '', '>', $txt['any_words'], '</option>
  79. </select>
  80. </dd>
  81. <dt class="righttext"><label for="userspec">',
  82. $txt['by_user'], ':</label>
  83. </dt>
  84. <dd>
  85. <input id="userspec" type="text" name="userspec" value="', empty($context['search_params']['userspec']) ? '*' : $context['search_params']['userspec'], '" size="40" class="input_text" />
  86. </dd>
  87. <dt class="righttext"><label for="sort">',
  88. $txt['search_order'], ':</label>
  89. </dt>
  90. <dd>
  91. <select id="sort" name="sort">
  92. <option value="relevance|desc">', $txt['search_orderby_relevant_first'], '</option>
  93. <option value="num_replies|desc">', $txt['search_orderby_large_first'], '</option>
  94. <option value="num_replies|asc">', $txt['search_orderby_small_first'], '</option>
  95. <option value="id_msg|desc">', $txt['search_orderby_recent_first'], '</option>
  96. <option value="id_msg|asc">', $txt['search_orderby_old_first'], '</option>
  97. </select>
  98. </dd>
  99. <dt class="righttext options">',
  100. $txt['search_options'], ':
  101. </dt>
  102. <dd class="options">
  103. <label for="show_complete">', $txt['search_show_complete_messages'], '
  104. <input type="checkbox" name="show_complete" id="show_complete" value="1"', !empty($context['search_params']['show_complete']) ? ' checked="checked"' : '', ' class="input_check" />
  105. </label><br />
  106. <label for="subject_only">', $txt['search_subject_only'], '
  107. <input type="checkbox" name="subject_only" id="subject_only" value="1"', !empty($context['search_params']['subject_only']) ? ' checked="checked"' : '', ' class="input_check" />
  108. </label>
  109. </dd>
  110. <dt class="righttext between">',
  111. $txt['search_post_age'], ':
  112. </dt>
  113. <dd><label for="minage">',
  114. $txt['search_between'], '</label><input type="text" name="minage" id="minage" value="', empty($context['search_params']['minage']) ? '0' : $context['search_params']['minage'], '" size="5" maxlength="4" class="input_text" />&nbsp;<label for="maxage">', $txt['search_and'], '&nbsp;</label><input type="text" name="maxage" id="maxage" value="', empty($context['search_params']['maxage']) ? '9999' : $context['search_params']['maxage'], '" size="5" maxlength="4" class="input_text" /> ', $txt['days_word'], '
  115. </dd>
  116. </dl>
  117. <script type="text/javascript"><!-- // --><![CDATA[
  118. createEventListener(window);
  119. window.addEventListener("load", initSearch, false);
  120. // ]]></script>
  121. <input type="hidden" name="advanced" value="1" />';
  122. // Require an image to be typed to save spamming?
  123. if ($context['require_verification'])
  124. {
  125. echo '
  126. <p>
  127. <strong>', $txt['verification'], ':</strong>
  128. ', template_control_verification($context['visual_verification_id'], 'all'), '
  129. </p>';
  130. }
  131. // If $context['search_params']['topic'] is set, that means we're searching just one topic.
  132. if (!empty($context['search_params']['topic']))
  133. echo '
  134. <p>', $txt['search_specific_topic'], ' &quot;', $context['search_topic']['link'], '&quot;.</p>
  135. <input type="hidden" name="topic" value="', $context['search_topic']['id'], '" />';
  136. echo '
  137. </div>
  138. </fieldset>
  139. ';
  140. if (empty($context['search_params']['topic']))
  141. {
  142. echo '
  143. <fieldset class="flow_hidden">
  144. <div class="roundframe">
  145. <div class="title_bar">
  146. <h4 class="titlebg">
  147. <span id="advanced_panel_toggle" class="toggle_down floatright" style="display: none;"></span>
  148. <a href="#" id="advanced_panel_link">', $txt['choose_board'], '</a>
  149. </h4>
  150. </div>
  151. <div class="flow_auto" id="advanced_panel_div"', $context['boards_check_all'] ? ' style="display: none;"' : '', '>
  152. <ul class="ignoreboards floatleft">';
  153. $i = 0;
  154. $limit = ceil($context['num_boards'] / 2);
  155. foreach ($context['categories'] as $category)
  156. {
  157. echo '
  158. <li class="category">
  159. <a href="javascript:void(0);" onclick="selectBoards([', implode(', ', $category['child_ids']), '], \'searchform\'); return false;">', $category['name'], '</a>
  160. <ul>';
  161. foreach ($category['boards'] as $board)
  162. {
  163. if ($i == $limit)
  164. echo '
  165. </ul>
  166. </li>
  167. </ul>
  168. <ul class="ignoreboards floatright">
  169. <li class="category">
  170. <ul>';
  171. echo '
  172. <li class="board" style="margin-', $context['right_to_left'] ? 'right' : 'left', ': ', $board['child_level'], 'em;">
  173. <label for="brd', $board['id'], '">
  174. <input type="checkbox" id="brd', $board['id'], '" name="brd[', $board['id'], ']" value="', $board['id'], '"', $board['selected'] ? ' checked="checked"' : '', ' class="input_check" /> ', $board['name'], '
  175. </label>
  176. </li>';
  177. $i++;
  178. }
  179. echo '
  180. </ul>
  181. </li>';
  182. }
  183. echo '
  184. </ul>
  185. </div>
  186. <br class="clear" />';
  187. echo '
  188. <div class="padding flow_auto">
  189. <input type="checkbox" name="all" id="check_all" value=""', $context['boards_check_all'] ? ' checked="checked"' : '', ' onclick="invertAll(this, this.form, \'brd\');" class="input_check floatleft" />
  190. <label for="check_all" class="floatleft"><em>', $txt['check_all'], '</em></label>
  191. <input type="submit" name="b_search" value="', $txt['search'], '" class="button_submit" />
  192. </div>
  193. </div>
  194. </fieldset>';
  195. }
  196. echo '
  197. <script type="text/javascript"><!-- // --><![CDATA[
  198. var oAdvancedPanelToggle = new smc_Toggle({
  199. bToggleEnabled: true,
  200. bCurrentlyCollapsed: ', $context['boards_check_all'] ? 'true' : 'false', ',
  201. aSwappableContainers: [
  202. \'advanced_panel_div\'
  203. ],
  204. aSwapImages: [
  205. {
  206. sId: \'advanced_panel_toggle\',
  207. altExpanded: ', JavaScriptEscape($txt['hide']), ',
  208. altCollapsed: ', JavaScriptEscape($txt['show']), '
  209. }
  210. ],
  211. aSwapLinks: [
  212. {
  213. sId: \'advanced_panel_link\',
  214. msgExpanded: ', JavaScriptEscape($txt['choose_board']), ',
  215. msgCollapsed: ', JavaScriptEscape($txt['choose_board']), '
  216. }
  217. ]
  218. });
  219. // ]]></script>
  220. <script type="text/javascript" src="', $settings['default_theme_url'], '/scripts/suggest.js?alp21"></script>
  221. <script type="text/javascript"><!-- // --><![CDATA[
  222. var oAddMemberSuggest = new smc_AutoSuggest({
  223. sSelf: \'oAddMemberSuggest\',
  224. sSessionId: smf_session_id,
  225. sSessionVar: smf_session_var,
  226. sControlId: \'userspec\',
  227. sSearchType: \'member\',
  228. bItemList: false
  229. });
  230. // ]]></script>';
  231. }
  232. echo '
  233. </form>';
  234. }
  235. function template_results()
  236. {
  237. global $context, $settings, $options, $txt, $scripturl, $message;
  238. if (isset($context['did_you_mean']) || empty($context['topics']) || !empty($context['search_ignored']))
  239. {
  240. echo '
  241. <div id="search_results">
  242. <div class="cat_bar">
  243. <h3 class="catbg">
  244. ', $txt['search_adjust_query'], '
  245. </h3>
  246. </div>
  247. <div class="roundframe">';
  248. // Did they make any typos or mistakes, perhaps?
  249. if (isset($context['did_you_mean']))
  250. echo '
  251. <p>', $txt['search_did_you_mean'], ' <a href="', $scripturl, '?action=search2;params=', $context['did_you_mean_params'], '">', $context['did_you_mean'], '</a>.</p>';
  252. if (!empty($context['search_ignored']))
  253. echo '
  254. <p>', $txt['search_warning_ignored_word' . (count($context['search_ignored']) == 1 ? '' : 's')], ': ', implode(', ', $context['search_ignored']), '</p>';
  255. echo '
  256. <form action="', $scripturl, '?action=search2" method="post" accept-charset="', $context['character_set'], '">
  257. <dl class="settings">
  258. <dt class="righttext">
  259. <strong>', $txt['search_for'], ':</strong>
  260. </dt>
  261. <dd>
  262. <input type="text" name="search"', !empty($context['search_params']['search']) ? ' value="' . $context['search_params']['search'] . '"' : '', ' maxlength="', $context['search_string_limit'], '" size="40" class="input_text" />
  263. </dd>
  264. </dl>
  265. <div class="flow_auto" >
  266. <input type="submit" name="edit_search" value="', $txt['search_adjust_submit'], '" class="button_submit" />
  267. <input type="hidden" name="searchtype" value="', !empty($context['search_params']['searchtype']) ? $context['search_params']['searchtype'] : 0, '" />
  268. <input type="hidden" name="userspec" value="', !empty($context['search_params']['userspec']) ? $context['search_params']['userspec'] : '', '" />
  269. <input type="hidden" name="show_complete" value="', !empty($context['search_params']['show_complete']) ? 1 : 0, '" />
  270. <input type="hidden" name="subject_only" value="', !empty($context['search_params']['subject_only']) ? 1 : 0, '" />
  271. <input type="hidden" name="minage" value="', !empty($context['search_params']['minage']) ? $context['search_params']['minage'] : '0', '" />
  272. <input type="hidden" name="maxage" value="', !empty($context['search_params']['maxage']) ? $context['search_params']['maxage'] : '9999', '" />
  273. <input type="hidden" name="sort" value="', !empty($context['search_params']['sort']) ? $context['search_params']['sort'] : 'relevance', '" />
  274. </div>';
  275. if (!empty($context['search_params']['brd']))
  276. foreach ($context['search_params']['brd'] as $board_id)
  277. echo '
  278. <input type="hidden" name="brd[', $board_id, ']" value="', $board_id, '" />';
  279. echo '
  280. </form>
  281. </div>
  282. </div><br />';
  283. }
  284. if ($context['compact'])
  285. {
  286. // Quick moderation set to checkboxes? Oh, how fun :/.
  287. if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1)
  288. echo '
  289. <form action="', $scripturl, '?action=quickmod" method="post" accept-charset="', $context['character_set'], '" name="topicForm">';
  290. echo '
  291. <div class="cat_bar">
  292. <h3 class="catbg">
  293. <span class="floatright">';
  294. if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1)
  295. echo '
  296. <input type="checkbox" onclick="invertAll(this, this.form, \'topics[]\');" class="input_check" />';
  297. echo '
  298. </span>
  299. <img src="' . $settings['images_url'] . '/buttons/search.png" alt="?" class="centericon" />&nbsp;', $txt['mlist_search_results'],':&nbsp;',$context['search_params']['search'],'
  300. </h3>
  301. </div>';
  302. // was anything even found?
  303. if (!empty($context['topics']))
  304. echo'
  305. <div class="pagesection">
  306. <span>', $context['page_index'], '</span>
  307. </div>';
  308. else
  309. echo '
  310. <div class="roundframe">', $txt['find_no_results'], '</div>';
  311. // while we have results to show ...
  312. while ($topic = $context['get_topics']())
  313. {
  314. $color_class = '';
  315. if ($topic['is_sticky'])
  316. $color_class = 'stickybg';
  317. if ($topic['is_locked'])
  318. $color_class .= 'lockedbg';
  319. echo '
  320. <div class="search_results_posts">
  321. <div class="', $message['alternate'] == 0 ? 'windowbg' : 'windowbg2', ' core_posts">
  322. <div class="content flow_auto">';
  323. foreach ($topic['matches'] as $message)
  324. {
  325. echo '
  326. <div class="topic_details floatleft" style="width: 94%">
  327. <div class="counter">', $message['counter'], '</div>
  328. <h5>', $topic['board']['link'], ' / <a href="', $scripturl, '?topic=', $topic['id'], '.msg', $message['id'], '#msg', $message['id'], '">', $message['subject_highlighted'], '</a></h5>
  329. <span class="smalltext">&#171;&nbsp;',$txt['by'],'&nbsp;<strong>', $message['member']['link'], '</strong>&nbsp;',$txt['on'],'&nbsp;<em>', $message['time'], '</em>&nbsp;&#187;</span>
  330. </div>';
  331. if (!empty($options['display_quick_mod']))
  332. {
  333. echo '
  334. <div class="floatright">';
  335. if ($options['display_quick_mod'] == 1)
  336. {
  337. echo '
  338. <input type="checkbox" name="topics[]" value="', $topic['id'], '" class="input_check" />';
  339. }
  340. else
  341. {
  342. if ($topic['quick_mod']['remove'])
  343. echo '
  344. <a href="', $scripturl, '?action=quickmod;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>';
  345. if ($topic['quick_mod']['lock'])
  346. echo '
  347. <a href="', $scripturl, '?action=quickmod;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>';
  348. if ($topic['quick_mod']['lock'] || $topic['quick_mod']['remove'])
  349. echo '
  350. <br />';
  351. if ($topic['quick_mod']['sticky'])
  352. echo '
  353. <a href="', $scripturl, '?action=quickmod;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>';
  354. if ($topic['quick_mod']['move'])
  355. echo '
  356. <a href="', $scripturl, '?action=movetopic;topic=', $topic['id'], '.0"><img src="', $settings['images_url'], '/icons/quick_move.png" width="16" alt="', $txt['move_topic'], '" title="', $txt['move_topic'], '" /></a>';
  357. }
  358. echo '
  359. </div>';
  360. }
  361. if ($message['body_highlighted'] != '')
  362. echo '
  363. <br class="clear" />
  364. <div class="list_posts double_height">', $message['body_highlighted'], '</div>';
  365. }
  366. echo '
  367. </div>
  368. </div>
  369. </div>';
  370. }
  371. if (!empty($context['topics']))
  372. echo '
  373. <div class="pagesection">
  374. <span>', $context['page_index'], '</span>
  375. </div>';
  376. if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && !empty($context['topics']))
  377. {
  378. echo '
  379. <div class="titlebg2" style="padding: 4px;">
  380. <div class="floatright flow_auto">
  381. <select class="qaction" name="qaction"', $context['can_move'] ? ' onchange="this.form.move_to.disabled = (this.options[this.selectedIndex].value != \'move\');"' : '', '>
  382. <option value="">--------</option>';
  383. foreach ($context['qmod_actions'] as $qmod_action)
  384. if ($context['can_' . $qmod_action])
  385. echo '
  386. <option value="' . $qmod_action . '">' . $txt['quick_mod_' . $qmod_action] . '</option>';
  387. echo '
  388. </select>';
  389. if ($context['can_move'])
  390. echo '
  391. <span id="quick_mod_jump_to">&nbsp;</span>';
  392. echo '
  393. <input type="hidden" name="redirect_url" value="', $scripturl . '?action=search2;params=' . $context['params'], '" />
  394. <input type="submit" value="', $txt['quick_mod_go'], '" onclick="return this.form.qaction.value != \'\' &amp;&amp; confirm(\'', $txt['quickmod_confirm'], '\');" class="button_submit" style="float: none;font-size: .8em;"/>
  395. </div>
  396. </div>';
  397. }
  398. if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && !empty($context['topics']))
  399. echo '
  400. <input type="hidden" name="' . $context['session_var'] . '" value="' . $context['session_id'] . '" />
  401. </form>';
  402. }
  403. else
  404. {
  405. echo '
  406. <div class="cat_bar">
  407. <h3 class="catbg">
  408. <img class="centericon" src="' . $settings['images_url'] . '/buttons/search_hd.png" alt="?" />&nbsp;', $txt['mlist_search_results'],':&nbsp;',$context['search_params']['search'],'
  409. </h3>
  410. </div>
  411. <div class="pagesection">
  412. <span>', $context['page_index'], '</span>
  413. </div>';
  414. if (empty($context['topics']))
  415. echo '
  416. <div class="information">(', $txt['search_no_results'], ')</div>';
  417. while ($topic = $context['get_topics']())
  418. {
  419. foreach ($topic['matches'] as $message)
  420. {
  421. echo '
  422. <div class="search_results_posts">
  423. <div class="', $message['alternate'] == 0 ? 'windowbg' : 'windowbg2', ' core_posts">
  424. <div class="content">
  425. <div class="counter">', $message['counter'], '</div>
  426. <div class="topic_details">
  427. <h5>', $topic['board']['link'], ' / <a href="', $scripturl, '?topic=', $topic['id'], '.', $message['start'], ';topicseen#msg', $message['id'], '">', $message['subject_highlighted'], '</a></h5>
  428. <span class="smalltext">&#171;&nbsp;', $txt['message'], ' ', $txt['by'], ' <strong>', $message['member']['link'], ' </strong>', $txt['on'], '&nbsp;<em>', $message['time'], '</em>&nbsp;&#187;</span>
  429. </div>
  430. <div class="list_posts">', $message['body_highlighted'], '</div>';
  431. if ($topic['can_reply'] || $topic['can_mark_notify'])
  432. echo '
  433. <div class="quickbuttons_wrap">
  434. <ul class="reset smalltext quickbuttons">';
  435. // If they *can* reply?
  436. if ($topic['can_reply'])
  437. echo '
  438. <li><a href="', $scripturl . '?action=post;topic=' . $topic['id'] . '.' . $message['start'], '" class="reply_button">', $txt['reply'], '</a></li>';
  439. // If they *can* quote?
  440. if ($topic['can_quote'])
  441. echo '
  442. <li><a href="', $scripturl . '?action=post;topic=' . $topic['id'] . '.' . $message['start'] . ';quote=' . $message['id'] . '" class="quote_button">', $txt['quote_action'], '</a></li>';
  443. // Can we request notification of topics?
  444. if ($topic['can_mark_notify'])
  445. echo '
  446. <li><a href="', $scripturl . '?action=notify;topic=' . $topic['id'] . '.' . $message['start'], '" class="notify_button">', $txt['notify'], '</a></li>';
  447. if ($topic['can_reply'] || $topic['can_mark_notify'])
  448. echo '
  449. </ul>
  450. </div>';
  451. echo '
  452. <br class="clear" />
  453. </div>
  454. </div>
  455. </div>';
  456. }
  457. }
  458. echo '
  459. <div class="pagesection">
  460. <span>', $context['page_index'], '</span>
  461. </div>';
  462. }
  463. // Show a jump to box for easy navigation.
  464. echo '
  465. <br class="clear" />
  466. <div class="smalltext righttext" id="search_jump_to">&nbsp;</div>
  467. <script type="text/javascript"><!-- // --><![CDATA[';
  468. if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && !empty($context['topics']) && $context['can_move'])
  469. echo '
  470. if (typeof(window.XMLHttpRequest) != "undefined")
  471. aJumpTo[aJumpTo.length] = new JumpTo({
  472. sContainerId: "quick_mod_jump_to",
  473. sClassName: "qaction",
  474. sJumpToTemplate: "%dropdown_list%",
  475. sCurBoardName: "', $context['jump_to']['board_name'], '",
  476. sBoardChildLevelIndicator: "==",
  477. sBoardPrefix: "=> ",
  478. sCatSeparator: "-----------------------------",
  479. sCatPrefix: "",
  480. bNoRedirect: true,
  481. bDisabled: true,
  482. sCustomName: "move_to"
  483. });';
  484. echo '
  485. if (typeof(window.XMLHttpRequest) != "undefined")
  486. aJumpTo[aJumpTo.length] = new JumpTo({
  487. sContainerId: "search_jump_to",
  488. sJumpToTemplate: "<label class=\"smalltext\" for=\"%select_id%\">', $context['jump_to']['label'], ':<" + "/label> %dropdown_list%",
  489. iCurBoardId: 0,
  490. iCurBoardChildLevel: 0,
  491. sCurBoardName: "', $context['jump_to']['board_name'], '",
  492. sBoardChildLevelIndicator: "==",
  493. sBoardPrefix: "=> ",
  494. sCatSeparator: "-----------------------------",
  495. sCatPrefix: "",
  496. sGoButtonLabel: "', $txt['quick_mod_go'], '"
  497. });
  498. // ]]></script>';
  499. }
  500. ?>