BoardIndex.template.php 23 KB

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