Holiday Cheer on Forums
Seems like Google has made it popular to change the logo of a website for holidays.
My question is how many of y’all do the same, and more importantly do your members like it?
Over on my photography forum I switched out the default logo with a winter themed one for Christmas. It’s scheduled to last for a couple more days before getting swapped for New Years. And then I’ve got a couple more scheduled to appear. But rather than describing them, here are the logos.
Original Logo
Christmas Logo
New Years
Inauguration Day – Jan 20, 2009
I’ll probably use this one for July 4th as well.
Valentines Day
On all of the logos I kept the basic design the same. I like the font and reflection. What can I say, I like stuff that’s got the cliché web 2.0 look.
As far as member response, it has been at least publically positive. A couple chimed in and said they liked the Christmas logo. We’ll have to wait to see what happens on the 31st. That’s when the logo is scheduled to change to the fireworks and it’ll stay that way until the 4th of January.
The code
To have the logo automatically swap I added a function to the index.template.php file in my themes folder and then call that function instead of the tag that normally would display the graphic. It's working for now, but with any luck the forum will get busy enough where the little bit of processing in this function becomes too much.
-
/**
-
* Returns the path to any special logo like New Years, Christmas, etc. If not
-
* within date range it'll return the path to the default logo.
-
*
-
* This returns a complete <img> tag including the height and width so that we
-
* can still define height and width without having to read the image file every
-
* time.
-
*/
-
function logoPath()
-
{
-
global $settings;
-
-
-
if ($currentMonth==12 && $currentDay>20 && $currentDay<31)
-
{
-
// Christmas logo
-
$imgReturn = '<img src="'.$settings['images_url'].'/logos/logo-christmas2008.png" height="85" width="596" alt="Happy Holidays" title="Happy Holidays">';
-
}
-
else if (($currentMonth==12 && $currentDay==31) || ($currentMonth==1 && $currentDay<4))
-
{
-
// New Years
-
$imgReturn ='<img src="'.$settings['images_url'].'/logos/logo-new-years-2009.png" height="135" width="595" alt="Happy New Years!" title="Happy New Years!">';
-
}
-
else if ($currentDay==14 && $currentMonth==2)
-
{
-
// Valentines Day
-
$imgReturn ='<img src="'.$settings['images_url'].'/logos/logo-valentines-day.png" height="83" width="595" alt="Happy Valentines Day" title="Happy Valentines Day">';
-
}
-
-
// Special cases - These can be removed after the date
-
else if ($currentMonth==1 && $currentYear==2009 && $currentDay = 20)
-
{
-
// Inauguration Day
-
$imgReturn = '<img src="'.$settings['images_url'].'/logos/logo-inauguration-2009.png" height="107" width="595" alt="Inauguration Day" title="Inauguration Day">';
-
}
-
-
// Default logo
-
else
-
{
-
// Default logo
-
$imgReturn = '<img src="'.$settings['images_url'].'/logo.png" height="70" width="596" alt="Logo" title="Return to forum home page">';
-
}
-
-
return $imgReturn;
-
-
}
Of course you'll need to change the code to point to your logos and work on whatever holidays you want. But using the date() function to get the day, month, and year makes it pretty easy to figure out what should be showing when. My next step will probably be to use the z parameter for date() and use the day of the year (0-365) instead of months and days to make it a little more efficient. Down side is it'll be harder to maintain. 2/14 is a lot easier to remember than day 46.
Question, Comments...
Do you have more questions. Please either leave a comment below or join us in our new forum.