Topic: punBB announcements: only on home page?
Hi,
One user got a little confused by an announcement of mine being displayed on all forum pages. Is it possible to have the announcement displayed only on the "home" page of my foruns?
Thanks,
You are not logged in. Please login or register.
PunBB Forums → PunBB 1.2 modifications, plugins and integrations → punBB announcements: only on home page?
Hi,
One user got a little confused by an announcement of mine being displayed on all forum pages. Is it possible to have the announcement displayed only on the "home" page of my foruns?
Thanks,
Try this. Open up header.php and look for
if ($pun_config['o_announcement'] == '1')
and replace it with
if ($pun_config['o_announcement'] == '1' && basename(__FILE__) == 'index.php')
This is a code modification so I'll move it to the mod forum.
Thanks Rickard.
I tried it (locally, at home), but it didn't work: the announcement will not show anywhere with this mod. Which surprised me, i thought it would work...
any ideas?
edit: would you like me to put it online, so you can see it?
Hmm, that's odd. I can't find anything wrong with the code. Try adding the following line to the top of header.php:
exit(basename(__FILE__));
And tell me what it outputs.
The output was "header.php", on a blank background...
Could this odd beahviour be because i am running this mod (and the test you just told me to) locally, on my mac ? I can try this online if you think it is worth it.
Ah, of course! I'm an idiot :) Try this instead:
if ($pun_config['o_announcement'] == '1' && basename($_SERVER['SCRIPT_FILENAME']) == 'index.php')
Yes, that works!
Thanks a lot, Rickard.
PunBB Forums → PunBB 1.2 modifications, plugins and integrations → punBB announcements: only on home page?
Powered by PunBB, supported by Informer Technologies, Inc.