MyBB Community Forums
A long one for you pros! - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: Extensions (https://community.mybb.com/forum-201.html)
+--- Forum: Themes (https://community.mybb.com/forum-103.html)
+---- Forum: Theme Support (https://community.mybb.com/forum-10.html)
+---- Thread: A long one for you pros! (/thread-94777.html)

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20


RE: A long one for you pros! - xomp - 2011-05-21

Oh, I'm trying to get it closer to the avatar image like this:

[Image: 8VwuN.gif]


RE: A long one for you pros! - faviouz - 2011-05-21

Just change 680px to some other value until it's where you want it:

<div id="panel" style="float: left; margin-top: -90px; margin-left: 680px">



RE: A long one for you pros! - xomp - 2011-05-21

OMG Thank You! That worked perfectly! Is there anyway to remove the avatar placeholder from guests? I noticed that when I'm logged out the placeholder is there with a image error.


RE: A long one for you pros! - faviouz - 2011-05-21

Do you want to completely remove the avatar or use some kind of default avatar for guests?


RE: A long one for you pros! - Yaldaram - 2011-05-21

In ./global.php file, add the following code Just Below the global_start hook.

if ($mybb->user['uid'])
{
   $avatar = $mybb->user['avatar'];
}
else
{
   $avatar = "";
}

Now Replace $mybb->user['avatar'] to $avatar in header template.


RE: A long one for you pros! - xomp - 2011-05-21

(2011-05-21, 03:12 PM)Yaldaram Wrote: In ./global.php file, add the following code Just Below the global_start hook.

if ($mybb->user['uid'])
{
   $avatar = $mybb->user['avatar'];
}
else
{
   $avatar = "";
}

Now Replace $mybb->user['avatar'] to $avatar in header template.

Just to make sure, I would change this:
// Run global_start plugin hook now that the basics are set up
$plugins->run_hooks("global_start");

if(function_exists('mb_internal_encoding') && !empty($lang->settings['charset']))
{
	@mb_internal_encoding($lang->settings['charset']);
}

To this?:
// Run global_start plugin hook now that the basics are set up
$plugins->run_hooks("global_start");

if(function_exists('mb_internal_encoding') && !empty($lang->settings['charset']))
{
	@mb_internal_encoding($lang->settings['charset']);
}
if ($mybb->user['uid'])
{
   $avatar = $mybb->user['avatar'];
}
else
{
   $avatar = "";
}



RE: A long one for you pros! - Yaldaram - 2011-05-21

Yes, its fine.
Or more precisely, use this;
if (!empty($mybb->user['avatar']))
{
   $avatar = $mybb->user['avatar'];
}
else
{
   $avatar = "";
}



RE: A long one for you pros! - xomp - 2011-05-21

(2011-05-21, 03:18 PM)Yaldaram Wrote: Yes, its fine.
Or more precisely, use this;
if (!empty($mybb->user['avatar']))
{
   $avatar = $mybb->user['avatar'];
}
else
{
   $avatar = "";
}

Thanks Yaldaram, I updated it but there seems to be a white thing there in place of the avatar heh. Am I supposed to have:
<img src="$avatar" width="100px"
or do I need to remove the "<img src" stuff there?


RE: A long one for you pros! - Yaldaram - 2011-05-21

Replace $avatar to {$avatar}


RE: A long one for you pros! - xomp - 2011-05-21

(2011-05-21, 03:27 PM)Yaldaram Wrote: Replace $avatar to {$avatar}

Done. I think the small white line thing is perhaps the avatar border? Here's what I see when I log out.

[Image: vj74Z.png]