[OzzModz] Badges

[OzzModz] Badges 2.3.5 Patch Level 2

No permission to download
A bit confused how this tier works. If I link more badges to the tier, it will show more numbers?
This is the number of badges with this tier that this user has (including not featured)


This was described in detail here:

#1 Badge tier​

Optional feature (admin would have to enable it in admin panel), which add 4 levels of badges:
  • platinum
  • gold
  • silver
  • bronze

Levels would be visible from the profile and help page, for example golden and silver badges with corresponding coloured bars at the right:
lvjwcZi.png


Further development possibilities:
  • add an option for admins to define their own badge levels with custom colors/icons
  • show number of gathered badges sorted by badge tier, example below
nyVjSTX.png
 
With latest beta version I get this:

Server error log
  • ErrorException: Template error: [E_USER_WARNING] Method canAddFeaturedBadge is not callable on the given object (SV\DailyStatistics\XF\Entity\User)
  • src/XF/Template/Templater.php:1186
  • Generated by:
  • 12. Jun 2022 at 21:32

Stack trace​

#0 [internal function]: XF\Template\Templater->handleTemplateError(512, '[E_USER_WARNING...', '/home/...', 1186)
#1 src/XF/Template/Templater.php(1186): trigger_error('Method canAddFe...', 512)
#2 internal_data/code_cache/templates/l1/s2/public/ozzmodz_badges_member_badges.php(74): XF\Template\Templater->method(Object(SV\DailyStatistics\XF\Entity\User), 'canAddFeaturedB...', Array)
#3 src/XF/Template/Templater.php(1651): XF\Template\Templater->{closure}(Object(SV\StandardLib\XF\Template\Templater), Array, NULL)
#4 src/XF/Template/Template.php(24): XF\Template\Templater->renderTemplate('ozzmodz_badges_...', Array)
#5 src/XF/Mvc/Renderer/Json.php(86): XF\Template\Template->render()
#6 src/XF/Mvc/Renderer/Json.php(70): XF\Mvc\Renderer\Json->renderHtmlFallback('XF:Member\\Badge...', 'public:ozzmodz_...', Array)
#7 src/XF/Mvc/Dispatcher.php(460): XF\Mvc\Renderer\Json->renderView('XF:Member\\Badge...', 'public:ozzmodz_...', Array)
#8 src/XF/Mvc/Dispatcher.php(442): XF\Mvc\Dispatcher->renderView(Object(XF\Mvc\Renderer\Json), Object(XF\Mvc\Reply\View))
#9 src/XF/Mvc/Dispatcher.php(402): XF\Mvc\Dispatcher->renderReply(Object(XF\Mvc\Renderer\Json), Object(XF\Mvc\Reply\View))
#10 src/XF/Mvc/Dispatcher.php(60): XF\Mvc\Dispatcher->render(Object(XF\Mvc\Reply\View), 'json')
#11 src/XF/App.php(2352): XF\Mvc\Dispatcher->run()
#12 src/XF.php(524): XF\App->run()
#13 index.php(20): XF::runApp('XF\\Pub\\App')
#14 {main}


-------------------

Maybe it's other add-on Daily Statistics.
 
Actually, the error happens when I look at the user profile and then the Badge tab. Clicking the tab triggers an error.
 
ErrorException: Template error: [E_USER_WARNING] Method canAddFeaturedBadge is not callable on the given object (SV\DailyStatistics\XF\Entity\User)
This method was removed.
Probably you have modified "ozzmodz_badges_member_badges" template in your style and now it's out of date.

Or your addon data was not imported correctly. In this case, rebuild the add-on data.
 
This method was removed.
Probably you have modified "ozzmodz_badges_member_badges" template in your style and now it's out of date.

Or your addon data was not imported correctly. In this case, rebuild the add-on data.

How I can hide Badge tier on mobile version? Takes too much room.
 
Hmm, I'm confused about that featured badges now. So users can't feature a badge anymore? How can I control how many badges are visible in messages? There are still permissions for featuring badges. I guess I'm missing something.
 
Thanks for adding REST endpoint support in last update.
How do I know which end points are available so I can test drive it?
I try to download to see if there is documentation in release notes.

Updated: Found it in the readme.html file. Can't wait to test it out via postman.
Now I need to look for custom made poker badges.
 
Last edited:
@Ozzy47, You forgot delete given medals for users in mass-delete category function. It may cause ErrorException: [E_NOTICE] Trying to get property 'Category' of non-object in src/addons/OzzModz/Badges/Repository/UserBadge.php when watching given medals in user profile.
In your case, you can add this query to OzzModz\Job\DeleteBadges class, method rebuildById($id).
It looks something like this, worked for me:
PHP:
protected function rebuildById($id)
{
    $badge = $this->app->finder(Addon::shortName('Badge'))->whereId($id)->fetchOne();
    $badge->delete();
 
    $this->app->db()->delete('xf_ozzmodz_badges_user_badge', 'badge_id = ?', $id);
}
 
sorry but to me it's not clear the stacking....
I got 5,10,15 years at the forum badge ok?
If I want to show only the 15 years and hyde 10 and 5 in member's profile, how to?
 
Hmm, I'm confused about that featured badges now. So users can't feature a badge anymore? How can I control how many badges are visible in messages? There are still permissions for featuring badges. I guess I'm missing something.
were you able to understand how to?
 
Top Bottom