-
Author
-
November 17, 2015 at 13:26 #87673Oscar570Participant
Hi !
I’d like to insert a button to ask a member for a CHAT instead of SEND A PUBLIC MESSAGE. I’m using COMETCHAT. I contacted them and they said to me :
“<span style=”color: #333333;font-family: Verdana, sans-serif;font-size: 11px”> </span><span style=”color: #333333;font-family: Verdana, sans-serif;font-size: 11px”>Add button or link with below code on click of which it should open chat window for the user.
</span><span style=”color: #333333;font-family: Verdana, sans-serif;font-size: 11px”>Chat with me“</span>
BUT I don’t know to do it.
How can I do this ? Can you help me?
Thanks a lot
Regards
Nathalie
November 17, 2015 at 14:23 #87689sharmstrModeratorI obviously cant test this, but something like this should work. Put it in your child theme’s functions.php file.
COPY CODE// Removing public message option function remove_public_message_button() { remove_filter( 'bp_member_header_actions','bp_send_public_message_button', 20); // Add chat button add_action( 'bp_member_header_actions','add_chat_button',20); } add_action( 'bp_member_header_actions', 'remove_public_message_button' ); function add_chat_button() { echo '<div class="generic-button"><a href="javascript:void(0)" onclick="javascript:jqcc.cometchat.chatWith(userid);">Chat with me</a></div>'; }
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
November 17, 2015 at 15:01 #87698Oscar570ParticipantDear Sharmstr,
The button is remove by “CHATTER” (instead of CHAT WITH ME) but nothing is happening…
Attachments:
You must be logged in to view attached files.November 17, 2015 at 15:08 #87700sharmstrModeratorPerhaps because of their code. How are they getting ‘userid’?
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
November 17, 2015 at 15:22 #87705sharmstrModeratorbp_displayed_user_id() will return the userid of the profile you are viewing. So, you can try the following. If it doesnt work, you’ll have to hire someone to get it working for you.
COPY CODE// Removing public message option function remove_public_message_button() { remove_filter( 'bp_member_header_actions','bp_send_public_message_button', 20); // Add chat button add_action( 'bp_member_header_actions','add_chat_button',20); } add_action( 'bp_member_header_actions', 'remove_public_message_button' ); function add_chat_button() { echo '<div class="generic-button"><a href="javascript:void(0)" onclick="javascript:jqcc.cometchat.chatWith(' . bp_displayed_user_id() . ');">Chat with me</a></div>'; }
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
November 17, 2015 at 15:33 #87708sharmstrModeratorIn the same place you did before. I gave you updated code that uses bp_displayed_user_id to get the userid. So delete the old code and add the new code.
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
November 18, 2015 at 10:49 #87827Oscar570ParticipantDear Sharmstr,
I used COMETCHAT.
From the side menu (who become my mobile menu) I’d like to insert a button on this menu to launch COMETCHAT Application. How can I do this please ?November 18, 2015 at 15:12 #87875sharmstrModeratorWhat’s the code you need to use? The code you gave me before was to launch a chat with a specific user. That wont work in the side menu since the side menu shows on every page.
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
-
AuthorPosts
The forum ‘Plugins questions’ is closed to new topics and replies.