Does a method exist to check what board a topic is in?

Started by themavesite, March 01, 2017, 12:03:23 PM

Previous topic - Next topic

themavesite

I want my header image to change depending on which board I'm in.
The following code works when you are in the board itself, but once you open a topic, of course that code doesn't work.
$url = 'http://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
        if(strpos($url,'board=98.0') !== false) {
$selectedBg = "header-bg13.jpg";   
}


So my question: is there some method to check in what board a topic is located? (so I can display the same header image as long as you're still in the same board)

Thanks!
TMS Forums
Since 2008 and still going strong! Join today! http://forums.themavesite.com/index.php

Arantor

Examine the $board variable. You might need to use global $board; first.

themavesite

Quote from: Arantor on March 01, 2017, 12:09:07 PM
Examine the $board variable. You might need to use global $board; first.

Thank you, this did the trick!
TMS Forums
Since 2008 and still going strong! Join today! http://forums.themavesite.com/index.php

Advertisement: