FreiChat related discussions
Login Integration doesn't works !

Hi !, Good afternoon , i have to say that is a great script !, thanks !

There is only one little problem
I can't login with my users, i have followed all the integrations steps ( except for avatars ) and i've implemented the code, and everything works fine, only the users are not detected bye the chat, the option Access Control > moderation it shows the users, it identify correctly the username and the password, but in the chat the name Guest-xxx remains, what could it be ?

Hi !, Good afternoon , i have to say that is a great script !, thanks ! There is only one little problem I can't login with my users, i have followed all the integrations steps ( except for avatars ) and i've implemented the code, and everything works fine, only the users are not detected bye the chat, the option Access Control > moderation it shows the users, it identify correctly the username and the password, but in the chat the name Guest-xxx remains, what could it be ?
Tanto si piensas que puedes, como si piensas que no puedes, de todas formas estás en lo correcto

excuse me the usernames and the ids *

excuse me the usernames and the ids *
Tanto si piensas que puedes, como si piensas que no puedes, de todas formas estás en lo correcto

I guess you are not passing the correct userid of the current user ( in the copy-pasted code) .

I guess you are not passing the correct userid of the current user ( in the copy-pasted code) .
Necessity is the mother of all inventions!

:O , ok this is my code:

if($fbuser!=0)
{
$array=mysql_fetch_array(mysql_query('SELECT * FROM usuarios WHERE fbid='.$fbuser));
$ses = $array['id']; //tell freichat the userid of the current user

setcookie("freichat_user", "LOGGED_IN", time()+3600, "/"); // *do not change -> freichat code
}
else {
$ses = null; //tell freichat that the current user is a guest

setcookie("freichat_user", null, time()+3600, "/"); // *do not change -> freichat code
}


the fbuser is the variable of the fbuser login the getUser() function from facebook sdk, i have implemented the full facebook login procces to my site and it works great, i don't know why exactly, y only know that the log says:


August 14, 2013, 10:21 pm: Wrong method defined!

August 14, 2013, 10:21 pm: Wrong method defined!

August 14, 2013, 10:21 pm: Wrong method defined!

August 14, 2013, 10:21 pm: Wrong method defined!

is a custom website

:O , ok this is my code: <code> if($fbuser!=0) { $array=mysql_fetch_array(mysql_query('SELECT * FROM usuarios WHERE fbid='.$fbuser)); $ses = $array['id']; //tell freichat the userid of the current user setcookie("freichat_user", "LOGGED_IN", time()+3600, "/"); // *do not change -> freichat code } else { $ses = null; //tell freichat that the current user is a guest setcookie("freichat_user", null, time()+3600, "/"); // *do not change -> freichat code } </code> the fbuser is the variable of the fbuser login the getUser() function from facebook sdk, i have implemented the full facebook login procces to my site and it works great, i don't know why exactly, y only know that the log says: August 14, 2013, 10:21 pm: Wrong method defined! August 14, 2013, 10:21 pm: Wrong method defined! August 14, 2013, 10:21 pm: Wrong method defined! August 14, 2013, 10:21 pm: Wrong method defined! is a custom website
Tanto si piensas que puedes, como si piensas que no puedes, de todas formas estás en lo correcto

the hardcode.php code Custom driver parte
is:

<?php /* Custom driver */
$usertable='usuarios'; //specifies the name of the table in which your user information is stored.
$row_username='usuario'; //specifies the name of the field in which the user's name/display name is stored.
$row_userid='fbid'; //specifies the name of the field in which the user's id is stored (usually id or userid)
?>

wich is ok, the only thing that i don't understand is the part of the log file that keeps saying:

August 15, 2013, 9:27 pm: Wrong method defined!

August 15, 2013, 9:27 pm: Wrong method defined!

when custom is definded in the hardcode :

<?php /* Data base details */
$dsn='mysql:host=chstark.ipagemysql.com;dbname=bachuta'; //DSN
$db_user='oziriz89'; //DB username
$db_pass='**********'; //DB password
$driver='Custom'; //Integration driver
$db_prefix=''; //prefix used for tables in database
$uid='520afca0c8cb0'; //Any random unique number

$connected='YES'; //only for custom installation

$PATH = 'frei/'; // Use this only if you have placed the freichat folder somewhere else
$installed=true; //make it false if you want to reinstall freichat
$admin_pswd='*******'; //backend password

$debug = false;
$custom_error_handling='NO'; // used during custom installation

$use_cookie='false';

/* email plugin */
$smtp_username = '';
$smtp_password = '';

$force_load_jquery = 'NO';

/* Custom driver */
$usertable='usuarios'; //specifies the name of the table in which your user information is stored.
$row_username='usuario'; //specifies the name of the field in which the user's name/display name is stored.
$row_userid='fbid'; //specifies the name of the field in which the user's id is stored (usually id or userid)


$avatar_table_name='usuarios'; //specifies the table where avatar information is stored
$avatar_column_name='avatar'; //specifies the column name where the avatar url is stored
$avatar_userid='fbid'; //specifies the userid to the user to get the user's avatar
$avatar_reference_user=''; //specifies the reference to the user to get the user's avatar in user table
$avatar_reference_avatar=''; //specifies the reference to the user to get the user's avatar in avatar
$avatar_field_name=$avatar_column_name; //to avoid unnecessary file changes , *do not change
?>

the hardcode.php code Custom driver parte is: &amp;lt;?php /* Custom driver */ $usertable=&#039;usuarios&#039;; //specifies the name of the table in which your user information is stored. $row_username=&#039;usuario&#039;; //specifies the name of the field in which the user&#039;s name/display name is stored. $row_userid=&#039;fbid&#039;; //specifies the name of the field in which the user&#039;s id is stored (usually id or userid) ?&amp;gt; wich is ok, the only thing that i don&#039;t understand is the part of the log file that keeps saying: August 15, 2013, 9:27 pm: Wrong method defined! August 15, 2013, 9:27 pm: Wrong method defined! when custom is definded in the hardcode : &amp;lt;?php /* Data base details */ $dsn=&#039;mysql:host=chstark.ipagemysql.com;dbname=bachuta&#039;; //DSN $db_user=&#039;oziriz89&#039;; //DB username $db_pass=&#039;**********&#039;; //DB password $driver=&#039;Custom&#039;; //Integration driver $db_prefix=&#039;&#039;; //prefix used for tables in database $uid=&#039;520afca0c8cb0&#039;; //Any random unique number $connected=&#039;YES&#039;; //only for custom installation $PATH = &#039;frei/&#039;; // Use this only if you have placed the freichat folder somewhere else $installed=true; //make it false if you want to reinstall freichat $admin_pswd=&#039;*******&#039;; //backend password $debug = false; $custom_error_handling=&#039;NO&#039;; // used during custom installation $use_cookie=&#039;false&#039;; /* email plugin */ $smtp_username = &#039;&#039;; $smtp_password = &#039;&#039;; $force_load_jquery = &#039;NO&#039;; /* Custom driver */ $usertable=&#039;usuarios&#039;; //specifies the name of the table in which your user information is stored. $row_username=&#039;usuario&#039;; //specifies the name of the field in which the user&#039;s name/display name is stored. $row_userid=&#039;fbid&#039;; //specifies the name of the field in which the user&#039;s id is stored (usually id or userid) $avatar_table_name=&#039;usuarios&#039;; //specifies the table where avatar information is stored $avatar_column_name=&#039;avatar&#039;; //specifies the column name where the avatar url is stored $avatar_userid=&#039;fbid&#039;; //specifies the userid to the user to get the user&#039;s avatar $avatar_reference_user=&#039;&#039;; //specifies the reference to the user to get the user&#039;s avatar in user table $avatar_reference_avatar=&#039;&#039;; //specifies the reference to the user to get the user&#039;s avatar in avatar $avatar_field_name=$avatar_column_name; //to avoid unnecessary file changes , *do not change ?&amp;gt;
Tanto si piensas que puedes, como si piensas que no puedes, de todas formas estás en lo correcto
$array=mysql_fetch_array(mysql_query('SELECT * FROM usuarios WHERE fbid='.$fbuser)); 
$ses = $array['id']; //tell freichat the userid of the current user


According to above code, you are passing the userid of the user stored in the `id` column .

But here:
$row_userid='fbid'; //specifies the name of the field in which the user's id is stored (usually id or userid)


You are telling freichat that the userid is stored in `fbid` column , which is wrong .
So either pass $fbuser directly without the query , or replace
$row_userid='fbid';


with

$row_userid='id';


Now, the above most probably wont solve your problem .
Go to your website , and check its source (ctrl+U) . Now search for the word 'client/main.php' . Then check if your id is passed correctly there
client/main.php?id=YOUR_ID
&amp;lt;code&amp;gt; $array=mysql_fetch_array(mysql_query(&#039;SELECT * FROM usuarios WHERE fbid=&#039;.$fbuser)); $ses = $array[&#039;id&#039;]; //tell freichat the userid of the current user &amp;lt;/code&amp;gt; According to above code, you are passing the userid of the user stored in the `id` column . But here: &amp;lt;code&amp;gt; $row_userid=&#039;fbid&#039;; //specifies the name of the field in which the user&#039;s id is stored (usually id or userid) &amp;lt;/code&amp;gt; You are telling freichat that the userid is stored in `fbid` column , which is wrong . So either pass $fbuser directly without the query , or replace &amp;lt;code&amp;gt; $row_userid=&#039;fbid&#039;; &amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt; $row_userid=&#039;id&#039;; &amp;lt;/code&amp;gt; Now, the above most probably wont solve your problem . Go to your website , and check its source (ctrl+U) . Now search for the word &#039;client/main.php&#039; . Then check if your id is passed correctly there client/main.php?id=YOUR_ID
Necessity is the mother of all inventions!

you are right i pass you a bad example, but as you say that didnt correct my problem, because i was trying to change all those details about the configuration

the line that you told me is not parsing the id :/

<script type="text/javascript" language="javascipt" src="http://mercaditolibre.tk/frei/client/main.php?id=&xhash=55769975fd0d7c6993cdcd800b284598"></script><link rel="stylesheet" href="http://mercaditolibre.tk/frei/client/jquery/freichat_themes/freichatcss.php" type="text/css">


thats the problem i guess, do you know how to sole it ?

you are right i pass you a bad example, but as you say that didnt correct my problem, because i was trying to change all those details about the configuration the line that you told me is not parsing the id :/ &amp;lt;code&amp;gt; &amp;lt;script type=&quot;text/javascript&quot; language=&quot;javascipt&quot; src=&quot;http://mercaditolibre.tk/frei/client/main.php?id=&amp;xhash=55769975fd0d7c6993cdcd800b284598&quot;&amp;gt;&amp;lt;/script&amp;gt; &amp;lt;link rel=&quot;stylesheet&quot; href=&quot;http://mercaditolibre.tk/frei/client/jquery/freichat_themes/freichatcss.php&quot; type=&quot;text/css&quot;&amp;gt; &amp;lt;/code&amp;gt; thats the problem i guess, do you know how to sole it ?
Tanto si piensas que puedes, como si piensas que no puedes, de todas formas estás en lo correcto

That means '$ses' variable is null in below code

if($fbuser!=0)
{
$array=mysql_fetch_array(mysql_query('SELECT * FROM usuarios WHERE fbid='.$fbuser));
$ses = $array['id']; //tell freichat the userid of the current user

setcookie("freichat_user", "LOGGED_IN", time()+3600, "/"); // *do not change -> freichat code
}
else {
$ses = null; //tell freichat that the current user is a guest

setcookie("freichat_user", null, time()+3600, "/"); // *do not change -> freichat code
}


Confirm whether the variable '$fbuser' for a loggedin user is not 0 .

That means &#039;$ses&#039; variable is null in below code &amp;lt;code&amp;gt; if($fbuser!=0) { $array=mysql_fetch_array(mysql_query(&#039;SELECT * FROM usuarios WHERE fbid=&#039;.$fbuser)); $ses = $array[&#039;id&#039;]; //tell freichat the userid of the current user setcookie(&quot;freichat_user&quot;, &quot;LOGGED_IN&quot;, time()+3600, &quot;/&quot;); // *do not change -&amp;gt; freichat code } else { $ses = null; //tell freichat that the current user is a guest setcookie(&quot;freichat_user&quot;, null, time()+3600, &quot;/&quot;); // *do not change -&amp;gt; freichat code } &amp;lt;/code&amp;gt; Confirm whether the variable &#039;$fbuser&#039; for a loggedin user is not 0 .
Necessity is the mother of all inventions!

trust me that variable is not 0, the entire login proces of my website depends on that variable, i test this code with echos and all its fine, i deliver the id in the $ses variable, and i configure the code to receive this value as the id and still doesnt work :/

trust me that variable is not 0, the entire login proces of my website depends on that variable, i test this code with echos and all its fine, i deliver the id in the $ses variable, and i configure the code to receive this value as the id and still doesnt work :/
Tanto si piensas que puedes, como si piensas que no puedes, de todas formas estás en lo correcto

This is weird . Try adding echo $ses; just before and after, including the freichat script file .

If you can provide us with your FTP details , we will install it for you .

This is weird . Try adding echo $ses; just before and after, including the freichat script file . If you can provide us with your FTP details , we will install it for you .
Necessity is the mother of all inventions!

sorry for the late response, i print he $ses variable and it getting the value, but the username still don't appear :/, you need ftp access to the frei folder only or full acces to home directory ?, i want to fix it by myself :), but i need yur instructions, how can i send you the ftp details in a safe way ?

sorry for the late response, i print he $ses variable and it getting the value, but the username still don&#039;t appear :/, you need ftp access to the frei folder only or full acces to home directory ?, i want to fix it by myself :), but i need yur instructions, how can i send you the ftp details in a safe way ?
Tanto si piensas que puedes, como si piensas que no puedes, de todas formas estás en lo correcto

As you said the $ses variable is getting the value , we wont need access to your home directory , access to freichat directory should be sufficient .

You can send us the details using the Contact us form or directly email us to admin[@]codologic.com
Please mention reference to this post .

As you said the $ses variable is getting the value , we wont need access to your home directory , access to freichat directory should be sufficient . You can send us the details using the Contact us form or directly email us to admin[@]codologic.com Please mention reference to this post .
Necessity is the mother of all inventions!

i already sent the ftp details ! , thanks id advance, i hope that you can fix it, and that you can say to me , what the problem was

i already sent the ftp details ! , thanks id advance, i hope that you can fix it, and that you can say to me , what the problem was
Tanto si piensas que puedes, como si piensas que no puedes, de todas formas estás en lo correcto
198
12
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