MyBB Community Forums

Full Version: fix users table in php? (For MyBB Tables)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am trying to set up my chat and I need to fix the PHP for getting the members from MyBB Tables, can anyone help me?

http://gyazo.com/1aff9409714087298f0e9a15cb8af2e6

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
}
else {
    $ses = null; //tell freichat that the current user is a guest

    setcookie("freichat_user", null, time()+3600, "/"); // *do not change -> freichat code
} 
The page clearly states on the bottom that "you need to edit the above code in such a way that the userid is stored in the $ses variable of the current user and null if the user is a guest. Then, replace $ses=0; in your copy-pasted code with your edited code."

This means that you should check the php to see if there's an SQL query that is grabbing the user data. If there is, you can use those results to grab the user id. If not, you could just run another query and use your own variables.
(2013-08-09, 11:41 AM)stratbasher Wrote: [ -> ]The page clearly states on the bottom that "you need to edit the above code in such a way that the userid is stored in the $ses variable of the current user and null if the user is a guest. Then, replace $ses=0; in your copy-pasted code with your edited code."

This means that you should check the php to see if there's an SQL query that is grabbing the user data. If there is, you can use those results to grab the user id. If not, you could just run another query and use your own variables.

I know that. I read it but I just don't know whether it's correct or not.. I need someone who know php to see if that's the correct settings.