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
Hi!
please tell me...
1- how can i detect many user that come into the my plugins page!
means... this user is a member or is just a external user
-------------------
2- many information about hashing algorithm
( excuse me, i dont know english more Big Grin)
thanks
if ($mybb->user['uid'])
{
         // is user
}
else 
       // is guest
Thanks my friend
but...!
Where is this $mybb class? where Defined it?
inc/class_core.php
Smile
thx
can you tell me an example?
i use this but dont work
It would not work untill you define the function.
if ($mybb->user['uid'])
{
         return true; // is user
}
else 
       return false; // is guest

For more explanation.

if ($mybb->user['uid'])
{
        return true;  // is user
}
else if ($mybb->user['uid'] == " ")
       return false; // is guest
(2009-09-09, 05:52 PM)ghazal Wrote: [ -> ]It would not work untill you define the function.
if ($mybb->user['uid'])
{
         return true; // is user
}
else 
       return false; // is guest

For more explanation.

if ($mybb->user['uid'])
{
        return true;  // is user
}
else if ($mybb->user['uid'] == " ")
       return false; // is guest

When it is a guest, the uid is 0 not a space
Quote:When it is a guest, the uid is 0 not a space
I used this bcz its easy to find out and also it WILL return the tru value.

The either methods are correct
(2009-09-09, 06:01 PM)ghazal Wrote: [ -> ]
Quote:When it is a guest, the uid is 0 not a space
I used this bcz its easy to find out and also it WILL return the tru value.

The either methods are correct

But the correct value is 0.
Example copied from class_session.php
		// Still no session, fall back
		if(!$this->sid)
		{
			$this->sid = 0;
			$this->uid = 0;
			$this->logins = 1;
			$this->failedlogin = 0;
		}
(2009-09-09, 06:01 PM)ghazal Wrote: [ -> ]
Quote:When it is a guest, the uid is 0 not a space
I used this bcz its easy to find out and also it WILL return the tru value.

The either methods are correct

You might as well do this then:

if ($mybb->user['uid'])
{
        return true;  // is user
}
else if ($mybb->user['uid'] == "ashd83qfnai389jfj39fj3")
       return false; // is guest 

It will return the same results. uid can never be " "...ever. You don't need the else if...just the else.

The if($mybb->user['uid']) checks if one exists...if it doesn't then the else action can kick in. No need for another if statement.

This is why I am very skeptical of anything you code. You can't even get something this simple right. And tbh...you copied the example and still got it wrong.

Dodgy
Pages: 1 2