News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Conditionals and variables in SMF...

Started by JustOneOldMan, November 11, 2014, 10:09:22 AM

Previous topic - Next topic

JustOneOldMan

SMF 2.0.9

Very basic question, I'm sure, but I'm having trouble with it.  I'm using the mod Global Headers & Footers, and the SMF Arcade mod, but although this question involves the use of these mods it doesn't really relate directly to either one.  More of a generic SMF question, so I figured this was the appropriate place to ask.

I've looked through the SMF Global Variables list and didn't see what I needed.  I'd like to show one header image (Global Headers & Footers) in the regular forums, and a different one in the arcade.  Since the arcade isn't a specific board, etc., I don't know what to check for in a condition.

So the question is, is there a variable available that I can use in a conditional check to see whether I'm in the arcade (for example), or at least not in the standard index or a board?  And if not, where would I set a variable that I could use for this check?  Or would it be best to simply check multiple available variables to see if I'm not in any of the normal areas?

Thanks...
A computer once beat me at chess, but as it turns out it was no match for me at kickboxing...

margarett

$context['current_action'] should let you know if you're inside a specific action, eg, arcade ;)
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

JustOneOldMan

Thank you, margarett, I'll go that way.  Appreciate the reply...
A computer once beat me at chess, but as it turns out it was no match for me at kickboxing...

Matthew K.

Although you can't put PHP in the Headers and Footers mod...

JustOneOldMan

Just found that out a few minutes ago, Labradoodle. :P

Trying to figure out how to do it now.  Guess there might not be an easy answer...
A computer once beat me at chess, but as it turns out it was no match for me at kickboxing...

margarett

You can always not use GHF and put the image code in index.template.php directly ;)
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Matthew K.

That's honestly probably the best way to do it at this point.

JustOneOldMan

Thanks margarett and Labradoodle.  That's actually what I'd just decided to do.  I was just about to do away with an image altogether, but kind of wanted it in there.

I know it's not best practice, but it will be quick and easy.  Thanks again for the help...
A computer once beat me at chess, but as it turns out it was no match for me at kickboxing...

JustOneOldMan

Almost forgot to come back and mark this as solved.  Was hoping to be able to do this through GHF somehow, but a couple simple lines in index.template.php did exactly what I needed.

Appreciate the assistance, marking this topic solved...
A computer once beat me at chess, but as it turns out it was no match for me at kickboxing...

Matthew K.


Advertisement: