PDA

View Full Version : Add seasonal images to your forum


tgmorris
21 Dec 2005, 17:14
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)
21 Dec 2005, 18:34
Hmmm

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

But Nothing

tgmorris
21 Dec 2005, 19:13
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
21 Dec 2005, 19:34
Would we need to change the date format to 2512, for example, in the UK as our dates are the opposite way around?

tgmorris
21 Dec 2005, 19:59
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)
21 Dec 2005, 20:05
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
21 Dec 2005, 20:27
Well, you might try removing the conditional just to make sure the image shows correctly.

Feckie (Roger)
21 Dec 2005, 20:40
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)
21 Dec 2005, 20:47
Ok I Got that sorted to


Learning fast he he

GuaRRand
22 Dec 2005, 13:44
screenshots?

tgmorris
22 Dec 2005, 14:31
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
22 Dec 2005, 16:26
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)
22 Dec 2005, 16:30
Interesting Just Set Mt Pc Date To 1 jan 2006
And there is no Change

Also visited your forum and No Difference

Hmmm

tgmorris
22 Dec 2005, 16:37
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)
22 Dec 2005, 17:17
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
14 Nov 2006, 22:58
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
15 Nov 2006, 00:32
It *should* be in the header template.

simalert
15 Nov 2006, 08:40
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.