FreiChat related discussions
Problem with custom configuration

Hello @all
I've added freichat to my backend. All is ok. But I can't see the names of the user. I only see the name guest-....
I have tried to configure that. But it won't run.

$ses = $_SESSION[SESS_NAME]['user_id'];

function freichatx_get_hash($ses){
global $APR;

if(is_file("$APR/freichat/hardcode.php")) {
require "$APR/freichat/hardcode.php";

$temp_id = $ses . $uid;

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

return 0;
}

$freichat_hash = freichatx_get_hash($ses);
$freichat_ses = $ses;

.....

<script type="text/javascript" language="javascipt" src="%7B%24APH%7D/freichat/client/main.php?id=%7B%24freichat_ses%7D&xhash=%7B%24freichat_hash%7D"></script>

hardcode.php:
$dsn='mysql:host=localhost;dbname=nk'; //DSN
$db_user='nk'; //DB username
$db_pass='...'; //DB password
$driver='Custom'; //Integration driver
$db_prefix='frei_'; //prefix used for tables in database
$uid='51d6b0722476a'; //Any random unique number

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

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

$use_cookie=true;

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

$force_load_jquery = 'YES';

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


in the table cms_session are all users stored who are logged in. After login I can see the chatwindow but everybody has the name 'guest-...'
$ses is initiated with a integrer and is the correct user_id. Also the values of $usertable, $row_username, $row_userid are correct
can anyone help??
thanks a lot!

Hello @all I&#039;ve added freichat to my backend. All is ok. But I can&#039;t see the names of the user. I only see the name guest-.... I have tried to configure that. But it won&#039;t run. &amp;lt;code&amp;gt; $ses = $_SESSION[SESS_NAME][&#039;user_id&#039;]; function freichatx_get_hash($ses){ global $APR; if(is_file(&quot;$APR/freichat/hardcode.php&quot;)) { require &quot;$APR/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; } $freichat_hash = freichatx_get_hash($ses); $freichat_ses = $ses; ..... &amp;lt;script type=&quot;text/javascript&quot; language=&quot;javascipt&quot; src=&quot;{$APH}/freichat/client/main.php?id={$freichat_ses}&amp;xhash={$freichat_hash}&quot;&amp;gt;&amp;lt;/script&amp;gt; hardcode.php: $dsn=&#039;mysql:host=localhost;dbname=nk&#039;; //DSN $db_user=&#039;nk&#039;; //DB username $db_pass=&#039;...&#039;; //DB password $driver=&#039;Custom&#039;; //Integration driver $db_prefix=&#039;frei_&#039;; //prefix used for tables in database $uid=&#039;51d6b0722476a&#039;; //Any random unique number $PATH = &#039;freichat/&#039;; // Use this only if you have placed the freichat folder somewhere else $installed=false; //make it false if you want to reinstall freichat $admin_pswd=&#039;testing&#039;; //backend password $debug = false; $custom_error_handling=&#039;NO&#039;; // used during custom installation $use_cookie=true; /* email plugin */ $smtp_username = &#039;&#039;; $smtp_password = &#039;&#039;; $force_load_jquery = &#039;YES&#039;; /* Custom driver */ $usertable=&#039;cms_session&#039;; //specifies the name of the table in which your user information is stored. $row_username=&#039;name&#039;; //specifies the name of the field in which the user&#039;s name/display name is stored. $row_userid=&#039;user_id&#039;; //specifies the name of the field in which the user&#039;s id is stored (usually id or userid) $avatar_field_name = &#039;avatar&#039;; &amp;lt;/code&amp;gt; in the table cms_session are all users stored who are logged in. After login I can see the chatwindow but everybody has the name &#039;guest-...&#039; $ses is initiated with a integrer and is the correct user_id. Also the values of $usertable, $row_username, $row_userid are correct can anyone help?? thanks a lot!

Can you check your website source code , and check if the id is correct here : main.php?id={$freichat_ses}

Can you check your website source code , and check if the id is correct here : main.php?id={$freichat_ses}
Necessity is the mother of all inventions!

Thank you for your answer. The ID is correct for every user

Thank you for your answer. The ID is correct for every user

the is the output of my user with id=28

<script type="text/javascript" language="javascipt" src="..../nk/freichat/client/main.php?id=28&xhash=e06409f245b1ffa05375c0d70e605701"></script>

btw I am using v9.4

the is the output of my user with id=28 &amp;lt;code&amp;gt;&amp;lt;script type=&quot;text/javascript&quot; language=&quot;javascipt&quot; src=&quot;..../nk/freichat/client/main.php?id=28&amp;xhash=e06409f245b1ffa05375c0d70e605701&quot;&amp;gt;&amp;lt;/script&amp;gt;&amp;lt;/code&amp;gt; btw I am using v9.4

Everything looks correct , can you enable php debugging from freichat backend-> additional .Then check freixlog.log in freichat folder for any errors .

Everything looks correct , can you enable php debugging from freichat backend-&amp;gt; additional .Then check freixlog.log in freichat folder for any errors .
Necessity is the mother of all inventions!
143
4
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