Is it possible to mute "Info Center" for guests?

Started by wakewatcher, October 16, 2021, 12:16:23 PM

Previous topic - Next topic

wakewatcher

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?
smf 2.0.18

Gary

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();
}
Gary M. Gadsdon
Do NOT PM me unless I say so
War of the Simpsons
Bongo Comics Fan Forum
Youtube Let's Plays

^ YT is changing monetisation policy, help reach 1000 sub threshold.

wakewatcher

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.
smf 2.0.18

Diego Andrés

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

SMF Tricks - Free & Premium Responsive Themes for SMF.

Gary

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.
Gary M. Gadsdon
Do NOT PM me unless I say so
War of the Simpsons
Bongo Comics Fan Forum
Youtube Let's Plays

^ YT is changing monetisation policy, help reach 1000 sub threshold.

wakewatcher

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.)
smf 2.0.18

mickjav

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.

shadav

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()

skb

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;

SMF 2.1.4 / TP 2.2.2

Shades.

ShadesWeb.com - Custom Logos - My Themes on SMF | My Themes on ShadesWeb
https://shadesweb.com

BikerHound.com - Sniffing out the road ahead
https://bikerhound.com

Dream as if you'll live forever; Live as if you'll die today. - James Dean

Advertisement: