Log in

View Full Version : Add seasonal images to your forum


tgmorris
12-20-2005, 10:00 PM
This is a simple plugin and header template modification which can be added to any template where it made sense if desired.

What this does is use a plugin to determine the month and day and creates a variable that may then be used in templates to decide what, if any, images should be shown. The format of the returned date is 'mmdd'. At the moment I'm using it in my header template to display Christmas and New Years stuff but it can easily be augmented with any holiday images you wish.

Installation

1. Install the attached plugin.
2. Add the following to whatever template you desire and modify it accordingly based on the location of your special images.

<!-- Holiday stuff -->
<if condition="$header_date_check >= '1220' AND $header_date_check <= '1225'">
<tr>
<td style="vertical-align: middle; background: #FFFFFF url(/Images/blinking_lights.gif) right no-repeat" height="18"><img src="$vboptions[cleargifurl]" width="760" height="1" alt="" />
</td>
</tr>
</if>
<if condition="$header_date_check == '1231' OR $header_date_check == '0101'">
<tr>
<td style="vertical-align: middle; background: #FFFFFF url(/Images/newyear.gif) center no-repeat" height="57"><img src="$vboptions[cleargifurl]" width="760" height="1" alt="" />
</td>
</tr>
</if>
<!-- / Holiday stuff -->


Notes

The way the template is currently written it's designed to fit within a table (I have mine under the navbar) but it can easily be modified to work in all situations.

Feckie (Roger)
12-21-2005, 05:34 PM
Hmmm

Doesn't seem to show up
added to header
installed plugin
uploaded images and location changed

But Nothing

tgmorris
12-21-2005, 06:13 PM
Hmmm

Doesn't seem to show up
added to header
installed plugin
uploaded images and location changed

But Nothing

I know it's obvious, did you make sure the plugin was set to "active"? It should be by default but one never knows.

Azhrialilu
12-21-2005, 06:34 PM
Would we need to change the date format to 2512, for example, in the UK as our dates are the opposite way around?

tgmorris
12-21-2005, 06:59 PM
Would we need to change the date format to 2512, for example, in the UK as our dates are the opposite way around?You shouldn't as the plugin converts the date using the 'md' format which should force it to the put it into how the template expects it to be. However feel free to modify the plugin format as well as the template if it makes it easier for you to work with that order.

Feckie (Roger)
12-21-2005, 07:05 PM
I know it's obvious, did you make sure the plugin was set to "active"? It should be by default but one never knows.

Yep it is set to active

tgmorris
12-21-2005, 07:27 PM
Well, you might try removing the conditional just to make sure the image shows correctly.

Feckie (Roger)
12-21-2005, 07:40 PM
Ok I got it to work

Just put it inside Table Tags and bingo

Would like to have it centered oBut no matter what I do
It is always left aligned

Any Idea's

Feckie (Roger)
12-21-2005, 07:47 PM
Ok I Got that sorted to

Learning fast he he

GuaRRand
12-22-2005, 12:44 PM
screenshots?

tgmorris
12-22-2005, 01:31 PM
screenshots?Not much point really as they'll vary depending on what images are used. If you take a look at my site (http://www.babblers.org) I'm running the included images until Jan 2nd.

SpeedyHire
12-22-2005, 03:26 PM
all looks nice if you have a white background to add it to,:) if ya got a dark background it looks naff
nice work

Feckie (Roger)
12-22-2005, 03:30 PM
Interesting Just Set Mt Pc Date To 1 jan 2006
And there is no Change

Also visited your forum and No Difference

Hmmm

tgmorris
12-22-2005, 03:37 PM
Interesting Just Set Mt Pc Date To 1 jan 2006
And there is no Change

Also visited your forum and No Difference

HmmmThe date used is based on the time of the server, not your local computer. I did just modify the xml file to at least adjust the server time to your location.

Feckie (Roger)
12-22-2005, 04:17 PM
The date used is based on the time of the server, not your local computer. I did just modify the xml file to at least adjust the server time to your location.

That Thought Had Crossed My Mind , But I could not change my Server time as it's in the States..

This Is One Kewl idea, Going to Sit Down And Get The Whole Year Sorted hehe

simalert
11-14-2006, 09:58 PM
This is exactly what I am looking for and I can get it to work on any image except my logo.

Where do I add this to change the logo at the top left of the page?

Thanks

tgmorris
11-14-2006, 11:32 PM
It *should* be in the header template.

simalert
11-15-2006, 07:40 AM
That's what I thought, but there doesn't appear to be any reference to the gif file used.

I suspect it's done in the CSS, meaning I won't be able to do this I don't think. I am not using a standard style.