• 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

#3
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).
 
#6
How have you associated avatars to users?
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
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...