This topic has 18 replies, 6 voices, and was last updated 9 years by jorasik.

  • Author
  • #32760
     creifelds
    Participant

    Hi guys, the “Private message” button (“Friends” tab, on the profile “tile” of a member) does not work. You can, however, compose a message from the “Messages” tab. Could you activate the button as well?
    Thanks,
    Stephan

    #32780
     sharmstr
    Moderator

    +1 The button link is missing the href attribute.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #32857
     Ferghus
    Participant

    I have the same issues. There is no HREF on the private message button. I think his was true before the update as well. @Abe, can we escalate the priority on this?

    #32861
     Abe
    Keymaster

    will check and come with a fix

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

    #32948
     PDMuniversal
    Participant

    any updates on this?

    #33229
     Abe
    Keymaster

    Hi, To make that work I had to override a buddypress function, so until next update here is the fix:
    update this file content with the content from the .txt file attached wp-content/themes/kleo/buddypress/buddypress-functions.php

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

    Attachments:
    You must be logged in to view attached files.
    #33399
     Ferghus
    Participant

    Abe,

    Your fix works well from the Members list. However, when I’m viewing an individual member, and then click the Private Message button, it takes me to my profile to start a new message. The targeted user name is not filled in like it is when I click Private Message from the Members list. I hope this makes sense.

    Best, Jerry

    #33438
     sharmstr
    Moderator

    +1 Its because he’s using bp_get_member_user_id() which only works in the members loop.

    Try changing the the filter_message_button_link function (around like 1800) to this.

    COPY CODE
    
    function filter_message_button_link( $link = '' ) {
    	$bp_user_id = (bp_get_member_user_id() == '' ? bp_displayed_user_id() : bp_get_member_user_id() );
    	$link = wp_nonce_url( bp_loggedin_user_domain() . bp_get_messages_slug() . '/compose/?r=' . bp_core_get_username( $bp_user_id ) );
    	return $link;
    }
    

    Basically it determines if a value is returned from bp_get_member_user_id(). If so, then it will assume that its in the members loop (friends tab in profile or directory listing) and will use that value. If not, then it assumes that your on a profile page and will use bp_displayed_user_id().

    I think that covers all the of the places a message button is displayed. Let me know if that works.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #33502
     Ferghus
    Participant

    Abe,

    Can you tell us if you’ll be fixing this in the next update? I don’t want to change source code and then lose the fix in the next update.

    Best, Jerry

    #33505
     Abe
    Keymaster

    thanks @sharmstr
    I will do that change

    Yes it will be included in the next update 2.2

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

    #33507
     sharmstr
    Moderator

    Cool. Not sure if its the best approach though.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #33518
     Abe
    Keymaster

    I’ll do a check for the page your are on and get the proper ID

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

    #33521
     Abe
    Keymaster

    Did it like this:

    COPY CODE
    
    function filter_message_button_link( $link = '' ) {
        $bp_user_id = (bp_is_user() ? bp_displayed_user_id() : bp_get_member_user_id() );
    	$link = wp_nonce_url( bp_loggedin_user_domain() . bp_get_messages_slug() . '/compose/?r=' . bp_core_get_username( $bp_user_id ) );
    	return $link;
    }
    
    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

    #33533
     sharmstr
    Moderator

    That wont work. I did that first, but the problem is that it will test true in the friends tab on a users profile, but the tab contains the loop, which you need. Does that make sense? (btw – I’m too lazy to test your code, so maybe I’m wrong)

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #33535
     Abe
    Keymaster

    hmm, you are right 🙂 you initial approach was fine since the bp_get_member_user_id() returns false if it is not in the loop.
    So final code here 🙂

    COPY CODE
    
    function filter_message_button_link( $link = '' ) {
        $bp_user_id = (bp_get_member_user_id() ? bp_get_member_user_id() : bp_displayed_user_id() );
    	$link = wp_nonce_url( bp_loggedin_user_domain() . bp_get_messages_slug() . '/compose/?r=' . bp_core_get_username( $bp_user_id ) );
    	return $link;
    }
    
    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

    #33559
     sharmstr
    Moderator

    *high five* 😀

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #45280
     jorasik
    Participant

    Hey guys, I am trying to use this function to generate same button for private message as the one in the members loop so that when it is clicked it will populate the SENT TO field with the specific user name. In short I need to generate the button in to author box under specific custom post type.

    It generated the link and it sends me to the form but it the auto-population of the field is not working, the link that is generated doesn’t contain the username.

    It is supposed to be like that:
    <a href="http://site.com/members/admin/messages/compose/?r=USERNAME&_wpnonce=aa6f4a1ca8" title="Send a private message to this user." class="send-message">Private Message</a>

    But it is like this:
    <a href="http://site.com/members/admin/messages/compose/?r&_wpnonce=aa6f4a1ca8" title="Send a private message to this user." class="send-message">Private Message</a>

    Any ideas how to fix that ?

    #45283
     sharmstr
    Moderator

    If you’re talking about putting it in the author meta, I added that feature in Kleo 2.4 that will be released any moment.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    Attachments:
    You must be logged in to view attached files.
    #45292
     jorasik
    Participant

    Super cool! 🙂 I believe it will do perfect job. Can’t wait for the release! 🙂
    Thanks for the fast response!

Viewing 19 posts - 1 through 19 (of 19 total)

The forum ‘KLEO’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?