Skip to:
Content
Pages
Categories
Search
Top
Bottom

Anonymous forum only for logged in users


  • common8308
    Participant

    @common8308

    Hi, I’m starting this topic since I was stuck on creating anonymous forum.
    First I want to thank mods and those all who are participating in this voluntary development, I’m very satisfied in using this forum plugin.

    Back to the topic, I have got two issues.

    One is creating an anonymous forum only logged-in members can write. I’m curious to know if this is possible in the given function of bbpress admin panel. Or should I do additional code tweaks.(guess the forum should be set private, and remove all the related username infos in my custom bbpress reply author loop.. right?)

    The other issue is making a query to this private forum’s post and displaying it in the main page which visitors can all see. Is it possible to unlock this access capability after querying the topic content which is set private?
    Currently, when I make a query to this private reply contents, and display them on the main page as a widget, ppl with proper capability only can see the content on the main page. Visitors cannot. I want to unlock this capability after querying the contents.

    Sorry for asking too much at once. I’m stuck over days.. so asking in this support forum after searching the whole forum.
    Thank you for reading!

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

  • Lynq
    Participant

    @lynq

    What you could do is check is_user_logged_in() around your bbPress template files, this would hide the forum.
    You could also do this whenever you show the link to your forum, this would mean the forum is never show to anyone who is not logged in.

    Then you could do a custom WP_Query to fetch some topics to display on the front of your website.

    Also as a nice little touch you could do an else {      } at the bottom of your is_user_logged_in() check and state that they need to be logged in to view the forum.


    common8308
    Participant

    @common8308

    Thanks for the kind reply @lynq.

    As you suggested, I changed some bbp template codes in my custom theme, removing all the author data and user-id class in the reply loop template so that one specific public forum could look like it’s working as anonymous one for logged in users…

    It looked as if it’s working fine as an intended anonymous forum.. and just found the biggest problem is that all those posts are shown in activity stream.
    (I’m also using Buddypress as other users do.)

    I tried to fix the buddypress activity template to not display the anonymous forum’s contents, but it doesn’t seem buddypress activity template is controlled by bbp_forum_id or bbp_topic_id.. can someone give a clue about solving this problem?

    If you’d like to completely hide your forum for non-logged in users there is a plugin for that 🙂

    https://wordpress.org/extend/plugins/bbpress-members-only/


    common8308
    Participant

    @common8308

    Thanks for the reply.
    I got it work, but not really nicely.
    I just did a crude hacking to the core to exclude a specific topic replies.

    \wp-content\plugins\bbpress\includes\extend\buddypress\activity.php
    in the reply_create, and reply_update function,
    `if ( bbp_get_topic_id() == ‘XXX’ )
    return;
    `
    it seems I really shouldn’t do this but since I don’t know how to handle this private function in the child theme. 🙂
    Thanks for the support!

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