[OzzModz] Badges

[OzzModz] Badges 2.0.0 Patch Level 6

No permission to download

Ozzy47

Well-known member
Ozzy47 submitted a new resource:

[OzzModz] Badges - Reward your users with collectible badges, and control how your users get them.

Requirements:
XenForo 2.2.0+

Description:
Reward your users with collectible badges, and control how your users get them.



Features

  • Award users badges based on criteria.
  • Manually award users badges.
  • Display badges on users profiles, and profile cards.
  • CRON Job for automatically applying badges when a user meets criteria.
  • Notification options (User controlled emails, global disable)
  • Uses caching to escape extra DB queries
  • Data importer from...

Read more about this resource...
 

Oblivion Knight

Well-known member
Kudos for taking this project on @Ozzy47 (even after some of the posts from the other thread(s)).

I'll probably look into replacing my current trophies with this at some point (y)
 

Brettflan

Active member
Nice. I notice these features are mentioned which are new from Versobit:
  • Uses caching to escape extra DB queries
  • Data importer from [VersoBit] Badges
Are there any other updates/changes from the Versobit 2.0.0p1 release? Whatever the case, it's good to see somebody else taking it over.
 

sbj

Well-known member
Does the criteria work in this one? I had no time to test it for myself. That was my biggest problem why I ditched the Verso one and switched to the paid addon, where the criteria also doesnt work. So I am gonna switch to this one asap.
 

Brettflan

Active member
Does the criteria work in this one? I had no time to test it for myself. That was my biggest problem why I ditched the Verso one and switched to the paid addon, where the criteria also doesnt work. So I am gonna switch to this one asap.
By criteria, do you mean the ability for badges to automatically be removed based on the user no longer fitting the criteria? If so, I'm guessing that's still not a thing. It would be a great addition, though.
 

sbj

Well-known member
By criteria, do you mean the ability for badges to automatically be removed based on the user no longer fitting the criteria? If so, I'm guessing that's still not a thing. It would be a great addition, though.
Yep, exactly this.

This doesn't act like the default xenforo criteria feature. It is broken. Because for whatever reason the logic used behind this was like the trophy system. Like once a trophy is given in XF, it stays and can't be removed. And the badges were designed like that, once given, it stays forever.

But we know from default XF criteria system (e.g. user promotions) that if a user doesn't fit the criteria anymore, it shouldn't be applied anymore.

In my case I allow my users to pick their own badges. I provide a list of badges and they can select in their profiles which one they want to use. And once a badge is given, they can't take it away anymore by de-selecting them. They are applied forever. It confuses users and makes no sense.

I'll make a report once I got to test it, but I am glad Ozzy took this one over. It could've been also a paid addon, so thanks for offering it for free.
 

BigPete7978

Active member
YES!
Just installed and trying to run the importer. Getting this error:

Code:
InvalidArgumentException: Attempted to convert object to JSON array [user_criteria] in src/XF/Import/Data/EntityEmulator.php at line 155
XF\Import\Data\EntityEmulator->set() in src/XF/Import/Data/AbstractEmulatedData.php at line 51
XF\Import\Data\AbstractEmulatedData->set() in src/addons/OzzModz/Badges/Import/Importer/VersoBitBadges.php at line 219
OzzModz\Badges\Import\Importer\VersoBitBadges->stepBadges() in src/XF/Import/Runner.php at line 242
XF\Import\Runner->runStep() in src/XF/Import/Runner.php at line 59
XF\Import\Runner->run() in src/XF/Admin/Controller/Import.php at line 234
XF\Admin\Controller\Import->actionRun() in src/XF/Mvc/Dispatcher.php at line 350
XF\Mvc\Dispatcher->dispatchClass() in src/XF/Mvc/Dispatcher.php at line 257
XF\Mvc\Dispatcher->dispatchFromMatch() in src/XF/Mvc/Dispatcher.php at line 113
XF\Mvc\Dispatcher->dispatchLoop() in src/XF/Mvc/Dispatcher.php at line 55
XF\Mvc\Dispatcher->run() in src/XF/App.php at line 2300
XF\App->run() in src/XF.php at line 488
XF::runApp() in admin.php at line 13
 

deslocotoco

Well-known member
As far from i remember, the Badges from CMTV can be removed if the criteria is not met anymore.

I can't remove Badges after give then?

I really like this add-on (should be official, btw) and is so nice that Ozzy take the project to himself. He is one the best coders/developers around our Community and I'm sure the add-on is in good hands right now.

The sad thing is that i stopped using Badges in my Forum (to much DB queries and other stuff, the old add-on was killing my server resources).

Maybe this one got better on the performance?
 

Ozzy47

Well-known member
YES!
Just installed and trying to run the importer. Getting this error:

Code:
InvalidArgumentException: Attempted to convert object to JSON array [user_criteria] in src/XF/Import/Data/EntityEmulator.php at line 155
XF\Import\Data\EntityEmulator->set() in src/XF/Import/Data/AbstractEmulatedData.php at line 51
XF\Import\Data\AbstractEmulatedData->set() in src/addons/OzzModz/Badges/Import/Importer/VersoBitBadges.php at line 219
OzzModz\Badges\Import\Importer\VersoBitBadges->stepBadges() in src/XF/Import/Runner.php at line 242
XF\Import\Runner->runStep() in src/XF/Import/Runner.php at line 59
XF\Import\Runner->run() in src/XF/Admin/Controller/Import.php at line 234
XF\Admin\Controller\Import->actionRun() in src/XF/Mvc/Dispatcher.php at line 350
XF\Mvc\Dispatcher->dispatchClass() in src/XF/Mvc/Dispatcher.php at line 257
XF\Mvc\Dispatcher->dispatchFromMatch() in src/XF/Mvc/Dispatcher.php at line 113
XF\Mvc\Dispatcher->dispatchLoop() in src/XF/Mvc/Dispatcher.php at line 55
XF\Mvc\Dispatcher->run() in src/XF/App.php at line 2300
XF\App->run() in src/XF.php at line 488
XF::runApp() in admin.php at line 13
We’ll check it out.
 

Ozzy47

Well-known member
YES!
Just installed and trying to run the importer. Getting this error:

Code:
InvalidArgumentException: Attempted to convert object to JSON array [user_criteria] in src/XF/Import/Data/EntityEmulator.php at line 155
XF\Import\Data\EntityEmulator->set() in src/XF/Import/Data/AbstractEmulatedData.php at line 51
XF\Import\Data\AbstractEmulatedData->set() in src/addons/OzzModz/Badges/Import/Importer/VersoBitBadges.php at line 219
OzzModz\Badges\Import\Importer\VersoBitBadges->stepBadges() in src/XF/Import/Runner.php at line 242
XF\Import\Runner->runStep() in src/XF/Import/Runner.php at line 59
XF\Import\Runner->run() in src/XF/Admin/Controller/Import.php at line 234
XF\Admin\Controller\Import->actionRun() in src/XF/Mvc/Dispatcher.php at line 350
XF\Mvc\Dispatcher->dispatchClass() in src/XF/Mvc/Dispatcher.php at line 257
XF\Mvc\Dispatcher->dispatchFromMatch() in src/XF/Mvc/Dispatcher.php at line 113
XF\Mvc\Dispatcher->dispatchLoop() in src/XF/Mvc/Dispatcher.php at line 55
XF\Mvc\Dispatcher->run() in src/XF/App.php at line 2300
XF\App->run() in src/XF.php at line 488
XF::runApp() in admin.php at line 13

Should be fixed.
 

Brettflan

Active member
As far from i remember, the Badges from CMTV can be removed if the criteria is not met anymore.

I can't remove Badges after give then?
You can manually remove them, yes. But not automatically based on them no longer matching the criteria.

The sad thing is that i stopped using Badges in my Forum (to much DB queries and other stuff, the old add-on was killing my server resources).

Maybe this one got better on the performance?
Apparently he has added caching in this version to decrease the DB query count, based on the feature list.
 
  • Like
Reactions: sbj

BigPete7978

Active member
Transferred over most of mine, then I got this error.

Code:
XF\Db\DuplicateKeyException: MySQL query error [1062]: Duplicate entry '5-132' for key 'PRIMARY' in src/XF/Db/AbstractStatement.php at line 228
XF\Db\AbstractStatement->getException() in src/XF/Db/Mysqli/Statement.php at line 196
XF\Db\Mysqli\Statement->getException() in src/XF/Db/Mysqli/Statement.php at line 77
XF\Db\Mysqli\Statement->execute() in src/XF/Db/AbstractAdapter.php at line 94
XF\Db\AbstractAdapter->query() in src/XF/Db/AbstractAdapter.php at line 218
XF\Db\AbstractAdapter->insert() in src/XF/Mvc/Entity/Entity.php at line 1510
XF\Mvc\Entity\Entity->_saveToSource() in src/XF/Mvc/Entity/Entity.php at line 1242
XF\Mvc\Entity\Entity->save() in src/addons/OzzModz/Badges/Import/Importer/VersoBitBadges.php at line 280
OzzModz\Badges\Import\Importer\VersoBitBadges->stepUsers() in src/XF/Import/Runner.php at line 242
XF\Import\Runner->runStep() in src/XF/Import/Runner.php at line 59
XF\Import\Runner->run() in src/XF/Admin/Controller/Import.php at line 234
XF\Admin\Controller\Import->actionRun() in src/XF/Mvc/Dispatcher.php at line 350
XF\Mvc\Dispatcher->dispatchClass() in src/XF/Mvc/Dispatcher.php at line 257
XF\Mvc\Dispatcher->dispatchFromMatch() in src/XF/Mvc/Dispatcher.php at line 113
XF\Mvc\Dispatcher->dispatchLoop() in src/XF/Mvc/Dispatcher.php at line 55
XF\Mvc\Dispatcher->run() in src/XF/App.php at line 2300
XF\App->run() in src/XF.php at line 488
XF::runApp() in admin.php at line 13
 

TFW

Active member
Can someone post some screenshots? Also can you award badges based on trophies/user groups?

i07sVMa.png


I would suggest to disable trophies while you use badges. Those are the same, but badges are more advanced feature.
 

TFW

Active member
Not sure if this is the best place to post that, but I have a couple of suggestions. I hope at least some of them will be useful ;)

#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


#2 Stack of badges​

Badge categories are useful, but sometimes they are not enough. Especially in case of similar, repetitive badges. For example, let's consider badges for achieving consecutive years since registration, in this case: 1, 3, 5, 7 and 10 years. Right now it looks like this if we use only badge categories:
c6wzj0O.png

Stack of badges (or something similar) would be much more visually informative, for example:
2WhCn6C.png


How this example works:
  • badges of lower "level" are showed inside the highest "level" badge
  • user still can choose any of lower "level" badges to display in his profile
  • description of lower "level" badges would be visible on hover/click event

Further development possibilities:
  • add locked badges from the same stack (they could be greyed out and moved to the right edge for example)

#3 Repetitive badges​

This might be useful especially for competitive badges (for winning in game tournaments or forum competitions). For example - let's consider badge for ending up annual competition on the first place. If this competition happens every year for 10 years, it would be better to have just one badge instead of ten. But what if someone won more than once? Right now we can solve this problem by writing it out in comment section. But for user it would be much cooler to have given that one badge twice (separately), so he could feature both won editions in his/her profile.

I would suggest to give an option like "multi badge", so it wouldn't be enabled by default.
 
Top