Topic: Index.php Only Message
I want to show a message on the front of the forums (index.php) only and not anywhere else on the forum. How can I do this?
You are not logged in. Please login or register.
PunBB Forums → PunBB 1.2 modifications, plugins and integrations → Index.php Only Message
I want to show a message on the front of the forums (index.php) only and not anywhere else on the forum. How can I do this?
Whereabouts on the index.php would you like it to appear?
above the whole forum
Create a file, pun_include it in main.tpl in the proper position. In the file, you'll have something like
if (basename($_SERVER['PHP_SELF']) == 'index.php')
{
// stuff
}
go to admin next go to option turn on announcement type ya message.... there you go... it will appear in the forum and index.php if you got this tag in the main.tpl
<pun_announcement>
Q
i dont want it in EVERY PAGE of the forum, just on index.php above the forum.
Thank u Smartys , I will try
I've changed the announcement to only appear on index.php before.
In header.php, find:
// START SUBST - <pun_announcement>
if ($pun_config['o_announcement'] == '1')
Replace with:
// START SUBST - <pun_announcement>
if ($pun_config['o_announcement'] == '1' && (strpos($_SERVER['SCRIPT_NAME'], '/index.php') != false)) // mod: front page only
(Not sure if that's the best conditional statement to use, but it worked for me at the time.)
I've changed the announcement to only appear on index.php before.
In header.php, find:
// START SUBST - <pun_announcement> if ($pun_config['o_announcement'] == '1')
Replace with:
// START SUBST - <pun_announcement> if ($pun_config['o_announcement'] == '1' && (strpos($_SERVER['SCRIPT_NAME'], '/index.php') != false)) // mod: front page only
(Not sure if that's the best conditional statement to use, but it worked for me at the time.)
The issue with that is that you then lose the use of the announcement
PunBB Forums → PunBB 1.2 modifications, plugins and integrations → Index.php Only Message
Powered by PunBB, supported by Informer Technologies, Inc.