1) I am not a programmer; I dabble here and there.
2) I am using Squarespace to build a business website www.prisma-pi.com
3) I want for specific clients to have access to their private page using a subscriber login (fully accomplished w/ SENTRYLOGIN.com)
4) I also want that private page to provide a chat service (partially accomplished w/ CLOUD.COMETCHAT.com)
WHAT I AM MISSING IS: I want SENTRYLOGIN to "talk to" COMETCHAT.
so that user info from SENTRYLOGIN (such as user name) loads on COMETCHAT.
COMETCHAT provides code that I have "injected" into Squarespace and it is somewhat obvious that the variables need to be updated with input from SENTRYLOGIN. (Which is my gap in knowledge in this problem).
var chat_name = 'LOGGEDIN_USERNAME' ;
var chat_id = 'LOGGEDIN_USERNAME_ID';
var chat_avatar = 'LOGGEDIN_PROFILE_IMAGE';
var chat_link = 'LOGGEDIN_USERS_PROFILE_LINK' ;
</script>
<link type="text/css" href="//fast.cometondemand.net/11205x002c3.css" rel="stylesheet" charset="utf-8">
<script type="text/javascript"
src="//fast.cometondemand.net/11205x002c3.js" charset="utf-8"></script>
This is some info available on CometChat's website, they say something along the lines: "Cookie is all you need" https://support.cometchat.com/documentation/php/installing-cometchat/custom-coded-site/java-or-jsp-site/
SENTRYLOGIN provides access to some JS code that looks promising in accomplishing that task, but I don't know how to complete it.
You can view the source code for Sentrylogin in the sign in page www.prisma-pi.com/sign-in/ Some relevant JS code is found here: http://www.sentrylogin.com/sentry/scripts/SENTRY_AJAX_Style2014.js
Any help would be very much appreciated. If you need more info, let me know.
I haven't tested the code, but it looks like SentryLogin stores the login information in cookies. If you have called the SentryLogin code before the CometChat code, then something like this should work:
if (getCookie('Sentry_loginTkn') != '') { // Check if user is logged in
var chat_name = getCookie('Sentry_firstName')+' '+getCookie('Sentry_lastName');
var chat_id = getCookie('Sentry_member_ID');
var chat_avatar = '';
var chat_link = '' ;
}