annotate forum/Themes/babylon/BoardIndex.template.php @ 76:e3e11437ecea website

Add forum code
author Chris Cannam
date Sun, 07 Jul 2013 11:25:48 +0200
parents
children
rev   line source
Chris@76 1 <?php
Chris@76 2 // Version: 1.1; BoardIndex
Chris@76 3
Chris@76 4 function template_main()
Chris@76 5 {
Chris@76 6 global $context, $settings, $options, $txt, $scripturl, $modSettings;
Chris@76 7
Chris@76 8 // Show some statistics next to the link tree if SP1 info is off.
Chris@76 9 echo '
Chris@76 10 <table width="100%" cellpadding="3" cellspacing="0">
Chris@76 11 <tr>
Chris@76 12 <td valign="bottom">', theme_linktree(), '</td>
Chris@76 13 <td align="right">';
Chris@76 14 if (!$settings['show_sp1_info'])
Chris@76 15 echo '
Chris@76 16 ', $txt[19], ': ', $context['common_stats']['total_members'], ' &nbsp;&#8226;&nbsp; ', $txt[95], ': ', $context['common_stats']['total_posts'], ' &nbsp;&#8226;&nbsp; ', $txt[64], ': ', $context['common_stats']['total_topics'], '
Chris@76 17 ', ($settings['show_latest_member'] ? '<br />' . $txt[201] . ' <b>' . $context['common_stats']['latest_member']['link'] . '</b>' . $txt[581] : '');
Chris@76 18 echo '
Chris@76 19 </td>
Chris@76 20 </tr>
Chris@76 21 </table>';
Chris@76 22
Chris@76 23 // Show the news fader? (assuming there are things to show...)
Chris@76 24 if ($settings['show_newsfader'] && !empty($context['fader_news_lines']))
Chris@76 25 {
Chris@76 26 echo '
Chris@76 27 <div class="tborder" style="margin-bottom: 2ex;">
Chris@76 28 <table border="0" width="100%" cellspacing="1" cellpadding="4">
Chris@76 29 <tr class="titlebg" align="center">
Chris@76 30 <td>', $txt[102], '</td>
Chris@76 31 </tr>
Chris@76 32 <tr>
Chris@76 33 <td valign="middle" align="center" style="height: 60px;">';
Chris@76 34
Chris@76 35 // Prepare all the javascript settings.
Chris@76 36 echo '
Chris@76 37 <div id="smfFadeScroller" style="width: 90%; padding: 2px;"><b>', $context['news_lines'][0], '</b></div>
Chris@76 38 <script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
Chris@76 39 // The fading delay (in ms.)
Chris@76 40 var smfFadeDelay = ', empty($settings['newsfader_time']) ? 5000 : $settings['newsfader_time'], ';
Chris@76 41 // Fade from... what text color? To which background color?
Chris@76 42 var smfFadeFrom = {"r": 0, "g": 0, "b": 0}, smfFadeTo = {"r": 255, "g": 255, "b": 255};
Chris@76 43 // Surround each item with... anything special?
Chris@76 44 var smfFadeBefore = "<b>", smfFadeAfter = "</b>";
Chris@76 45
Chris@76 46 var foreColor, backEl, backColor;
Chris@76 47
Chris@76 48 if (typeof(document.getElementById(\'smfFadeScroller\').currentStyle) != "undefined")
Chris@76 49 {
Chris@76 50 foreColor = document.getElementById(\'smfFadeScroller\').currentStyle.color.match(/#([\da-f][\da-f])([\da-f][\da-f])([\da-f][\da-f])/);
Chris@76 51 smfFadeFrom = {"r": parseInt(foreColor[1]), "g": parseInt(foreColor[2]), "b": parseInt(foreColor[3])};
Chris@76 52
Chris@76 53 backEl = document.getElementById(\'smfFadeScroller\');
Chris@76 54 while (backEl.currentStyle.backgroundColor == "transparent" && typeof(backEl.parentNode) != "undefined")
Chris@76 55 backEl = backEl.parentNode;
Chris@76 56
Chris@76 57 backColor = backEl.currentStyle.backgroundColor.match(/#([\da-f][\da-f])([\da-f][\da-f])([\da-f][\da-f])/);
Chris@76 58 smfFadeTo = {"r": eval("0x" + backColor[1]), "g": eval("0x" + backColor[2]), "b": eval("0x" + backColor[3])};
Chris@76 59 }
Chris@76 60 else if (typeof(window.opera) == "undefined" && typeof(document.defaultView) != "undefined")
Chris@76 61 {
Chris@76 62 foreColor = document.defaultView.getComputedStyle(document.getElementById(\'smfFadeScroller\'), null).color.match(/rgb\((\d+), (\d+), (\d+)\)/);
Chris@76 63 smfFadeFrom = {"r": parseInt(foreColor[1]), "g": parseInt(foreColor[2]), "b": parseInt(foreColor[3])};
Chris@76 64
Chris@76 65 backEl = document.getElementById(\'smfFadeScroller\');
Chris@76 66 while (document.defaultView.getComputedStyle(backEl, null).backgroundColor == "transparent" && typeof(backEl.parentNode) != "undefined" && typeof(backEl.parentNode.tagName) != "undefined")
Chris@76 67 backEl = backEl.parentNode;
Chris@76 68
Chris@76 69 backColor = document.defaultView.getComputedStyle(backEl, null).backgroundColor.match(/rgb\((\d+), (\d+), (\d+)\)/);
Chris@76 70 smfFadeTo = {"r": parseInt(backColor[1]), "g": parseInt(backColor[2]), "b": parseInt(backColor[3])};
Chris@76 71 }
Chris@76 72
Chris@76 73 // List all the lines of the news for display.
Chris@76 74 var smfFadeContent = new Array(
Chris@76 75 "', implode('",
Chris@76 76 "', $context['fader_news_lines']), '"
Chris@76 77 );
Chris@76 78 // ]]></script>
Chris@76 79 <script language="JavaScript" type="text/javascript" src="', $settings['default_theme_url'], '/fader.js"></script>
Chris@76 80 </td>
Chris@76 81 </tr>
Chris@76 82 </table>
Chris@76 83 </div>';
Chris@76 84 }
Chris@76 85
Chris@76 86 /* Each category in categories is made up of:
Chris@76 87 id, href, link, name, is_collapsed (is it collapsed?), can_collapse (is it okay if it is?),
Chris@76 88 new (is it new?), collapse_href (href to collapse/expand), collapse_image (up/down iamge),
Chris@76 89 and boards. (see below.) */
Chris@76 90 foreach ($context['categories'] as $category)
Chris@76 91 {
Chris@76 92 echo '
Chris@76 93 <div class="tborder"><table border="0" width="100%" cellspacing="1" cellpadding="5">
Chris@76 94 <tr>
Chris@76 95 <td colspan="4" class="catbg', $category['new'] ? '2' : '', '" height="18">';
Chris@76 96
Chris@76 97 // If this category even can collapse, show a link to collapse it.
Chris@76 98 if ($category['can_collapse'])
Chris@76 99 echo '
Chris@76 100 <a href="', $category['collapse_href'], '">', $category['collapse_image'], '</a>';
Chris@76 101
Chris@76 102 echo '
Chris@76 103 ', $category['link'], '
Chris@76 104 </td>
Chris@76 105 </tr>';
Chris@76 106
Chris@76 107 // Assuming the category hasn't been collapsed...
Chris@76 108 if (!$category['is_collapsed'])
Chris@76 109 {
Chris@76 110 /* Each board in each category's boards has:
Chris@76 111 new (is it new?), id, name, description, moderators (see below), link_moderators (just a list.),
Chris@76 112 children (see below.), link_children (easier to use.), children_new (are they new?),
Chris@76 113 topics (# of), posts (# of), link, href, and last_post. (see below.) */
Chris@76 114 foreach ($category['boards'] as $board)
Chris@76 115 {
Chris@76 116 echo '
Chris@76 117 <tr class="windowbg2">
Chris@76 118 <td class="windowbg" width="6%" align="center" valign="top"><a href="', $scripturl, '?action=unread;board=', $board['id'], '.0">';
Chris@76 119
Chris@76 120 // If the board is new, show a strong indicator.
Chris@76 121 if ($board['new'])
Chris@76 122 echo '<img src="', $settings['images_url'], '/on.gif" alt="', $txt[333], '" title="', $txt[333], '" border="0" />';
Chris@76 123 // This board doesn't have new posts, but its children do.
Chris@76 124 elseif ($board['children_new'])
Chris@76 125 echo '<img src="', $settings['images_url'], '/on2.gif" alt="', $txt[333], '" title="', $txt[333], '" border="0" />';
Chris@76 126 // No new posts at all! The agony!!
Chris@76 127 else
Chris@76 128 echo '<img src="', $settings['images_url'], '/off.gif" alt="', $txt[334], '" title="', $txt[334], '" border="0" />';
Chris@76 129
Chris@76 130 echo '</a></td>
Chris@76 131 <td>
Chris@76 132 <b><a href="', $board['href'], '" name="b', $board['id'], '">', $board['name'], '</a></b><br />
Chris@76 133 ', $board['description'];
Chris@76 134
Chris@76 135 // Show the "Moderators: ". Each has name, href, link, and id. (but we're gonna use link_moderators.)
Chris@76 136 if (!empty($board['moderators']))
Chris@76 137 echo '
Chris@76 138 <div style="padding-top: 1px;" class="smalltext"><i>', count($board['moderators']) == 1 ? $txt[298] : $txt[299], ': ', implode(', ', $board['link_moderators']), '</i></div>';
Chris@76 139
Chris@76 140 // Show the "Child Boards: ". (there's a link_children but we're going to bold the new ones...)
Chris@76 141 if (!empty($board['children']))
Chris@76 142 {
Chris@76 143 // Sort the links into an array with new boards bold so it can be imploded.
Chris@76 144 $children = array();
Chris@76 145 /* Each child in each board's children has:
Chris@76 146 id, name, description, new (is it new?), topics (#), posts (#), href, link, and last_post. */
Chris@76 147 foreach ($board['children'] as $child)
Chris@76 148 {
Chris@76 149 $child['link'] = '<a href="' . $child['href'] . '" title="' . ($child['new'] ? $txt[333] : $txt[334]) . ' (' . $txt[330] . ': ' . $child['topics'] . ', ' . $txt[21] . ': ' . $child['posts'] . ')">' . $child['name'] . '</a>';
Chris@76 150 $children[] = $child['new'] ? '<b>' . $child['link'] . '</b>' : $child['link'];
Chris@76 151 }
Chris@76 152
Chris@76 153 echo '
Chris@76 154 <div style="padding-top: 1px;" class="smalltext"><i>', $txt['parent_boards'], ': ', implode(', ', $children), '</i></div>';
Chris@76 155 }
Chris@76 156
Chris@76 157 // Show some basic information about the number of posts, etc.
Chris@76 158 echo '
Chris@76 159 </td>
Chris@76 160 <td class="windowbg" valign="middle" align="center" style="width: 12ex;"><span class="smalltext">
Chris@76 161 ', $board['posts'], ' ', $txt[21], ' ', $txt['smf88'], '<br />
Chris@76 162 ', $board['topics'], ' ', $txt[330], '
Chris@76 163 </span></td>
Chris@76 164 <td class="smalltext" valign="middle" width="22%">';
Chris@76 165
Chris@76 166 /* The board's and children's 'last_post's have:
Chris@76 167 time, timestamp (a number that represents the time.), id (of the post), topic (topic id.),
Chris@76 168 link, href, subject, start (where they should go for the first unread post.),
Chris@76 169 and member. (which has id, name, link, href, username in it.) */
Chris@76 170 if (!empty($board['last_post']['id']))
Chris@76 171 echo '
Chris@76 172 ', $txt[22], ' ', $txt[30], ' ', $board['last_post']['time'], '<br />
Chris@76 173 ', $txt['smf88'], ' ', $board['last_post']['link'], ' ', $txt[525], ' ', $board['last_post']['member']['link'];
Chris@76 174
Chris@76 175 echo '
Chris@76 176 </td>
Chris@76 177 </tr>';
Chris@76 178 }
Chris@76 179 }
Chris@76 180
Chris@76 181 echo '
Chris@76 182 </table></div>
Chris@76 183 <br />';
Chris@76 184 }
Chris@76 185
Chris@76 186 if ($context['user']['is_logged'])
Chris@76 187 {
Chris@76 188 echo '
Chris@76 189 <div class="tborder" style="padding: 3px;"><table border="0" width="100%" cellspacing="0" cellpadding="5">
Chris@76 190 <tr class="titlebg">
Chris@76 191 <td align="', !$context['right_to_left'] ? 'left' : 'right', '" class="smalltext">
Chris@76 192 <img src="' . $settings['images_url'] . '/new_some.gif" alt="" border="0" align="middle" /> ', $txt[333], '
Chris@76 193 <img src="' . $settings['images_url'] . '/new_none.gif" alt="" border="0" align="middle" style="margin-left: 4ex;" /> ', $txt[334], '
Chris@76 194 </td>
Chris@76 195 <td align="', !$context['right_to_left'] ? 'right' : 'left', '" class="smalltext">';
Chris@76 196 // Show the mark all as read button?
Chris@76 197 if ($settings['show_mark_read'])
Chris@76 198 echo '
Chris@76 199 <a href="', $scripturl, '?action=markasread;sa=all;sesc=' . $context['session_id'] . '">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/markread.gif" alt="' . $txt[452] . '" border="0" />' : $txt[452]), '</a>';
Chris@76 200 echo '
Chris@76 201 </td>
Chris@76 202 </tr>
Chris@76 203 </table></div>';
Chris@76 204 }
Chris@76 205
Chris@76 206 // Here's where the "Info Center" starts...
Chris@76 207 echo '
Chris@76 208 <br />
Chris@76 209 <div class="tborder"><table border="0" width="100%" cellspacing="1" cellpadding="4">
Chris@76 210 <tr class="titlebg">
Chris@76 211 <td align="center" colspan="2">', $txt[685], '</td>
Chris@76 212 </tr>';
Chris@76 213
Chris@76 214 // This is the "Recent Posts" bar.
Chris@76 215 if (!empty($settings['number_recent_posts']))
Chris@76 216 {
Chris@76 217 echo '
Chris@76 218 <tr>
Chris@76 219 <td class="catbg" colspan="2">', $txt[214], '</td>
Chris@76 220 </tr>
Chris@76 221 <tr>
Chris@76 222 <td class="windowbg" width="20" valign="middle" align="center">
Chris@76 223 <a href="', $scripturl, '?action=recent">
Chris@76 224 <img src="', $settings['images_url'], '/post/xx.gif" alt="', $txt[214], '" border="0" /></a>
Chris@76 225 </td>
Chris@76 226 <td class="windowbg2">';
Chris@76 227
Chris@76 228 // Only show one post.
Chris@76 229 if ($settings['number_recent_posts'] == 1)
Chris@76 230 {
Chris@76 231 // latest_post has link, href, time, subject, short_subject (shortened with...), and topic. (its id.)
Chris@76 232 echo '
Chris@76 233 <b><a href="', $scripturl, '?action=recent">', $txt[214], '</a></b>
Chris@76 234 <div class="smalltext">
Chris@76 235 ', $txt[234], ' &quot;', $context['latest_post']['link'], '&quot; ', $txt[235], ' (', $context['latest_post']['time'], ')<br />
Chris@76 236 </div>';
Chris@76 237 }
Chris@76 238 // Show lots of posts.
Chris@76 239 elseif (!empty($context['latest_posts']))
Chris@76 240 {
Chris@76 241 echo '
Chris@76 242 <table width="100%" border="0">';
Chris@76 243 /* Each post in latest_posts has:
Chris@76 244 board (with an id, name, and link.), topic (the topic's id.), poster (with id, name, and link.),
Chris@76 245 subject, short_subject (shortened with...), time, link, and href. */
Chris@76 246 foreach ($context['latest_posts'] as $post)
Chris@76 247 echo '
Chris@76 248 <tr>
Chris@76 249 <td align="right" valign="top" nowrap="nowrap">[', $post['board']['link'], ']</td>
Chris@76 250 <td valign="top">', $post['link'], ' ', $txt[525], ' ', $post['poster']['link'], '</td>
Chris@76 251 <td align="right" valign="top" nowrap="nowrap">', $post['time'], '</td>
Chris@76 252 </tr>';
Chris@76 253 echo '
Chris@76 254 </table>';
Chris@76 255 }
Chris@76 256 echo '
Chris@76 257 </td>
Chris@76 258 </tr>';
Chris@76 259 }
Chris@76 260
Chris@76 261 // Show information about events, birthdays, and holidays on the calendar.
Chris@76 262 if ($context['show_calendar'])
Chris@76 263 {
Chris@76 264 echo '
Chris@76 265 <tr>
Chris@76 266 <td class="catbg" colspan="2">', $context['calendar_only_today'] ? $txt['calendar47b'] : $txt['calendar47'], '</td>
Chris@76 267 </tr><tr>
Chris@76 268 <td class="windowbg" width="20" valign="middle" align="center">
Chris@76 269 <a href="', $scripturl, '?action=calendar">
Chris@76 270 <img src="', $settings['images_url'], '/icons/calendar.gif" alt="', $txt['calendar24'], '" border="0" /></a>
Chris@76 271 </td>
Chris@76 272 <td class="windowbg2" width="100%">
Chris@76 273 <span class="smalltext">';
Chris@76 274
Chris@76 275 // Holidays like "Christmas", "Chanukah", and "We Love [Unknown] Day" :P.
Chris@76 276 if (!empty($context['calendar_holidays']))
Chris@76 277 echo '
Chris@76 278 <span style="color: #', $modSettings['cal_holidaycolor'], ';">', $txt['calendar5'], ' ', implode(', ', $context['calendar_holidays']), '</span><br />';
Chris@76 279
Chris@76 280 // People's birthdays. Like mine. And yours, I guess. Kidding.
Chris@76 281 if (!empty($context['calendar_birthdays']))
Chris@76 282 {
Chris@76 283 echo '
Chris@76 284 <span style="color: #', $modSettings['cal_bdaycolor'], ';">', $context['calendar_only_today'] ? $txt['calendar3'] : $txt['calendar3b'], '</span> ';
Chris@76 285 /* Each member in calendar_birthdays has:
Chris@76 286 id, name (person), age (if they have one set?), is_last. (last in list?), and is_today (birthday is today?) */
Chris@76 287 foreach ($context['calendar_birthdays'] as $member)
Chris@76 288 echo '
Chris@76 289 <a href="', $scripturl, '?action=profile;u=', $member['id'], '">', $member['is_today'] ? '<b>' : '', $member['name'], $member['is_today'] ? '</b>' : '', isset($member['age']) ? ' (' . $member['age'] . ')' : '', '</a>', $member['is_last'] ? '<br />' : ', ';
Chris@76 290 }
Chris@76 291 // Events like community get-togethers.
Chris@76 292 if (!empty($context['calendar_events']))
Chris@76 293 {
Chris@76 294 echo '
Chris@76 295 <span style="color: #', $modSettings['cal_eventcolor'], ';">', $context['calendar_only_today'] ? $txt['calendar4'] : $txt['calendar4b'], '</span> ';
Chris@76 296 /* Each event in calendar_events should have:
Chris@76 297 title, href, is_last, can_edit (are they allowed?), modify_href, and is_today. */
Chris@76 298 foreach ($context['calendar_events'] as $event)
Chris@76 299 echo '
Chris@76 300 ', $event['can_edit'] ? '<a href="' . $event['modify_href'] . '" style="color: #FF0000;">*</a> ' : '', $event['href'] == '' ? '' : '<a href="' . $event['href'] . '">', $event['is_today'] ? '<b>' . $event['title'] . '</b>' : $event['title'], $event['href'] == '' ? '' : '</a>', $event['is_last'] ? '<br />' : ', ';
Chris@76 301
Chris@76 302 // Show a little help text to help them along ;).
Chris@76 303 if ($context['calendar_can_edit'])
Chris@76 304 echo '
Chris@76 305 (<a href="', $scripturl, '?action=helpadmin;help=calendar_how_edit" onclick="return reqWin(this.href);">', $txt['calendar_how_edit'], '</a>)';
Chris@76 306 }
Chris@76 307 echo '
Chris@76 308 </span>
Chris@76 309 </td>
Chris@76 310 </tr>';
Chris@76 311 }
Chris@76 312
Chris@76 313 // Show a member bar. Not heavily ornate, but functional at least.
Chris@76 314 if ($settings['show_member_bar'])
Chris@76 315 {
Chris@76 316 echo '
Chris@76 317 <tr>
Chris@76 318 <td class="catbg" colspan="2">', $txt[331], '</td>
Chris@76 319 </tr>
Chris@76 320 <tr>
Chris@76 321 <td class="windowbg" width="20" valign="middle" align="center">
Chris@76 322 ', $context['show_member_list'] ? '<a href="' . $scripturl . '?action=mlist">' : '', '<img src="', $settings['images_url'], '/icons/members.gif" alt="', $txt[332], '" border="0" />', $context['show_member_list'] ? '</a>' : '', '
Chris@76 323 </td>
Chris@76 324 <td class="windowbg2" width="100%">
Chris@76 325 <b>', $context['show_member_list'] ? '<a href="' . $scripturl . '?action=mlist">' . $txt[332] . '</a>' : $txt[332], '</b>
Chris@76 326 <div class="smalltext">', $txt[200], '</div>
Chris@76 327 </td>
Chris@76 328 </tr>';
Chris@76 329 }
Chris@76 330
Chris@76 331 // Show YaBB SP1 style information...
Chris@76 332 if ($settings['show_sp1_info'])
Chris@76 333 {
Chris@76 334 echo '
Chris@76 335 <tr>
Chris@76 336 <td class="catbg" colspan="2">', $txt[645], '</td>
Chris@76 337 </tr>
Chris@76 338 <tr>
Chris@76 339 <td class="windowbg" width="20" valign="middle" align="center">
Chris@76 340 <a href="', $scripturl, '?action=stats">
Chris@76 341 <img src="', $settings['images_url'], '/icons/info.gif" alt="', $txt[645], '" border="0" /></a>
Chris@76 342 </td>
Chris@76 343 <td class="windowbg2" width="100%">
Chris@76 344 <table border="0" width="90%"><tr>
Chris@76 345 <td class="smalltext">
Chris@76 346 <div style="float: ', !$context['right_to_left'] ? 'left' : 'right', '; width: 50%;">', $txt[490], ': <b>', $context['common_stats']['total_topics'], '</b></div>', $txt[489], ': <b>', $context['common_stats']['total_posts'], '</b><br />', !empty($context['latest_post']) ? '
Chris@76 347 ' . $txt[659] . ': &quot;' . $context['latest_post']['link'] . '&quot; (' . $context['latest_post']['time'] . ')<br />' : '', '
Chris@76 348 <a href="', $scripturl, '?action=recent">', $txt[234], '</a>', $context['show_stats'] ? '<br />
Chris@76 349 <a href="' . $scripturl . '?action=stats">' . $txt['smf223'] . '</a>' : '', '
Chris@76 350 </td>
Chris@76 351 <td width="32%" class="smalltext" valign="top">
Chris@76 352 ', $txt[488], ': <b><a href="', $scripturl, '?action=mlist">', $context['common_stats']['total_members'], '</a></b><br />
Chris@76 353 ', $txt[656], ': <b>', $context['common_stats']['latest_member']['link'], '</b><br />';
Chris@76 354 // If they are logged in, show their unread message count, etc..
Chris@76 355 if ($context['user']['is_logged'])
Chris@76 356 echo '
Chris@76 357 ', $txt['smf199'], ': <b><a href="', $scripturl, '?action=pm">', $context['user']['messages'], '</a></b> ', $txt['newmessages3'], ': <b><a href="', $scripturl, '?action=pm">', $context['user']['unread_messages'], '</a></b>';
Chris@76 358 echo '
Chris@76 359 </td>
Chris@76 360 </tr></table>
Chris@76 361 </td>
Chris@76 362 </tr>';
Chris@76 363 }
Chris@76 364
Chris@76 365 // "Users online" - in order of activity.
Chris@76 366 echo '
Chris@76 367 <tr>
Chris@76 368 <td class="catbg" colspan="2">', $txt[158], '</td>
Chris@76 369 </tr><tr>
Chris@76 370 <td class="windowbg" width="20" valign="middle" align="center">
Chris@76 371 ', $context['show_who'] ? '<a href="' . $scripturl . '?action=who">' : '', '<img src="', $settings['images_url'], '/icons/online.gif" alt="', $txt[158], '" border="0" />', $context['show_who'] ? '</a>' : '', '
Chris@76 372 </td>
Chris@76 373 <td class="windowbg2" width="100%">';
Chris@76 374
Chris@76 375 if ($context['show_who'])
Chris@76 376 echo '
Chris@76 377 <a href="', $scripturl, '?action=who">';
Chris@76 378
Chris@76 379 echo $context['num_guests'], ' ', $context['num_guests'] == 1 ? $txt['guest'] : $txt['guests'], ', ' . $context['num_users_online'], ' ', $context['num_users_online'] == 1 ? $txt['user'] : $txt['users'];
Chris@76 380
Chris@76 381 // Handle hidden users and buddies.
Chris@76 382 if (!empty($context['num_users_hidden']) || ($context['show_buddies'] && !empty($context['show_buddies'])))
Chris@76 383 {
Chris@76 384 echo ' (';
Chris@76 385
Chris@76 386 // Show the number of buddies online?
Chris@76 387 if ($context['show_buddies'])
Chris@76 388 echo $context['num_buddies'], ' ', $context['num_buddies'] == 1 ? $txt['buddy'] : $txt['buddies'];
Chris@76 389
Chris@76 390 // How about hidden users?
Chris@76 391 if (!empty($context['num_users_hidden']))
Chris@76 392 echo $context['show_buddies'] ? ', ' : '', $context['num_users_hidden'] . ' ' . $txt['hidden'];
Chris@76 393
Chris@76 394 echo ')';
Chris@76 395 }
Chris@76 396
Chris@76 397 if ($context['show_who'])
Chris@76 398 echo '</a>';
Chris@76 399
Chris@76 400 echo '
Chris@76 401 <div class="smalltext">';
Chris@76 402
Chris@76 403 // Assuming there ARE users online... each user in users_online has an id, username, name, group, href, and link.
Chris@76 404 if (!empty($context['users_online']))
Chris@76 405 echo '
Chris@76 406 ', $txt[140], ':<br />', implode(', ', $context['list_users_online']);
Chris@76 407
Chris@76 408 echo '
Chris@76 409 <br />', $context['show_stats'] && !$settings['show_sp1_info'] ? '
Chris@76 410 <a href="' . $scripturl . '?action=stats">' . $txt['smf223'] . '</a>' : '', '
Chris@76 411 </div>
Chris@76 412 </td>
Chris@76 413 </tr>';
Chris@76 414
Chris@76 415 // If they are logged in, but SP1 style information is off... show a personal message bar.
Chris@76 416 if ($context['user']['is_logged'] && !$settings['show_sp1_info'])
Chris@76 417 {
Chris@76 418 echo '
Chris@76 419 <tr>
Chris@76 420 <td class="catbg" colspan="2">', $txt[159], '</td>
Chris@76 421 </tr><tr>
Chris@76 422 <td class="windowbg" width="20" valign="middle" align="center">
Chris@76 423 ', $context['allow_pm'] ? '<a href="' . $scripturl . '?action=pm">' : '', '<img src="', $settings['images_url'], '/message_sm.gif" alt="', $txt[159], '" border="0" />', $context['allow_pm'] ? '</a>' : '', '
Chris@76 424 </td>
Chris@76 425 <td class="windowbg2" valign="top">
Chris@76 426 <b><a href="', $scripturl, '?action=pm">', $txt[159], '</a></b>
Chris@76 427 <div class="smalltext">
Chris@76 428 ', $txt[660], ' ', $context['user']['messages'], ' ', $context['user']['messages'] == 1 ? $txt[471] : $txt[153], '.... ', $txt[661], ' <a href="', $scripturl, '?action=pm">', $txt[662], '</a> ', $txt[663], '
Chris@76 429 </div>
Chris@76 430 </td>
Chris@76 431 </tr>';
Chris@76 432 }
Chris@76 433
Chris@76 434 // Show the login bar. (it's only true if they are logged out anyway.)
Chris@76 435 if ($context['show_login_bar'])
Chris@76 436 {
Chris@76 437 echo '
Chris@76 438 <tr>
Chris@76 439 <td class="catbg" colspan="2">', $txt[34], ' <a href="', $scripturl, '?action=reminder" class="smalltext">(' . $txt[315] . ')</a></td>
Chris@76 440 </tr>
Chris@76 441 <tr>
Chris@76 442 <td class="windowbg" width="20" align="center">
Chris@76 443 <a href="', $scripturl, '?action=login">
Chris@76 444 <img src="', $settings['images_url'], '/icons/login.gif" alt="', $txt[34], '" border="0" /></a>
Chris@76 445 </td>
Chris@76 446 <td class="windowbg2" valign="middle">
Chris@76 447 <form action="', $scripturl, '?action=login2" method="post" style="margin: 0;" accept-charset="', $context['character_set'], '">
Chris@76 448 <table border="0" cellpadding="2" cellspacing="0" width="100%"><tr>
Chris@76 449 <td valign="middle" align="left">
Chris@76 450 <label for="user"><b>', $txt[35], ':</b><br /><input type="text" name="user" id="user" size="15" /></label>
Chris@76 451 </td>
Chris@76 452 <td valign="middle" align="left">
Chris@76 453 <label for="passwrd"><b>', $txt[36], ':</b><br /><input type="password" name="passwrd" id="passwrd" size="15" /></label>
Chris@76 454 </td>
Chris@76 455 <td valign="middle" align="left">
Chris@76 456 <label for="cookielength"><b>', $txt[497], ':</b><br /><input type="text" name="cookielength" id="cookielength" size="4" maxlength="4" value="', $modSettings['cookieTime'], '" /></label>
Chris@76 457 </td>
Chris@76 458 <td valign="middle" align="left">
Chris@76 459 <label for="cookieneverexp"><b>', $txt[508], ':</b><br /><input type="checkbox" name="cookieneverexp" id="cookieneverexp" checked="checked" class="check" /></label>
Chris@76 460 </td>
Chris@76 461 <td valign="middle" align="left">
Chris@76 462 <input type="submit" value="', $txt[34], '" />
Chris@76 463 </td>
Chris@76 464 </tr></table>
Chris@76 465 </form>
Chris@76 466 </td>
Chris@76 467 </tr>';
Chris@76 468 }
Chris@76 469
Chris@76 470 echo '
Chris@76 471 </table></div>';
Chris@76 472 }
Chris@76 473
Chris@76 474 ?>