1
I made this change awile ago, but thought I would share it. This is pretty much a change to the default theme header. This is the change I made to theme.tpl to the header section.
<!-- Start Header -->
<table cellspacing="0">
<tr id="header">
<td id="headerlogo"><a href="<{xoAppUrl /}>" title="<{$xoops_sitename}>"><{php}>
//This is used to calculate the various holidays and change the main Banner Logo Appropriately
$currentYear = date("Y");
$day = date("j");
$mnth = date("n");
//Used to Calculate floating Holidays
$easterday = date("j", easter_date($currentYear));
$eastermnth = date("n", easter_date($currentYear));
$edaystart = ($easterday - 7);
$edaystop = ($easterday + 2);
if ($edaystart<1 ) {$edaystart = 1;}
if ($edaystop>31 ) {$edaystop = 31;}
$turkeyDay = date('j', strtotime("november $currentYear fourth thursday"));
$turkeyStart = ($turkeyDay - 7);
$turkeyStop = ($turkeyDay + 2);
//Normal Image
$HolidayMsg = "Hello";
$logofile = $this->_tpl_vars['xoops_imageurl']. "logo_normal.jpg";
//XMAS
if ($mnth == "12" AND $day <= 29){
$logofile = $this->_tpl_vars['xoops_imageurl']. "logo_xmas.jpg";
$HolidayMsg = "Merry Christmas";
}else if ($mnth == "11" AND $day > $turkeyStop ) {
$logofile = $this->_tpl_vars['xoops_imageurl']. "logo_xmas.jpg";
$HolidayMsg = "Merry Christmas";
//NYE
}else if ($mnth == "12" AND $day > 29) {
$logofile = $this->_tpl_vars['xoops_imageurl']. "logo_newyears.jpg";
$HolidayMsg = "Happy New Years";
}else if ($mnth == "1" AND $day < 7) {
$logofile = $this->_tpl_vars['xoops_imageurl']. "logo_newyears.jpg";
$HolidayMsg = "Happy New Years";
//St Pattys Day
}else if ($mnth == "3" AND $day > 10 AND $day <= 19){
$logofile = $this->_tpl_vars['xoops_imageurl']. "logo_stpattys.jpg";
$HolidayMsg = "Happy St. Patty's Day";
//Easter
}else if ($mnth == $eastermnth AND $day >= $edaystart and $day <= $edaystop){
$logofile = $this->_tpl_vars['xoops_imageurl']. "logo_easter.jpg";
$HolidayMsg = "Happy Easter";
//4th July
}else if ($mnth == "6" AND $day >= 28){
$logofile = $this->_tpl_vars['xoops_imageurl']. "logo_4thjuly.jpg";
$HolidayMsg = "Happy 4th of July";
}else if ($mnth == "7" AND $day <= 6){
$logofile = $this->_tpl_vars['xoops_imageurl']. "logo_4thjuly.jpg";
$HolidayMsg = "Happy 4th of July";
//THANKSGIVING
}else if ($mnth == "11" AND $day >= $$turkeyStart AND $day <= $turkeyStop ) {
$logofile = $this->_tpl_vars['xoops_imageurl']. "logo_turkey.jpg";
$HolidayMsg = "Happy Thanksgiving";
//Default Normal Logo
}else{
$logofile = $this->_tpl_vars['xoops_imageurl']. "logo_normal.jpg";
}
echo '<img src="' . $logofile . '"';
<{/php}> alt="<{$xoops_sitename}>"/></a></td>
<td id="headerbanner"><{$xoops_banner}></td>
</tr>
<tr>
<td id="headerbar" colspan="2" height="25" style="vertical-align: middle;"><FONT COLOR = #0066FF><B> <{if $xoops_isuser}> <{php}>echo $HolidayMsg;<{/php}> <{$xoops_name}> and Welcome Back! <{else}> <{php}>echo $HolidayMsg;<{/php}>! If you're new here, please register for a free account <{/if}> </B></FONT COLOR></td>
</tr>
</table>
<!-- End header -->
This looks at the date, then changes the img src to the appropriate logo depending on the holiday. It changes a few days before the holiday and reset a few days after the holiday. It also changes the welcome message that appears in the header bar. Each of those images are basically my same site logo, with a different holiday theme added to it.
Hopefully, someone else finds this useful. I am sure there is a more SMARTY way of doing this. I just figured it was easier for me to inject PHP to handle it.