MyBB Community Forums

Full Version: Detect members
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
and to avoid parse errors, you (ghazal) should use elseif not else if, unless you know what you're doing
I've seen that else if cause havoc in some places...


(2009-09-08, 02:39 PM)AMEAR Wrote: [ -> ]Where is this $mybb class? where Defined it?

The best method (or easiest) is to do:

define("IN_MYBB", 1);
require_once './global.php';

if($mybb->user['uid'])
{
     // Is a User.
}

Then you're good to go. You can use $mybb, $db, $lang etc. anywhere. For less specifics, you can just include ./inc/init.php.
dear Tomm M!
$mybb->user['uid'] how can specify uid? how set uid?
$mybb->user['uid'] contains the uid of the current user. 'uid' is a field in the users table. You don't set it because that's done when someone registers.
...or logs in...

Shy
No, but I mean the 'uid' field is filled with an id when someone registers.
The uid is always the same.
You misunderstood me Toungue
...meh - I meant it's set from 0 to 8582 when you log in here... Toungue
(2009-09-11, 07:37 AM)Tomm M Wrote: [ -> ]I've seen that else if cause havoc in some places...


(2009-09-08, 02:39 PM)AMEAR Wrote: [ -> ]Where is this $mybb class? where Defined it?

The best method (or easiest) is to do:

define("IN_MYBB", 1);
require_once './global.php';

if($mybb->user['uid'])
{
     // Is a User.
}

Then you're good to go. You can use $mybb, $db, $lang etc. anywhere. For less specifics, you can just include ./inc/init.php.
Its ok thx
but... how can set it, when user loging in?
excuse me i dont know more things about mybb system
As I said, the 'uid' field is created on sign up, it never changes. You don't set it, it is a unique identification number
Pages: 1 2