MyBB Community Forums

Full Version: Disable stats.php
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
There is a plugin to Disable Stats.
I tried to use it, but we are a German forum and there is no translation into German by the moment.
So, I did what is written in the readme file, but I can't activate this plugin, because there is no plugin in the German part of our folders ...

How can I solve this problem?
I'd try to make you one in some time and try if that works.
Thanks for your answer Smile

Meanwhile I tried it myself. It's working fine and I just submitted the whole zip-file with readme included in German language to MyBB.

Please note: The German version does the same as the English version, it disables stats.php not only for regular users (non-moderators) but also for moderators and even for admins.



Okay then, I won't be completing it then.

You can manually add a setting to make it bypass for some usergroup. Open plugin file and add something like:

$std_setting2 = array(
		"name" => "std_gid",
		"title" => "Usergroup not allowed to see stats page.",
		"description" => "Enter the group id of the usergroup you would like to banned from viewing stats.php, separate each uid with a <strong>comma</strong>.",
		"optionscode" => "text",
		"value" => "",
		"disporder" => "3",
		"gid" => intval($gid),
		);
	$db->insert_query("settings", $std_setting2);

And add functions to it. Smile

Or better than plugins, lol, you could open stats.php file and add the below code:

if(!in_array($mybb->user['usergroup'], array('4','3')))
{
    error_no_permission();
}

(This code would allow Administrators and Super Moderators still to view stats.php page but others would get no perms page.)

Add above code after some line like:
require_once "./global.php";

and it'd work. Toungue
Hi, that's great Heart Thanks a lot.

I am going to do so as soon as possible and yes, I think that I will do it without the plugin, the easier and direct way.
You're welcome.
(2011-09-30, 06:59 AM)crazy4cs Wrote: [ -> ]Or better than plugins, lol, you could open stats.php file and add the below code:

if(!in_array($mybb->user['usergroup'], array('4','3')))
{
    error_no_permission();
}

(This code would allow Administrators and Super Moderators still to view stats.php page but others would get no perms page.)

Add above code after some line like:
require_once "./global.php";

and it'd work. Toungue
Do I need to edit any (?) German language file too ?

(2011-09-30, 07:35 PM)Ruby Wrote: [ -> ]
(2011-09-30, 06:59 AM)crazy4cs Wrote: [ -> ]Or better than plugins, lol, you could open stats.php file and add the below code:

if(!in_array($mybb->user['usergroup'], array('4','3')))
{
    error_no_permission();
}

(This code would allow Administrators and Super Moderators still to view stats.php page but others would get no perms page.)

Add above code after some line like:
require_once "./global.php";

and it'd work. Toungue
Do I need to edit any (?) German language file too ?
No, it'd simply show standard no perms page which is already by default in all language pages.

(2011-10-01, 06:49 AM)crazy4cs Wrote: [ -> ]No, it'd simply show standard no perms page which is already by default in all language pages.
OK, thanks, I was waiting for your answer before doing anything wrong on our forums.

We had such a lot of spammers who answered to our threads that whole the statistic shows up thousands of replies and threads which were never to be seen because our forum is moderated. It's a lot of work to delete all this spam ... I won't show up this sophisticated statistics.

Thanks for your answer Smile

No problems, just do that change and it'd block stats.php to all guys on your forum except Administrator and Super Moderator.