Search Results for 'private message button'
-
Search Results
-
Hello,
I made a button below each post for sending a message to the post author. But I need also that the subject line fills automatically with the post title and ID.
This is the code I have now:
/** * Get a link to send PM to the given User. * * @param int $user_id user id. * * @return string */ function buddydev_get_send_private_message_to_user_url( $user_id ) { return wp_nonce_url( bp_loggedin_user_domain() . bp_get_messages_slug() . '/compose/?r=' . bp_core_get_username( $user_id )); } /** * Shortcode [bp-pm-button username=optional_some_user_name] * * @param array $atts shortcode attributes. * @param string $content content. * * @return string */ function buddydev_private_message_button_shortcode( $atts, $content = '' ) { $atts = shortcode_atts( array( 'user_id' => '', 'username' => '', 'label' => 'Send Private Message', ), $atts ); $user_id = absint( $atts['user_id'] ); $user_login = $atts['username']; // if the username is given, override the user id. if ( $user_login ) { $user = get_user_by( 'login', $user_login ); if ( ! $user ) { return ''; } $user_id = $user->ID; } if ( ! $user_id ) { if ( ! in_the_loop() ) { return ''; } $user_id = get_the_author_meta('ID' ); } } add_shortcode( 'bp-pm-button', 'buddydev_private_message_button_shortcode' ); /** * Get the button for the post author. * * @return string */ function buddydev_get_author_private_message_button() { if ( ! in_the_loop()) { return ''; } $user_id = get_the_author_meta('ID'); // can't pm to themselves. if ( bp_loggedin_user_id() === $user_id ) { return ''; } return sprintf('<a class="sg-popup-id-11605" id="private-message-bp" href="%1$s">%2$s</a>', buddydev_get_send_private_message_to_user_url( $user_id ), 'Send Private Message' ); } /** * Do you want to automatically inject the button on each post? * * @param string $entry_content entry content. * * @return string */ function buddydev_inject_private_message_button( $entry_content ) { // append at the bottom. $entry_content = $entry_content . buddydev_get_author_private_message_button(); // if you want to only do it on single entry pages(single post etc), you can comment the above line // and uncomment the block below /* if ( is_singular() ) { $entry_content = $entry_content . buddydev_get_author_private_message_button(); } */ // want to test for a post type, you may use is_singular('post_type_name') instead of is_singular() return $entry_content; } // append to the post entry? add_filter( 'the_content', 'buddydev_inject_private_message_button' );
Thank you!
Topic: DIrect messaging problem
Topic: Add subject title in URL
Im building a Apartment rental site.
And on the single apartment page I have a “Send a private message” button where people can send a private message to the person who owns the apartment and ask a questions.So therefor I need to automaticly add the Apartment name in the Subject of the message.
Is it possible to make the subject within the URL something link “https://domain.com/members/user1/messages/compose/?r=user2?subject=xxxxxxxx” So the Subject is automaticly filled when people clicks the “Send a private message”
Hello I think I have a bug here, ok I am on buddypress Version 3.1.0 and logged in as admin I click on a member in the members directory and it has a button for “private message”, when clicked on I am assuming it is supposed to open the compose message box with the members name in the send to field but it is not doing that for some reason. I am assuming this also because of the url link. https://www.theexample.com/members/admin/messages/compose?r=thememberid
So is this a bug and how can I fix this if it is?Hi. I have buddypress + woocommerce + WC marketplace installed on my site running the flatsome theme. My site is a multi-vendor marketplace and I would really like to have a button or something on the single product’s page where logged in users easily can send a message to the product’s particular vendor through Buddypress’ PM system. Could someone please help me creating a shortcode that allows me to do this?
I’ve tried to search the forum but to no help.
Thanks.
Hello,
I am new to Buddypress and this is my first post, I am new to web development also, and my PhP coding is not all that great, my years as a software developer was strictly in a windows environment (vb.net and sql)
I developed my own website and I am using Buddypress as part of my social media for users to connect with each other.
I have spent endless hours researching a fix, and I have not been able to find anything php file that I can edit in File Manager to edit or remove the line of code.
When a user updates an Activity, it updates in three places:
1. The Activity Stream (which is what I want)
2. The Member’s Profile where the Activity tab was (now removed, which is what I want)
3. Under the Member’s profile cover, with that pesky “view link” (which I DO NOT want to show)And the “view link” is a bit buggy also, sometimes when a user clicks on it, it throws a 404 error, sometimes it opens up a blank page, and sometimes it opens up the recent activity that they posted in the Activity Stream.
Also in the members directory I have a button to send the user a private message whether or not they are friends.
When I click on a user name from the member’s directory, it take me to the compose a message like it is suppose to do, and the user name appears , but it does not save the user name in the send to box, do you have a fix for this also?
Thank you very much, a fix to these problems are greatly appreciated.
Naomi
Topic: HTML Form to private message
Topic: Help with this code
add_filter( 'bp_get_send_message_button', function( $array ) { if ( friends_check_friendship( bp_loggedin_user_id(), bp_displayed_user_id() ) ) { return $array; } else { return ''; } } );
I am using the above filter to hide private message button to non friends. It works but it also hides private message button to site admins and bbpress moderators. I want site admins and bbpress moderatos (bbp_moderator) could send and receive private messages even if they are not friend.
Any solution?
Hello,i want to add an “star with me” button next to the button”private message””public message””add friend”buttons in member’s profile.now the chat plugin provider has told the Api to star the chat box ,it is a The JS function:
FlyzooApi.startChat(LocalUserId, SuccessCallback(), FailCallback()) .
i searched a lot about it but it is too hard for me to solve this question,now i wish to get help.While using the “Private Message” button, Buddypress is displaying my own name and profile photo (must be grabbing from members-loop, or something) at the top of the screen.
I’d like to make a modification to change this, so that it will display the recipient’s name/photo instead. This way, my users will be looking at the person they are contacting, while entering their message, instead of looking at themselves. It will serve as a reminder of who they are writing to. (Some people forget things very quickly!)
I’ve carefully reviewed the compose.php file, but am I even looking at the right file to make these changes?
Whether it’s the right file or not, does anyone know exactly how I should go about making this change?
If this sounds too complicated, then perhaps you can suggest how to add a line of text like this, right before the Subject field:
This message is to: (Recipient’s Name)
(That would be better than nothing!)