Apokh (@apokh)

Forum Replies Created

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

  • Apokh
    Participant

    @apokh

    Okay I declared the 2 Functions

    function my_bbp_current_user_can_publish_replies($input)
    {
    $topic_id = bbp_topic_id();
    $root_forum = alsb_get_post_root_forum($topic_id);
    $groups_id = bbp_get_forum_group_ids($root_forum);
    $user_id = get_current_user_id();
    if (groups_is_user_admin( $user_id, $groups_id[0])
    || groups_is_user_mod ($user_id, $groups_id[0])
    || groups_is_user_member ($user_id, $groups_id[0]) )
    return true;
    else return false;
    }
    
    function alsb_get_post_root_forum($post_id)
    {
    $post = get_post($post_id);
    do
    {
    $post = get_post($post->post_parent);
    }while ($post->post_parent != 0);
    return $post->ID;
    }
    
    add_filter (‘bbp_current_user_can_publish_replies’, my_bbp_current_user_can_publish_replies, 10);

    within my themes function.php. It seems to work, but only for the Parent Forum, not for their child forums.

    So when i have

    Parent (Private buddypress rootforum for Goup)
    — Child 1
    — Child 2

    Only the Parent is “safe”, when I click as non-member of the group in the forum index on one of the Children, I have access, can read and post. Seems the Access Control of bbpress cannot compete in direct comparism to the forumintegrations of other CMS´. I´m asking how other users do realize their communities with buddypress (which is based on a really good idea) in comnbination with bbpress as forum.

    In reply to: What is it?

    Apokh
    Participant

    @apokh

    Solution found

    For Example to add the firstname from the WP User Info add
    <?php $user_info = get_userdata( bbp_get_reply_author_id() ); echo $user_info->first_name . "\n";?>
    in ‘loop-single-reply.php’ somewhere between Line 41 and 59.


    Apokh
    Participant

    @apokh

    Okay for anyone, searching this

    For Example to add the firstname from the WP User Info add
    <?php $user_info = get_userdata( bbp_get_reply_author_id() ); echo $user_info->first_name . "\n";?>
    in ‘loop-single-reply.php’ somewhere between Line 41 and 59.

    In reply to: What is it?

    Apokh
    Participant

    @apokh

    Okay I tested out both. The topic counter is really great. But with the user info thing, I´m not so happy, for the user will have to enter the Data (once again) there which is already present in WP somewhere. I´d prefer a slolution where I can get teh userinfo from WP for example the First Name and display it under the avatar…or above it.


    Apokh
    Participant

    @apokh

    Okay thank you so much. I´ll try that out next days.


    Apokh
    Participant

    @apokh

    Okay the first part is to replace the function within the template.php but where goes the second one? function alsb_get_post_root_forum($post_id)

    I´m not php common, so di I have to replace the whole function bbp_current_user_can_publish_replies()function within the template.php with your code?


    Apokh
    Participant

    @apokh

    Nobody?
    Come on, this must be recognized by someone except me?!

    In reply to: What is it?

    Apokh
    Participant

    @apokh

    thank you very much.

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