News:

Join the Facebook Fan Page.

Main Menu

Hide Info Center from Guests

Started by skb, October 03, 2020, 12:05:51 AM

Previous topic - Next topic

skb

How can I hide the entire Info Center section (Calendar + Stats + Users Online) from Guests ?

Thanks in advance.

SMF 2.1.2 (default theme) / TP 2.2.2

Sir Osis of Liver

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;



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

skb


SMF 2.1.2 (default theme) / TP 2.2.2

Shades.

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

Douglas

@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.
Doug Hazard
* Full Stack (Web) Developer for The Catholic Diocese of Richmond
(20+ Diocesan sites, 130+ Church sites & 24 School sites)
* Sports Photographer and Media Personality
* CFB Historian
* Tech Admin for one 1M+ post, one 2M+ post and one 10M+ post sites (last two are powered by multiple servers)
* WordPress Developer (Junkie / Guru / Maven / whatever)

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: