[OzzModz] Avatar Gallery

[OzzModz] Avatar Gallery 2.0.2 Patch Level 4

No permission to download
Can’t edit my above post but I also checked my logs and I have this… Just wanted to report as it seems to be working fine but I’m not sure if this will pop up again…

Code:
ErrorException: [E_NOTICE] Undefined offset: 5 src/XF/Mvc/Entity/AbstractCollection.php:69
Generated by: DudeThatsErin Feb 25, 2022 at 7:08 PM

Stack Trace
Code:
#0 src/XF/Mvc/Entity/AbstractCollection.php(69): XF::handlePhpError(8, '[E_NOTICE] Unde...', '/home/codinghel...', 69, Array)
#1 src/addons/ThemeHouse/AvatarGallery/Service/Import.php(32): XF\Mvc\Entity\AbstractCollection->offsetGet(5)
#2 src/addons/ThemeHouse/AvatarGallery/Service/Import.php(12): ThemeHouse\AvatarGallery\Service\Import->importCategories(Object(SimpleXMLElement))
#3 src/XF/ControllerPlugin/Xml.php(66): ThemeHouse\AvatarGallery\Service\Import->import(Object(SimpleXMLElement))
#4 src/addons/ThemeHouse/AvatarGallery/Admin/Controller/AvatarGallery.php(410): XF\ControllerPlugin\Xml->actionImport('th-avatar-galle...', 'avatars_export', 'ThemeHouse\\Avat...')
#5 src/XF/Mvc/Dispatcher.php(352): ThemeHouse\AvatarGallery\Admin\Controller\AvatarGallery->actionImport(Object(XF\Mvc\ParameterBag))
#6 src/XF/Mvc/Dispatcher.php(259): XF\Mvc\Dispatcher->dispatchClass('ThemeHouse\\Avat...', 'Import', Object(XF\Mvc\RouteMatch), Object(ThemeHouse\AvatarGallery\Admin\Controller\AvatarGallery), NULL)
#7 src/XF/Mvc/Dispatcher.php(115): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(ThemeHouse\AvatarGallery\Admin\Controller\AvatarGallery), NULL)
#8 src/XF/Mvc/Dispatcher.php(57): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#9 src/XF/App.php(2351): XF\Mvc\Dispatcher->run()
#10 src/XF.php(517): XF\App->run()
#11 admin.php(13): XF::runApp('XF\\Admin\\App')
#12 {main}

Request State
Code:
array(4) {
  ["url"] => string(35) "/admin.php?th-avatar-gallery/import"
  ["referrer"] => string(54) "https://domainjunkie.site/admin.php?th-avatar-gallery/"
  ["_GET"] => array(1) {
    ["th-avatar-gallery/import"] => string(0) ""
  }
  ["_POST"] => array(4) {
    ["_xfToken"] => string(8) "********"
    ["_xfRequestUri"] => string(29) "/admin.php?th-avatar-gallery/"
    ["_xfWithData"] => string(1) "1"
    ["_xfResponseType"] => string(4) "json"
  }
}
 
Feature suggestion -

Allow users to upload a gif from giphy directly from the avatar selection modal. I've looked around and it seems you can only upload gifs that you've downloaded yourself. Would be great to choose from giphy.

Thanks!
 
Will this addon also work for new registrations in the registration process ?
As guest when he wants to join the forum he needs to type email, username, password etc.
Would your addon also show the gallery to the guests when they in the registration process ?

That would be awesome !
 
I use this in conjunction with Nixfifty's Onboarding add-on, and get pretty high adoption of avatar usage from it.
 
I noted that if you removed all the avatars (as I did on a test board) and had users who's avatars were set to one from the set the board threw an error and fails to load:

Code:
Error: Template public:PAGE_CONTAINER error: Call to a member function getAvatarUrl() on null src/addons/ThemeHouse/AvatarGallery/XF/Entity/User.php:46

The offending function in src/addons/ThemeHouse/AvatarGallery/XF/Entity/User.php is:

PHP:
        /**
         * @param $sizeCode
         * @param null $forceType
         * @param bool $canonical
         * @return mixed|null|string
         * @throws \XF\PrintableException
         */
        public function getAvatarUrl($sizeCode, $forceType = null, $canonical = false)
        {
                if ($this->thag_avatar_id)
                {
                        return $this->THAvatar->getAvatarUrl($canonical, $sizeCode);
                }

                return parent::getAvatarUrl($sizeCode, $forceType, $canonical);
        }

Wrapping return $this->THAvatar->getAvatarUrl($canonical, $sizeCode); is enough to fix the error and have the board render (with the icons just 404ing) again.

PHP:
        /**
         * @param $sizeCode
         * @param null $forceType
         * @param bool $canonical
         * @return mixed|null|string
         * @throws \XF\PrintableException
         */
        public function getAvatarUrl($sizeCode, $forceType = null, $canonical = false)
        {
                if ($this->thag_avatar_id)
                {
                    if ($this->THAvatar) {
                        return $this->THAvatar->getAvatarUrl($canonical, $sizeCode);
                    }
                }

                return parent::getAvatarUrl($sizeCode, $forceType, $canonical);
        }

Anyhow lovely add-on. Thank you for your work on it. Very much appreciated.
 
It would be nice to have an option that would automatically assign to the new members a random avatar from the gallery when they sign up instead of the boring default avatar. @Ozzy47
Do you perhaps have some time to spend on this? :D

I noted that if you removed all the avatars (as I did on a test board) and had users who's avatars were set to one from the set the board threw an error and fails to load
I can confirm this too.
 
1688163713078.webp

After installing this addon, there is no longer an option to upload new avatar via user control panel.
 
Make sure you set the user group permissions right.
That doesn't always work (mine were correct). For some reason (probably caching of some type) when I disabled the add-on then enabled it again, it started working.
 
That doesn't always work (mine were correct). For some reason (probably caching of some type) when I disabled the add-on then enabled it again, it started working.
Correct, permissions were fine. Ended up being a cache issue - appreciate the tip with that
 
Any way to edit the template so all categories are open by default, instead of collapsed?
 
Hi @Ozzy47 ,
on XF 2.2.13 Avatar Gallery 2.0.2 Patch Level 3
I have this Ungrouped
category and i cannot put something in it or remove it.
Also, on user side, i must click on "Edit" to get the gallery, if i click on the image of the avatar it only load and show the actual image on the web page (might need the image link to the text)... i may dig on that last one ;)

Thank you for this great add-on! :)
 

Attachments

  • gallery.webp
    gallery.webp
    27.1 KB · Views: 8
I understand this add-on was created by Themehouse. There's another Avatar Gallery add-on:


They look almost the same, including the permission options.. so is there any relationship between them? Which one is better?
 
I understand this add-on was created by Themehouse. There's another Avatar Gallery add-on:


They look almost the same, including the permission options.. so is there any relationship between them? Which one is better?
There isn't likely any relationship other than them being based off of ThemeHouse's addon, but I believe that this one has more development done to it currently.
 
Top Bottom