FreiChat related discussions
Multisites

I have a few wordpress blogs. Is it possible to share chat guests (in one database) among several custom sites? I wonder if these chat guests can see each other and talk each other.

I have a few wordpress blogs. Is it possible to share chat guests (in one database) among several custom sites? I wonder if these chat guests can see each other and talk each other.

If you want the chat to work for guests in multiple sites then it is possible , but integrating freichat with the user system of every blog will be difficult



If you want the chat to work for guests in multiple sites then it is possible , but integrating freichat with the user system of every blog will be difficult
Necessity is the mother of all inventions!

I try to make it but have some problems.
1. First I pick Custom inslatation and install Freichat on one blog. It works fine.
2. Then I take code in header for first custom blog:

<!--===========================FreiChatX=======START=========================-->
<!-- For uninstalling ME , first remove/comment all FreiChatX related code i.e below code
Then remove FreiChatX tables frei_session & frei_chat if necessary
The best/recommended way is using the module for installation -->

<?php $ses=$_SESSION;

if(!function_exists("freichatx_get_hash")){
function freichatx_get_hash($ses){

if(is_file("/home/marekrz/domains/firstblog.com/public_html/freichat/hardcode.php")){

require "/home/marekrz/domains/firstblog.com/public_html/freichat/hardcode.php";

$temp_id = $ses . $uid;

return md5($temp_id);

}
else
{
echo "<script>alert('module freichatx says: hardcode.php file not
found!');";
}

return 0;
}
}
?>
<script type="text/javascript" language="javascipt" src="http://firstblog.com/freichat/client/main.php?id=&lt;?php%20echo%20%24ses;?&gt;&amp;xhash=&lt;?php%20echo%20freichatx_get_hash(%24ses);%20?&gt;"></script><link rel="stylesheet" href="http://firstblog.com/freichat/client/jquery/freichat_themes/freichatcss.php" type="text/css"><!--===========================FreiChatX=======END=========================-->







and place it on second blog changing firstblog.com to secondblog.com. The code for second blog looks like this:

<!--===========================FreiChatX=======START=========================-->
<!-- For uninstalling ME , first remove/comment all FreiChatX related code i.e below code
Then remove FreiChatX tables frei_session & frei_chat if necessary
The best/recommended way is using the module for installation -->

<?php $ses=$_SESSION;

if(!function_exists("freichatx_get_hash")){
function freichatx_get_hash($ses){

if(is_file("/home/marekrz/domains/secondblog.com/public_html/freichat/hardcode.php")){

require "/home/marekrz/domains/secondblog.com/public_html/freichat/hardcode.php";

$temp_id = $ses . $uid;

return md5($temp_id);

}
else
{
echo "<script>alert('module freichatx says: hardcode.php file not
found!');";
}

return 0;
}
}
?>
<script type="text/javascript" language="javascipt" src="http://secondblog.com/freichat/client/main.php?id=&lt;?php%20echo%20%24ses;?&gt;&amp;xhash=&lt;?php%20echo%20freichatx_get_hash(%24ses);%20?&gt;"></script><link rel="stylesheet" href="http://secondblog.com/freichat/client/jquery/freichat_themes/freichatcss.php" type="text/css"><!--===========================FreiChatX=======END=========================-->

3. I have copied files from instlation blog one to catalog on second blog (so paths in code above is fine)

4. I changed rights for my chat database access to enable access from other domain

5. In file hardcode.php I have changed $host='localhost';
to
$host='XXX.YYY.ZZZ.QQQ'; //IP for my database (also with port - but I can't see it helped)

Thats all but this is not sufficent.

firstblog.com works fine (even with hardcode.php changes) but on secondblog.com
- chatrooms names are not apear and I always see message:
Fetching...user..data
kindly wait
loading...........

on right down corner (users status).

Probably communication with database is not working.

Any help?

Best regards,
Marek


I try to make it but have some problems. 1. First I pick Custom inslatation and install Freichat on one blog. It works fine. 2. Then I take code in header for first custom blog: &amp;lt;!--===========================FreiChatX=======START=========================--&amp;gt; &amp;lt;!-- For uninstalling ME , first remove/comment all FreiChatX related code i.e below code Then remove FreiChatX tables frei_session &amp; frei_chat if necessary The best/recommended way is using the module for installation --&amp;gt; &amp;lt;?php $ses=$_SESSION; if(!function_exists(&quot;freichatx_get_hash&quot;)){ function freichatx_get_hash($ses){ if(is_file(&quot;/home/marekrz/domains/firstblog.com/public_html/freichat/hardcode.php&quot;)){ require &quot;/home/marekrz/domains/firstblog.com/public_html/freichat/hardcode.php&quot;; $temp_id = $ses . $uid; return md5($temp_id); } else { echo &quot;&amp;lt;script&amp;gt;alert(&#039;module freichatx says: hardcode.php file not found!&#039;);&amp;lt;/script&amp;gt;&quot;; } return 0; } } ?&amp;gt; &amp;lt;script type=&quot;text/javascript&quot; language=&quot;javascipt&quot;src=&quot;http://firstblog.com/freichat/client/main.php?id=&amp;lt;?php echo $ses;?&amp;gt;&amp;xhash=&amp;lt;?php echo freichatx_get_hash($ses); ?&amp;gt;&quot;&amp;gt;&amp;lt;/script&amp;gt; &amp;lt;link rel=&quot;stylesheet&quot; href=&quot;http://firstblog.com/freichat/client/jquery/freichat_themes/freichatcss.php&quot; type=&quot;text/css&quot;&amp;gt; &amp;lt;!--===========================FreiChatX=======END=========================--&amp;gt; and place it on second blog changing firstblog.com to secondblog.com. The code for second blog looks like this: &amp;lt;!--===========================FreiChatX=======START=========================--&amp;gt; &amp;lt;!-- For uninstalling ME , first remove/comment all FreiChatX related code i.e below code Then remove FreiChatX tables frei_session &amp; frei_chat if necessary The best/recommended way is using the module for installation --&amp;gt; &amp;lt;?php $ses=$_SESSION; if(!function_exists(&quot;freichatx_get_hash&quot;)){ function freichatx_get_hash($ses){ if(is_file(&quot;/home/marekrz/domains/secondblog.com/public_html/freichat/hardcode.php&quot;)){ require &quot;/home/marekrz/domains/secondblog.com/public_html/freichat/hardcode.php&quot;; $temp_id = $ses . $uid; return md5($temp_id); } else { echo &quot;&amp;lt;script&amp;gt;alert(&#039;module freichatx says: hardcode.php file not found!&#039;);&amp;lt;/script&amp;gt;&quot;; } return 0; } } ?&amp;gt; &amp;lt;script type=&quot;text/javascript&quot; language=&quot;javascipt&quot;src=&quot;http://secondblog.com/freichat/client/main.php?id=&amp;lt;?php echo $ses;?&amp;gt;&amp;xhash=&amp;lt;?php echo freichatx_get_hash($ses); ?&amp;gt;&quot;&amp;gt;&amp;lt;/script&amp;gt; &amp;lt;link rel=&quot;stylesheet&quot; href=&quot;http://secondblog.com/freichat/client/jquery/freichat_themes/freichatcss.php&quot; type=&quot;text/css&quot;&amp;gt; &amp;lt;!--===========================FreiChatX=======END=========================--&amp;gt; 3. I have copied files from instlation blog one to catalog on second blog (so paths in code above is fine) 4. I changed rights for my chat database access to enable access from other domain 5. In file hardcode.php I have changed $host=&#039;localhost&#039;; to $host=&#039;XXX.YYY.ZZZ.QQQ&#039;; //IP for my database (also with port - but I can&#039;t see it helped) Thats all but this is not sufficent. firstblog.com works fine (even with hardcode.php changes) but on secondblog.com - chatrooms names are not apear and I always see message: Fetching...user..data&amp;lt;br/&amp;gt;kindly wait&amp;lt;br/&amp;gt;loading........... on right down corner (users status). Probably communication with database is not working. Any help? Best regards, Marek

From the first line of your code . i.e

<?php $ses=$_SESSION;

From the first line of your code . i.e &amp;lt;code&amp;gt; &amp;lt;?php $ses=$_SESSION;&amp;lt;/code&amp;gt; The custom installation looks wrong , because you have stored the entire session in $ses , whereas FreiChat needs you to store only the id of the current user. But since the chat is going to work for guests , you can just pass 0 . Also , are your websites located in different servers or the same server ? If they are on the same server , you do not need to change the host to IP address.
Necessity is the mother of all inventions!

When I use

$ses=0;
insted of $ses=$_SESSION;

then widget is not apear.

In javascript console I see message:
Uncaught SyntaxError: Unexpected token

When I use $ses=0; insted of $ses=$_SESSION; then widget is not apear. In javascript console I see message: Uncaught SyntaxError: Unexpected token &amp;lt; /freichat/client/main.php?id=0&amp;xhash=%3Cscript%3Ealert(&#039;module%20freichatx%20says:%20hardcode.php%20file%20notfound!&#039;);%3C/script%3E0:1 Actualy hardcode.php is present on server and main.php also but probaly freichat dont see paths. I try to solve this problem myself, but maybe you can suggest what is wrong with paths. Thank you for help. Anyway, if I solve this problem I buy full version. Great job!

Clicking by details:

Fatal error: Call to a member function fetchAll() on a non-object in /home/marekrz/domains/mydomain.com/public_html/freichat/server/drivers/Custom.php on line 33


And line 33 in Custom.php is:
$res = $res_obj->fetchAll();

in function getDBdata($session_id, $first)



Clicking by details: &amp;lt;b&amp;gt;Fatal error&amp;lt;/b&amp;gt;: Call to a member function fetchAll() on a non-object in &amp;lt;b&amp;gt;/home/marekrz/domains/mydomain.com/public_html/freichat/server/drivers/Custom.php&amp;lt;/b&amp;gt; on line &amp;lt;b&amp;gt;33&amp;lt;/b&amp;gt;&amp;lt;br /&amp;gt; And line 33 in Custom.php is: $res = $res_obj-&amp;gt;fetchAll(); in function getDBdata($session_id, $first)

A small error in my last post , IT should be $ses=null; and not $ses=0;

Because in Custom.php it checks if the variable $ses is null to identify a user as a guest .


After replacing that piece of code , what you need to do is , select one database as a base , and then in hardcode.php of every folder of freichat of your website replace the database name to your base database .
So now all instances of FreiChat will store and fetch the users from a single database .

A small error in my last post , IT should be $ses=null; and not $ses=0; Because in Custom.php it checks if the variable $ses is null to identify a user as a guest . After replacing that piece of code , what you need to do is , select one database as a base , and then in hardcode.php of every folder of freichat of your website replace the database name to your base database . So now all instances of FreiChat will store and fetch the users from a single database .
Necessity is the mother of all inventions!

Thank you for help.

unfortunatly it's still not works. It is working on original installation, but for additional site, which is connecting to early created database I receive status message about logged guests:
Fetching...user..datakindly waitloading...........
And no chat rooms names are loaded on left pane.

Probably it is still problem with connection to databes.
I am considering... what have to be written in hardcode.php file in line:
$uid='xxxxxxxxxxx';

I copied this $uid from my original installation, but I think it my cause a problem...

Thank you for help. unfortunatly it&#039;s still not works. It is working on original installation, but for additional site, which is connecting to early created database I receive status message about logged guests: Fetching...user..datakindly waitloading........... And no chat rooms names are loaded on left pane. Probably it is still problem with connection to databes. I am considering... what have to be written in hardcode.php file in line: $uid=&#039;xxxxxxxxxxx&#039;; I copied this $uid from my original installation, but I think it my cause a problem...

To complete information about previous post: no error message show on console using freichat on additional site.

To complete information about previous post: no error message show on console using freichat on additional site.

It is a server side error , so you wont get any errors in your console . You should check your apache error log for any errors .

Also , enable PHP debug from FreiChat backend , and then check the contents of freixlog.log in ~/freichat folder .

Can you just summarize on the changes that you have made until now .

It is a server side error , so you wont get any errors in your console . You should check your apache error log for any errors . Also , enable PHP debug from FreiChat backend , and then check the contents of freixlog.log in ~/freichat folder . Can you just summarize on the changes that you have made until now .
Necessity is the mother of all inventions!

On server site I receive 3 warning message:

[Sat Nov 24 16:03:46 2012] [warn] [client 89.75.70.71] (70007)The timeout specified has expired: mod_fcgid: can't get data from http client, referer: http://alergia.apteka-internetowa.shop.pl/


[Sat Nov 24 16:06:13 2012] [warn] [client 89.75.70.71] mod_fcgid: stderr: PHP Warning: Cannot modify header information - headers already sent by (output started at /home/marekrz/domains/apteka-internetowa.shop.pl/public_html/alergia/freichat/lang/polish.php:1) in /home/marekrz/domains/apteka-internetowa.shop.pl/public_html/alergia/freichat/client/jquery/freichat_themes/basic/css.php on line 3, referer: http://alergia.apteka-internetowa.shop.pl/

[Sat Nov 24 16:06:14 2012] [warn] [client 89.75.70.71] mod_fcgid: stderr: PHP Warning: Cannot modify header information - headers already sent by (output started at /home/marekrz/domains/apteka-internetowa.shop.pl/public_html/alergia/freichat/lang/polish.php:1) in /home/marekrz/domains/apteka-internetowa.shop.pl/public_html/alergia/freichat/client/main.php on line 223, referer: http://alergia.apteka-internetowa.shop.pl/


http://alergia.apteka-internetowa.shop.pl/ is my second domain where I am testing connection with chat installed oryginally on kurierzydrowia.pl

I tried out with simply usage ob_start() and ob_end_flush() but without result at this time...

On server site I receive 3 warning message: [Sat Nov 24 16:03:46 2012] [warn] [client 89.75.70.71] (70007)The timeout specified has expired: mod_fcgid: can&#039;t get data from http client, referer: http://alergia.apteka-internetowa.shop.pl/ [Sat Nov 24 16:06:13 2012] [warn] [client 89.75.70.71] mod_fcgid: stderr: PHP Warning: Cannot modify header information - headers already sent by (output started at /home/marekrz/domains/apteka-internetowa.shop.pl/public_html/alergia/freichat/lang/polish.php:1) in /home/marekrz/domains/apteka-internetowa.shop.pl/public_html/alergia/freichat/client/jquery/freichat_themes/basic/css.php on line 3, referer: http://alergia.apteka-internetowa.shop.pl/ [Sat Nov 24 16:06:14 2012] [warn] [client 89.75.70.71] mod_fcgid: stderr: PHP Warning: Cannot modify header information - headers already sent by (output started at /home/marekrz/domains/apteka-internetowa.shop.pl/public_html/alergia/freichat/lang/polish.php:1) in /home/marekrz/domains/apteka-internetowa.shop.pl/public_html/alergia/freichat/client/main.php on line 223, referer: http://alergia.apteka-internetowa.shop.pl/ http://alergia.apteka-internetowa.shop.pl/ is my second domain where I am testing connection with chat installed oryginally on kurierzydrowia.pl I tried out with simply usage ob_start() and ob_end_flush() but without result at this time...

Did you get any errors in freichat/freixlog.log after enabling PHP debug in FreiChat backend ?

$host='XXX.YYY.ZZZ.QQQ'; //IP for my database (also with port - but I can't see it helped)

Are you still using IP address or localhost for the other sites ?

Did you get any errors in freichat/freixlog.log after enabling PHP debug in FreiChat backend ? &amp;lt;em&amp;gt; $host=&#039;XXX.YYY.ZZZ.QQQ&#039;; //IP for my database (also with port - but I can&#039;t see it helped)&amp;lt;/em&amp;gt; Are you still using IP address or localhost for the other sites ?
Necessity is the mother of all inventions!

When I enable PHP debugging I receive following messages:
November 26, 2012, 1:22 am: main.php loaded
November 26, 2012, 1:22 am: Wrong method defined!
November 26, 2012, 1:22 am: Inserted the user with the following data :: Username = Gość_9y8 And ID = 1354182788 Default status = Jestem dostępny

I use polish (Gość = Guest) (Jestem dostępny = I'm available)

And yes, I am still using IP to connect to host. In fact the database is in the same domain so, ‘localhost' is working. Explicit domain name 'kurierzyzdrowia.pl' is working, but with wrong IP address - chat is not appear. Currently I am using $host='62.212.69.227' and is ok, because chat is appear

When I enable PHP debugging I receive following messages: November 26, 2012, 1:22 am: main.php loaded November 26, 2012, 1:22 am: Wrong method defined! November 26, 2012, 1:22 am: Inserted the user with the following data :: Username = Gość_9y8 And ID = 1354182788 Default status = Jestem dostępny I use polish (Gość = Guest) (Jestem dostępny = I&#039;m available) And yes, I am still using IP to connect to host. In fact the database is in the same domain so, ‘localhost&#039; is working. Explicit domain name &#039;kurierzyzdrowia.pl&#039; is working, but with wrong IP address - chat is not appear. Currently I am using $host=&#039;62.212.69.227&#039; and is ok, because chat is appear

Try this ,

Open your chrome console , click on network tab , you should see requests being made by freichat , click on any one of those requests , then click on response tab of that request .

You should see some errors in the response , please post this content .

Try this , Open your chrome console , click on network tab , you should see requests being made by freichat , click on any one of those requests , then click on response tab of that request . You should see some errors in the response , please post this content .
Necessity is the mother of all inventions!

Message is: invalid install uid


Message path:
http://alergia.apteka-internetowa.shop.pl/freichat/server/freichat.php?freimode=getmembers&xhash=%3Cscript%3Ealert('module+freichatx+says%3A+hardcode.php+file+not+found!')%3B%3C%2Fscript%3E0&id=&first=false&time=0&chatroom_mesg_time=0&clrchtids%5B%5D=&custom_mesg=Jestem+dost%C4%99pny&long_poll=false&in_room=1

Message is: invalid install uid Message path: http://alergia.apteka-internetowa.shop.pl/freichat/server/freichat.php?freimode=getmembers&amp;xhash=%3Cscript%3Ealert(&#039;module+freichatx+says%3A+hardcode.php+file+not+found!&#039;)%3B%3C%2Fscript%3E0&amp;id=&amp;first=false&amp;time=0&amp;chatroom_mesg_time=0&amp;clrchtids%5B%5D=&amp;custom_mesg=Jestem+dost%C4%99pny&amp;long_poll=false&amp;in_room=1
f...('module+freichatx+says%3A+hardcode.php+file+not+found!')%3B%3C%2Fscript%3E0&id=&first=false&time=0&chatroom_mesg_time=0&clrchtids%5B%5

Above error clearly says that the path below

if(is_file("/home/marekrz/domains/secondblog.com/public_html/freichat/hardcode.php")){

require "/home/marekrz/domains/secondblog.com/public_html/freichat/hardcode.php";


is wrong , please correct the path .
&amp;lt;em&amp;gt;f...(&#039;module+freichatx+says%3A+hardcode.php+file+not+found!&#039;)%3B%3C%2Fscript%3E0&amp;id=&amp;first=false&amp;time=0&amp;chatroom_mesg_time=0&amp;clrchtids%5B%5&amp;lt;/em&amp;gt; Above error clearly says that the path below &amp;lt;code&amp;gt; if(is_file(&quot;/home/marekrz/domains/secondblog.com/public_html/freichat/hardcode.php&quot;)){ require &quot;/home/marekrz/domains/secondblog.com/public_html/freichat/hardcode.php&quot;; &amp;lt;/code&amp;gt; is wrong , please correct the path .
Necessity is the mother of all inventions!

That's right. My mistake - I have placed wrong path with subdomain before dot. Currently is working fine :) . Thank You very much!

That&#039;s right. My mistake - I have placed wrong path with subdomain before dot. Currently is working fine :) . Thank You very much!
111
16
0
live preview
enter atleast 10 characters
WARNING: You mentioned %MENTIONS%, but they cannot see this message and will not be notified
Saving...
Saved
With selected deselect posts show selected posts
All posts under this topic will be deleted ?
Pending draft ... Click to resume editing
Discard draft