SimplePortal
Customization => Custom Coding => Topic started 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.
-
You could try:
global $user_info;
if ($user_info['is_admin'])
{
// code to allow file deletion
}
-
Thanks, what I was looking for =P