Simple Machines Community Forum

SMF Support => SMF 2.1.x Support => Topic started by: skb on October 03, 2020, 12:05:51 AM

Title: Hide Info Center from Guests
Post by: skb on October 03, 2020, 12:05:51 AM
How can I hide the entire Info Center section (Calendar + Stats + Users Online) from Guests ?

Thanks in advance.
Title: Re: Hide Info Center from Guests
Post by: Sir Osis of Liver on October 03, 2020, 05:46:12 PM
Don't currently have a 2.1 install running, but this should work -



* Displays the info center
*/
function template_info_center()
{
global $context, $options, $txt;

if (empty($context['info_center']) || $context['user']['is_guest'])
return;



Title: Re: Hide Info Center from Guests
Post by: skb on October 03, 2020, 11:43:34 PM
Perfect Krash.
Thanks.
Title: Re: Hide Info Center from Guests
Post by: Shades. on August 18, 2021, 05:19:41 PM
Quote from: Sir Osis of Liver on October 03, 2020, 05:46:12 PMDon't currently have a 2.1 install running, but this should work -


 * Displays the info center
 */
function template_info_center()
{
global $context, $options, $txt;

if (empty($context['info_center']) || $context['user']['is_guest'])
return;




Will this work on 2.1RC4 and where do I put it? I too would like to be able to hide the info center from guests! Thanks 8)
Title: Re: Hide Info Center from Guests
Post by: Douglas on August 18, 2021, 07:36:12 PM
@Shades, in your theme directory, "BoardIndex.template.php". Search for the function (should be around line 315).

If you're using a child theme or custom theme, and you don't see BoardIndex.template.php in that directory, then go into the default theme directory (Themes/default) and make your change there.

BACK UP THE DIRECTORY FIRST BEFORE MAKING ANY CHANGES.
Title: Re: Hide Info Center from Guests
Post by: Shades. on August 18, 2021, 11:37:46 PM
Ok got it thanks a bunch! 8)