Help
Ask questions about how to do or fix things in Arrowchat
User avatar
SKhoshbuie
Customer
 
Posts: 2
Joined: 27 Apr 2014, 13:04

 

by SKhoshbuie 01 May 2014, 16:10

Hi and thanks for this wounderfull programm.
I use arrowchat on a PHPFOX website and can not see the users as logged in users!
waht schoud i change in integration.php file and how may i fix this error? maybe a problem with the function get_user_id() ... ?
thank you
User avatar
JSICKMEYER
Customer
 
Posts: 2
Joined: 11 Nov 2013, 11:59

 

by JSICKMEYER 23 May 2014, 10:27

I had to modify the function to get the $userid set based on session or cookie.

Code: Select all
function get_user_id() 
   {
      $userid = NULL;
      
      if (!empty($_SESSION['memberId']))
      {
         $userid = $_SESSION['memberId'];
                }
      
      if (!empty($_COOKIE['memberId']))
      {
         $userid = preg_replace('#[^0-9]#','',$_COOKIE['memberId']);
      }
      
      return $userid;
   }


If that is not the problem, perhaps the table is not set correctly to pull the userid?

Another thing I did was in the init.php file, I included my sites typical functions used for logging in and setting sessions/cookies. I then started the custom sec_session_start() function I built before setting the $userid:

Code: Select all
include 'path-to/your-functions-file.php';
sec_session_start();
$userid    = get_user_id();


The session would not be set otherwise and therefore the userid would be null.

I hope that makes sense. I'm still learning this system. :)

Cheers!
User avatar
Staff Bot
ArrowChat Team
 
Posts: 8996
Joined: 07 Nov 2012, 13:41

 

by Staff Bot 16 Dec 2014, 00:26

[b]This thread has been locked because the last post is greater than six months old. There is a good chance that the information in this thread is outdated. Please open a new topic if you wish to discuss this further.[/b]