miniBB ®

miniBB

®
Support Forums
  
 · Start · Sign in · Register · Search · Statistics · File Bank · Manual ·
Custom Tutorials and Modifications miniBB Support Forums / Custom Tutorials and Modifications /  
 

Hide statistics from users

 
Author SteveB
Partaker
#1 · Posted: 18 Jun 2012 10:34Reply Quote
Hi
Have looked for this in previous posts but cannot see anything.
Could someone please tell me is it possible (and how to ) hide the statistics link from public & users, leaving it viewable only for the
administrator?
Many Thanks

Author Paul
Lead Lead Developer
#2 · Posted: 19 Jun 2012 20:28Reply Quote
- Completely remove {$l_menu[3]} from the main_header template's menu, and replace it to the {$l_menuStats} var.

- the code for bb_plugins will be:

if($user_id!=1) {
//disable menu item from the top menu
$l_menuStats='';
}
else $l_menuStats="<a href=\"https://www.minibb.com/forums/{$indexphp}action=stats\">{$l_menu[3]}</a> {$l_sepr} ";
if($user_id!=1 and $action=='stats') {
//redirect to the main website, if someone except admin tries to view that page
header("Location: https://www.minibb.com/forums/");
exit;
}

Author SteveB
Partaker
#3 · Posted: 20 Jun 2012 17:46Reply Quote
Many thanks Paul that worked.
Much appreciated !
Steve

Author floraforum
Partaker
#4 · Posted: 20 Jun 2012 21:23Reply Quote
I would like it if only logged in members could view the statistics.
Is that possible?

Author Paul
Lead Lead Developer
#5 · Posted: 21 Jun 2012 14:49Reply Quote
Note my new condition :) It should be `if($user_id==0)`.

if($user_id==0) {
//disable menu item from the top menu
$l_menuStats='';
}
else $l_menuStats="<a href=\"https://www.minibb.com/forums/{$indexphp}action=stats\">{$l_menu[3]}</a> {$l_sepr} ";
if($user_id==0 and $action=='stats') {
//redirect to the main website, if someone except admin tries to view that page
header("Location: https://www.minibb.com/forums/");
exit;
}

Author floraforum
Partaker
#6 · Posted: 21 Jun 2012 16:01Reply Quote
It works perfectly

Thanks

Author vmarinichy
Partaker
#7 · Posted: 10 Jul 2012 14:40Reply Quote
It works

Custom Tutorials and Modifications miniBB Support Forums / Custom Tutorials and Modifications /
 Hide statistics from users
 Share Topic's Link

Your Reply Click this icon to move up to the quoted message

BB code for the Bold StyleBB code for the Italic StyleBB Code for the PictureBB code for the URLUpload a File

  ?
Post as a Guest, leaving the Password field blank. You could also enter a Guest name, if it's not taken by a member yet. Sign-in and post at once, or just sign-in, bypassing the message's text.


Before posting, make sure your message is compliant with forum rules; otherwise it could be locked or removed with no explanation.

 

 
miniBB Support Forums Powered by Forum Software miniBB ® Home  Features  Requirements  Demo  Download  Showcase  Gallery of Arts
Compiler  Premium Extensions  Premium Support  License  Contact Us
Try the File and Picture Attachments add-on: extend your miniBB-forums, attaching images and files.