MyBB Community Forums

Full Version: Wierd code in avatars?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Fixed!
What page are you getting this error on and what plugins are you using?
(2012-11-05, 02:23 AM)kamz89 Wrote: [ -> ]What page are you getting this error on and what plugins are you using?

Heres list of my plugins:


-Awards
-Fit on Page
-Form Manager
-Hide Tags BBCode
-Clean Favicon
-Mods can't edit admins posts
-mytabs
-newpoints
-page manager
-profile comments
-profile skype id and status indicator
-remember us
-thanks

line 2013:
if($mybb->user['avatartype'] == "upload" || stristr($mybb->user['avatar'], $mybb->settings['avataruploadpath']))

line 2017:
elseif($mybb->user['avatartype'] == "gallery" || stristr($mybb->user['avatar'], $mybb->settings['avatardir']))

So it seems for some reason, your avatar settings are empty. By default they should be:
$settings['avatardir'] = "images/avatars";
$settings['avataruploadpath'] = "./uploads/avatars";

You can find these settings under "User Registration and Profile Options"
(2012-11-05, 09:44 AM)frostschutz Wrote: [ -> ]line 2013:
if($mybb->user['avatartype'] == "upload" || stristr($mybb->user['avatar'], $mybb->settings['avataruploadpath']))

line 2017:
elseif($mybb->user['avatartype'] == "gallery" || stristr($mybb->user['avatar'], $mybb->settings['avatardir']))

So it seems for some reason, your avatar settings are empty. By default they should be:
$settings['avatardir'] = "images/avatars";
$settings['avataruploadpath'] = "./uploads/avatars";

You can find these settings under "User Registration and Profile Options"

So what is wrong in " user registration and profile options "?

Here's part of that code. When I edited that code what you gave me it wouldn't open that page at all saying there is problem on line 2021. This code starts on 2004 and ends on 2031.


		if($mybb->user['avatartype'] == "upload" || stristr($mybb->user['avatar'], $mybb->settings['avataruploadpath']))
		{
			$avatarmsg = "<br /><strong>".$lang->already_uploaded_avatar."</strong>";
		}
		elseif($mybb->user['avatartype'] == "gallery" || stristr($mybb->user['avatar'], $mybb->settings['avatardir']))
		{
			$avatarmsg = "<br /><strong>".$lang->using_gallery_avatar."</strong>";
		}
		elseif($mybb->user['avatartype'] == "remote" || my_strpos(my_strtolower($mybb->user['avatar']), "http://") !== false)
		{
			$avatarmsg = "<br /><strong>".$lang->using_remote_avatar."</strong>";
			$avatarurl = htmlspecialchars_uni($mybb->user['avatar']);
		}
		$urltoavatar = htmlspecialchars_uni($mybb->user['avatar']);
		if($mybb->user['avatar'])
		{
			$avatar_dimensions = explode("|", $mybb->user['avatardimensions']);
			if($avatar_dimensions[0] && $avatar_dimensions[1])
			{
				$avatar_width_height = "width=\"{$avatar_dimensions[0]}\" height=\"{$avatar_dimensions[1]}\"";
			}
			eval("\$currentavatar = \"".$templates->get("usercp_avatar_current")."\";");
			$colspan = 1;
		}
		else
		{
			$colspan = 2;
		}


Problem fixed!