SimplePortal

Customization => Custom Coding => Topic started by: Faythi on September 08, 2010, 09:56:39 AM

Title: Pages - User Conditions?
Post by: Faythi on September 08, 2010, 09:56:39 AM
Hi, I'm working on various simple portal pages on my forums. They are set as PHP pages and I'm basically making a media gallery type page. I have a way so you can delete files from the server but I want to do it only if you're an admin. I've tried using conditions with $context['user']['is_admin'] but it doesn't seem to work. I know you can set permissions to view the page, but I want it to be viewable to everyone. I just want a section of the page only to load if you're an admin.

Thanks in advance.
Title: Re: Pages - User Conditions?
Post by: excaliburj on September 08, 2010, 11:41:31 AM
You could try:

Code: [Select]
global $user_info;
if ($user_info['is_admin'])
{
// code to allow file deletion
}
Title: Re: Pages - User Conditions?
Post by: Faythi on September 08, 2010, 03:08:25 PM
Thanks, what I was looking for =P
SimplePortal 2.3.8 © 2008-2024, SimplePortal