FreiChat related discussions
Install Freichat with OSdate - username only shows after log out?

Hi I have installed Freichat I am using OSdate when I login it shows guest user, when I logout it shows my username.

any suggestions on how I can fix this it seems to be backwards

/* FreiChat STARTS HERE */

$ses=$_SESSION['UserId'];

if(USER_IS_LOGGED_IN)
{
    $ses = LOGGED_IN_USERID; //tell freichat the userid of the current user

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


if($Username_And_Password_Match)
{
   $_SESSION['UserId'] = $users['id']; // Modify to suit your requirements


//$ses = null; // Return null if user is not logged in

if(isset($_SESSION['UserId']))
{
   $ses=$_SESSION['UserId']; //LOOK, now userid will be passed to FreiChat
  }
}


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

       if(is_file("/home/***/thaidating.tk/freichat/hardcode.php")){

               require "/home/***/thaidating.tk/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 ENDS HERE */
Hi I have installed Freichat I am using OSdate when I login it shows guest user, when I logout it shows my username. any suggestions on how I can fix this it seems to be backwards ```` /* FreiChat STARTS HERE */ $ses=$_SESSION[&#039;UserId&#039;]; if(USER_IS_LOGGED_IN) { $ses = LOGGED_IN_USERID; //tell freichat the userid of the current user setcookie(&quot;freichat_user&quot;, &quot;LOGGED_IN&quot;, time()+3600, &quot;/&quot;); // *do not change -&gt; freichat code } if($Username_And_Password_Match) { $_SESSION[&#039;UserId&#039;] = $users[&#039;id&#039;]; // Modify to suit your requirements //$ses = null; // Return null if user is not logged in if(isset($_SESSION[&#039;UserId&#039;])) { $ses=$_SESSION[&#039;UserId&#039;]; //LOOK, now userid will be passed to FreiChat } } if(!function_exists(&quot;freichatx_get_hash&quot;)) { function freichatx_get_hash(){ if(is_file(&quot;/home/***/thaidating.tk/freichat/hardcode.php&quot;)){ require &quot;/home/***/thaidating.tk/freichat/hardcode.php&quot;; $temp_id = $ses . $uid; return md5($temp_id); } else { echo &quot;&lt;script&gt;alert(&#039;module freichatx says: hardcode.php file not found!&#039;)&lt;/script&gt;&quot;; } return 0; } } /* FreiChat ENDS HERE */ ````
if(USER_IS_LOGGED_IN)
{
    $ses = LOGGED_IN_USERID; //tell freichat the userid of the current user

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

You need to edit here, USER_IS_LOGGED_IN should be replaced with something to identify if current user is logged in or not

``` if(USER_IS_LOGGED_IN) { $ses = LOGGED_IN_USERID; //tell freichat the userid of the current user setcookie(&quot;freichat_user&quot;, &quot;LOGGED_IN&quot;, time()+3600, &quot;/&quot;); // *do not change -&gt; freichat code } ``` You need to edit here, USER_IS_LOGGED_IN should be replaced with something to identify if current user is logged in or not
165
1
2
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