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