Hi,
If you remember , during the installation i.e before you reached this step , you had to copy/paste some lines of code something like :
<?php
$ses=null;
if(!function_exists("freichatx_get_hash")){
function freichatx_get_hash($ses){
if(is_file("/opt/lampp/htdocs/j3/freichat/hardcode.php")){
require "/opt/lampp/htdocs/j3/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;
}
}
?>
<script type="text/javascript" language="javascipt" src="http://localhost/j3/freichat/client/main.php?id=<?php echo $ses;?>&xhash=<?php echo freichatx_get_hash($ses); ?>"></script>
<link rel="stylesheet" href="http://localhost/j3/freichat/client/jquery/freichat_themes/freichatcss.php" type="text/css">
I assume you have copy/pasted the above code in the header file .
Now, the code in our current step i.e
if(isset($_SESSION['user_id']))
{
$ses = $_SESSION['user_id']
setcookie("freichat_user", "LOGGED_IN", time()+3600, "/");
}
else {
$ses = null;
setcookie("freichat_user", null, time()+3600, "/");
}
will be merged before that but after the <?php tag
So the final result will look like
<?php
if(isset($_SESSION['user_id']))
{
$ses = $_SESSION['user_id']
setcookie("freichat_user", "LOGGED_IN", time()+3600, "/");
}
else {
$ses = null;
setcookie("freichat_user", null, time()+3600, "/");
}
if(!function_exists("freichatx_get_hash")){
function freichatx_get_hash($ses){
if(is_file("/opt/lampp/htdocs/j3/freichat/hardcode.php")){
require "/opt/lampp/htdocs/j3/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;
}
}
?>
<script type="text/javascript" language="javascipt" src="http://localhost/j3/freichat/client/main.php?id=<?php echo $ses;?>&xhash=<?php echo freichatx_get_hash($ses); ?>"></script>
<link rel="stylesheet" href="http://localhost/j3/freichat/client/jquery/freichat_themes/freichatcss.php" type="text/css">
<!--===========================FreiChatX=======END=========================-->
Don't just copy paste above code , i have given so that you understand the format and the order of the code .
And also I see in my login.php file it shows "userid" instead of 'user_id'
That makes a difference . It should be according to your login.php
What i gave was just code for your reference . So if it is userid , then change the code to reflect that .
So
$_SESSION['user_id']
will become
$_SESSION['userid']
Hi,
If you remember , during the installation i.e before you reached this step , you had to copy/paste some lines of code something like :
````
&lt;!--===========================FreiChat=======START=========================--&gt;
&lt;!-- For uninstalling ME , first remove/comment all FreiChat related code i.e below code
Then remove FreiChat tables frei_session & frei_chat if necessary
The best/recommended way is using the module for installation --&gt;
&lt;?php
$ses=null;
if(!function_exists("freichatx_get_hash")){
function freichatx_get_hash($ses){
if(is_file("/opt/lampp/htdocs/j3/freichat/hardcode.php")){
require "/opt/lampp/htdocs/j3/freichat/hardcode.php";
$temp_id = $ses . $uid;
return md5($temp_id);
}
else
{
echo "&lt;script&gt;alert('module freichatx says: hardcode.php file not
found!');&lt;/script&gt;";
}
return 0;
}
}
?&gt;
&lt;script type="text/javascript" language="javascipt" src="http://localhost/j3/freichat/client/main.php?id=&lt;?php echo $ses;?&gt;&xhash=&lt;?php echo freichatx_get_hash($ses); ?&gt;"&gt;&lt;/script&gt;
&lt;link rel="stylesheet" href="http://localhost/j3/freichat/client/jquery/freichat_themes/freichatcss.php" type="text/css"&gt;
&lt;!--===========================FreiChatX=======END=========================--&gt;
````
I assume you have copy/pasted the above code in the header file .
Now, the code in our current step i.e
````
if(isset($_SESSION['user_id']))
{
$ses = $_SESSION['user_id'] //tell freichat the userid of the current user
setcookie("freichat_user", "LOGGED_IN", time()+3600, "/"); // *do not change -&gt; freichat code
}
else {
$ses = null; //tell freichat that the current user is a guest
setcookie("freichat_user", null, time()+3600, "/"); // *do not change -&gt; freichat code
}
````
will be merged before that but after the &lt;?php tag
So the final result will look like
````
&lt;?php
if(isset($_SESSION['user_id']))
{
$ses = $_SESSION['user_id'] //tell freichat the userid of the current user
setcookie("freichat_user", "LOGGED_IN", time()+3600, "/"); // *do not change -&gt; freichat code
}
else {
$ses = null; //tell freichat that the current user is a guest
setcookie("freichat_user", null, time()+3600, "/"); // *do not change -&gt; freichat code
}
if(!function_exists("freichatx_get_hash")){
function freichatx_get_hash($ses){
if(is_file("/opt/lampp/htdocs/j3/freichat/hardcode.php")){
require "/opt/lampp/htdocs/j3/freichat/hardcode.php";
$temp_id = $ses . $uid;
return md5($temp_id);
}
else
{
echo "&lt;script&gt;alert('module freichatx says: hardcode.php file not
found!');&lt;/script&gt;";
}
return 0;
}
}
?&gt;
&lt;script type="text/javascript" language="javascipt" src="http://localhost/j3/freichat/client/main.php?id=&lt;?php echo $ses;?&gt;&xhash=&lt;?php echo freichatx_get_hash($ses); ?&gt;"&gt;&lt;/script&gt;
&lt;link rel="stylesheet" href="http://localhost/j3/freichat/client/jquery/freichat_themes/freichatcss.php" type="text/css"&gt;
&lt;!--===========================FreiChatX=======END=========================--&gt;
````
Don't just copy paste above code , i have given so that you understand the format and the order of the code .
&gt;And also I see in my login.php file it shows "userid" instead of 'user_id'
That makes a difference . It should be according to your login.php
What i gave was just code for your reference . So if it is userid , then change the code to reflect that .
So
````
$_SESSION['user_id']
````
will become
````
$_SESSION['userid']
````