Link to my site: Its a private forum
SMF version: SMF 1.1.6
TP version: TP 0.983
Theme name and version: Neon by Tippmaster
Mods installed: Adv Sb 2.1 and RSS Feed Poster
Related Error messages: None
I would like to know how to show a block to guest only but hide it from members including admin.
I hope this would be possible.
Someone else asked this just a day or so ago. At this moment, there is no setting to allow a block to be hidden from admins. I don't know if that option will be in later versions or not.
You can make a php block that has different content for different groups, which can make it appear that the block is hidden from admins, if you do not have the title and the frame for the block. However, the easier way to do it is to just allow the block to be collapsed and have the admin collapse it.
Quote from: JPDeni on October 09, 2008, 01:31:01 AM
Someone else asked this just a day or so ago. At this moment, there is no setting to allow a block to be hidden from admins. I don't know if that option will be in later versions or not.
You can make a php block that has different content for different groups, which can make it appear that the block is hidden from admins, if you do not have the title and the frame for the block.
I want to learn that. The block is html.
You will have to use a php article in order to exclude the admin from seeing the information.
This code would display only to a guest. You would have to use echo statements or use the include statement (see php.net for that function) to output your html from that point.
global $context;
if($context['user']['is_guest'])
{
// php echo statements for html or use include to link to external file
}
It works,
can it be changed so that if user is not guest it will show a different html page?
Here ya go...
global $context;
if($context['user']['is_guest'])
{
// php echo statements for html or use include to link to external file
}
else
{
// non-guest display
}
I forgot to add that you can change 'is_guest' to 'is_admin' to make different variations on what to display or not.
Thank you
You are very welcome. Marking as SOLVED.
This was actually solved long ago...
http://www.tinyportal.net/index.php/topic,15456.0.html
Still comes up in the search by the way.
Duly noted T. ;)
LOL.. no worries... we keep getting a fresh recycle of previous questions all the time.