miniBB ®  
miniBB Support Forums
 | Forums | Register | Reply | Search | Statistics | Manual |
Custom Tutorials and Modifications miniBB Support Forums / Custom Tutorials and Modifications /   

Hide statistics from users

Author SteveB
Registered
#1 | Posted: 18 Jun 2012 10:34 
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 Developer
#2 | Posted: 19 Jun 2012 20:28 | Edited by: Paul 
- 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=\"{$main_url}/{$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: {$main_url}/{$startIndex}");
exit;
}


Author SteveB
Registered
#3 | Posted: 20 Jun 2012 17:46 
Many thanks Paul that worked.
Much appreciated !
Steve

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

Author Paul
Lead Developer
#5 | Posted: 21 Jun 2012 14:49 | Edited by: Paul 
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=\"{$main_url}/{$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: {$main_url}/{$startIndex}");
exit;
}


Author floraforum
Registered
#6 | Posted: 21 Jun 2012 16:01 
It works perfectly

Thanks

Author vmarinichy
Registered
#7 | Posted: 10 Jul 2012 14:40 
It works

Custom Tutorials and Modifications miniBB Support Forums / Custom Tutorials and Modifications / Hide statistics from users Top
Your Reply Click this icon to move up to the quoted message
 Short link for this topic:

 ?
You are welcome to post anonymously, by entering a nickname with no password (if the similar Username has not been taken yet), or by leaving both fields empty. If you have a forums account, you can also sign in from this page without posting a message, or sign in and post at once.


Before posting, make sure your message is compliant with our forum posting rules. If not, it may be locked or deleted with no explanation.
 
miniBB Support Forums Powered by Forum Software miniBB ® Features  Requirements  Demo  Download  Showcase  Gallery of Arts
Compiler  Premium Extensions  Premium Support  License  Contacts
  Extend your miniBB-forums, attaching the images and files,
get the File and Picture Attachments add-on!
Galleries / Attachments Addon for miniBB