PDA

View Full Version : Adding an if statement to a template


bigsoccer tech
Thu 4th May '00, 12:08am
I need to do the following:

In my header I want to serve button a in forums that belong to category 1 and 5, button b in forums that belong to category 2 and 4 and button elsewhere.

I'ld like to create a variable called:

$ppnbutton

And have code something liek this:

If category=1 or 5
then $ppnbutton = (html code)
else
if category=......etc

Is this doable? How?

John
Thu 4th May '00, 1:54am
Use a different header in forums 2 and 5. You can add a new header template into the database from the control panel. Calling it 'header2' or something. Then, modify the forums that you want changed, and set their header template to point at header2.

John

bigsoccer tech
Thu 4th May '00, 3:42am
Ah..i get it.

but can this be done for a _category_ instead of having to manually do what, for me, is 20 different forums but only 2 categories?

John
Thu 4th May '00, 6:12am
Unfortunately, it has to be done manually at the moment.

John

bigsoccer tech
Thu 4th May '00, 10:00pm
that's kewl...it's still about 1000, no...1001 times better than the ubb method.