FreiChat related discussions
Custom installation php syntax error

Hello,
i am using a freichat bought on november 2013 (can not find the version...).
I performed a custom installation and everything seems gone well.
I set up freichat for logged users only and as you can see the call to main.php semms to be correct. "nzb79Q3RrUFE6dO" is actual logged user id.

http://www.test.consultriver.com/freichat/client/main.php?id=nzb79Q3RrUFE6dO&xhash=4d38625407dae3cd2c366d2fac35c61a

The problem is chat does not show up and firebug console (in firefox) says:
SyntaxError: syntax error
<br />
in main.php line 1 (seems to be a jquery error!)

What can i do to solve this?
The main.php file is the original downloaded one.
Thank you in advance

Hello, i am using a freichat bought on november 2013 (can not find the version...). I performed a custom installation and everything seems gone well. I set up freichat for logged users only and as you can see the call to main.php semms to be correct. &quot;nzb79Q3RrUFE6dO&quot; is actual logged user id. http://www.test.consultriver.com/freichat/client/main.php?id=nzb79Q3RrUFE6dO&amp;xhash=4d38625407dae3cd2c366d2fac35c61a The problem is chat does not show up and firebug console (in firefox) says: SyntaxError: syntax error &amp;lt;br /&amp;gt; in main.php line 1 (seems to be a jquery error!) What can i do to solve this? The main.php file is the original downloaded one. Thank you in advance

In the console, the error must appear as a link . (chrome developer tools)
Try clicking that link , and see what error is shown in the file .

If it is in anyway related to jquery , you can try this:

Open freichat/hardcode.php

Replace

$force_load_jquery = 'NO';

with

$force_load_jquery = 'YES';
In the console, the error must appear as a link . (chrome developer tools) Try clicking that link , and see what error is shown in the file . If it is in anyway related to jquery , you can try this: Open freichat/hardcode.php Replace ``` $force_load_jquery = &#039;NO&#039;; ``` with ``` $force_load_jquery = &#039;YES&#039;; ```

Hello,
in hardcode.php the parameter for jquery is already set to

$force_load_jquery = 'YES';

Following the previous post error link it opens a page with this error:

<br />
<b>Fatal error</b>:  Call to a member function rowCount() on a non-object in <b>/homepages/42/d475180382/htdocs/consultriver.com/test.consultriver/www/freichat/server/drivers/base.php</b> on line <b>187</b><br />

Moreover in freichat admin panel/user moderation i can find all user listed by ID and name but when i try to make a query filtering by ID or user name it appens the following error:

Fatal error: Call to a member function fetchAll() on a non-object in /homepages/42/d475180382/htdocs/consultriver.com/test.consultriver/www/freichat/administrator/admin_files/moderate_users/drivers/base.php on line 129

Am I doing something wrong with the configuration file? Or is it a problem in drivers/base.php?

Thank you

p.s. if you need more info please let me know

Hello, in hardcode.php the parameter for jquery is already set to ```` $force_load_jquery = &#039;YES&#039;; ```` Following the previous post error link it opens a page with this error: ```` &amp;lt;br /&amp;gt; &amp;lt;b&amp;gt;Fatal error&amp;lt;/b&amp;gt;: Call to a member function rowCount() on a non-object in &amp;lt;b&amp;gt;/homepages/42/d475180382/htdocs/consultriver.com/test.consultriver/www/freichat/server/drivers/base.php&amp;lt;/b&amp;gt; on line &amp;lt;b&amp;gt;187&amp;lt;/b&amp;gt;&amp;lt;br /&amp;gt; ```` Moreover in freichat admin panel/user moderation i can find all user listed by ID and name but when i try to make a query filtering by ID or user name it appens the following error: ```` Fatal error: Call to a member function fetchAll() on a non-object in /homepages/42/d475180382/htdocs/consultriver.com/test.consultriver/www/freichat/administrator/admin_files/moderate_users/drivers/base.php on line 129 ```` Am I doing something wrong with the configuration file? Or is it a problem in drivers/base.php? Thank you p.s. if you need more info please let me know

It looks like a problem in the configuration file in freichat/hardcode.php

Please make sure the table names and database prefix are correct .

It looks like a problem in the configuration file in freichat/hardcode.php Please make sure the table names and database prefix are correct .

Hello,
I have found out what is the cause of the errors.
In my DB table the userid is alphanumeric. I have already modified the DB
query in base.php file (both admin and client side) wrapping the userid with quotes and all seems to be fine, no more errors.
Now the new issue is the following error found in log file

September 15, 2014, 10:41 am: main.php  loaded

September 15, 2014, 10:41 am: Inserted the user with the following data :: Username = Marco And ID = nzb79Q3RrUFE6dO Default status  = Sono Disponibile

September 15, 2014, 10:41 am: main.php  loaded

September 15, 2014, 10:41 am: Wrong method defined!

and in the chat box it hangs saying retrieving user data with no result.

Have I to change something regarding userid in other files?
Or is it a way to tell the system that userid is a string?

Thank you.

Hello, I have found out what is the cause of the errors. In my DB table the userid is alphanumeric. I have already modified the DB query in base.php file (both admin and client side) wrapping the userid with quotes and all seems to be fine, no more errors. Now the new issue is the following error found in log file ```` September 15, 2014, 10:41 am: main.php loaded September 15, 2014, 10:41 am: Inserted the user with the following data :: Username = Marco And ID = nzb79Q3RrUFE6dO Default status = Sono Disponibile September 15, 2014, 10:41 am: main.php loaded September 15, 2014, 10:41 am: Wrong method defined! ```` and in the chat box it hangs saying retrieving user data with no result. Have I to change something regarding userid in other files? Or is it a way to tell the system that userid is a string? Thank you.

Hi,

Can you do the following .

Open your website and start developer tools (f12 in chrome) .

Click on network tab, wait for freichat to make a request .

Click on any of the requests , then check its response tab.

Do you see any errors ? If yes, please post them here.

Hi, Can you do the following . Open your website and start developer tools (f12 in chrome) . Click on **network** tab, wait for freichat to make a request . Click on any of the requests , then check its **response** tab. Do you see any errors ? If yes, please post them here.

Hi,
here is the error you want to see

<br />
<b>Notice</b>:  Constant DBprefix already defined in <b>/homepages/42/d475180382/htdocs/consultriver.com/test.consultriver/www/freichat/server/drivers/Custom.php</b> on line <b>182</b><br />
<br />
<b>Fatal error</b>:  Call to a member function fetchAll() on a non-object in <b>/homepages/42/d475180382/htdocs/consultriver.com/test.consultriver/www/freichat/server/drivers/Custom.php</b> on line <b>137</b><br />

Thank you

Hi, here is the error you want to see ```` &amp;lt;br /&amp;gt; &amp;lt;b&amp;gt;Notice&amp;lt;/b&amp;gt;: Constant DBprefix already defined in &amp;lt;b&amp;gt;/homepages/42/d475180382/htdocs/consultriver.com/test.consultriver/www/freichat/server/drivers/Custom.php&amp;lt;/b&amp;gt; on line &amp;lt;b&amp;gt;182&amp;lt;/b&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;br /&amp;gt; &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;/homepages/42/d475180382/htdocs/consultriver.com/test.consultriver/www/freichat/server/drivers/Custom.php&amp;lt;/b&amp;gt; on line &amp;lt;b&amp;gt;137&amp;lt;/b&amp;gt;&amp;lt;br /&amp;gt; ```` Thank you

The query in the Custom.php file in the method get_guests() is wrong .

I guess it is a problem of quotes since your id is alphanumeric , can you check that ?

The query in the Custom.php file in the method get_guests() is wrong . I guess it is a problem of quotes since your id is alphanumeric , can you check that ?

Hello again,
i have checked Custom.php and added all the quotes needed.
The main problem is that no record is created in frei_session table.
After have added quotes in the INSERT query in base.php it appears like this:

public function createFreiChatXdb() {
        if (!isset($_SESSION[$this->uid . 'isset_freichatx']) || $_SESSION[$this->uid . 'time'] < $this->time_string - 100) { //To check if session is created or not
            $query = "INSERT INTO frei_session (username,session_id,time,permanent_id,status,status_mesg,guest)
                      VALUES (" . $this->db->quote($_SESSION[$this->uid . 'usr_name']) . "," . $this->db->quote($_SESSION[$this->uid . 'usr_ses_id']) . "," . $this->time_string . "," . $this->db->quote($_SESSION[$this->uid . 'gst_ses_id']) . ",1,'" . $this->frei_trans['default_status'] . "'," . $_SESSION[$this->uid . 'is_guest'] . ")";
            $this->db->query($query);

            $this->freichat_debug('Inserted the user with the following data :: Username = ' . $_SESSION[$this->uid . 'usr_name'] . ' And ID = ' . $_SESSION[$this->uid . 'usr_ses_id'] . ' Default status  = ' . $this->frei_trans['default_status']);
            $_SESSION[$this->uid . 'time'] = time();
            $_SESSION[$this->uid . 'isset_freichatx'] = 0;
        }
    }

Is it right?
The debug file appear like this:

September 22, 2014, 8:21 am: main.php  loaded

But ther is no message from:

$this->freichat_debug('Inserted the user with the following data :: Username = ' . $_SESSION[$this->uid . 'usr_name'] . ' And ID = ' . $_SESSION[$this->uid . 'usr_ses_id'] . ' Default status  = ' . $this->frei_trans['default_status']);
            $_SESSION[$this->uid . 'time'] = time();
            $_SESSION[$this->uid . 'isset_freichatx'] = 0;
Hello again, i have checked Custom.php and added all the quotes needed. The main problem is that no record is created in frei_session table. After have added quotes in the INSERT query in base.php it appears like this: ```` public function createFreiChatXdb() { if (!isset($_SESSION[$this-&amp;gt;uid . &#039;isset_freichatx&#039;]) || $_SESSION[$this-&amp;gt;uid . &#039;time&#039;] &amp;lt; $this-&amp;gt;time_string - 100) { //To check if session is created or not $query = &quot;INSERT INTO frei_session (username,session_id,time,permanent_id,status,status_mesg,guest) VALUES (&quot; . $this-&amp;gt;db-&amp;gt;quote($_SESSION[$this-&amp;gt;uid . &#039;usr_name&#039;]) . &quot;,&quot; . $this-&amp;gt;db-&amp;gt;quote($_SESSION[$this-&amp;gt;uid . &#039;usr_ses_id&#039;]) . &quot;,&quot; . $this-&amp;gt;time_string . &quot;,&quot; . $this-&amp;gt;db-&amp;gt;quote($_SESSION[$this-&amp;gt;uid . &#039;gst_ses_id&#039;]) . &quot;,1,&#039;&quot; . $this-&amp;gt;frei_trans[&#039;default_status&#039;] . &quot;&#039;,&quot; . $_SESSION[$this-&amp;gt;uid . &#039;is_guest&#039;] . &quot;)&quot;; $this-&amp;gt;db-&amp;gt;query($query); $this-&amp;gt;freichat_debug(&#039;Inserted the user with the following data :: Username = &#039; . $_SESSION[$this-&amp;gt;uid . &#039;usr_name&#039;] . &#039; And ID = &#039; . $_SESSION[$this-&amp;gt;uid . &#039;usr_ses_id&#039;] . &#039; Default status = &#039; . $this-&amp;gt;frei_trans[&#039;default_status&#039;]); $_SESSION[$this-&amp;gt;uid . &#039;time&#039;] = time(); $_SESSION[$this-&amp;gt;uid . &#039;isset_freichatx&#039;] = 0; } } ```` Is it right? The debug file appear like this: ```` September 22, 2014, 8:21 am: main.php loaded ```` But ther is no message from: ```` $this-&amp;gt;freichat_debug(&#039;Inserted the user with the following data :: Username = &#039; . $_SESSION[$this-&amp;gt;uid . &#039;usr_name&#039;] . &#039; And ID = &#039; . $_SESSION[$this-&amp;gt;uid . &#039;usr_ses_id&#039;] . &#039; Default status = &#039; . $this-&amp;gt;frei_trans[&#039;default_status&#039;]); $_SESSION[$this-&amp;gt;uid . &#039;time&#039;] = time(); $_SESSION[$this-&amp;gt;uid . &#039;isset_freichatx&#039;] = 0; ````

Is it right?
The debug file appear like this:

September 22, 2014, 8:21 am: main.php loaded
But ther is no message from:

That message is not shown if the session for that user is already created. Try closing the browser and reopen your website.

&amp;gt;&amp;gt;Is it right? The debug file appear like this: &amp;gt;September 22, 2014, 8:21 am: main.php loaded &amp;gt;But ther is no message from: That message is not shown if the session for that user is already created. Try closing the browser and reopen your website.
237
9
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