J!Extensions Store™
Forum
Welcome, Guest
Please Login to access forum.
Re:Need some (javascript-) Links (1 viewing) 
Go to bottom
TOPIC: Re:Need some (javascript-) Links
#3683
Becker
Fresh Boarder
Posts: 3
User Offline
Need some (javascript-) Links 5 Years ago Karma: 0  
Hi,
I need some links for jchat to build in to my template:

-one to open/close chatbar with a link
-one to open a chat window with a special user (a link in a profile: chat with user x)


e.g so one
Code:

a href="javascript:void(0)" onclick="javascript:Open.JChat.Sidebar('chatrooms');"
 
Logged Logged  
  The administrator has disabled public write access.
#3684
John Dagelmore
Admin
Posts: 3568
User Offline
Re:Need some (javascript-) Links 5 Years ago Karma: 75  
Hi.

Doing this is not so easy, the chat app is a complex javascript app and you need to deal with javascript and PHP to setup an external integration. It's not a link.

To open/close the chat sidebar you can use a code like this:

Code:

jQuery('#jchat_userstab').trigger('click');
To start and open a private chat with a certain user the code must rely on the session ID of Joomla assigned to each user. The PHP code must render the Joomla session ID in the javascript code.
Code:

jQuery('#jchat_userlist_' + sessionID).trigger('click');
 
Logged Logged  
  The administrator has disabled public write access.
#3685
Becker
Fresh Boarder
Posts: 3
User Offline
Re:Need some (javascript-) Links 5 Years ago Karma: 0  
Thank you very mutch for the link codes.

Please can you help how I get the session id of the other user I couldn't find a way
 
Logged Logged  
  The administrator has disabled public write access.
#3688
John Dagelmore
Admin
Posts: 3568
User Offline
Re:Need some (javascript-) Links 5 Years ago Karma: 75  
Well to get the session id from various users you have to query the Joomla database table '#__session'
If you need the current session ID for logged in users you may have to JOIN the #__users table with the #__session table.
The session ID is the first primary key field of the table #__session.
 
Logged Logged  
  The administrator has disabled public write access.
Go to top