Miscellaneous
 
By adding a text file called 'seasonal_banner.inc' to the project's root folder you can have banner overlays appearing between specific dates. You also need to add the content files, images, to a folder called 'seasonal_banner' inside a 'res' in the project's root folder. An example of such a file is shown below, it adds a Christmas flourish between December 17 and January 6 each year.
Note, add the lines beginning with document.getElementById and ending with a single quote and a semicolon on one line (they are shown on multiple lines to make it easier to read).

<script>
//Xmas
ms = 12;
ds = 4;
mf = 12;
df = 31;
isWithin = checkDate(ms, ds, mf, df);
if(isWithin) {
document.getElementById("banner").innerHTML+=
'<div id="overlay">
<img src="${resPath}/seasonal_banner/snow.gif"
alt="snow.gif" width="${themeWidth}" height="${themeHeight}">
</div>';
document.getElementById("banner").innerHTML+=
'<div id="flourish">
<img src="${resPath}/seasonal_banner/hollyl.gif" alt="hollyl.gif" width="44" height="36">
  Merry Christmas  
<img src="${resPath}/seasonal_banner/hollyr.gif" alt="hollyr.gif" width="44" height="36">
</div>';
}
//New year
ms = 1;
ds = 1;
mf = 1;
df = 6;
isWithin = checkDate(ms, ds, mf, df);
if(isWithin) {
document.getElementById("banner").innerHTML+=
'<div id="overlay">
<img src="${resPath}/seasonal_banner/snow.gif"
alt="snow.gif" width="${themeWidth}" height="${themeHeight}">
</div>';
}
//Easter
ms = 4;
ds = 7;
mf = 4;
df = 10;
isWithin = checkDate(ms, ds, mf, df);
if(isWithin) {
document.getElementById("banner").innerHTML+=
'<div id="flourish"><img src="${resPath}/seasonal_banner/egg.gif"
alt="egg.gif" width="50" height="60">
  Happy Easter!  
<img src="${resPath}/seasonal_banner/egg.gif"
alt="egg.gif" width="50" height="60">
</div>';
}
</script>

As you can see, you can have more than one period, the example above shows three periods.
The example also shows that you can have, above the banner/theme image, an overlay, flourish or both.

It might look complicated but it is very easy to change both dates and contents.
First, the dates for displaying the content. ms and ds define the starting date, month and day. In the first section above it is set to start on December 17 (ms=12, ds=17). mf and df are the ending date January 6 (mf=1, df = 6). The content will be displayed from December 17 until January 6.

The content is the html code to be inserted and is within the lines starting with document.getElementById. The code is being appended to the banner div tag. To include your own content just add your files as shown above and then change:

snow.gif to your overlay image and hollyl.gif to your flourish images.
Change, or remove, the text for the flourish ( Merry Christmas  ).
Change the image dimensions (width="44" height="36") to those of your images.
Leave everything else alone.

If you want content on fewer occasions just remove the blocks starting with
//Subject
if(isWithin) { and ending with the last } before the </script> tag.

 
Go to top of page