This topic has 16 replies, 5 voices, and was last updated 10 years by alberhd.

  • Author
  • #5203
     aztlanla
    Participant

    Hi, great theme by the way. Where should I add this Javascript code I got from Cometchat to put a chat with link on users profiles that are online at the moment? What about the USERID variable will that work?

    <noformat>test<noformat>

    #5208
     aztlanla
    Participant

    I was trying the paste the code and ran out of edits. Trying again in a reply.

    [code language=”javascript”]
    Chat with me
    [/code]

    #5211
     aztlanla
    Participant

    This is where I got the code from
    http://www.cometchat.com/answers/how-do-i-add-a-chat-link-in-profile-pages/

    I was not able to paste it in this post. Not sure what the escape codes are.

    #5262
     SQadmin
    Keymaster

    You can add code with “pre” tag
    That code shoud go in members/single/member-header.php
    instead of ‘USERID’ this php function gets the displayed user id:

    COPY CODE
    
    bp_displayed_user_id()
    
    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #5304
     aztlanla
    Participant

    I got these both to work.

    Text Link

    COPY CODE
    
    <a href="void(0)">');">Chat with me</a>
    

    Button Link

    COPY CODE
    
    <button type="button" onclick="javascript:jqcc.cometchat.chatWith('<?php echo bp_displayed_user_id() ?>');">Chat with me</button>
    

    Thanks

    #5308
     aztlanla
    Participant

    I couldn’t get the text link to come out using pre or code. I guess you can look at the button code and figure out the text code.

    #7258
     jaybini
    Participant

    after making a button in the member’s profile , i want to make the chat “one to one” conversation for example u can’t talk to several people in the same time u have to close the conversation to start another one.
    how can this be done ?

    #7322
     SQadmin
    Keymaster

    I think is more of a Cometchat problem or I didn’t understand your question.

    Regards,
    Abe

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

    1. when it says who’s online this represent all users on the website who are online or my friends who are online ?

    2. if i want to limit it to premium membership is all users are going to appear too ?

    3. I don’t want users to be flooded with messages from random people on the website.that’s what I want to reach

    Could u help me please
    thank u

    #7388
     SQadmin
    Keymaster

    Hi, Who’s online is generated by Cometchat and you should ask them since we don’t support third party plugins and don’t know how their functionality is built. The requests implies custom work and it needs to be applied to the cometchat plugin.

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

    Hi,this code is working good: <button type=”button” onclick=”javascript:jqcc.cometchat.chatWith(‘<?php echo bp_displayed_user_id() ?>’);”>Chat with me</button>

    But, how can i put the chat button under the button of private message and with the same design? Thanks

    #25490
     Abe
    Keymaster

    You will need to style it using CSS depending on the location added.

    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.

    #25495
     alberhd
    Participant

    I want just that appear here,is the standard menu,without touch nothing,some plugins put there his buttons automatically,so should be just put the cometchat button code on the correct file,but i dont know where,thank for your time and help

    Attachments:
    You must be logged in to view attached files.
    #25501
     alberhd
    Participant

    wangguard put the button “user report” directly there for example,so should be:

    add a new blue button on this place with the word “Chat” that works with this action “”javascript:jqcc.cometchat.chatWith(‘<?php echo bp_displayed_user_id() ?>’);”

    I dont know much,is just one idea

    #25502
     Abe
    Keymaster

    See this code that should be add in child theme/functions.php

    COPY CODE
    
    add_action('bp_member_header_actions', 'kleo_cometchat_button', 100);
    function kleo_cometchat_button() {
        echo '<div class="generic-button"><a onclick="javascript:jqcc.cometchat.chatWith(\'' . bp_displayed_user_id() . '\');" href="#">Chat with me</a></div>';
    }
    

    I must remind you that custom changes to the theme is not support responsibility and you should hire a developer to help.

    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.

    #25504
     alberhd
    Participant

    I appreciate your help, thanks for the detail. After i will try the code,one more time,thank you!

    #25520
     alberhd
    Participant

    Is working perfectly,the only problem is that the button appear on my own profile to

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

The forum ‘Sweetdate – WordPress’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?