phpBB2Refugees.com Logo
Not affiliated with or endorsed by the phpBB Group

Register •  Login 

Continue the legacy...

Welcome to all phpBB2 Refugees!Wave Smilie

This site is intended to continue support for the legacy 2.x line of the phpBB2 bulletin board package. If you are a fan of phpBB2, please, by all means register, post, and help us out by offering your suggestions. We are primarily a community and support network. Our secondary goal is to provide a phpBB2 MOD Author and Styles area.

show only for admin


 
Search this topic... | Search MOD Requests... | Search Box
Register or Login to Post    Index » MOD Requests  Previous TopicPrint TopicNext Topic
Author Message
hoimyr
Board Member



Joined: 16 Apr 2009

Posts: 115
Location: Oslo


flag
PostPosted: Wed Sep 09, 2009 8:41 pm 
Post subject: show only for admin

Hi, I was wondering if its possible or if anybobody know how to make stuff in the templates to only show up for admins.
In some of the template files you have "<!-- BEGIN switch_user_logged_out -->". If you had one for <!-- BEGIN show_admin_only> you could use this for many things. The security bit is not important just hiding the stuff from the visual. I will try to make this mod but let me know if you know how 2. icon_wink.gif Thanks
Back to top
Dog Cow
Board Member



Joined: 18 Nov 2008

Posts: 378


flag
PostPosted: Wed Sep 09, 2009 9:57 pm 
Post subject: Re: show only for admin

Add to page_header.php:

Code:

if($userdata['user_level'] == ADMIN)
{
   $template->assign_block_vars('switch_admin', array());
}


Now you can use this in your .tpl files:
Code:

<!-- BEGIN switch_admin -->
Only admins can see this message!
<!-- END switch_admin -->

_________________
Moof!
Lincoln's Tomb, Oak Ridge Cemetery, Springfield IL Mac 512K Blog Mac GUI
Back to top
hoimyr
Board Member



Joined: 16 Apr 2009

Posts: 115
Location: Oslo


flag
PostPosted: Thu Sep 10, 2009 4:56 pm 
Post subject: Re: show only for admin

thanks icon_wink.gif
Back to top
Display posts from previous:   
Register or Login to Post    Index » MOD Requests  Previous TopicPrint TopicNext Topic
Page 1 of 1 All times are GMT
 
Jump to:  

Index • About • FAQ • Rules • Privacy • Search •  Register •  Login 
Not affiliated with or endorsed by the phpBB Group
Powered by phpBB2 © phpBB Group
Generated in 0.0250 seconds using 15 queries. (SQL 0.0014 Parse 0.0008 Other 0.0227)
phpBB Customizations by the phpBBDoctor.com
Template Design by DeLFlo and MomentsOfLight.com Moments of Light Logo