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

Find user attached to avatar

Discussion in 'XenForo Development Discussions' started by Helmut2509, Nov 12, 2013.

  1. Helmut2509

    Helmut2509 Member

    How can I find out which user is attached to a certain avatar?
     
  2. Brogan

    Brogan XenForo Moderator Staff Member

  3. Helmut2509

    Helmut2509 Member

    this answer refers to the *normal* avatar features in Xenforo. But in my case it's different: I have written an add-on which allows the administrator to create custom avatar galleries.
    So he can upload avatars to those custom galleries and also delete them. In case of deletion I have to find the affected users in order to use XenForo_Model_Avatar::->deleteAvatar($userId).
     
  4. Brogan

    Brogan XenForo Moderator Staff Member

    It wasn't clear your question related to development.
    I have moved the thread.
     
  5. Jeremy

    Jeremy XenForo Moderator Staff Member

    How have you associated avatars to users?
     
  6. Helmut2509

    Helmut2509 Member

    With a listener, I have overwritten XenForo_ControllerPublic_Account::actionAvatarUpload, where I fetch the avatars not from the *normal*
    avatar folder, but from the custom avatar gallery.
    if the administrator deletes an avatar, all attached users should be attached to the default avatar.
    as far as I can see, it is easy to find the avatar attached to a user. but the other way round, finding the user(s) attached to a certain avatar, is rather tricky...
     
  7. Helmut2509

    Helmut2509 Member

    Sorry, I have to correct my previous posting:
    With a listener, I have overwritten XenForo_ViewPublic_Account_Avatar, where I fetch the avatars from the custom avatar gallery.
    if the administrator deletes an avatar, all attached users should be attached to the default avatar.
    as far as I can see, it is easy to find the avatar attached to a user. but the other way round, finding the user(s) attached to a certain avatar, is rather tricky...
     

Share This Page