Performancing Metrics

Creating Admin Friendly Index Page

Repost This

This article explains a simple process to create an admin friendly Index page. As an admin it would be nice to have certain quick links available to access from the index page but not accessible to your visitors.

The author uses the following to check if you are an admin

if ($user_login == 'my_user_name')
{
echo "only blog's author sees that";
} else {
echo "that's what everybody else sees";
}

I’m wondering if this would be better?

global $HTTP_SERVER_VARS;
global $user_level;
get_currentuserinfo();
if ($user_level < 9) {
echo "that's what everybody else sees";
}
else {
echo "only blog's author sees that";
}

Which is better? What's the difference?

Once you add the code you can then have links to post, login, check stats, or any other links that you don't want accessible to your visitors. Visitors will only see what you want them to see.

Repost This

Categories: WordPress Tips

This post was written by . You can visit the for a short bio, more posts, and other information about the author.


Comments Closed

Comments

  1. Justin Baeder says: 6/26/2004

    Thanks for the tip. I used this code (your version) to create a private blog – I just changed the echo statements to include statements, and included a file that creates a PHP error if the person isn’t logged in. I don’t know if it’s really bad to create PHP errors, but I don’t anticipate people running across the private blog page very often. I think I’ll do a tutorial before too long, since a lot of people apparently want private blogs.

  2. Neil says: 7/15/2004

    This can actually be used to provide different links for several different levels of user. I’m using it for a club website I’m developing, where club members are level 2, registered website users are level 1, and Joe Public is level 0. Each level of user has different links.
    For example, level 2 and above has a quicklink to the message post screen.

Content


Receive the top stories from BloggingPro and the Splashpress Media network every week, right in your Inbox. Relevant and timely content is yours for FREE!