• Resolved Georgio

    (@georgio-1)


    Hi dear @shamim51
    thank you for this excellent plugin

    I recently added your snippet for bbpress forum. It’s very cool so I did the same thing in the group memberlist (buddypress) by inserting a shortcode in the template
    wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/groups/single/members.php in the item_action area

    How about a snippet for that? Here is a screenshot

    Thanks again

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter Georgio

    (@georgio-1)

    This is the code I used to put a button in the group memberlist:

    <?php if( groups_is_user_member(bp_loggedin_user_id(), bp_get_current_group_id() ) || is_super_admin() ) : ?>
    <?php echo do_shortcode('[fep_shortcode_message_to to="{' . bp_get_group_member_name()  . '}" subject="{current-post-title}" text="PM"]'); ?> <?php endif; ?>
    

    This code is incomplete, because I see the button near my username when I am logged-in. This is not need as I will never send pm to myself. How can I hide the button in that case?

    Plugin Author Shamim Hasan

    (@shamim51)

    You can also check bp_loggedin_user_id() != bp_group_member_id()

    Thread Starter Georgio

    (@georgio-1)

    Thank you for your quick response.
    Unfortunately I am not so…expert with code and I don’t know how to use the code you wrote. If you have a complete piece of code for the template mentionned above or a snippet for functions.php/custom.php I can use it. Otherwise, ignore my message. I don’t want to bother you.

    Plugin Author Shamim Hasan

    (@shamim51)

    You can use

    
    <?php if( ( groups_is_user_member(bp_loggedin_user_id(), bp_get_current_group_id() ) || is_super_admin() ) && bp_loggedin_user_id() != bp_group_member_id() ) : ?>
    <?php echo do_shortcode('[fep_shortcode_message_to to="{' . bp_get_group_member_name()  . '}" subject="{current-post-title}" text="PM"]'); ?> <?php endif; ?>
    
    Thread Starter Georgio

    (@georgio-1)

    It worked with
    && bp_loggedin_user_id() != bp_get_group_member_id()

    (I had to add a “get”)

    Thank you very much

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[feature] A button in the group memberlist?’ is closed to new replies.