[OzzModz] Badges

[OzzModz] Badges 2.3.5 Patch Level 2

No permission to download
Would it be possible to incorporate an option for us to create a fully custom HTML5 badge? Instead of being limited to images and icons, this feature could provide a large field where users could input their own HTML code to create a unique badge and custom interactions.

e.g: custom HTML5 animation on hover, with that html code can use custom svg/json/js elements for small file sizes, etc....
 
Last edited:
I added a badge and I'm using a font awesome icon. I want to change the color of it. What would I put in the CSS field and what would I put in extra.less to change the color?

Thanks in advance.
 
What is the right way to update the number of awarded badges on the Help page?
I reran the cron, rebuild all the caches but it still not correctly shows the number.
 
Can it be created like this?
1691017655342.webp
If user have 1 message they get bagde 1, if they have 150 message they get badge 6 and badge 1 disappear, and so on.

1691017597209.webp
 
These in xf would be default trophies but they don't have images... there is a plugin that adds images...
 
Anybody have success in implementing an Ozzmodz Badge display section on the Member Account page? (see image for exactly what I'm looking to make)... I know I'll have to modify the Member Account template... Any suggestions or code examples are appreciated.
 

Attachments

  • Screen Shot 2023-08-12 at 9.49.48 AM.webp
    Screen Shot 2023-08-12 at 9.49.48 AM.webp
    56.4 KB · Views: 46
Hi, I've been trying to use this addon for a while and had hoped version updates would maybe fix it for me eventually, but no matter the version I've never had a "Badges" submenu show up in user customization. The other stuff is all there, i just have no way to create any badges to award. How can I fix this?
 
Great mod!

I saw the answer to this a few versions back, I just wanted to make sure it still applies to these latest releases. If only manually giving badges, can the cron be turned off?

Thank you!
 
Is there a way to set some badges to be user chosen? I want users to be able to pick their own badge if they want to?

It would be neat to let users pick their own badges and a setting to limit it on a usergroup basis. Ie, silver members can pick 2 badges, gold members can pick 4 badges, etc.

I'm willing to pay some money to get this added if it does not currently support it.
 
Last edited:
Anybody have success in implementing an Ozzmodz Badge display section on the Member Account page? (see image for exactly what I'm looking to make)... I know I'll have to modify the Member Account template... Any suggestions or code examples are appreciated.

That's an awesome member account page.
 
@Ozzy47 I tried to see if I could find a convo on this, but have not had any luck. I have users on my system who have no badges but are showing in member profiles that they have "2" badges.

I think I know what happened, a while back I have out a badge(s) for one and two year anniversary of being a member and then decided to take back those badges because it was simply a test. However, now the profiles are still showing that users have badges even though they do not.

How do you make the add-on update and remove the badge count from users who no longer have an actual badge attached to their account?

Thanks for the help, Oz (or anyone else who knows this answer) !

---- I did find that I can do this manually, a page at a time, under the ACP -> Logs -> Users Awarded With Badge and simply select all (remove any that shouldn't be tagged) and hit delete. That just seems like an awful long and complicated process to update badge count for previously removed badges.
 
Last edited:
When importing badges from versobit the images are not showing on the forums - we do see them in the ACP but it seems that relative urls are not displaying correctly on the help page and postbit:
<siteUrl>/help/ozzmodz_badges/<relativePath> instead of <siteUrl>/<relativePath> (how it works with VersoBit version)

Thank you for this great add-on 🙏
 
@Ozzy47 some feature requests, some easier than others :) All are mostly SEO/pagespeed-related 🤓
  • Easiest for now: Add Permission for "View badges in the threads/posts"
    • Would allow us to disable it for guests, as some of our admins/mods have uploaded quite high-res GIFs/PNGs as badges and they are affecting load speeds and CLS of threads
  • To fix page speed and CLS things here are some <img>-template fixes/improvements:
    • Add loading="lazy" to the badges so that they don't load unless/until needed
    • Add width="X" and height="Y" to the badges so that browser can calculate aspect ratio and reserve enough space for them
      • CSS rules will limit the actual size, don't worry that X/Y values are larger than what will render
  • Option to auto-resize uploaded badges to "sane values"
    • I guess limits could be definable in options? But rarely no badge images would need to be large than 100x100px
    • Up to you if you want to store the "original" image and generate "thumbnail"-versions that are served for actual badge images
    • XF has quite nice handling of resizing already so you can look at their code for examples :)
 
Looking for any suggestions on how to approach adding new custom triggers to the "add badge -> badge options" from a development perspective.
 
Has anyone come across an issue with this plugin, where badges are not awarded when cron runs?

If I assign manually, then everything works as expected. However, if I set the criteria to grant a badge for a user that has more than 30 posts, then kickoff the cron, the badge is not awarded. Is it something simple that I am missing here?
 
Hey @Ozzy47 @Painbaker

Attempted a fresh install of @Bob 's showcase addon and got this in the admin dashboard. I've previously installed showcase without errors (before badges were around). Help on a postcard please. :) The installation fails to complete leaving this as a pending job.


  • Error: Call to protected method XF\AddOn\AbstractSetup::schemaManager() from scope OzzModz\ContentBadges\Listener
  • src/addons/OzzModz/ContentBadges/Listener.php:61
  • Generated by: Nik
  • Nov 8, 2023 at 6:29 PM

Stack trace​

#0 src/XF/Extension.php(49): OzzModz\ContentBadges\Listener::addonPostInstall(Object(XF\AddOn\AddOn), Object(XF\Entity\AddOn), Array, Array)
#1 src/XF.php(966): XF\Extension->fire('addon_post_inst...', Array, 'XenAddons/Showc...')
#2 src/XF/AddOn/AddOn.php(552): XF::fire('addon_post_inst...', Array, 'XenAddons/Showc...')
#3 src/XF/Job/AddOnInstallBatch.php(384): XF\AddOn\AddOn->postInstall(Array)
#4 src/XF/Job/AddOnInstallBatch.php(99): XF\Job\AddOnInstallBatch->stepFinalize(Object(XF\Timer))
#5 src/XF/Job/Manager.php(260): XF\Job\AddOnInstallBatch->run(8)
#6 src/XF/Job/Manager.php(202): XF\Job\Manager->runJobInternal(Array, 8)
#7 src/XF/Job/Manager.php(118): XF\Job\Manager->runJobEntry(Array, 8)
#8 src/XF/Admin/Controller/Tools.php(122): XF\Job\Manager->runByIds(Array, 8)
#9 src/XF/Mvc/Dispatcher.php(352): XF\Admin\Controller\Tools->actionRunJob(Object(XF\Mvc\ParameterBag))
#10 src/XF/Mvc/Dispatcher.php(259): XF\Mvc\Dispatcher->dispatchClass('XF:Tools', 'RunJob', Object(XF\Mvc\RouteMatch), Object(SV\UserMentionsImprovements\XF\Admin\Controller\Tools), NULL)
#11 src/XF/Mvc/Dispatcher.php(115): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(SV\UserMentionsImprovements\XF\Admin\Controller\Tools), NULL)
#12 src/XF/Mvc/Dispatcher.php(57): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#13 src/XF/App.php(2487): XF\Mvc\Dispatcher->run()
#14 src/XF.php(524): XF\App->run()
#15 admin.php(13): XF::runApp('XF\\Admin\\App')
#16 {main}

Request state​

array(4) {
["url"] => string(24) "/admin.php?tools/run-job"
["referrer"] => string(58) "https://mysite.com/admin.php?tools/run-job"
["_GET"] => array(1) {
["tools/run-job"] => string(0) ""
}
["_POST"] => array(3) {
["_xfRedirect"] => string(95) "https://mysite.com/admin.php?add-ons/install-from-archive-complete&batch_id=239"
["_xfToken"] => string(8) "********"
["only_ids"] => string(8) "XXXX"
}
}
 
Last edited:
Top Bottom