User ID Question For Cometchat

derrickhand300
@derrickhand300
10 years ago
1,353 posts
I am working on installing a third party chat from profile using
<a href="javascript:void(0)" onclick="javascript:jqcc.cometchat.chatWith('profile_id=$_profile_id');">Chat with me</a>

This is not working and I am trying to find the corret code for

('profile_id=$_profile_id')  I have also tried ('{profile_id=$_profile_id}')

Any help appreciated

Here are some links in configuring this
http://www.cometchat.com/documentation/developers-api/javascript-api/

i know several members here use cometchat and wonder if they have configured this already?
updated by @derrickhand300: 05/22/15 04:56:49PM
SteveX
SteveX
@ultrajam
10 years ago
2,584 posts
<a href="javascript:void(0)" onclick="javascript:jqcc.cometchat.chatWith('profile_id={$_profile_id}');">Chat with me</a>
I'm not using cometchat, but if this is for in a template try the above code.

You need the smarty brackets around the smarty variable {$_profile_id} in order for it to print.

It will be printed into the javascript in the html page as a number. The javascript then runs once the page is loaded into the browser.


--
¯\_(ツ)_/¯ Education, learning resources, TEL, AR/VR/MR, CC licensed content, panoramas, interactive narrative, sectional modules (like jrDocs), lunch at Uni of Bristol. Get in touch if you share my current interests or can suggest better :)
derrickhand300
@derrickhand300
10 years ago
1,353 posts
Thanks UJ
I added the code as a template to the page-when I click on "Chat With Me" nothing happens..
Right click on it and "inspect Source" I get the following
<a href="javascript:void(0)" onclick="javascript:jqcc.cometchat.chatWith('profile_id=');">Chat with me</a>

Still trying to get it right-it looks like it cannot get the code from within the smarty brackets
updated by @derrickhand300: 04/18/15 06:59:30PM
derrickhand300
@derrickhand300
10 years ago
1,353 posts
Trying this code-If I click on a users "Chat With Me" on their profile
<a href="javascript:void(0)" onclick="javascript:openChatMe('{$unique_id}')">Chat with me</a>
still nothing opens for me-Right click and inspect code shows its getting a ID# 17236 shown here

<a href="javascript:void(0)" onclick="javascript:openChatMe('17236')">Chat with me</a>

With this code installed others can click on my profile "Chat With Me" and it opens a chat box but says i am offline ( I am not)- I click on theirs and nothing happens


But again it returns the user id now...

I found comet chat from posts of people here using it so I was hoping someone had already worked this out...

Have renamed jqcc.cometchat in the script because I think it was calling on their hosted server and not mine...
updated by @derrickhand300: 04/18/15 07:18:42PM
gary.moncrieff
gary.moncrieff
@garymoncrieff
10 years ago
865 posts
I have used the api in the past to launch the chatroom window, but not this, you shouldn't rename jqcc.cometchat as far as I recall.

Are you sure your integration is actually working? anytime I tried a few months ago I could never get it to work, it would install, but there was never any indication that your followers were online.

<a href="javascript:void(0)" onclick="javascript:jqcc.cometchat.chatWith('{$_profile_id}');">Chat with me<a>

updated by @garymoncrieff: 04/19/15 01:16:40AM
derrickhand300
@derrickhand300
10 years ago
1,353 posts
Thank you Gary

Im really disappointed in it for sure-got a question though

it your example you leave the closing off the

<a>  where I added the  </a> to mine 

I thought maybe it was a cometchat typo....is is supposed to finish without the closing slash?
gary.moncrieff
gary.moncrieff
@garymoncrieff
10 years ago
865 posts
My typo sorry.
derrickhand300
@derrickhand300
10 years ago
1,353 posts
Its actually written that way at the cometchat website in their example- I though maybe there was a reason for it i did not understand...thanks Gary- when I get a few cups of coffee down I will try the smarty you used and see if it works for me :)
derrickhand300
@derrickhand300
10 years ago
1,353 posts
I have hired cometchat to do this now- if they are able to get it working I will post the code for anyone that wants it
Strumelia
Strumelia
@strumelia
10 years ago
3,603 posts
I bought the version that includes them installing it for me as well.
I only had to add a bit of code to a skin template on my end.
Mine's working fine now. But I'm not using the 'personal' one for profile pages like I think Curtis is trying to do...? I don't know nothin about that.


--
...just another satisfied Jamroom customer.
Migrated from Ning to Jamroom June 2015
derrickhand300
@derrickhand300
10 years ago
1,353 posts
Yeah My idea stems from a post of ya'll' earlier where you wanted to be able to leave/send a message to the profile owner which is a good idea
Pubically it can be done with a comment box ( just got that)
Privately it can be done with Cometchat using a "Chat With Me" button under their profile pic..I noticed that cometchat allowed messages to be left for offline users so I am giving it a try ( and getting a custom chat room skin installed by cometchat because I struggle enough already)
updated by @derrickhand300: 04/20/15 03:52:14PM

Tags