|
@@ -236,6 +236,9 @@ function template_info_center()
|
|
|
{
|
|
|
global $context, $settings, $options, $txt, $scripturl, $modSettings;
|
|
|
|
|
|
+ if (empty($context['info_center']))
|
|
|
+ return;
|
|
|
+
|
|
|
// Here's where the "Info Center" starts...
|
|
|
echo '
|
|
|
<div class="roundframe" id="info_center">
|
|
@@ -247,10 +250,59 @@ function template_info_center()
|
|
|
</div>
|
|
|
<div id="upshrinkHeaderIC"', empty($options['collapse_header_ic']) ? '' : ' style="display: none;"', '>';
|
|
|
|
|
|
- // This is the "Recent Posts" bar.
|
|
|
- if (!empty($settings['number_recent_posts']) && (!empty($context['latest_posts']) || !empty($context['latest_post'])))
|
|
|
+ foreach ($context['info_center'] as $block)
|
|
|
{
|
|
|
- echo '
|
|
|
+ $func = 'template_ic_block_' . $block;
|
|
|
+ $func();
|
|
|
+ }
|
|
|
+
|
|
|
+ echo '
|
|
|
+ </div>
|
|
|
+ </div>';
|
|
|
+
|
|
|
+ // Info center collapse object.
|
|
|
+ echo '
|
|
|
+ <script type="text/javascript"><!-- // --><![CDATA[
|
|
|
+ var oInfoCenterToggle = new smc_Toggle({
|
|
|
+ bToggleEnabled: true,
|
|
|
+ bCurrentlyCollapsed: ', empty($options['collapse_header_ic']) ? 'false' : 'true', ',
|
|
|
+ aSwappableContainers: [
|
|
|
+ \'upshrinkHeaderIC\'
|
|
|
+ ],
|
|
|
+ aSwapImages: [
|
|
|
+ {
|
|
|
+ sId: \'upshrink_ic\',
|
|
|
+ altExpanded: ', JavaScriptEscape($txt['hide']), ',
|
|
|
+ altCollapsed: ', JavaScriptEscape($txt['show']), '
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ aSwapLinks: [
|
|
|
+ {
|
|
|
+ sId: \'upshrink_link\',
|
|
|
+ msgExpanded: ', JavaScriptEscape(sprintf($txt['info_center_title'], $context['forum_name_html_safe'])), ',
|
|
|
+ msgCollapsed: ', JavaScriptEscape(sprintf($txt['info_center_title'], $context['forum_name_html_safe'])), '
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ oThemeOptions: {
|
|
|
+ bUseThemeSettings: ', $context['user']['is_guest'] ? 'false' : 'true', ',
|
|
|
+ sOptionName: \'collapse_header_ic\',
|
|
|
+ sSessionId: smf_session_id,
|
|
|
+ sSessionVar: smf_session_var,
|
|
|
+ },
|
|
|
+ oCookieOptions: {
|
|
|
+ bUseCookie: ', $context['user']['is_guest'] ? 'true' : 'false', ',
|
|
|
+ sCookieName: \'upshrinkIC\'
|
|
|
+ }
|
|
|
+ });
|
|
|
+ // ]]></script>';
|
|
|
+}
|
|
|
+
|
|
|
+function template_ic_block_recent()
|
|
|
+{
|
|
|
+ global $context, $scripturl, $settings, $txt;
|
|
|
+
|
|
|
+ // This is the "Recent Posts" bar.
|
|
|
+ echo '
|
|
|
<div class="title_barIC">
|
|
|
<h4 class="titlebg">
|
|
|
<a href="', $scripturl, '?action=recent"><img class="icon" src="', $settings['images_url'], '/post/xx.png" alt="" />', $txt['recent_posts'], '</a>
|
|
@@ -262,19 +314,19 @@ function template_info_center()
|
|
|
<a rel="feedurl" href="', $scripturl, '?action=.xml;type=webslice">', $txt['subscribe_webslice'], '</a>
|
|
|
</div>';
|
|
|
|
|
|
- // Only show one post.
|
|
|
- if ($settings['number_recent_posts'] == 1)
|
|
|
- {
|
|
|
- // latest_post has link, href, time, subject, short_subject (shortened with...), and topic. (its id.)
|
|
|
- echo '
|
|
|
+ // Only show one post.
|
|
|
+ if ($settings['number_recent_posts'] == 1)
|
|
|
+ {
|
|
|
+ // latest_post has link, href, time, subject, short_subject (shortened with...), and topic. (its id.)
|
|
|
+ echo '
|
|
|
<p id="infocenter_onepost" class="inline">
|
|
|
<a href="', $scripturl, '?action=recent">', $txt['recent_view'], '</a> "', sprintf($txt['is_recent_updated'], '"' . $context['latest_post']['link'], '"'), ' (', $context['latest_post']['time'], ')<br />
|
|
|
</p>';
|
|
|
- }
|
|
|
- // Show lots of posts.
|
|
|
- elseif (!empty($context['latest_posts']))
|
|
|
- {
|
|
|
- echo '
|
|
|
+ }
|
|
|
+ // Show lots of posts.
|
|
|
+ elseif (!empty($context['latest_posts']))
|
|
|
+ {
|
|
|
+ echo '
|
|
|
<table id="ic_recentposts">
|
|
|
<tr>
|
|
|
<th class="recentpost first_th">', $txt['message'], '</th>
|
|
@@ -283,74 +335,78 @@ function template_info_center()
|
|
|
<th class="recenttime last_th">', $txt['date'], '</th>
|
|
|
</tr>';
|
|
|
|
|
|
- /* Each post in latest_posts has:
|
|
|
- board (with an id, name, and link.), topic (the topic's id.), poster (with id, name, and link.),
|
|
|
- subject, short_subject (shortened with...), time, link, and href. */
|
|
|
- foreach ($context['latest_posts'] as $post)
|
|
|
- echo '
|
|
|
+ /* Each post in latest_posts has:
|
|
|
+ board (with an id, name, and link.), topic (the topic's id.), poster (with id, name, and link.),
|
|
|
+ subject, short_subject (shortened with...), time, link, and href. */
|
|
|
+ foreach ($context['latest_posts'] as $post)
|
|
|
+ echo '
|
|
|
<tr>
|
|
|
<td class="recentpost"><strong>', $post['link'], '</strong></td>
|
|
|
<td class="recentposter">', $post['poster']['link'], '</td>
|
|
|
<td class="recentboard">', $post['board']['link'], '</td>
|
|
|
<td class="recenttime">', $post['time'], '</td>
|
|
|
</tr>';
|
|
|
- echo '
|
|
|
- </table>';
|
|
|
- }
|
|
|
echo '
|
|
|
- </div>';
|
|
|
+ </table>';
|
|
|
}
|
|
|
+ echo '
|
|
|
+ </div>';
|
|
|
+}
|
|
|
+
|
|
|
+function template_ic_block_calendar()
|
|
|
+{
|
|
|
+ global $context, $scripturl, $txt, $settings;
|
|
|
|
|
|
// Show information about events, birthdays, and holidays on the calendar.
|
|
|
- if ($context['show_calendar'])
|
|
|
- {
|
|
|
- echo '
|
|
|
+ echo '
|
|
|
<div class="title_barIC">
|
|
|
<h4 class="titlebg">
|
|
|
<a href="', $scripturl, '?action=calendar' . '"><img class="icon" src="', $settings['images_url'], '/icons/calendar.png', '" alt="" />', $context['calendar_only_today'] ? $txt['calendar_today'] : $txt['calendar_upcoming'], '</a>
|
|
|
</h4>
|
|
|
</div>';
|
|
|
|
|
|
- // Holidays like "Christmas", "Chanukah", and "We Love [Unknown] Day" :P.
|
|
|
- if (!empty($context['calendar_holidays']))
|
|
|
- echo '
|
|
|
+ // Holidays like "Christmas", "Chanukah", and "We Love [Unknown] Day" :P.
|
|
|
+ if (!empty($context['calendar_holidays']))
|
|
|
+ echo '
|
|
|
<p class="inline holiday"><span>', $txt['calendar_prompt'], '</span> ', implode(', ', $context['calendar_holidays']), '</p>';
|
|
|
|
|
|
- // People's birthdays. Like mine. And yours, I guess. Kidding.
|
|
|
- if (!empty($context['calendar_birthdays']))
|
|
|
- {
|
|
|
- echo '
|
|
|
+ // People's birthdays. Like mine. And yours, I guess. Kidding.
|
|
|
+ if (!empty($context['calendar_birthdays']))
|
|
|
+ {
|
|
|
+ echo '
|
|
|
<p class="inline">
|
|
|
<span class="birthday">', $context['calendar_only_today'] ? $txt['birthdays'] : $txt['birthdays_upcoming'], '</span>';
|
|
|
- // Each member in calendar_birthdays has: id, name (person), age (if they have one set?), is_last. (last in list?), and is_today (birthday is today?)
|
|
|
- foreach ($context['calendar_birthdays'] as $member)
|
|
|
- echo '
|
|
|
- <a href="', $scripturl, '?action=profile;u=', $member['id'], '">', $member['is_today'] ? '<strong class="fix_rtl_names">' : '', $member['name'], $member['is_today'] ? '</strong>' : '', isset($member['age']) ? ' (' . $member['age'] . ')' : '', '</a>', $member['is_last'] ? '' : ', ';
|
|
|
+ // Each member in calendar_birthdays has: id, name (person), age (if they have one set?), is_last. (last in list?), and is_today (birthday is today?)
|
|
|
+ foreach ($context['calendar_birthdays'] as $member)
|
|
|
echo '
|
|
|
+ <a href="', $scripturl, '?action=profile;u=', $member['id'], '">', $member['is_today'] ? '<strong class="fix_rtl_names">' : '', $member['name'], $member['is_today'] ? '</strong>' : '', isset($member['age']) ? ' (' . $member['age'] . ')' : '', '</a>', $member['is_last'] ? '' : ', ';
|
|
|
+ echo '
|
|
|
</p>';
|
|
|
- }
|
|
|
+ }
|
|
|
|
|
|
- // Events like community get-togethers.
|
|
|
- if (!empty($context['calendar_events']))
|
|
|
- {
|
|
|
- echo '
|
|
|
+ // Events like community get-togethers.
|
|
|
+ if (!empty($context['calendar_events']))
|
|
|
+ {
|
|
|
+ echo '
|
|
|
<p class="inline">
|
|
|
<span class="event">', $context['calendar_only_today'] ? $txt['events'] : $txt['events_upcoming'], '</span> ';
|
|
|
|
|
|
- // Each event in calendar_events should have:
|
|
|
- // title, href, is_last, can_edit (are they allowed?), modify_href, and is_today.
|
|
|
- foreach ($context['calendar_events'] as $event)
|
|
|
- echo '
|
|
|
- ', $event['can_edit'] ? '<a href="' . $event['modify_href'] . '" title="' . $txt['calendar_edit'] . '"><img src="' . $settings['images_url'] . '/icons/calendar_modify.png" alt="*" class="centericon" /></a> ' : '', $event['href'] == '' ? '' : '<a href="' . $event['href'] . '">', $event['is_today'] ? '<strong>' . $event['title'] . '</strong>' : $event['title'], $event['href'] == '' ? '' : '</a>', $event['is_last'] ? '<br />' : ', ';
|
|
|
+ // Each event in calendar_events should have:
|
|
|
+ // title, href, is_last, can_edit (are they allowed?), modify_href, and is_today.
|
|
|
+ foreach ($context['calendar_events'] as $event)
|
|
|
echo '
|
|
|
+ ', $event['can_edit'] ? '<a href="' . $event['modify_href'] . '" title="' . $txt['calendar_edit'] . '"><img src="' . $settings['images_url'] . '/icons/calendar_modify.png" alt="*" class="centericon" /></a> ' : '', $event['href'] == '' ? '' : '<a href="' . $event['href'] . '">', $event['is_today'] ? '<strong>' . $event['title'] . '</strong>' : $event['title'], $event['href'] == '' ? '' : '</a>', $event['is_last'] ? '<br />' : ', ';
|
|
|
+ echo '
|
|
|
</p>';
|
|
|
- }
|
|
|
}
|
|
|
+}
|
|
|
+
|
|
|
+function template_ic_block_stats()
|
|
|
+{
|
|
|
+ global $scripturl, $txt, $context, $settings;
|
|
|
|
|
|
// Show statistical style information...
|
|
|
- if ($settings['show_stats_index'])
|
|
|
- {
|
|
|
- echo '
|
|
|
+ echo '
|
|
|
<div class="title_barIC">
|
|
|
<h4 class="titlebg">
|
|
|
<a href="', $scripturl, '?action=stats" title="', $txt['more_stats'], '"><span class="stats_icon boards"></span>', $txt['forum_stats'], '</a>
|
|
@@ -361,8 +417,11 @@ function template_info_center()
|
|
|
', (!empty($context['latest_post']) ? $txt['latest_post'] . ': <strong>"' . $context['latest_post']['link'] . '"</strong> ( ' . $context['latest_post']['time'] . ' )<br />' : ''), '
|
|
|
<a href="', $scripturl, '?action=recent">', $txt['recent_view'], '</a>
|
|
|
</p>';
|
|
|
- }
|
|
|
+}
|
|
|
|
|
|
+function template_ic_block_online()
|
|
|
+{
|
|
|
+ global $context, $scripturl, $txt, $modSettings;
|
|
|
// "Users online" - in order of activity.
|
|
|
echo '
|
|
|
<div class="title_barIC">
|
|
@@ -404,59 +463,5 @@ function template_info_center()
|
|
|
|
|
|
echo '
|
|
|
</p>';
|
|
|
-
|
|
|
- // If they are logged in, but statistical information is off... show a personal message bar.
|
|
|
- if ($context['user']['is_logged'] && !$settings['show_stats_index'])
|
|
|
- {
|
|
|
- echo '
|
|
|
- <div class="title_barIC">
|
|
|
- <h4 class="titlebg">
|
|
|
- ', $context['allow_pm'] ? '<a href="' . $scripturl . '?action=pm">' : '', '<span class="pm_icons inbox icon"></span>', $txt['personal_message'], '', $context['allow_pm'] ? '</a>' : '', '
|
|
|
- </h4>
|
|
|
- </div>
|
|
|
- <p class="pminfo">
|
|
|
- ', empty($context['user']['messages']) ? $txt['you_have_no_msg'] : ($context['user']['messages'] == 1 ? sprintf($txt['you_have_one_msg'], $scripturl . '?action=pm') : sprintf($txt['you_have_many_msgs'], $scripturl . '?action=pm', $context['user']['messages'])), '
|
|
|
- </p>';
|
|
|
- }
|
|
|
-
|
|
|
- echo '
|
|
|
- </div>
|
|
|
- </div>';
|
|
|
-
|
|
|
- // Info center collapse object.
|
|
|
- echo '
|
|
|
- <script type="text/javascript"><!-- // --><![CDATA[
|
|
|
- var oInfoCenterToggle = new smc_Toggle({
|
|
|
- bToggleEnabled: true,
|
|
|
- bCurrentlyCollapsed: ', empty($options['collapse_header_ic']) ? 'false' : 'true', ',
|
|
|
- aSwappableContainers: [
|
|
|
- \'upshrinkHeaderIC\'
|
|
|
- ],
|
|
|
- aSwapImages: [
|
|
|
- {
|
|
|
- sId: \'upshrink_ic\',
|
|
|
- altExpanded: ', JavaScriptEscape($txt['hide']), ',
|
|
|
- altCollapsed: ', JavaScriptEscape($txt['show']), '
|
|
|
- }
|
|
|
- ],
|
|
|
- aSwapLinks: [
|
|
|
- {
|
|
|
- sId: \'upshrink_link\',
|
|
|
- msgExpanded: ', JavaScriptEscape(sprintf($txt['info_center_title'], $context['forum_name_html_safe'])), ',
|
|
|
- msgCollapsed: ', JavaScriptEscape(sprintf($txt['info_center_title'], $context['forum_name_html_safe'])), '
|
|
|
- }
|
|
|
- ],
|
|
|
- oThemeOptions: {
|
|
|
- bUseThemeSettings: ', $context['user']['is_guest'] ? 'false' : 'true', ',
|
|
|
- sOptionName: \'collapse_header_ic\',
|
|
|
- sSessionId: smf_session_id,
|
|
|
- sSessionVar: smf_session_var,
|
|
|
- },
|
|
|
- oCookieOptions: {
|
|
|
- bUseCookie: ', $context['user']['is_guest'] ? 'true' : 'false', ',
|
|
|
- sCookieName: \'upshrinkIC\'
|
|
|
- }
|
|
|
- });
|
|
|
- // ]]></script>';
|
|
|
}
|
|
|
?>
|