BoardIndex.template.php 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485
  1. <?php
  2. /**
  3. * Simple Machines Forum (SMF)
  4. *
  5. * @package SMF
  6. * @author Simple Machines
  7. * @copyright 2011 Simple Machines
  8. * @license http://www.simplemachines.org/about/smf/license.php BSD
  9. *
  10. * @version 2.1 Alpha 1
  11. */
  12. function template_main()
  13. {
  14. global $context, $settings, $options, $txt, $scripturl, $modSettings;
  15. // Show some statistics if stat info is off.
  16. if (!$settings['show_stats_index'])
  17. echo '
  18. <div id="index_common_stats">
  19. ', $txt['members'], ': ', $context['common_stats']['total_members'], ' &nbsp;&#8226;&nbsp; ', $txt['posts_made'], ': ', $context['common_stats']['total_posts'], ' &nbsp;&#8226;&nbsp; ', $txt['topics'], ': ', $context['common_stats']['total_topics'], '
  20. ', ($settings['show_latest_member'] ? ' ' . $txt['welcome_member'] . ' <strong>' . $context['common_stats']['latest_member']['link'] . '</strong>' . $txt['newest_member'] : '') , '
  21. </div>';
  22. // Show the news fader? (assuming there are things to show...)
  23. if ($settings['show_newsfader'] && !empty($context['fader_news_lines']))
  24. {
  25. echo '
  26. <div id="newsfader">
  27. <div class="cat_bar">
  28. <h3 class="catbg">
  29. <img id="newsupshrink" src="', $settings['images_url'], '/collapse.png" alt="*" title="', $txt['upshrink_description'], '" align="bottom" style="display: none;" />
  30. ', $txt['news'], '
  31. </h3>
  32. </div>
  33. <ul class="reset" id="smfFadeScroller"', empty($options['collapse_news_fader']) ? '' : ' style="display: none;"', '>';
  34. foreach ($context['news_lines'] as $news)
  35. echo '
  36. <li>', $news, '</li>';
  37. echo '
  38. </ul>
  39. </div>
  40. <script type="text/javascript" src="', $settings['default_theme_url'], '/scripts/fader.js"></script>
  41. <script type="text/javascript"><!-- // --><![CDATA[
  42. // Create a news fader object.
  43. var oNewsFader = new smc_NewsFader({
  44. sFaderControlId: \'smfFadeScroller\',
  45. sItemTemplate: ', JavaScriptEscape('<strong>%1$s</strong>'), ',
  46. iFadeDelay: ', empty($settings['newsfader_time']) ? 5000 : $settings['newsfader_time'], '
  47. });
  48. // Create the news fader toggle.
  49. var smfNewsFadeToggle = new smc_Toggle({
  50. bToggleEnabled: true,
  51. bCurrentlyCollapsed: ', empty($options['collapse_news_fader']) ? 'false' : 'true', ',
  52. aSwappableContainers: [
  53. \'smfFadeScroller\'
  54. ],
  55. aSwapImages: [
  56. {
  57. sId: \'newsupshrink\',
  58. srcExpanded: smf_images_url + \'/collapse.png\',
  59. altExpanded: ', JavaScriptEscape($txt['upshrink_description']), ',
  60. srcCollapsed: smf_images_url + \'/expand.png\',
  61. altCollapsed: ', JavaScriptEscape($txt['upshrink_description']), '
  62. }
  63. ],
  64. oThemeOptions: {
  65. bUseThemeSettings: ', $context['user']['is_guest'] ? 'false' : 'true', ',
  66. sOptionName: \'collapse_news_fader\',
  67. sSessionVar: smf_session_var,
  68. sSessionId: smf_session_id
  69. },
  70. oCookieOptions: {
  71. bUseCookie: ', $context['user']['is_guest'] ? 'true' : 'false', ',
  72. sCookieName: \'newsupshrink\'
  73. }
  74. });
  75. // ]]></script>';
  76. }
  77. echo '
  78. <div id="boardindex_table" class="boardindex_table">
  79. <table class="table_list">';
  80. /* Each category in categories is made up of:
  81. id, href, link, name, is_collapsed (is it collapsed?), can_collapse (is it okay if it is?),
  82. new (is it new?), collapse_href (href to collapse/expand), collapse_image (up/down image),
  83. and boards. (see below.) */
  84. foreach ($context['categories'] as $category)
  85. {
  86. // If theres no parent boards we can see, avoid showing an empty category (unless its collapsed)
  87. if (empty($category['boards']) && !$category['is_collapsed'])
  88. continue;
  89. echo '
  90. <tbody class="header" id="category_', $category['id'], '">
  91. <tr>
  92. <td colspan="4">
  93. <div class="cat_bar">
  94. <h3 class="catbg">';
  95. // If this category even can collapse, show a link to collapse it.
  96. if ($category['can_collapse'])
  97. echo '
  98. <a class="collapse" href="', $category['collapse_href'], '" title="' ,$category['is_collapsed'] ? $txt['show'] : $txt['hide'] ,'">', $category['collapse_image'], '</a>';
  99. if (!$context['user']['is_guest'] && !empty($category['show_unread']))
  100. echo '
  101. <a class="unreadlink" href="', $scripturl, '?action=unread;c=', $category['id'], '">', $txt['view_unread_category'], '</a>';
  102. echo '
  103. ', $category['link'], '
  104. </h3>
  105. </div>
  106. </td>
  107. </tr>
  108. </tbody>';
  109. // Assuming the category hasn't been collapsed...
  110. if (!$category['is_collapsed'])
  111. {
  112. echo '
  113. <tbody class="content" id="category_', $category['id'], '_boards">';
  114. /* Each board in each category's boards has:
  115. new (is it new?), id, name, description, moderators (see below), link_moderators (just a list.),
  116. children (see below.), link_children (easier to use.), children_new (are they new?),
  117. topics (# of), posts (# of), link, href, and last_post. (see below.) */
  118. foreach ($category['boards'] as $board)
  119. {
  120. echo '
  121. <tr id="board_', $board['id'], '" class="windowbg2">
  122. <td class="windowbg icon"', !empty($board['children']) ? ' rowspan="2"' : '', '>
  123. <a href="', ($board['is_redirect'] || $context['user']['is_guest'] ? $board['href'] : $scripturl . '?action=unread;board=' . $board['id'] . '.0;children'), '">';
  124. // If the board or children is new, show an indicator.
  125. if ($board['new'] || $board['children_new'])
  126. echo '
  127. <img src="', $settings['images_url'], '/', $context['theme_variant_url'], 'on', $board['new'] ? '' : '2', '.png" alt="', $txt['new_posts'], '" title="', $txt['new_posts'], '" />';
  128. // Is it a redirection board?
  129. elseif ($board['is_redirect'])
  130. echo '
  131. <img src="', $settings['images_url'], '/', $context['theme_variant_url'], 'redirect.png" alt="*" title="*" />';
  132. // No new posts at all! The agony!!
  133. else
  134. echo '
  135. <img src="', $settings['images_url'], '/', $context['theme_variant_url'], 'off.png" alt="', $txt['old_posts'], '" title="', $txt['old_posts'], '" />';
  136. echo '
  137. </a>
  138. </td>
  139. <td class="info">
  140. <a class="subject" href="', $board['href'], '" name="b', $board['id'], '">', $board['name'], '</a>';
  141. // Has it outstanding posts for approval?
  142. if ($board['can_approve_posts'] && ($board['unapproved_posts'] || $board['unapproved_topics']))
  143. echo '
  144. <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>';
  145. echo '
  146. <p>', $board['description'] , '</p>';
  147. // Show the "Moderators: ". Each has name, href, link, and id. (but we're gonna use link_moderators.)
  148. if (!empty($board['moderators']))
  149. echo '
  150. <p class="moderators">', count($board['moderators']) == 1 ? $txt['moderator'] : $txt['moderators'], ': ', implode(', ', $board['link_moderators']), '</p>';
  151. // Show some basic information about the number of posts, etc.
  152. echo '
  153. </td>
  154. <td class="windowbg stats">
  155. <p>', comma_format($board['posts']), ' ', $board['is_redirect'] ? $txt['redirects'] : $txt['posts'], ' <br />
  156. ', $board['is_redirect'] ? '' : comma_format($board['topics']) . ' ' . $txt['board_topics'], '
  157. </p>
  158. </td>
  159. <td class="lastpost">';
  160. if (!empty($board['last_post']['id']))
  161. echo '
  162. <p>', $board['last_post']['last_post_message'], '</p>';
  163. echo '
  164. </td>
  165. </tr>';
  166. // Show the "Child Boards: ". (there's a link_children but we're going to bold the new ones...)
  167. if (!empty($board['children']))
  168. {
  169. // Sort the links into an array with new boards bold so it can be imploded.
  170. $children = array();
  171. /* Each child in each board's children has:
  172. id, name, description, new (is it new?), topics (#), posts (#), href, link, and last_post. */
  173. foreach ($board['children'] as $child)
  174. {
  175. if (!$child['is_redirect'])
  176. $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 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>';
  177. else
  178. $child['link'] = '<a href="' . $child['href'] . '" title="' . comma_format($child['posts']) . ' ' . $txt['redirects'] . '">' . $child['name'] . '</a>';
  179. // Has it posts awaiting approval?
  180. if ($child['can_approve_posts'] && ($child['unapproved_posts'] || $child['unapproved_topics']))
  181. $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>';
  182. $children[] = $child['new'] ? '<strong>' . $child['link'] . '</strong>' : $child['link'];
  183. }
  184. echo '
  185. <tr id="board_', $board['id'], '_children" class="windowbg2">
  186. <td colspan="3" class="windowbg children">
  187. <p><strong>', $txt['parent_boards'], '</strong>: ', implode(', ', $children), '</p>
  188. </td>
  189. </tr>';
  190. }
  191. }
  192. echo '
  193. </tbody>';
  194. }
  195. echo '
  196. <tbody class="divider">
  197. <tr>
  198. <td colspan="4"></td>
  199. </tr>
  200. </tbody>';
  201. }
  202. echo '
  203. </table>
  204. </div>';
  205. if ($context['user']['is_logged'])
  206. {
  207. echo '
  208. <div id="posting_icons" class="floatleft">';
  209. echo '
  210. <ul class="reset">
  211. <li class="floatleft"><img src="', $settings['images_url'], '/', $context['theme_variant_url'], 'new_some.png" alt="" /> ', $txt['new_posts'], '</li>
  212. <li class="floatleft"><img src="', $settings['images_url'], '/', $context['theme_variant_url'], 'new_none.png" alt="" /> ', $txt['old_posts'], '</li>
  213. <li class="floatleft"><img src="', $settings['images_url'], '/', $context['theme_variant_url'], 'new_redirect.png" alt="" /> ', $txt['redirect_board'], '</li>
  214. </ul>
  215. </div>';
  216. // Show the mark all as read button?
  217. if ($settings['show_mark_read'] && !empty($context['categories']))
  218. echo '<div class="mark_read">', template_button_strip($context['mark_read_button'], 'right'), '</div>';
  219. }
  220. else
  221. {
  222. echo '
  223. <div id="posting_icons" class="flow_hidden">
  224. <ul class="reset">
  225. <li class="floatleft"><img src="', $settings['images_url'], '/new_none.png" alt="" /> ', $txt['old_posts'], '</li>
  226. <li class="floatleft"><img src="', $settings['images_url'], '/new_redirect.png" alt="" /> ', $txt['redirect_board'], '</li>
  227. </ul>
  228. </div>';
  229. }
  230. template_info_center();
  231. }
  232. function template_info_center()
  233. {
  234. global $context, $settings, $options, $txt, $scripturl, $modSettings;
  235. // Here's where the "Info Center" starts...
  236. echo '
  237. <div class="roundframe" id="info_center">
  238. <div class="cat_bar">
  239. <h3 class="catbg">
  240. <img class="icon" id="upshrink_ic" src="', $settings['images_url'], '/collapse.png" alt="*" title="', $txt['upshrink_description'], '" style="display: none;" />
  241. <a href="#" id="upshrink_link">', sprintf($txt['info_center_title'], $context['forum_name_html_safe']), '</a>
  242. </h3>
  243. </div>
  244. <div id="upshrinkHeaderIC"', empty($options['collapse_header_ic']) ? '' : ' style="display: none;"', '>';
  245. // This is the "Recent Posts" bar.
  246. if (!empty($settings['number_recent_posts']) && (!empty($context['latest_posts']) || !empty($context['latest_post'])))
  247. {
  248. echo '
  249. <div class="title_barIC">
  250. <h4 class="titlebg">
  251. <a href="', $scripturl, '?action=recent"><img class="icon" src="', $settings['images_url'], '/post/xx.png" alt="" />', $txt['recent_posts'], '</a>
  252. </h4>
  253. </div>
  254. <div class="hslice" id="recent_posts_content">
  255. <div class="entry-title" style="display: none;">', $context['forum_name_html_safe'], ' - ', $txt['recent_posts'], '</div>
  256. <div class="entry-content" style="display: none;">
  257. <a rel="feedurl" href="', $scripturl, '?action=.xml;type=webslice">', $txt['subscribe_webslice'], '</a>
  258. </div>';
  259. // Only show one post.
  260. if ($settings['number_recent_posts'] == 1)
  261. {
  262. // latest_post has link, href, time, subject, short_subject (shortened with...), and topic. (its id.)
  263. echo '
  264. <p id="infocenter_onepost" class="inline">
  265. <a href="', $scripturl, '?action=recent">', $txt['recent_view'], '</a>&nbsp;&quot;', $context['latest_post']['link'], '&quot; ', $txt['recent_updated'], ' (', $context['latest_post']['time'], ')<br />
  266. </p>';
  267. }
  268. // Show lots of posts.
  269. elseif (!empty($context['latest_posts']))
  270. {
  271. echo '
  272. <dl id="ic_recentposts">';
  273. /* Each post in latest_posts has:
  274. board (with an id, name, and link.), topic (the topic's id.), poster (with id, name, and link.),
  275. subject, short_subject (shortened with...), time, link, and href. */
  276. foreach ($context['latest_posts'] as $post)
  277. echo '
  278. <dt>
  279. <strong>', $post['link'], '</strong> ', $txt['by'], ' ', $post['poster']['link'], ' (', $post['board']['link'], ')
  280. </dt>
  281. <dd>', $post['time'], '</dd>';
  282. echo '
  283. </dl>';
  284. }
  285. echo '
  286. </div>';
  287. }
  288. // Show information about events, birthdays, and holidays on the calendar.
  289. if ($context['show_calendar'])
  290. {
  291. echo '
  292. <div class="title_barIC">
  293. <h4 class="titlebg">
  294. <a href="', $scripturl, '?action=calendar' . '"><img class="icon" src="', $settings['images_url'], '/icons/calendar.png', '" alt="" />', $context['calendar_only_today'] ? $txt['calendar_today'] : $txt['calendar_upcoming'], '</a>
  295. </h4>
  296. </div>';
  297. // Holidays like "Christmas", "Chanukah", and "We Love [Unknown] Day" :P.
  298. if (!empty($context['calendar_holidays']))
  299. echo '
  300. <p class="inline holiday">', $txt['calendar_prompt'], ' ', implode(', ', $context['calendar_holidays']), '</p>';
  301. // People's birthdays. Like mine. And yours, I guess. Kidding.
  302. if (!empty($context['calendar_birthdays']))
  303. {
  304. echo '
  305. <p class="inline">
  306. <span class="birthday">', $context['calendar_only_today'] ? $txt['birthdays'] : $txt['birthdays_upcoming'], '</span>';
  307. // Each member in calendar_birthdays has: id, name (person), age (if they have one set?), is_last. (last in list?), and is_today (birthday is today?)
  308. foreach ($context['calendar_birthdays'] as $member)
  309. echo '
  310. <a href="', $scripturl, '?action=profile;u=', $member['id'], '">', $member['is_today'] ? '<strong class="fix_rtl_names">' : '', $member['name'], $member['is_today'] ? '</strong>' : '', isset($member['age']) ? ' (' . $member['age'] . ')' : '', '</a>', $member['is_last'] ? '' : ', ';
  311. echo '
  312. </p>';
  313. }
  314. // Events like community get-togethers.
  315. if (!empty($context['calendar_events']))
  316. {
  317. echo '
  318. <p class="inline">
  319. <span class="event">', $context['calendar_only_today'] ? $txt['events'] : $txt['events_upcoming'], '</span> ';
  320. // Each event in calendar_events should have:
  321. // title, href, is_last, can_edit (are they allowed?), modify_href, and is_today.
  322. foreach ($context['calendar_events'] as $event)
  323. echo '
  324. ', $event['can_edit'] ? '<a href="' . $event['modify_href'] . '" title="' . $txt['calendar_edit'] . '"><img src="' . $settings['images_url'] . '/icons/calendar_modify.png" alt="*" class="centericon" /></a> ' : '', $event['href'] == '' ? '' : '<a href="' . $event['href'] . '">', $event['is_today'] ? '<strong>' . $event['title'] . '</strong>' : $event['title'], $event['href'] == '' ? '' : '</a>', $event['is_last'] ? '<br />' : ', ';
  325. echo '
  326. </p>';
  327. }
  328. }
  329. // Show statistical style information...
  330. if ($settings['show_stats_index'])
  331. {
  332. echo '
  333. <div class="title_barIC">
  334. <h4 class="titlebg">
  335. <a href="', $scripturl, '?action=stats"><img class="icon" src="', $settings['images_url'], '/icons/info.png" alt="" />', $txt['forum_stats'], '</a>
  336. </h4>
  337. </div>
  338. <p class="inline">
  339. ', $context['common_stats']['boardindex_total_posts'], '', !empty($settings['show_latest_member']) ? ' - '. $txt['latest_member'] . ': <strong> ' . $context['common_stats']['latest_member']['link'] . '</strong>' : '', '<br />
  340. ', (!empty($context['latest_post']) ? $txt['latest_post'] . ': <strong>&quot;' . $context['latest_post']['link'] . '&quot;</strong> ( ' . $context['latest_post']['time'] . ' )<br />' : ''), '
  341. <a href="', $scripturl, '?action=recent">', $txt['recent_view'], '</a>', $context['show_stats'] ? '&nbsp;&nbsp;&nbsp;<a href="' . $scripturl . '?action=stats">' . $txt['more_stats'] . '</a>' : '', '
  342. </p>';
  343. }
  344. // "Users online" - in order of activity.
  345. echo '
  346. <div class="title_barIC">
  347. <h4 class="titlebg">
  348. ', $context['show_who'] ? '<a href="' . $scripturl . '?action=who' . '">' : '', '<img class="icon" src="', $settings['images_url'], '/icons/online.png', '" alt="" />', $txt['online_users'], '', $context['show_who'] ? '</a>' : '', '
  349. </h4>
  350. </div>
  351. <p class="inline">
  352. ', $context['show_who'] ? '<a href="' . $scripturl . '?action=who">' : '', '<strong>', $txt['online'], ': </strong>', comma_format($context['num_guests']), ' ', $context['num_guests'] == 1 ? $txt['guest'] : $txt['guests'], ', ' . comma_format($context['num_users_online']), ' ', $context['num_users_online'] == 1 ? $txt['user'] : $txt['users'];
  353. // Handle hidden users and buddies.
  354. $bracketList = array();
  355. if ($context['show_buddies'])
  356. $bracketList[] = comma_format($context['num_buddies']) . ' ' . ($context['num_buddies'] == 1 ? $txt['buddy'] : $txt['buddies']);
  357. if (!empty($context['num_spiders']))
  358. $bracketList[] = comma_format($context['num_spiders']) . ' ' . ($context['num_spiders'] == 1 ? $txt['spider'] : $txt['spiders']);
  359. if (!empty($context['num_users_hidden']))
  360. $bracketList[] = comma_format($context['num_users_hidden']) . ' ' . $txt['hidden'];
  361. if (!empty($bracketList))
  362. echo ' (' . implode(', ', $bracketList) . ')';
  363. echo $context['show_who'] ? '</a>' : '', '<br />';
  364. // Assuming there ARE users online... each user in users_online has an id, username, name, group, href, and link.
  365. if (!empty($context['users_online']))
  366. {
  367. echo '
  368. ', sprintf($txt['users_active'], $modSettings['lastActive']), ': ', implode(', ', $context['list_users_online']);
  369. // Showing membergroups?
  370. if (!empty($settings['show_group_key']) && !empty($context['membergroups']))
  371. echo '
  372. <span class="membergroups">[' . implode(',&nbsp;', $context['membergroups']). ']</span>';
  373. }
  374. echo '
  375. </p>
  376. <p class="last">
  377. ', $txt['most_online_today'], ': <strong>', comma_format($modSettings['mostOnlineToday']), '</strong>.
  378. ', $txt['most_online_ever'], ': ', comma_format($modSettings['mostOnline']), ' (', timeformat($modSettings['mostDate']), ')
  379. </p>';
  380. // If they are logged in, but statistical information is off... show a personal message bar.
  381. if ($context['user']['is_logged'] && !$settings['show_stats_index'])
  382. {
  383. echo '
  384. <div class="title_barIC">
  385. <h4 class="titlebg">
  386. ', $context['allow_pm'] ? '<a href="' . $scripturl . '?action=pm">' : '', '<img class="icon" src="', $settings['images_url'], '/message_sm.png" alt="" />', $txt['personal_message'], '', $context['allow_pm'] ? '</a>' : '', '
  387. </h4>
  388. </div>
  389. <p class="pminfo">
  390. ', $txt['you_have'], ' ', comma_format($context['user']['messages']), ' ', $context['user']['messages'] == 1 ? $txt['message_lowercase'] : $txt['msg_alert_messages'], '.... ', $txt['click'], ' <a href="', $scripturl, '?action=pm">', $txt['here'], '</a> ', $txt['to_view'], '
  391. </p>';
  392. }
  393. echo '
  394. </div>
  395. </div>';
  396. // Info center collapse object.
  397. echo '
  398. <script type="text/javascript"><!-- // --><![CDATA[
  399. var oInfoCenterToggle = new smc_Toggle({
  400. bToggleEnabled: true,
  401. bCurrentlyCollapsed: ', empty($options['collapse_header_ic']) ? 'false' : 'true', ',
  402. aSwappableContainers: [
  403. \'upshrinkHeaderIC\'
  404. ],
  405. aSwapImages: [
  406. {
  407. sId: \'upshrink_ic\',
  408. srcExpanded: smf_images_url + \'/collapse.png\',
  409. altExpanded: ', JavaScriptEscape($txt['upshrink_description']), ',
  410. srcCollapsed: smf_images_url + \'/expand.png\',
  411. altCollapsed: ', JavaScriptEscape($txt['upshrink_description']), '
  412. }
  413. ],
  414. aSwapLinks: [
  415. {
  416. sId: \'upshrink_link\',
  417. msgExpanded: ', JavaScriptEscape(sprintf($txt['info_center_title'], $context['forum_name_html_safe'])), ',
  418. msgCollapsed: ', JavaScriptEscape(sprintf($txt['info_center_title'], $context['forum_name_html_safe'])), '
  419. }
  420. ],
  421. oThemeOptions: {
  422. bUseThemeSettings: ', $context['user']['is_guest'] ? 'false' : 'true', ',
  423. sOptionName: \'collapse_header_ic\',
  424. sSessionId: smf_session_id,
  425. sSessionVar: smf_session_var,
  426. },
  427. oCookieOptions: {
  428. bUseCookie: ', $context['user']['is_guest'] ? 'true' : 'false', ',
  429. sCookieName: \'upshrinkIC\'
  430. }
  431. });
  432. // ]]></script>';
  433. }
  434. ?>