Hide Blocks From Guests

Post Reply
User avatar

Topic author
AylaAsperger
Active Member
Posts: 10
Joined: 30. March 2009 19:17
phpBB.com User: AylaAsperger
Location: Netherlands

Hide Blocks From Guests

Post by AylaAsperger »

I was wondering if it is possible in any way to hide certain blocks from guests. I know the blocks containing news and announcement only have content when the user is logged in and has the permission to see the messages, but I would like to see something similar (i.e. hide the block or at least the content of it) for other blocks like Most Posters, New Members, Team, etc. I hope anyone can help me out!
User avatar

Mike
Former Team Member
Posts: 1862
Joined: 3. July 2008 23:59
Location: Schwarzwald / FDS
Contact:

Re: Hide Blocks From Guests

Post by Mike »

You can make a switch around the block like this:

Code: Select all

<!-- IF S_USER_LOGGED_IN -->
         <!-- INCLUDE portal/block/xyz.html -->
      <!-- ENDIF -->
kein Support per PN / Messenger
no Support via PM / Messenger
User avatar

Topic author
AylaAsperger
Active Member
Posts: 10
Joined: 30. March 2009 19:17
phpBB.com User: AylaAsperger
Location: Netherlands

Re: Hide Blocks From Guests

Post by AylaAsperger »

Thank you very much, that ought to do it! Could you please also tell me in which file this has to be done?
User avatar

Marc
Dev
Posts: 2504
Joined: 17. July 2008 21:08
phpBB.de User: marc1706
phpBB.com User: Marc
Location: Clausthal-Zellerfeld / München
Contact:

Re: Hide Blocks From Guests

Post by Marc »

You will have to do this in the HTML files portal_left.html, portal_center.html and portal_right.html, depending on where the blocks are being shown.
User avatar

Topic author
AylaAsperger
Active Member
Posts: 10
Joined: 30. March 2009 19:17
phpBB.com User: AylaAsperger
Location: Netherlands

Re: Hide Blocks From Guests

Post by AylaAsperger »

Thank you very much! As the blocks were in an IF clause already I updated the existing IF clause with "and S_USER_LOGGED_IN" instead of adding an extra IF clause. And it worked perfectly!
Post Reply

Return to “Modification Requests”