MyBB Community Forums

Full Version: keeping board statistics off the main page
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I want to protect privacy of members by keeping the board statistics off the main page of my forum since non registered web surfers could read their names there. I do want to keep the board statistics for members to view once they are registered and enter into the forum pages. Is that possible?

TIA
Open index.php

Find
// Show the board statistics table only if one or more index statistics are enabled.
if($mybb->settings['showwol'] != "no" || $mybb->settings['showindexstats'] != "no" || ($mybb->settings['showbirthdays'] != "no" && $bdaycount > 0))
{
	eval("\$boardstats = \"".$templates->get("index_boardstats")."\";");
}

Change into
// Show the board statistics table only if one or more index statistics are enabled.
if(($mybb->settings['showwol'] != "no" || $mybb->settings['showindexstats'] != "no" || ($mybb->settings['showbirthdays'] != "no" && $bdaycount > 0)) && $mybb->user['uid'] != 0)
{
	eval("\$boardstats = \"".$templates->get("index_boardstats")."\";");
}

Guests won't see the 'box' Board Statistics, unless they register. Still visible for 'members'.
LeX- Wrote:Open index.php

Find
// Show the board statistics table only if one or more index statistics are enabled.
if($mybb->settings['showwol'] != "no" || $mybb->settings['showindexstats'] != "no" || ($mybb->settings['showbirthdays'] != "no" && $bdaycount > 0))
{
	eval("\$boardstats = \"".$templates->get("index_boardstats")."\";");
}

Change into
// Show the board statistics table only if one or more index statistics are enabled.
if(($mybb->settings['showwol'] != "no" || $mybb->settings['showindexstats'] != "no" || ($mybb->settings['showbirthdays'] != "no" && $bdaycount > 0)) && $mybb->user['uid'] != 0)
{
	eval("\$boardstats = \"".$templates->get("index_boardstats")."\";");
}

Guests won't see the 'box' Board Statistics, unless they register. Still visible for 'members'.

I tried adding the small change you made and over wrote the index. php file but i got this error?

Parse error: syntax error, unexpected T_BOOLEAN_AND in /home/respcare/public_html/index.php on line 229
You probably did some other stuff too <_< ; cause as far as i know that error aint caused by my modification.
LeX- Wrote:You probably did some other stuff too <_< ; cause as far as i know that error aint caused by my modification.

tried again and worked well Thanks for your patience!
LeX- Wrote:Open index.php

Find
// Show the board statistics table only if one or more index statistics are enabled.
if($mybb->settings['showwol'] != "no" || $mybb->settings['showindexstats'] != "no" || ($mybb->settings['showbirthdays'] != "no" && $bdaycount > 0))
{
	eval("\$boardstats = \"".$templates->get("index_boardstats")."\";");
}

Change into
// Show the board statistics table only if one or more index statistics are enabled.
if(($mybb->settings['showwol'] != "no" || $mybb->settings['showindexstats'] != "no" || ($mybb->settings['showbirthdays'] != "no" && $bdaycount > 0)) && $mybb->user['uid'] != 0)
{
	eval("\$boardstats = \"".$templates->get("index_boardstats")."\";");
}

Guests won't see the 'box' Board Statistics, unless they register. Still visible for 'members'.

I was in need for the same function in my forum but I wasn't able to find that word in my \forums\index.php

sorry for the mess...
vickoy Wrote:I was in need for the same function in my forum but I wasn't able to find that word in my \forums\index.php

sorry for the mess...

vickoy, copy and paste the whole script above . there are subtle differences.
OK, I do have the board statistics off the main page (private forum).

But, I want them back again, so people know #members but, I don't want the line:

"Please Welcome our Newest Member, John Doe"

to appear...except for logged in members.

Is this an easy fix?

One thought I had was to install the "More Stats on Index Page" plugin.
http://mods.mybboard.net/view/additional...index-page
Maybe that would be the same thing?
rcw Wrote:OK, I do have the board statistics off the main page (private forum).

But, I want them back again, so people know #members but, I don't want the line:

"Please Welcome our Newest Member, John Doe"

to appear...except for logged in members.

Is this an easy fix?

One thought I had was to install the "More Stats on Index Page" plugin.
http://mods.mybboard.net/view/additional...index-page
Maybe that would be the same thing?

I realize that this is some code modification but if you have time..please let me know