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?

Re: Index.php Only Message

Whereabouts on the index.php would you like it to appear?

Re: Index.php Only Message

above the whole forum

Re: Index.php Only Message

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
}

Re: Index.php Only Message

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

My stuff or my style might sux, but atleast I'm willing to help when I can.
Don't be stupid and help ! We are the stupid one's !!!

Re: Index.php Only Message

i dont want it in EVERY PAGE of the forum, just on index.php above the forum.

Thank u Smartys , I will try

Re: Index.php Only Message

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.)

Re: Index.php Only Message

guardian34 wrote:

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 wink