MyBB Community Forums

Full Version: Default avatar not showing
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
[Image: d0e7d380f8c9047cf12c06b60cd8f252.png]

Sorry for many problems. But i try to find solutions first before posting!

This is my headerwelcome block member
<span class="d-flex align-items-center mobile-nav">
{$myalerts_headericon}{$pmslink}
	<li class="item dropdown-activate">
		<a title="{$mybb->user['username']}">
			<div class="d-flex align-items-center bold">
				<img src="{$mybb->user['avatar']}" width="25" height="25">&nbsp;
				{$mybb->user['username']}&nbsp;&nbsp;
				<i class="fa fa-angle-down" aria-hidden="true"></i>
			</div>
		</a>
	</li> 
</span>
<div class="dropdown">
	<div class="dropdown-content user-dropdown-content" style="display: none;">
		<div class="arrow-up"></div>
		<div class="dropdown-menu">
			<a href="member.php?action=profile" class="fullwidth">
				<div class="trow1 grey">
					<link class="rippleJS">
					<i class="fa fa-user"></i>
					Profile 
				</div>
			</a>
			{$usercplink}
			{$modcplink}
			{$admincplink}
			<a href="member.php?action=logout&amp;logoutkey={$mybb->user['logoutkey']}" class="logout fullwidth">
				<div class="trow1 grey">
					<link class="rippleJS">
					<i class="fa fa-lock"></i>
					{$lang->welcome_logout} 
				</div>
			</a>
		</div>
	</div>
</div>
<script>
$(document).ready(function() {
	$(".dropdown-activate").click(function(){
		var more = $(document).find('.user-dropdown-content');
		more.slideToggle();
		if($(this).hasClass('active')) {
			$(this).removeClass('active');
		} else {
			$(this).addClass('active');
		}
	})
});
</script>

How to fix this default avatar image looking broken? There is an image in images/default_avatar.png so not sure why not working
Hi,

are you using 1.8.20 version of MyBB?

Do you remove the avatar javascript in the footer?
(2019-06-10, 06:55 AM)NoRules Wrote: [ -> ]Hi,

are you using 1.8.20 version of MyBB?

Do you remove the avatar javascript in the footer?

Yes I am in 1.8.20 and what JavaScript? This only happens when someone signs up, no image saves. When u change avatar it will update but if u register and don’t upload a picture it is broken
Find and remove all the instances of:
	<script type="text/javascript">
		$(".author_avatar img").error(function () {
			$(this).unbind("error").closest('.author_avatar').remove();
		});
	</script>
from all of your templates.
(2019-06-10, 07:44 AM)NoRules Wrote: [ -> ]Find and remove all the instances of:
	<script type="text/javascript">
		$(".author_avatar img").error(function () {
			$(this).unbind("error").closest('.author_avatar').remove();
		});
	</script>
from all of your templates.

No templates were found containing the string '$(this).unbind("error").closest('.author_avatar').remove(); '

My header include:
<link rel="alternate" type="application/rss+xml" title="{$lang->latest_threads} (RSS 2.0)" href="{$mybb->settings['bburl']}/syndication.php" />
<link rel="alternate" type="application/atom+xml" title="{$lang->latest_threads} (Atom 1.0)" href="{$mybb->settings['bburl']}/syndication.php?type=atom1.0" />
<meta http-equiv="Content-Type" content="text/html; charset={$charset}" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<script type="text/javascript" src="{$mybb->asset_url}/jscripts/jquery.js?ver=1820"></script>
<script type="text/javascript" src="{$mybb->asset_url}/jscripts/jquery.plugins.min.js?ver=1820"></script>
<script type="text/javascript" src="{$mybb->asset_url}/jscripts/general.js?ver=1820"></script>

<link href='https://fonts.googleapis.com/css?family=Roboto:400,100,300,100italic,300italic,400italic,500italic,500,700,700italic,900,900italic' rel='stylesheet' type='text/css'> 
<link href="https://fonts.googleapis.com/css?family=Roboto+Condensed" rel="stylesheet">
<link href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet"> 

{$avatarep_script}{$stylesheets}{$ougc_awards_js} {$guestwarn}
<link href="{$mybb->asset_url}/inc/plugins/myfontawesomeicons/font-awesome-5/css/all.css" rel="stylesheet" type="text/css">
<script type="text/javascript">
<!--
	lang.unknown_error = "{$lang->unknown_error}";

	lang.select2_match = "{$lang->select2_match}";
	lang.select2_matches = "{$lang->select2_matches}";
	lang.select2_nomatches = "{$lang->select2_nomatches}";
	lang.select2_inputtooshort_single = "{$lang->select2_inputtooshort_single}";
	lang.select2_inputtooshort_plural = "{$lang->select2_inputtooshort_plural}";
	lang.select2_inputtoolong_single = "{$lang->select2_inputtoolong_single}";
	lang.select2_inputtoolong_plural = "{$lang->select2_inputtoolong_plural}";
	lang.select2_selectiontoobig_single = "{$lang->select2_selectiontoobig_single}";
	lang.select2_selectiontoobig_plural = "{$lang->select2_selectiontoobig_plural}";
	lang.select2_loadmore = "{$lang->select2_loadmore}";
	lang.select2_searching = "{$lang->select2_searching}";

	var templates = {
		modal: '{$jsTemplates['modal']}',
		modal_button: '{$jsTemplates['modal_button']}'
	};

	var cookieDomain = "{$mybb->settings['cookiedomain']}";
	var cookiePath = "{$mybb->settings['cookiepath']}";
	var cookiePrefix = "{$mybb->settings['cookieprefix']}";
	var cookieSecureFlag = "{$mybb->settings['cookiesecureflag']}";
	var deleteevent_confirm = "{$lang->deleteevent_confirm}";
	var removeattach_confirm = "{$lang->removeattach_confirm}";
	var loading_text = '{$lang->ajax_loading}';
	var saving_changes = '{$lang->saving_changes}';
	var use_xmlhttprequest = "{$mybb->settings['use_xmlhttprequest']}";
	var my_post_key = "{$mybb->post_code}";
	var rootpath = "{$mybb->settings['bburl']}";
	var imagepath = "{$theme['imgdir']}";
  	var yes_confirm = "{$lang->yes}";
	var no_confirm = "{$lang->no}";
	var MyBBEditor = null;
	var spinner_image = "{$theme['imgdir']}/spinner.gif";
	var spinner = "<img src='" + spinner_image +"' alt='' />";
	var modal_zindex = 9999;
// -->
</script>{$myalerts_js}<script type="text/javascript" src="{$mybb->asset_url}/jscripts/like_system.min.js"></script>

It will show on user CP, but not in header or sidebar recent threads
try using MyBB Default Avatar Fix plugin (more details here)
(2019-06-10, 09:21 AM)makpaolo Wrote: [ -> ]
(2019-06-10, 09:11 AM).m. Wrote: [ -> ]try using MyBB Default Avatar Fix plugin (more details here)

Works good for header, but not for sidebar:
https://i.gyazo.com/4c88498cbe9981de8d68...53c32b.png

Using this for my plugin:
https://community.mybb.com/mods.php?action=view&pid=291
https://community.mybb.com/thread-181997...pid1283846

You have to fix the templates that are specific for the Sidebar.

Which plugin are you using for the Sidebar?
(2019-06-10, 11:10 AM)Serpius Wrote: [ -> ]
(2019-06-10, 09:21 AM)makpaolo Wrote: [ -> ]
(2019-06-10, 09:11 AM).m. Wrote: [ -> ]try using MyBB Default Avatar Fix plugin (more details here)

Works good for header, but not for sidebar:
https://i.gyazo.com/4c88498cbe9981de8d68...53c32b.png

Using this for my plugin:
https://community.mybb.com/mods.php?action=view&pid=291
https://community.mybb.com/thread-181997...pid1283846

You have to fix the templates that are specific for the Sidebar.

Which plugin are you using for the Sidebar?

I have already linked it
(2019-06-10, 01:42 PM)makpaolo Wrote: [ -> ]
(2019-06-10, 11:10 AM)Serpius Wrote: [ -> ]
(2019-06-10, 09:21 AM)makpaolo Wrote: [ -> ]
(2019-06-10, 09:11 AM).m. Wrote: [ -> ]try using MyBB Default Avatar Fix plugin (more details here)

Works good for header, but not for sidebar:
https://i.gyazo.com/4c88498cbe9981de8d68...53c32b.png

Using this for my plugin:
https://community.mybb.com/mods.php?action=view&pid=291
https://community.mybb.com/thread-181997...pid1283846

You have to fix the templates that are specific for the Sidebar.

Which plugin are you using for the Sidebar?

I have already linked it

Contact @Wires about fixing the issue for your avatars.