Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: wakewatcher on October 16, 2021, 12:16:23 PM

Title: Is it possible to mute "Info Center" for guests?
Post by: wakewatcher on October 16, 2021, 12:16:23 PM
I'm looking for a setting to remove the Info Center for guests as I don't see the need to share that information for random lookie-loos. How can this be done?
Title: Re: Is it possible to mute "Info Center" for guests?
Post by: Gary on October 16, 2021, 12:28:41 PM
Well, there isn't a setting for it you could always just force it for logged in users in BoardIndex.template.php

Like so:

if($context['user']['is_logged'])
{
  template_info_center();
}
Title: Re: Is it possible to mute "Info Center" for guests?
Post by: wakewatcher on October 16, 2021, 12:54:11 PM
Quote from: Gary on October 16, 2021, 12:28:41 PMWell, there isn't a setting for it you could always just force it for logged in users in BoardIndex.template.php

Like so:

if($context['user']['is_logged'])
{
  template_info_center();
}

Thanks. I like that idea but I couldn't find BoardIndex.template.php or template_info_center() anywhere. I expected to find template_info_center() someplace and then put the condition around it. I will admit that I'm sometimes dense about these things.
Title: Re: Is it possible to mute "Info Center" for guests?
Post by: Diego Andrés on October 16, 2021, 12:56:18 PM
Should be in Themes/current_theme/BoardIndex.template.php
If your theme does not have a BoardIndex.template.php file, you can edit the one from the default theme in Themes/default
Title: Re: Is it possible to mute "Info Center" for guests?
Post by: Gary on October 16, 2021, 01:22:35 PM
Quote from: Diego Andrés on October 16, 2021, 12:56:18 PMIf your theme does not have a BoardIndex.template.php file, you can edit the one from the default theme in Themes/default

And to follow on from that you then upload it into the folder of your current theme and not the default if this ends up being the case.
Title: Re: Is it possible to mute "Info Center" for guests?
Post by: wakewatcher on October 16, 2021, 01:29:28 PM
Thanks to both of you.  I'm just using the default theme and your tips helped me better understand that how themes work.  (Found it strange that when I 'searched' all my files on my host that template_info_center(); never showed up but that's a different issue I'll figure out later.)
Title: Re: Is it possible to mute "Info Center" for guests?
Post by: mickjav on October 16, 2021, 02:46:39 PM
Quote from: wakewatcher on October 16, 2021, 01:29:28 PMThanks to both of you.  I'm just using the default theme and your tips helped me better understand that how themes work.  (Found it strange that when I 'searched' all my files on my host that template_info_center(); never showed up but that's a different issue I'll figure out later.)

I use notepad++ For editing my sites files just carried out the above update on my 2.0.18 forum Thanks For that lol, I found it without a problem.
Title: Re: Is it possible to mute "Info Center" for guests?
Post by: shadav on October 16, 2021, 02:50:33 PM
smf 2.0.18 default theme BoardIndex.template.php
search for
template_info_centeryou should have 2 instances
the one that you need to change
template_info_center();and then directly below that
function template_info_center()
Title: Re: Is it possible to mute "Info Center" for guests?
Post by: skb on October 16, 2021, 11:20:16 PM
The way I did it was to add the last bit in red to the BoardIndex Template.php

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

 if (empty($context['info_center']) || $context['user']['is_guest'])
 return;
Title: Re: Is it possible to mute "Info Center" for guests?
Post by: Shades. on October 17, 2021, 10:26:35 PM
There's also these two mods:

https://custom.simplemachines.org/index.php?mod=2473
https://custom.simplemachines.org/index.php?mod=3929 (I'm using this one and it works great)