Simple Machines Community Forum

Customizing SMF => SMF Coding Discussion => Topic started by: Low on August 25, 2015, 08:45:57 AM

Title: IF page
Post by: Low on August 25, 2015, 08:45:57 AM
2.0.10 - I want to add a banner for certain pages. What PHP-if call can I use to only show it on the home, boards, and topic pages. I.e. if topic/home/board = echo 'banner';
Title: Re: IF page
Post by: JBlaze on August 25, 2015, 01:19:14 PM
To make your life easier, you can consider installing SimpleAds (http://custom.simplemachines.org/mods/index.php?mod=2557) and use that to display a banner (doesn't have to be an ad!) on certain actions/boards/topics, and it has customizable locations to put the banner as well. :)
Title: Re: IF page
Post by: Diego Andrés on August 25, 2015, 10:12:01 PM
BTW, the if would be

if (!isset($_REQUEST['action']) || !empty($topic) || !empty($board))

Don't forget to globalize $board and $topic
Title: Re: IF page
Post by: Low on August 26, 2015, 09:46:07 AM
Thanks guys, from the given information I should be able to get it sorted. Thanks again!