Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Mod Requests => Topic started by: jossanaijr on June 07, 2008, 06:33:18 PM

Title: Automatical Calendar Banner MOD
Post by: jossanaijr on June 07, 2008, 06:33:18 PM
Another idea...
A Mod that create a banner with the next calendar event to be shown / used with Ad Management MOD...
Title: Re: Automatical Calendar Banner MOD
Post by: KiLLuMiNaTi-7- on June 07, 2008, 06:51:30 PM
Place this in the content box. Inside the ad management panel.

Quote// Show information about events, birthdays, and holidays on the calendar.
if ($context['show_calendar'])
{
echo '
<tr>
<td class="titlebg" colspan="2">', $context['calendar_only_today'] ? $txt['calendar47b'] :  '</td>
</tr><tr>
<td class="windowbg2" width="50%">
<span class="smalltext">';

// Events like community get-togethers.
if (!empty($context['calendar_events']))
{
echo '
<span style="color: #', $modSettings['cal_eventcolor'], ';">', $context['calendar_only_today'] ? $name="Upcoming Events" : $name="Upcoming Events", '</span> ';
/* Each event in calendar_events should have:
title, href, is_last, can_edit (are they allowed?), modify_href, and is_today. */
echo ' <br />';
foreach ($context['calendar_events'] as $event)
echo '
', $event['date'], ' - ', $event['href'] == '' ? '' : '<a href="' . $event['href'] . '">', $event['is_today'] ? '<b>' . $event['title'] . '</b>' : $event['title'], $event['href'] == '' ? '' : '</a>', $event['is_last'] ? '<br />' : ', <br /> ';
}
echo '
</span>
</td>
</tr>';
}

This will only display the upcoming events. Nothing else. It will also display the date of the event.

The code is a bit messy (Got some code in there which isn't doing anything.) But it works fine

Make sure you have selected PHP as the type, in the ad management admin panel
Title: Re: Automatical Calendar Banner MOD
Post by: jossanaijr on June 07, 2008, 06:59:16 PM
Wow! Thanks!
Title: Re: Automatical Calendar Banner MOD
Post by: KiLLuMiNaTi-7- on June 07, 2008, 07:11:37 PM
No problem ;)