Info
- 5 posts
- 3 voices
- Started 3 years ago by bamosk
- Latest reply from chrishajer
- This topic is resolved
How to show tags only to logged in users
-
- Posted 3 years ago #
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 -
- Posted 3 years ago #
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.
-
- Posted 3 years ago #
Just a heads up - you probably want to use the "Hidden Forums" plugin instead of "Private Forums":
http://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.
-
- Posted 3 years ago #
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! -
- Posted 3 years ago #
@bamosk - I edited the original to include the <?php. Sorry about that.
-
You must log in to post.