Info Center

Started by Paulsa, May 01, 2022, 12:45:23 PM

Previous topic - Next topic

Paulsa

SMF 2.1.1  Default Theme - No Mods

Where do I control the Info Center ?  I don't want the following information visible to guest and would like to be selective as to which member groups can see it. If I can turn it off completely, that will also work.

In the Info Center:

Users Online

The line below is what I want to make unviewable by guests:

Online: 0 Guests, 1 User  - Most Online Today: 0 -  Most Online Ever: 0 (Apr 26, 2022, 03:36 PM)


In Configuration> General I unchecked the boxes below but that does not change what is displayed in the info center.

Track statistics - (Unchecked)

Track daily page views (statistics tracking must be enabled) - (Unchecked)

Unchecked view forum statistics  permission for guests.


Kindred

There is no setting for parts or for permissions. It's either on or off.

However, the section that you are referring to is not even part of the info center. That is always on, no setting.

You'd have to modify the template code. (I think it's in boardindex.template.php, or maybe index.template.php)

I guess the biggest question is, why? What, specifically,  are you trying to accomplish by not letting guests see that info?
Слова
Украина

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Sir Osis of Liver

This will remove Users Online for guests -

BoardIndex.template.php


function template_ic_block_online()
{
    global $context, $scripturl, $txt, $modSettings, $settings;

    if (!$context['user']['is_guest']) {

    // "Users online" - in order of activity.

        // Showing membergroups?
        if (!empty($settings['show_group_key']) && !empty($context['membergroups']))
            echo '
                <span class="membergroups">' . implode(', ', $context['membergroups']) . '</span>';
    }

    echo '
            </p>';
    }
}


Don't forget to add the curly bracket at bottom.

"The best laid schemes o' mice an' men / Gang aft a-gley." - Robert Burns

Shades.

Or you can try this mod https://custom.simplemachines.org/index.php?mod=3929 ;)

It works on 2.1.1 just have to click on "emulate for 2.0" in package manager after you upload it.
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

Kindred

Or...  instead of modifying the code in the function, modify the display/call for the function...
Слова
Украина

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Paulsa

I modified the code exactly as shown but get an error: Parse error: syntax error, unexpected '}', expecting end of file

I modified the code exactly as shown but get an error: Parse error: syntax error, unexpected '}', expecting end of file

Looked at the mod, Looks like it will work for me. Will try it of I can't get the error fixed.

Paulsa

I installed the mod and does what I want to do.

Thanks to everyone who replied.

Advertisement: