BoardIndex.template.php 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502
  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'], '<br />
  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 smf_NewsFader({
  44. sSelf: \'oNewsFader\',
  45. sFaderControlId: \'smfFadeScroller\',
  46. sItemTemplate: ', JavaScriptEscape('<strong>%1$s</strong>'), ',
  47. iFadeDelay: ', empty($settings['newsfader_time']) ? 5000 : $settings['newsfader_time'], '
  48. });
  49. // Create the news fader toggle.
  50. var smfNewsFadeToggle = new smc_Toggle({
  51. bToggleEnabled: true,
  52. bCurrentlyCollapsed: ', empty($options['collapse_news_fader']) ? 'false' : 'true', ',
  53. aSwappableContainers: [
  54. \'smfFadeScroller\'
  55. ],
  56. aSwapImages: [
  57. {
  58. sId: \'newsupshrink\',
  59. srcExpanded: smf_images_url + \'/collapse.png\',
  60. altExpanded: ', JavaScriptEscape($txt['upshrink_description']), ',
  61. srcCollapsed: smf_images_url + \'/expand.png\',
  62. altCollapsed: ', JavaScriptEscape($txt['upshrink_description']), '
  63. }
  64. ],
  65. oThemeOptions: {
  66. bUseThemeSettings: ', $context['user']['is_guest'] ? 'false' : 'true', ',
  67. sOptionName: \'collapse_news_fader\',
  68. sSessionVar: smf_session_var,
  69. sSessionId: smf_session_id
  70. },
  71. oCookieOptions: {
  72. bUseCookie: ', $context['user']['is_guest'] ? 'true' : 'false', ',
  73. sCookieName: \'newsupshrink\'
  74. }
  75. });
  76. // ]]></script>';
  77. }
  78. echo ' <a href="#" id="skipnav_target"></a>';
  79. /* Each category in categories is made up of:
  80. id, href, link, name, is_collapsed (is it collapsed?), can_collapse (is it okay if it is?),
  81. new (is it new?), collapse_href (href to collapse/expand), collapse_image (up/down image),
  82. and boards. (see below.) */
  83. foreach ($context['categories'] as $category)
  84. {
  85. // If theres no parent boards we can see, avoid showing an empty category (unless its collapsed)
  86. if (empty($category['boards']) && !$category['is_collapsed'])
  87. continue;
  88. echo '
  89. <div class="category_wrapper">
  90. <div id="category_', $category['id'], '" class="cat_bar">
  91. <h3 class="catbg">';
  92. // If this category even can collapse, show a link to collapse it.
  93. if ($category['can_collapse'])
  94. echo '
  95. <a class="collapse" href="', $category['collapse_href'], '" title="' ,$category['is_collapsed'] ? $txt['show'] : $txt['hide'] ,'">', $category['collapse_image'], '</a>';
  96. if (!$context['user']['is_guest'] && !empty($category['show_unread']))
  97. echo '
  98. <a class="cat_unread" href="', $scripturl, '?action=unread;c=', $category['id'], '" title="', $txt['view_unread_category'], '">', $category['name'], '</a>';
  99. else
  100. echo '
  101. ', $category['name'];
  102. echo '
  103. <span style="margin-left: -999em;">', $category['link'], '</span>
  104. </h3>
  105. </div>';
  106. // Assuming the category hasn't been collapsed...
  107. if (!$category['is_collapsed'])
  108. {
  109. echo '
  110. <ul class="forum_category" id="category_', $category['id'], '_boards">
  111. <li class="titlebg subheader">
  112. <div class="icon">&nbsp;</div>
  113. <div class="info">', $txt['board_name'], '</div>
  114. <div class="stats">
  115. <ul>
  116. <li class="stats">', $txt['forum_stats'], '</li>
  117. <li class="posts">', $txt['posts'], '</li>
  118. <li class="topics">', $txt['topics'], '</li>
  119. </ul>
  120. </div>
  121. <div class="lastpost">', $txt['latest_post'], '</div>
  122. </li>';
  123. /* Each board in each category's boards has:
  124. new (is it new?), id, name, description, moderators (see below), link_moderators (just a list.),
  125. children (see below.), link_children (easier to use.), children_new (are they new?),
  126. topics (# of), posts (# of), link, href, and last_post. (see below.) */
  127. foreach ($category['boards'] as $board)
  128. {
  129. echo '
  130. <li id="board_', $board['id'], '">
  131. <div class="windowbg icon">
  132. <a href="', ($board['is_redirect'] || $context['user']['is_guest'] ? $board['href'] : $scripturl . '?action=unread;board=' . $board['id'] . '.0;children'), '">';
  133. // If the board or children is new, show an indicator.
  134. if ($board['new'] || $board['children_new'])
  135. echo '
  136. <img src="', $settings['images_url'], '/', $context['theme_variant_url'], 'on', $board['new'] ? '' : '2', '.png" alt="', $txt['new_posts'], '" title="', $txt['new_posts'], ' ', $txt['in'], ' ', $board['name'], '" />';
  137. // Is it a redirection board?
  138. elseif ($board['is_redirect'])
  139. echo '
  140. <img src="', $settings['images_url'], '/', $context['theme_variant_url'], 'redirect.png" alt="*" title="*" />';
  141. // No new posts at all! The agony!!
  142. else
  143. echo '
  144. <img src="', $settings['images_url'], '/', $context['theme_variant_url'], 'off.png" alt="', $txt['old_posts'], '" title="', $txt['old_posts'], '" />';
  145. echo '
  146. </a>
  147. </div>
  148. <div class="windowbg2 info">
  149. <h4><a class="subject" href="', $board['href'], '" name="b', $board['id'], '">', $board['name'], '</a></h4>';
  150. // Has it outstanding posts for approval?
  151. if ($board['can_approve_posts'] && ($board['unapproved_posts'] || $board['unapproved_topics']))
  152. echo '
  153. <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>';
  154. echo '
  155. <p>', $board['description'] , '</p>';
  156. // Show the "Moderators: ". Each has name, href, link, and id. (but we're gonna use link_moderators.)
  157. if (!empty($board['moderators']))
  158. echo '
  159. <div class="moderators">
  160. <h5>', count($board['moderators']) == 1 ? $txt['moderator'] : $txt['moderators'], ':</h5>&nbsp; ', implode(', ', $board['link_moderators']), '
  161. </div>';
  162. // Show some basic information about the number of posts, etc.
  163. echo '
  164. </div>
  165. <div class="windowbg stats">
  166. <ul>
  167. <li class="posts" style="display: none;">', comma_format($board['posts']), ' <span>', $board['is_redirect'] ? $txt['redirects'] : $txt['posts'], '</span></li>
  168. <li class="topics" style="font-size: 1em; color: #444; text-align: right;">', $board['last_post']['time'], '</li>
  169. </ul>
  170. </div>
  171. <div class="windowbg2 lastpost">';
  172. /* The board's and children's 'last_post's have:
  173. time, timestamp (a number that represents the time.), id (of the post), topic (topic id.),
  174. link, href, subject, start (where they should go for the first unread post.),
  175. and member. (which has id, name, link, href, username in it.) */
  176. if (!empty($board['last_post']['id']))
  177. echo '
  178. <ul>
  179. <li><h5>', $txt['last_post'], ' &nbsp; </h5><span>', $txt['by'], '</span>', $board['last_post']['member']['link'] , '</li>
  180. <li><span>', $txt['in'], '</span>', $board['last_post']['link'], '</li>
  181. <li><span>', $txt['on'], '</span>', $board['last_post']['time'], '</li>
  182. </ul>';
  183. echo '
  184. </div>';
  185. // Show the "Child Boards: ". (there's a link_children but we're going to bold the new ones...)
  186. if (!empty($board['children']))
  187. {
  188. // Sort the links into an array with new boards bold so it can be imploded.
  189. $children = array();
  190. /* Each child in each board's children has:
  191. id, name, description, new (is it new?), topics (#), posts (#), href, link, and last_post. */
  192. foreach ($board['children'] as $child)
  193. {
  194. if (!$child['is_redirect'])
  195. $child['link'] = '<a href="' . $child['href'] . '" ' . ($child['new'] ? 'class="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']) . ')"><img src="' . $settings['lang_images_url'] . '/new.png" class="new_posts" alt="" />' : '') . '</a>';
  196. else
  197. $child['link'] = '<a href="' . $child['href'] . '" title="' . comma_format($child['posts']) . ' ' . $txt['redirects'] . '">' . $child['name'] . '</a>';
  198. // Has it posts awaiting approval?
  199. if ($child['can_approve_posts'] && ($child['unapproved_posts'] || $child['unapproved_topics']))
  200. $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>';
  201. $children[] = $child['new'] ? '<li><strong>' . $child['link'] . '</strong></li>' : '<li> ' .$child['link'] . '</li>';
  202. }
  203. echo '
  204. <div id="board_', $board['id'], '_children" class="windowbg children">
  205. <h5>', $txt['parent_boards'], ':</h5><ul class="reset">', implode($children), '</ul>
  206. </div>';
  207. }
  208. echo '
  209. </li>';
  210. }
  211. echo '
  212. <li class="divider"></li>
  213. </ul>';
  214. }
  215. echo '
  216. </div>';
  217. }
  218. if ($context['user']['is_logged'])
  219. {
  220. echo '
  221. <div id="posting_icons" class="floatleft">';
  222. // Mark read button.
  223. $mark_read_button = array(
  224. 'markread' => array('text' => 'mark_as_read', 'image' => 'markread.png', 'lang' => true, 'url' => $scripturl . '?action=markasread;sa=all;' . $context['session_var'] . '=' . $context['session_id']),
  225. );
  226. echo '
  227. <ul class="reset">
  228. <li class="floatleft"><img src="', $settings['images_url'], '/', $context['theme_variant_url'], 'new_some.png" alt="" /> ', $txt['new_posts'], '</li>
  229. <li class="floatleft"><img src="', $settings['images_url'], '/', $context['theme_variant_url'], 'new_none.png" alt="" /> ', $txt['old_posts'], '</li>
  230. <li class="floatleft"><img src="', $settings['images_url'], '/', $context['theme_variant_url'], 'new_redirect.png" alt="" /> ', $txt['redirect_board'], '</li>
  231. </ul>
  232. </div>';
  233. }
  234. else
  235. {
  236. echo '
  237. <div id="posting_icons" class="flow_hidden">
  238. <ul class="reset">
  239. <li class="floatleft"><img src="', $settings['images_url'], '/new_none.png" alt="" /> ', $txt['old_posts'], '</li>
  240. <li class="floatleft"><img src="', $settings['images_url'], '/new_redirect.png" alt="" /> ', $txt['redirect_board'], '</li>
  241. </ul>
  242. </div>';
  243. }
  244. template_info_center();
  245. }
  246. function template_info_center()
  247. {
  248. global $context, $settings, $options, $txt, $scripturl, $modSettings;
  249. // Here's where the "Info Center" starts...
  250. echo '
  251. <span class="clear upperframe"><span></span></span>
  252. <div id="info_center" class="roundframe"><div class="innerframe">
  253. <div class="cat_bar">
  254. <h3 class="catbg">
  255. <img class="icon" id="upshrink_ic" src="', $settings['images_url'], '/go_up.png" alt="*" title="', $txt['upshrink_description'], '" style="display: none;" />
  256. ', sprintf($txt['info_center_title'], $context['forum_name_html_safe']), '
  257. </h3>
  258. </div>
  259. <div id="upshrinkHeaderIC"', empty($options['collapse_header_ic']) ? '' : ' style="display: none;"', '>';
  260. // This is the "Recent Posts" bar.
  261. if (!empty($settings['number_recent_posts']) && (!empty($context['latest_posts']) || !empty($context['latest_post'])))
  262. {
  263. echo '
  264. <div class="title_barIC">
  265. <h4 class="titlebg">
  266. <a href="', $scripturl, '?action=recent"><img class="icon" src="', $settings['images_url'], '/icons/recent.png" alt="" />', $txt['recent_posts'], '</a>
  267. </h4>
  268. </div>
  269. <div class="hslice" id="recent_posts_content">
  270. <div class="entry-title" style="display: none;">', $context['forum_name_html_safe'], ' - ', $txt['recent_posts'], '</div>
  271. <div class="entry-content" style="display: none;">
  272. <a rel="feedurl" href="', $scripturl, '?action=.xml;type=webslice">', $txt['subscribe_webslice'], '</a>
  273. </div>';
  274. // Only show one post.
  275. if ($settings['number_recent_posts'] == 1)
  276. {
  277. // latest_post has link, href, time, subject, short_subject (shortened with...), and topic. (its id.)
  278. echo '
  279. <p id="infocenter_onepost" class="middletext">
  280. &quot;', $context['latest_post']['link'], '&quot; ', $txt['recent_updated'], ' <span class="floatright">(', $context['latest_post']['time'], ')</span>
  281. </p>';
  282. }
  283. // Show lots of posts.
  284. elseif (!empty($context['latest_posts']))
  285. {
  286. //echo '
  287. //<dl id="ic_recentposts" class="middletext">';
  288. echo ' <table style="width: 100%; max-width: 96em; padding: 0 0.5em 0.2em 0.5em; font-size: 0.917em;" cellspacing="0">';
  289. /* Each post in latest_posts has:
  290. board (with an id, name, and link.), topic (the topic's id.), poster (with id, name, and link.),
  291. subject, short_subject (shortened with...), time, link, and href. */
  292. foreach ($context['latest_posts'] as $post)
  293. echo '
  294. <tr>
  295. <td style="width: 35%; border-top: 1px solid #eee;"><strong>', $post['link'], '</strong></td>
  296. <td style="width: 15%; border-top: 1px solid #eee;"> ', $txt['by'], ' ', $post['poster']['link'], ' </td>
  297. <td style="width: 25%; border-top: 1px solid #eee;">(', $post['board']['link'], ')</td>
  298. <td style="width: 25%; border-top: 1px solid #eee; text-align: right;">', $post['time'], '</td>
  299. </tr>';
  300. // echo '
  301. // </dl>';
  302. echo ' </table>';
  303. }
  304. echo '
  305. </div>';
  306. }
  307. // Show information about events, birthdays, and holidays on the calendar.
  308. if ($context['show_calendar'])
  309. {
  310. echo '
  311. <div class="title_barIC">
  312. <h4 class="titlebg">
  313. <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>
  314. </h4>
  315. </div>
  316. <div id="calendar_IC" style="line-height: 1.7em;">';
  317. // Holidays like "Christmas", "Chanukah", and "We Love [Unknown] Day" :P.
  318. if (!empty($context['calendar_holidays']))
  319. echo '
  320. <p class="smalltext" style="border-bottom: 1px solid #eee; margin: 0; padding: 0.2em 0.5em;"><span class="holiday">', $txt['calendar_prompt'], ' ', implode(', ', $context['calendar_holidays']), '</span></p>';
  321. // People's birthdays. Like mine. And yours, I guess. Kidding.
  322. if (!empty($context['calendar_birthdays']))
  323. {
  324. echo '
  325. <p class="smalltext" style="border-bottom: 1px solid #eee; margin: 0; padding: 0.2em 0.5em;"><span class="birthday">', $context['calendar_only_today'] ? $txt['birthdays'] : $txt['birthdays_upcoming'], '</span>';
  326. /* Each member in calendar_birthdays has:
  327. id, name (person), age (if they have one set?), is_last. (last in list?), and is_today (birthday is today?) */
  328. foreach ($context['calendar_birthdays'] as $member)
  329. echo '
  330. <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'] ? '<br />' : ', ';
  331. echo '
  332. </p>';
  333. }
  334. // Events like community get-togethers.
  335. if (!empty($context['calendar_events']))
  336. {
  337. echo '
  338. <p class="smalltext" style="margin: 0; padding: 0.2em 0.5em;"><span class="event">', $context['calendar_only_today'] ? $txt['events'] : $txt['events_upcoming'], '</span>';
  339. /* Each event in calendar_events should have:
  340. title, href, is_last, can_edit (are they allowed?), modify_href, and is_today. */
  341. foreach ($context['calendar_events'] as $event)
  342. echo '
  343. ', $event['can_edit'] ? '<a href="' . $event['modify_href'] . '" title="' . $txt['calendar_edit'] . '"><img src="' . $settings['images_url'] . '/icons/modify_small.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 />' : ', ';
  344. echo '
  345. </p>';
  346. }
  347. echo '
  348. </div>';
  349. }
  350. // Show statistical style information...
  351. if ($settings['show_stats_index'])
  352. {
  353. echo '
  354. <div class="title_barIC">
  355. <h4 class="titlebg">
  356. <a href="', $scripturl, '?action=stats"><img class="icon" src="', $settings['images_url'], '/icons/info.png" alt="" />', $txt['forum_stats'], '</a>
  357. </h4>
  358. </div>
  359. <ul id="stats_IC" style="max-width: 96em; margin: 0; padding: 0; font-size: 0.917em; line-height: 2em; overflow: auto; list-style: none;">
  360. ', !empty($settings['show_latest_member']) ? '<li style="float: left; width: 49%; padding: 0 0.5%;">'. $txt['latest_member'] . ': <strong> ' . $context['common_stats']['latest_member']['link'] . '</strong></li>' : '', '
  361. ', ($context['allow_memberlist']) ? '<li style="float: left; width: 49%; padding: 0 0.5%; text-align: right;"><a href="'. $scripturl. '?action=mlist;sort=registered;start=0;desc">New members</a></li>' : '', '
  362. <li style="float: left; width: 49%; padding: 0 0.5%; border-top: 1px solid #eee;">', $context['common_stats']['total_posts'], ' ', $txt['posts_made'], ' ', $txt['in'], ' ', $context['common_stats']['total_topics'], ' ', $txt['topics'], ' ', $txt['by'], ' ', $context['common_stats']['total_members'], ' ', $txt['members'], '.</li>
  363. ', $context['show_stats'] ? '<li style="float: left; width: 49%; padding: 0 0.5%; border-top: 1px solid #eee; text-align: right;"><a href="' . $scripturl . '?action=stats">Statistics Center</a></li>' : '', '
  364. <li style="float: left; width: 49%; padding: 0 0.5%; border-top: 1px solid #eee;">', (!empty($context['latest_post']) ? $txt['latest_post'] . ': <strong>' . $context['latest_post']['link'] . '</strong>&nbsp;(' . $context['latest_post']['time'] . ')</li>' : ''), '
  365. <li style="float: left; width: 49%; padding: 0 0.5%; border-top: 1px solid #eee; text-align: right;"><a href="', $scripturl, '?action=recent">', $txt['recent_view'], '</a></li>
  366. </ul>';
  367. }
  368. // "Users online" - in order of activity.
  369. echo '
  370. <div class="title_barIC" style="clear: both;">
  371. <h4 class="titlebg">
  372. <span class="inline stats" style="margin: 0 0 0 0; padding: 0 0 0 0; "><img class="icon" src="', $settings['images_url'], '/icons/online.png', '" alt="" />', $txt['online'], '&nbsp;Now:&nbsp;
  373. ', $context['show_who'] ? '<a href="' . $scripturl . '?action=who">' : '', 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'];
  374. // Handle hidden users and buddies.
  375. $bracketList = array();
  376. if ($context['show_buddies'])
  377. $bracketList[] = comma_format($context['num_buddies']) . ' ' . ($context['num_buddies'] == 1 ? $txt['buddy'] : $txt['buddies']);
  378. if (!empty($context['num_spiders']))
  379. $bracketList[] = comma_format($context['num_spiders']) . ' ' . ($context['num_spiders'] == 1 ? $txt['spider'] : $txt['spiders']);
  380. if (!empty($context['num_users_hidden']))
  381. $bracketList[] = comma_format($context['num_users_hidden']) . ' ' . $txt['hidden'];
  382. if (!empty($bracketList))
  383. echo ' (' . implode(', ', $bracketList) . ')';
  384. echo $context['show_who'] ? '</a>' : '', '
  385. </span>
  386. </h4>
  387. </div>
  388. <p id="online_IC" class="inline smalltext">';
  389. // Assuming there ARE users online... each user in users_online has an id, username, name, group, href, and link.
  390. if (!empty($context['users_online']))
  391. {
  392. echo '
  393. <span class="floatleft" style="display: block;">', sprintf($txt['users_active'], $modSettings['lastActive']), ':&nbsp;</span><span class="floatleft" style="display: block;>', implode(', ', $context['list_users_online']). '</span>';
  394. // Showing membergroups?
  395. if (!empty($settings['show_group_key']) && !empty($context['membergroups']))
  396. echo '
  397. <span class="clear" style="display: block;">' . implode('&nbsp;|&nbsp;', $context['membergroups']) . '</span>';
  398. }
  399. echo '
  400. </p>
  401. <p class="last smalltext" style="max-width: 95em;">
  402. <span class="floatright">', $txt['most_online_today'], ': <strong>', comma_format($modSettings['mostOnlineToday']), '</strong></span>
  403. <br />', $txt['most_online_ever'], ': ', comma_format($modSettings['mostOnline']), ' (', timeformat($modSettings['mostDate']), ')
  404. </p>';
  405. echo '
  406. </div>
  407. </div></div>';
  408. // Info center collapse object.
  409. echo '
  410. <script type="text/javascript"><!-- // --><![CDATA[
  411. var oInfoCenterToggle = new smc_Toggle({
  412. bToggleEnabled: true,
  413. bCurrentlyCollapsed: ', empty($options['collapse_header_ic']) ? 'false' : 'true', ',
  414. aSwappableContainers: [
  415. \'upshrinkHeaderIC\'
  416. ],
  417. aSwapImages: [
  418. {
  419. sId: \'upshrink_ic\',
  420. srcExpanded: smf_images_url + \'/go_up.png\',
  421. altExpanded: ', JavaScriptEscape($txt['upshrink_description']), ',
  422. srcCollapsed: smf_images_url + \'/go_down.png\',
  423. altCollapsed: ', JavaScriptEscape($txt['upshrink_description']), '
  424. }
  425. ],
  426. aSwapLinks: [
  427. {
  428. sId: \'upshrink_link\',
  429. msgExpanded: ', JavaScriptEscape(sprintf($txt['info_center_title'], $context['forum_name_html_safe'])), ',
  430. msgCollapsed: ', JavaScriptEscape(sprintf($txt['info_center_title'], $context['forum_name_html_safe'])), '
  431. }
  432. ],
  433. oThemeOptions: {
  434. bUseThemeSettings: ', $context['user']['is_guest'] ? 'false' : 'true', ',
  435. sOptionName: \'collapse_header_ic\',
  436. sSessionId: smf_session_id,
  437. sSessionVar: smf_session_var,
  438. },
  439. oCookieOptions: {
  440. bUseCookie: ', $context['user']['is_guest'] ? 'true' : 'false', ',
  441. sCookieName: \'upshrinkIC\'
  442. }
  443. });
  444. $(document).ready(function() {
  445. $("a.collapse, a.cat_unread").bt();
  446. });
  447. // ]]></script>';
  448. }
  449. ?>