Help
Ask questions about how to do or fix things in Arrowchat
User avatar
Melanie
Customer
 
Posts: 66
Joined: 11 Jul 2011, 02:50

 

by Melanie 11 Sep 2017, 04:57

Is it possible to display the arrowchat bar on a site where the code isn't installed? I basically want to be able to view my chatbar when I am in my other website but do not want to install the component there as the users I chat to will be in the website where arrowchat is installed. I know I used to be able to display the bar in an un-related component, but this was stored in the same root folder as where the arrowchat installation was.

My other website is on the same server.

Kind regards

Mel
User avatar
bato3
Free
 
Posts: 5
Joined: 06 Oct 2016, 16:41

 

by bato3 14 Sep 2017, 02:45

Yes, it is possible, but not simple. It require some modifications and resolving login procedure.

1. So, you must have solution for auth users for all subdomains.

2. Add
Code: Select all
    $.ajaxSetup({xhrFields: {
        withCredentials: true
    }});
in all subdomains.

3. Set `Access-Control-Allow-Origin` in `.htacces` for ac instalation domain
Code: Select all
<IfModule mod_headers.c>
    SetEnvIf Origin "http(s)?://((www\.)?((test|beta|mobile|forum\.)?domain.pl|localhost)$" AccessControlAllowOrigin=$0
        Header add Access-Control-Allow-Origin %{AccessControlAllowOrigin}e env=AccessControlAllowOrigin


    Header set Access-Control-Allow-Credentials true
Header always set Access-Control-Allow-Methods "POST, GET, PUT, OPTIONS, PATCH, DELETE"
Header always set Access-Control-Allow-Headers "X-Accept-Charset,X-Accept,Content-Type"

RewriteCond %{REQUEST_METHOD} OPTIONS
RewriteRule ^(.*)$ $1 [R=200,L,E=HTTP_ORIGIN:%{HTTP:ORIGIN}]
</IfModule>


4. In Configuration section set `Base URL` with domain.

5. Giphly finding: Add in your `arrowchat/includes/js/arrowchat_core.js` method: `loadGiphy` section `a.ajax({` add
Code: Select all
xhrFields: {
                    withCredentials: false
                },
or cry, that you don't have knowledge to unpack script.
6. Add this in other sections, that need `withCredentials: false`

7. I don't remember, that are all modifications