MyBB Community Forums

Full Version: Message for Guest only
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I know there is a place to do this I just do not want to experiment and wreck the board LOL...
What I want is .. a message in the same place that colorful messages shows..but I want to customize it so just guests see it.
How do I put a custom group message in the header?

http://www.24x7depot.com

Where the colorful message is..that is where I wish to place the custom message that shows just for guests.

Thank you...Shy
I believe this would require a plugin.

You could though, if you feel safe, do some file editing, and edit the index, and add something like this...

if($mybb->user['uid'] == "")
{
     echo "Your message here...";
}

or
if($mybb->user['uid'])
{

}

Not too sure of which one though.
I would recommend putting it in the header_welcomeblock_guest template
Okay so I would put :
if($mybb->user['uid'] == "")
{
echo "Your message here...";
}

In the header_welcomeblock_guest template, at the end of what is currently there. I will get back to you and let you know how it went LOL. thank you..
That will not work (php in templates)

You have to put it in index.php (i think somewhere at the end, before the last eval)

if($mybb->user['uid'] == "")
{
$guestalert = "<div style=blablabvla>message.</div>";
}


and then put {$guestalert} in the index template.






ETA: if you want to put it in header_welcomeblock_guest, you have to edit global.php...

around where you find

// Otherwise, we have a guest

(around line 305..)

You don't need the if statemnt there..
Replace:

// Otherwise, we have a guest
else
{
eval("\$welcomeblock = \"".$templates->get("header_welcomeblock_guest")."\";");
}

with

// Otherwise, we have a guest
else
{
$guestalert = "<div style=blablabvla>message.</div>";
eval("\$welcomeblock = \"".$templates->get("header_welcomeblock_guest")."\";");
}




untested..
ahhhh yes I am back to say it did not work... so now I will use your theory. So if I understand this... Go to index.php and palce the code you have listed.

Then index template.. {$guestalert}
(2010-04-14, 05:15 PM)Starnova Wrote: [ -> ]ahhhh yes I am back to say it did not work... so now I will use your theory. So if I understand this... Go to index.php and palce the code you have listed.

Then index template.. {$guestalert}

Updated my post!
Okay I will try again I forgot to change the global PHP DUH.. another blonde surge I guess.. LOL
Thank you