MyBB Community Forums

Full Version: Php Code to check for avatar
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
What php code can i use to check if a user has no avatar and if they have no avatar choose one automatically ?

Heres an example of checking is a usergroups has permission how could i do something like this for an avatar check ?

if(in_array($mybb->user['usergroup'], array(1,5,7)))
{
    error_no_permission();
} 


But instead of the "error no permission"

place this image: <img src="http://mysitehere.com/images/avatars/image.gif" height="55" width="55">
if($mybb->user['avatar'] == "")
{
        $mybb->user['avatar']  = "<img src=\"http://mysitehere.com/images/avatars/image.gif\" height=\"55\" width=\"55\" />
}

Something like that.
Oh thanks matt Big Grin