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.

Do you like this article? Submit it to Blogosphere News!