Advertisement:

Author Topic: Calendar colors by theme basis  (Read 17777 times)

Offline codenaught

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 14,653
  • Gender: Male
  • Formerly Known As akabugeyes
Calendar colors by theme basis
« 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
Code: [Select]
<span class="titlebg" style="color: #', $modSettings['cal_holidaycolor'], ';">
Replace
Code: [Select]
<span class="holiday">
Find
Code: [Select]
<span style="color: #', $modSettings['cal_bdaycolor'], ';">
Replace
Code: [Select]
<span class="birthday">
Find
Code: [Select]
<span style="color: #', $modSettings['cal_eventcolor'], ';">
Replace
Code: [Select]
<span class="event">
Open
style.css

Add
Code: [Select]
.holiday
{
   color: #000080;
}

.event
{
   color: #078907;
}

.birthday
{
   color: #920AC4;
}

Change the hex values to whatever you want. Here they are on their default value.
Dev Consultant
Former SMF Doc Coordinator

Offline Kirby

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 2,040
  • Gender: Male
Re: Calendar colors by theme basis
« Reply #1 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:

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