Author Topic: display for admin only  (Read 4077 times)

0 Members and 1 Guest are viewing this topic.

Offline Coastie

  • Newbie
  • *
  • Posts: 15
    • View Profile
    • http://www.greytalk.com
display for admin only
« on: December 08, 2002, 07:33:49 PM »
I would like to know the code to add things viewable for admins only.

A simple example would be the Control Panel link at the bottom of a page for admins.

I'd like to add stats to my pages and only have them viewable to admins using the define('PRINT_STATS', '1');  command.

It currently works, but is viewable by all.
Code: [Select]
Page generated in 0.896900 seconds with 9 queries, spending 0.051000 seconds doing MySQL queries and 0.845900 doing PHP things. GZIP compression enabled


Something like :  if admin define('PRINT_STATS', '1');  

Thank you

Offline Jan

  • Administrator
  • 4images Guru
  • *****
  • Posts: 5.024
    • View Profile
    • 4images - Image Gallery Management System
display for admin only
« Reply #1 on: December 08, 2002, 08:48:57 PM »
Change in includes/page_footer.php
Code: [Select]
if (defined("PRINT_QUERIES")) {
to
Code: [Select]
if ($user_info['user_level'] == ADMIN) {

Jan
Your first three "must do" before you ask a question:
1. Forum rules
2. FAQ
3. Search

Offline Coastie

  • Newbie
  • *
  • Posts: 15
    • View Profile
    • http://www.greytalk.com
display for admin only
« Reply #2 on: December 08, 2002, 08:53:04 PM »
Thank You.

Offline Jan

  • Administrator
  • 4images Guru
  • *****
  • Posts: 5.024
    • View Profile
    • 4images - Image Gallery Management System
display for admin only
« Reply #3 on: December 08, 2002, 08:56:53 PM »
Sorry, replace this line:

Code: [Select]
if ((defined("PRINT_STATS") && PRINT_STATS == 1) || (isset($HTTP_GET_VARS['printstats']) && md5($HTTP_GET_VARS['printstats']) == "6111426fcb0b0a76558f9058c331a3a6")) {
Jan
Your first three "must do" before you ask a question:
1. Forum rules
2. FAQ
3. Search