FreiChat related discussions
WebsiteBaker Portal Script

Hi Admin. I use WebsiteBaker Portal Script and I do not know how to do user login integration. If you have time to help me Thank you.

Hi Admin. I use WebsiteBaker Portal Script and I do not know how to do user login integration. If you have time to help me Thank you.

You can try using the Custom installation in freichat .

Let us know if you get into some problem during the installation .

You can try using the Custom installation in freichat . Let us know if you get into some problem during the installation .
Necessity is the mother of all inventions!

yes, I tried to install Custom installation in freichat but appeared several problems

if put this code I have no problem, all work well.

                    <!--===========================FreiChat=======START=========================-->
<!--    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                         -->

<?php
$ses=null;

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

       if(is_file("/opt/lampp/htdocs/freichat/hardcode.php")){

               require "/opt/lampp/htdocs/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/freichat/client/main.php?id=<?php echo $ses;?>&xhash=<?php echo freichatx_get_hash($ses); ?>"></script>
    <link rel="stylesheet" href="http://localhost/freichat/client/jquery/freichat_themes/freichatcss.php" type="text/css">
<!--===========================FreiChatX=======END=========================-->

but if I put the code below my site have problems
Parse error: syntax error, unexpected T_STRING in /home/localhost/index.php on line 48

line 48 is this: setcookie('freichat_user", 'LOGGED_IN", time()+3600, '/"); // *do not change -> freichat code

<?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 -> 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
}  

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

       if(is_file("/opt/lampp/htdocs/freichat/hardcode.php")){

               require "/opt/lampp/htdocs/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/freichat/client/main.php?id=<?php echo $ses;?>&xhash=<?php echo freichatx_get_hash($ses); ?>"></script>
    <link rel="stylesheet" href="http://localhost/freichat/client/jquery/freichat_themes/freichatcss.php" type="text/css">
<!--===========================FreiChatX=======END=========================-->
yes, I tried to install Custom installation in freichat but appeared several problems if put this code I have no problem, all work well. ```` &amp;lt;!--===========================FreiChat=======START=========================--&amp;gt; &amp;lt;!-- For uninstalling ME , first remove/comment all FreiChat related code i.e below code Then remove FreiChat tables frei_session &amp; frei_chat if necessary The best/recommended way is using the module for installation --&amp;gt; &amp;lt;?php $ses=null; if(!function_exists(&quot;freichatx_get_hash&quot;)){ function freichatx_get_hash($ses){ if(is_file(&quot;/opt/lampp/htdocs/freichat/hardcode.php&quot;)){ require &quot;/opt/lampp/htdocs/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; } } ?&amp;gt; &amp;lt;script type=&quot;text/javascript&quot; language=&quot;javascipt&quot; src=&quot;http://localhost/freichat/client/main.php?id=&amp;lt;?php echo $ses;?&amp;gt;&amp;xhash=&amp;lt;?php echo freichatx_get_hash($ses); ?&amp;gt;&quot;&amp;gt;&amp;lt;/script&amp;gt; &amp;lt;link rel=&quot;stylesheet&quot; href=&quot;http://localhost/freichat/client/jquery/freichat_themes/freichatcss.php&quot; type=&quot;text/css&quot;&amp;gt; &amp;lt;!--===========================FreiChatX=======END=========================--&amp;gt; ```` but if I put the code below my site have problems **Parse error: syntax error, unexpected T_STRING in /home/localhost/index.php on line 48** line 48 is this: ** setcookie(&#039;freichat_user&quot;, &#039;LOGGED_IN&quot;, time()+3600, &#039;/&quot;); // *do not change -&amp;gt; freichat code** ```` &amp;lt;?php if(isset($_SESSION[&#039;user_id&#039;])) { $ses = $_SESSION[&#039;user_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 } if(!function_exists(&quot;freichatx_get_hash&quot;)){ function freichatx_get_hash($ses){ if(is_file(&quot;/opt/lampp/htdocs/freichat/hardcode.php&quot;)){ require &quot;/opt/lampp/htdocs/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; } } ?&amp;gt; &amp;lt;script type=&quot;text/javascript&quot; language=&quot;javascipt&quot; src=&quot;http://localhost/freichat/client/main.php?id=&amp;lt;?php echo $ses;?&amp;gt;&amp;xhash=&amp;lt;?php echo freichatx_get_hash($ses); ?&amp;gt;&quot;&amp;gt;&amp;lt;/script&amp;gt; &amp;lt;link rel=&quot;stylesheet&quot; href=&quot;http://localhost/freichat/client/jquery/freichat_themes/freichatcss.php&quot; type=&quot;text/css&quot;&amp;gt; &amp;lt;!--===========================FreiChatX=======END=========================--&amp;gt; ````

you don't have a semicolon in the line

   $ses = $_SESSION['user_id']

try fixing that error by adding a semicolon .

you don&#039;t have a semicolon in the line ``` $ses = $_SESSION[&#039;user_id&#039;] ``` try fixing that error by adding a semicolon .
Necessity is the mother of all inventions!
208
3
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