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.