BoardIndex.template.php 22 KB

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