WordPress.org

Ready to get started?Download WordPress

Forums

Only registerd users can see links (7 posts)

  1. Tek
    Member
    Posted 9 years ago #

    I have some links to some static pages or other directories on my site. The thing is that I only want users of a certain level to have access to those static pages or directories. Is there any way using the view level plugin that a plugin could be made that will let only logged in users of a certian level have the ability to see those links?
    Thanks!

  2. moisie
    Member
    Posted 9 years ago #

    From memory the function: getuserinfo() will return $user_level which can be used to allow/disallow stuff depending on what it is. I may be wrong.

  3. Tek
    Member
    Posted 9 years ago #

    Yes, but I was wondering if there is a plugin-
    I'm stupid. I don't know how to program- just fix computers.

  4. Anonymous
    Unregistered
    Posted 9 years ago #

    <?php
    getuserinfo();
    if ($user_level > X) { ?>
    Links to static pages
    <?php } ?>

  5. Tek
    Member
    Posted 9 years ago #

    Oo... I have to try that. Thanks! =)

  6. indi
    Member
    Posted 9 years ago #

    The function I saw was get_currentuserinfo(). Still not showing up for me, but getuserinfo() doesn't seem to exist at all.

  7. Stevish
    Member
    Posted 8 years ago #

    I figured out how to do it... we were missing a small peice. It should look like this:

    <?php
    global $user_level;
    getuserinfo();
    if ($user_level > X) { ?>

    Links to static pages
    <?php } ?>

    The "global $user_level;" is important, but I have no idea why. I think it just lets the command know what it's working with or something. Anyways, that should do it. It worked for me. I'm running wordpress 1.5.2.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.