Ok, I'm trying to modify a bit of code that is used to make my website display random headers on pageload.
What I am modifying is this bit here:
$file = array('header.html', 'header2.html', 'header3.html');
$rand = rand(0, count($file)-1);
if (THEME_USES_TPL) {
$cpgtpl->set_filenames(array('cpgheader' => $file[$rand]));
$cpgtpl->display('cpgheader');
}
The change I am wanting deals with the array that contains the alternate header.html files.
The existing array is the default, but I would like the code to check the current date and if it falls between date X and date Y pull the headers from an alternate array. The idea is to automate the display of special holiday headers.
I'm not much of a php coder but I'm trying to learn.
It seems to me that it's simply a matter of an IF/THEN/ELSE statement to choose which array is used for $file, but I don't know how to do the date handling/checking.
Any help would be appreciated