Jump to content

Default Avatar Fix (If Not Showing)
   (0 reviews)

c.widow
  • For an unknown reason, sometimes when we try to place user avatars in particular areas, the default avatar (if they do not have one) does not show! I'll explain here a little HTML (image scroll tag with javascript) fix that will solve all your problems. Usually this problem will occur while putting the image in the header area or somewhere else. If you are having this problem on posts or profiles, this solution may work as well you'll just need to play around with the variable used for the users avatar.

    Software: MyBB

Default Avatar Fix (If Not Showing) Icyboards OR Self Hosted

For an unknown reason, sometimes when we try to place user avatars in particular areas, the default avatar (if they do not have one) does not show! I'll explain here a little HTML (image scroll tag with javascript) fix that will solve all your problems. Usually this problem will occur while putting the image in the header area or somewhere else. If you are having this problem on posts or profiles, this solution may work as well you'll just need to play around with the variable used for the users avatar.

 

Tutorial Created By: Isoldehn
Tutorial Permissions: You may use this tutorial on other sites so long as you credit me for the creation of the tutorial. If you reword this tutorial and make it your own, no need to credit me as it's no longer my wording. Do not claim credit for the creating the code and do not credit me for creating the code, this code is floating about the internet in many resource areas and is as well a very BASIC code.
Tutorial Needs: Copy & Paste Abilities

 

Self Hosted MyBB
- Use this code, replace INSERTDEFAULTAVATARIMGURLHERE with your forums default avatar link:

<img src="{$mybb->user['avatar']}" onerror="this.onerror=null;this.src='INSERTDEFAULTAVATARIMGURLHERE';"></img>

 

Icyboards Hosted MyBB
- Use this code, replace INSERTDEFAULTAVATARIMGURLHERE with your forums default avatar link:

<img src="{$mybb->user['avatarcdn']}" onerror="this.onerror=null;this.src='INSERTDEFAULTAVATARIMGURLHERE';"></img>

 

----

 

This guide WILL work for using images any where else on a forum. So if you do not use MyBB/Icyboards, this might work on whatever forum you are using if you declare variable correctly. My example is just for MyBB in particular. :)





User Feedback

Create an account or sign in to leave a review

You need to be a member in order to leave a review

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

There are no reviews to display.


×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use, Guidelines and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.