Jump to the post that solved this thread.
Not Solved [How To?] Make default avatar CSS
#1
Not Solved
What condition can i use to make the default avatar display as CSS in memberlist_user_avatar template ?

Something like

<if $useravatar['image'] = images/default_avatar.png then>
	<i class="fa fa-user-circle-o"></i>	
<else>	
<img src="{$useravatar['image']}" alt="" {$useravatar['width_height']} />
</if>
What goes around comes around
Reply
#2
Not Solved
Try with this:
<if $useravatar['image'] == "images/default_avatar.png" then>
    <i class="fa fa-user-circle-o"></i>    
<else>    
<img src="{$useravatar['image']}" alt="" {$useravatar['width_height']} />
</if>

or with this:
<if $useravatar['image'] == str_replace('{theme}', $theme['imgdir'], $mybb->settings['useravatar']) then>
    <i class="fa fa-user-circle-o"></i>    
<else>    
<img src="{$useravatar['image']}" alt="" {$useravatar['width_height']} />
</if>
My Projects - Support My Projects

Don't forget to rate posts!
Reply
#3
Not Solved
(2017-08-13, 04:44 PM)chack1172 Wrote: Try with this:
<if $useravatar['image'] == "images/default_avatar.png" then>
    <i class="fa fa-user-circle-o"></i>    
<else>    
<img src="{$useravatar['image']}" alt="" {$useravatar['width_height']} />
</if>

Tried that already, does not work.
What goes around comes around
Reply
#4
Not Solved
Try the second code
My Projects - Support My Projects

Don't forget to rate posts!
Reply
#5
Not Solved
(2017-08-13, 04:56 PM)chack1172 Wrote: Try the second code

Still not. The CSS displays but the avatar does not display when a user has one set.
What goes around comes around
Reply
#6
Not Solved
This should work:
<if $useravatar['image'] == $mybb->settings['bburl'].'/'.$mybb->settings['useravatar'] then>
    default
<else>    
<img src="{$useravatar['image']}" alt="" {$useravatar['width_height']} />
</if>
My Projects - Support My Projects

Don't forget to rate posts!
Reply
#7
Not Solved
(2017-08-13, 05:14 PM)chack1172 Wrote: This should work:
<if $useravatar['image'] == $mybb->settings['bburl'].'/'.$mybb->settings['useravatar'] then>
    default
<else>    
<img src="{$useravatar['image']}" alt="" {$useravatar['width_height']} />
</if>

That works! Thanks.
What goes around comes around
Reply
Jump to the post that solved this thread.


Forum Jump:


Users browsing this thread: 1 Guest(s)