News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Automatical Calendar Banner MOD

Started by jossanaijr, June 07, 2008, 06:33:18 PM

Previous topic - Next topic

jossanaijr

Another idea...
A Mod that create a banner with the next calendar event to be shown / used with Ad Management MOD...

KiLLuMiNaTi-7-

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

jossanaijr


KiLLuMiNaTi-7-


Advertisement: