Skip to:
Content
Pages
Categories
Search
Top
Bottom

Different views for registered and nonregistered users

  • I know there’s a way to hide a certain part of the front page by using this:

    <?php if ( bb_is_user_logged_in() ) : ?>
    INSERT HIDDEN CODE HERE
    <?php endif; else : // $forums ?>

    but I was wondering if you could have a section that only nonregistered users can view. This will make more sense after visiting my site:

    http://tapestry.endless-sonata.net

    At the bottom, I have a table that contains Hot Tags, Views, Users Online, and Top Posters. What I want is for that view to be only visible to registered users. Then, when a nonregistered user views this site, I want just the Hot tags to show in an expanded version, not off to the left. Is there a way to do this? I tried entering the alternate code after this:

    <?php endif; else : // $forums ?>

    but it didn’t display anything.

Viewing 1 replies (of 1 total)
  • Nevermind. I figured it out. All I needed to do was create this:

    <?php if ( !bb_is_user_logged_in() ) : ?>

    ENTER CODE TO HIDE FROM REGISTERED USERS

    <?php endif; ?>

    A simple not was all it took.

Viewing 1 replies (of 1 total)

You must be logged in to reply to this topic.