Simple Machines Community Forum

Customizing SMF => Tips and Tricks => Topic started by: codenaught on June 20, 2005, 06:27:50 PM

Title: Calendar colors by theme basis
Post by: codenaught on June 20, 2005, 06:27:50 PM
SMF has all of the calendar colors that are displayed on the Board Index set in Edit Features and Options->Calendar.

The problem is, what if your theme uses colors that make the calendar colors displayed globally on all themes hard to read?

The following tip is how to take a theme and make it use its own custom calendar colors rather then have it use the global ModSettings colors.
Open
ThemeName/BoardIndex.template.php

Find
<span class="titlebg" style="color: #', $modSettings['cal_holidaycolor'], ';">

Replace
<span class="holiday">

Find
<span style="color: #', $modSettings['cal_bdaycolor'], ';">

Replace
<span class="birthday">

Find
<span style="color: #', $modSettings['cal_eventcolor'], ';">

Replace
<span class="event">


Open
style.css

Add
.holiday
{
   color: #000080;
}

.event
{
   color: #078907;
}

.birthday
{
   color: #920AC4;
}


Change the hex values to whatever you want. Here they are on their default value.
Title: Re: Calendar colors by theme basis
Post by: Kirby on June 22, 2005, 10:02:45 PM
Or you can change them in your index template by going to the template_init function, add $modSettings in the global line, and then add this before the last curly bracket/} of the function:


$modSettings['cal_holidaycolor'] = '#newcolor';
$modSettings['cal_bdaycolor'] = '#newcolor';
$modSettings['cal_eventcolor'] = '#newcolor';