Skip to:
Content
Pages
Categories
Search
Top
Bottom

How to show tags only to logged in users

  • Hallo,

    Please excuse my english!

    I’using “private forums” and “approve user registration” to keep my forum privat. I don’t want to show the tags to users who are not logged in.

    So I just did this <!– –> with the tags part in front-page.php.

    But is there any way to show the tags to users who are loggend in?

    For example change the front-page.php to something like:

    if (user_is_logged_in)

    {

    <div id=”hottags”>

    <h2><?php _e(‘Hot Tags’); ?></h2>

    <p class=”frontpageheatmap”><?php bb_tag_heat_map(); ?></p>

    </div>–>

    }

    This would be very nice :)

    Benjamin

Viewing 4 replies - 1 through 4 (of 4 total)

  • chrishajer
    Participant

    @chrishajer

    You could use the bb_is_user_logged_in() function like this:

    <?php if ( bb_is_user_logged_in() ) { ?>
    <div id="hottags">
    <h2><?php _e('Hot Tags'); ?></h2>
    <p class="frontpageheatmap"><?php bb_tag_heat_map(); ?>
    </div>
    <?php } ?>

    You were very close with your guess as to the function name.

    Just a heads up – you probably want to use the “Hidden Forums” plugin instead of “Private Forums”:

    https://bbpress.org/plugins/topic/hidden-forums/

    As one user put it, “The plug-in is great, but somehow it turns off randomly”. That exact same thing happened to me twice, before I got fed up. Each time it happened, I almost had a heart attack!

    “Hidden Forums” is a better version of the plugin, and has no reports of that bug.

    Hallo and thank you so much, it works!

    For all who know even less than me about php, there is one little change to do:

    Just start the code with: <?php

    And it will work great.

    Thanks to all!


    chrishajer
    Participant

    @chrishajer

    @bamosk – I edited the original to include the <?php. Sorry about that.

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.
Skip to toolbar