1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.2 Hide default avatars?

Discussion in 'Troubleshooting and Problems' started by JMEWLS, Nov 17, 2013.


    JMEWLS Active Member

    If someone has not uploaded an avatar is there a conditional to hide it in the user_info next to the posts? It's confusing seeing numerous users without avatars, a lot of my community really only refer to their users by avatar.

    Adam Howard likes this.
  2. Adam Howard

    Adam Howard Well-Known Member

    I do not think there is away to hide, only the default avatar.

  3. Adam Howard

    Adam Howard Well-Known Member

  4. Brogan

    Brogan XenForo Moderator Staff Member

    You could edit the templates and use a conditional statement: <xen:if is="{$visitor.avatar_date}>

    Only those who have uploaded an avatar will have a date set.
    Adam Howard likes this.

    JMEWLS Active Member

    Appreciate the reply. But wouldn't this only hide avatars for people who don't have them set? I'm wanting to remove the default avatar in the user_info.
  6. Brogan

    Brogan XenForo Moderator Staff Member

    Isn't that the same thing?

    If they haven't uploaded an avatar then the default avatar is shown.

    JMEWLS Active Member

    Sorry I think I didn't articulate my post correctly. What I meant is that people who don't have avatars would be able to see any at all?

    I've added this code, I'm still able to see avatars as well as the default ones on users (I have an avatar set) . However I created a test account (with no avatar set) and they're unable to see no avatars. I simply want users to be able to see people with avatars set and remove the default avatar from the user_info.

    Hopefully that makes more sense. :lol:

    JMEWLS Active Member

    <xen:if is="{xen:helper avatar, $user, m, 'true'}">
       <xen:hook name="message_user_info_avatar" params="{xen:array 'user={$user}', 'isQuickReply={$isQuickReply}'}">
         <div class="avatarHolder">
           <span class="helper"></span>
           <xen:avatar user="$user" size="m" img="true" />
           <!-- slot: message_user_info_avatar -->
       <xen:else />
    Was trying to do something like this, but obviously didn't work :(
  9. Jeremy

    Jeremy Well-Known Member

    You may be able to use Paul's conditional substituting $user for $visitor.
  10. JMEWLS

    JMEWLS Active Member

    Thanks for the reply, still no dice. Hmmm.
  11. JMEWLS

    JMEWLS Active Member

    Is it possible to implement a 'helper' for if the avatar = "avatar_male_m.png" or something like that?
  12. JMEWLS

    JMEWLS Active Member

  13. Adam Howard

    Adam Howard Well-Known Member

    I'm fairly sure I understood you in the 1st post.

    You want it so people see only the avatars that people upload. And if someone does not upload an avatar, everyone will see only the user name.

    And no matter what they do or do not do, you want no one to see the standard default at any time ... ie.... "avatar_male_m.png" for example.

    I do not think this is possible. It is either all or nothing.

    This really should be a feature (in my opinion)
    JMEWLS likes this.

Share This Page