-
Author
Tagged: Private message
-
October 23, 2014 at 11:45 #32760creifeldsParticipant
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,
StephanOctober 23, 2014 at 14:37 #32780sharmstrModerator+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 solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
October 24, 2014 at 02:44 #32857FerghusParticipantI 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?
October 24, 2014 at 02:54 #32861AbeKeymasterwill 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.October 28, 2014 at 00:18 #33229AbeKeymasterHi, 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.phpHi 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.October 29, 2014 at 02:49 #33399FerghusParticipantAbe,
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
October 29, 2014 at 16:31 #33438sharmstrModerator+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 CODEfunction 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 solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
October 29, 2014 at 21:01 #33502FerghusParticipantAbe,
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
October 29, 2014 at 21:24 #33505AbeKeymasterthanks @sharmstr
I will do that changeYes 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.October 29, 2014 at 21:27 #33507sharmstrModeratorCool. 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 solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
October 29, 2014 at 22:00 #33518AbeKeymasterI’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.October 29, 2014 at 22:03 #33521AbeKeymasterDid it like this:
COPY CODEfunction 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.October 30, 2014 at 00:31 #33533sharmstrModeratorThat 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 solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
October 30, 2014 at 00:40 #33535AbeKeymasterhmm, 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 CODEfunction 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.October 30, 2014 at 01:27 #33559sharmstrModerator*high five* 😀
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
February 9, 2015 at 19:04 #45280jorasikParticipantHey 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 ?
February 9, 2015 at 19:19 #45283sharmstrModeratorIf 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 solutionThis 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. -
AuthorPosts
The forum ‘KLEO’ is closed to new topics and replies.