[OzzModz] Badges

[OzzModz] Badges 2.1.1

No permission to download

tomnjerry74

New member
After a user is awarded a badge and subsequently has the badge taken away, the alert notification that says "You have been awarded a badge" remains. I believe it was automatically deleted in the old VersoBit version.
 

Ozzy47

Well-known member
After a user is awarded a badge and subsequently has the badge taken away, the alert notification that says "You have been awarded a badge" remains. I believe it was automatically deleted in the old VersoBit version.

I don’t believe so, pretty sure we didn’t remove any code from the old addon. 🤔
 

interforo

Active member
how can I download the plugin? It says I don't have the permission (I have subscribed to the other forum)
 

yodiceman

Member
I would like to issue a badge for each year a member has been registered on our forum. I've created a badge category called 'Tenure'. What I want to know is if they are awarded a 2-year badge if it's possible for the 1-year to not show. Right now, both badges are shown.
 

NobleMan

Active member
Hey @Ozzy47, seeing an error every few minutes when i have this enabled.
Code below.

  • TypeError: Macro public_ozzmodz_badges_featured_badges_macros :: featured_badges() error: Argument 1 passed to XF\Template\Templater phrase() must be of the type string, null given, called in /home/xxxxxx/public_html/src/XF/Template/Templater.php on line 3456
  • src/XF/Template/Templater.php:447

Stack trace​


#0 src/XF/Template/Templater.php(3456): XF\Template\Templater->phrase(NULL, Array)
#1 [internal function]: XF\Template\Templater->fnPhraseDynamic(Object(MaZ\AMP\XF\Template\XF22\Templater), true, NULL)
#2 src/XF/Template/Templater.php(1121): call_user_func_array(Array, Array)
#3 internal_data/code_cache/templates/l1/s107/public/ozzmodz_badges_featured_badges_macros.php(52): XF\Template\Templater->func('phrase_dynamic', Array, true)
#4 src/XF/Template/Templater.php(817): XF\Template\Templater->{closure}(Object(MaZ\AMP\XF\Template\XF22\Templater), Array, NULL)
#5 src/addons/MaZ/AMP/XF/Template/Templater.php(139): XF\Template\Templater->callMacro('ozzmodz_badges_...', 'featured_badges', Array, Array, Object(XF\Template\MacroState))
#6 internal_data/code_cache/templates/l1/s107/public/message_macros.php(53): MaZ\AMP\XF\Template\Templater->callMacro('ozzmodz_badges_...', 'featured_badges', Array, Array)
#7 src/XF/Template/Templater.php(817): XF\Template\Templater->{closure}(Object(MaZ\AMP\XF\Template\XF22\Templater), Array, NULL)
#8 src/addons/MaZ/AMP/XF/Template/Templater.php(139): XF\Template\Templater->callMacro('message_macros', 'user_info', Array, Array, Object(XF\Template\MacroState))
#9 internal_data/code_cache/templates/l1/s107/public/post_macros.php(35): MaZ\AMP\XF\Template\Templater->callMacro('message_macros', 'user_info', Array, Array)
#10 src/XF/Template/Templater.php(980): XF\Template\Templater->{closure}(Object(MaZ\AMP\XF\Template\XF22\Templater), Array, Object(XF\Template\ExtensionSet))
#11 src/XF/Template/Templater.php(916): XF\Template\Templater->renderExtensionInternal('user_cell', Array, Array, Object(XF\Template\ExtensionSet))
#12 internal_data/code_cache/templates/l1/s107/public/post_macros.php(156): XF\Template\Templater->renderExtension('user_cell', Array, Object(XF\Template\ExtensionSet))
#13 src/XF/Template/Templater.php(980): XF\Template\Templater->{closure}(Object(MaZ\AMP\XF\Template\XF22\Templater), Array, Object(XF\Template\ExtensionSet))
#14 src/XF/Template/Templater.php(916): XF\Template\Templater->renderExtensionInternal('full_body', Array, Array, Object(XF\Template\ExtensionSet))
#15 internal_data/code_cache/templates/l1/s107/public/post_macros.php(192): XF\Template\Templater->renderExtension('full_body', Array, Object(XF\Template\ExtensionSet))
#16 src/XF/Template/Templater.php(817): XF\Template\Templater->{closure}(Object(MaZ\AMP\XF\Template\XF22\Templater), Array, Object(XF\Template\ExtensionSet))
#17 src/addons/MaZ/AMP/XF/Template/Templater.php(139): XF\Template\Templater->callMacro('post_macros', 'post', Array, Array, Object(XF\Template\MacroState))
#18 internal_data/code_cache/templates/l1/s107/public/thread_view.php(913): MaZ\AMP\XF\Template\Templater->callMacro(NULL, 'post_macros::po...', Array, Array)
#19 src/XF/Template/Templater.php(1644): XF\Template\Templater->{closure}(Object(MaZ\AMP\XF\Template\XF22\Templater), Array, Object(XF\Template\ExtensionSet))
#20 src/addons/MaZ/AMP/XF/Template/XF22/Templater.php(52): XF\Template\Templater->renderTemplate('thread_view', Array, true, NULL)
#21 src/XF/Template/Template.php(24): MaZ\AMP\XF\Template\XF22\Templater->renderTemplate('public:thread_v...', Array)
#22 src/XF/Mvc/Renderer/Html.php(48): XF\Template\Template->render()
#23 src/XF/Mvc/Dispatcher.php(458): XF\Mvc\Renderer\Html->renderView('XF:Thread\\View', 'public:thread_v...', Array)
#24 src/XF/Mvc/Dispatcher.php(440): XF\Mvc\Dispatcher->renderView(Object(XF\Mvc\Renderer\Html), Object(XF\Mvc\Reply\View))
#25 src/XF/Mvc/Dispatcher.php(400): XF\Mvc\Dispatcher->renderReply(Object(XF\Mvc\Renderer\Html), Object(XF\Mvc\Reply\View))
#26 src/XF/Mvc/Dispatcher.php(58): XF\Mvc\Dispatcher->render(Object(XF\Mvc\Reply\View), 'html')
#27 src/XF/App.php(2344): XF\Mvc\Dispatcher->run()
#28 src/XF.php(512): XF\App->run()
#29 index.php(20): XF::runApp('XF\\Pub\\App')
#30 {main}

Request state​


array(4) {
["url"] => string(39) "/threads/the-community-thread.26/page-2"
["referrer"] => string(55) "https://xxxxxx/threads/the-community-thread.26/"
["_GET"] => array(0) {
}
["_POST"] => array(0) {
}
}


Any idea what would be causing this?
 

btmgreg

Well-known member
I keep getting these errors - It seems to be a conflict with the uprade/import of the old addon?

Code:
InvalidArgumentException: Error rendering widget: Unknown column cmtv_badges_badge_count on XF:User src/XF/Mvc/Entity/Finder.php:1640

Stack trace -

Code:
#0 src/XF/Mvc/Entity/Finder.php(603): XF\Mvc\Entity\Finder->resolveFieldToTableAndColumn('cmtv_badges_bad...', true)
#1 src/XF/Mvc/Entity/Finder.php(1014): XF\Mvc\Entity\Finder->columnSqlName('cmtv_badges_bad...', true)
#2 src/addons/CMTV/Badges/MemberStat/MostBadges.php(18): XF\Mvc\Entity\Finder->order('cmtv_badges_bad...', 'DESC')
#3 [internal function]: CMTV\Badges\MemberStat\MostBadges::getBadgeUsers(Object(XF\Entity\MemberStat), Object(NF\Calendar\XF\Finder\User))
#4 src/XF/Service/MemberStat/Preparer.php(138): call_user_func_array(Array, Array)
#5 src/XF/Service/MemberStat/Preparer.php(201): XF\Service\MemberStat\Preparer->applyCallback('CMTV\\Badges\\Mem...', 'getBadgeUsers', Object(NF\Calendar\XF\Finder\User))
#6 src/XF/Service/MemberStat/Preparer.php(101): XF\Service\MemberStat\Preparer->getResultsData()
#7 src/XF/Entity/MemberStat.php(122): XF\Service\MemberStat\Preparer->getResults(true)
#8 src/XF/Widget/MemberStat.php(44): XF\Entity\MemberStat->getResults(true)
#9 internal_data/code_cache/widgets/_36_membersstat.php(5): XF\Widget\MemberStat->render()
#10 src/XF/Template/Templater.php(7472): XF\SubContainer\Widget->{closure}(Object(MaZ\AMP\XF\Template\XF22\Templater), Array, Array)
#11 src/XF/SubContainer/Widget.php(168): XF\Template\Templater->renderWidgetClosure(Object(Closure), Array)
#12 src/XF/Template/Templater.php(1903): XF\SubContainer\Widget->getCompiledWidget(Array, Array)
#13 internal_data/code_cache/templates/l1/s17/public/forum_list.php(219): XF\Template\Templater->widgetPosition('forum_list_side...', Array)
#14 src/XF/Template/Templater.php(1628): XF\Template\Templater->{closure}(Object(MaZ\AMP\XF\Template\XF22\Templater), Array, NULL)
#15 src/addons/MaZ/AMP/XF/Template/XF22/Templater.php(52): XF\Template\Templater->renderTemplate('forum_list', Array, true, NULL)
#16 src/XF/Template/Template.php(24): MaZ\AMP\XF\Template\XF22\Templater->renderTemplate('public:forum_li...', Array)
#17 src/XF/Mvc/Renderer/Html.php(48): XF\Template\Template->render()
#18 src/XF/Mvc/Dispatcher.php(458): XF\Mvc\Renderer\Html->renderView('XF:Forum\\Listin...', 'public:forum_li...', Array)
#19 src/XF/Mvc/Dispatcher.php(440): XF\Mvc\Dispatcher->renderView(Object(XF\Mvc\Renderer\Html), Object(XF\Mvc\Reply\View))
#20 src/XF/Mvc/Dispatcher.php(400): XF\Mvc\Dispatcher->renderReply(Object(XF\Mvc\Renderer\Html), Object(XF\Mvc\Reply\View))
#21 src/XF/Mvc/Dispatcher.php(58): XF\Mvc\Dispatcher->render(Object(XF\Mvc\Reply\View), 'html')
#22 src/XF/App.php(2337): XF\Mvc\Dispatcher->run()
#23 src/XF.php(488): XF\App->run()
#24 index.php(20): XF::runApp('XF\\Pub\\App')
#25 {main}

Thanks
 

yodiceman

Member
I would like to issue a badge for each year a member has been registered on our forum. I've created a badge category called 'Tenure'. What I want to know is if they are awarded a 2-year badge if it's possible for the 1-year to not show. Right now, both badges are shown.
@Ozzy47 is this possible?
 

Ozzy47

Well-known member
Hey @Ozzy47, seeing an error every few minutes when i have this enabled.
Code below.

  • TypeError: Macro public_ozzmodz_badges_featured_badges_macros :: featured_badges() error: Argument 1 passed to XF\Template\Templater phrase() must be of the type string, null given, called in /home/xxxxxx/public_html/src/XF/Template/Templater.php on line 3456
  • src/XF/Template/Templater.php:447

Stack trace​


#0 src/XF/Template/Templater.php(3456): XF\Template\Templater->phrase(NULL, Array)
#1 [internal function]: XF\Template\Templater->fnPhraseDynamic(Object(MaZ\AMP\XF\Template\XF22\Templater), true, NULL)
#2 src/XF/Template/Templater.php(1121): call_user_func_array(Array, Array)
#3 internal_data/code_cache/templates/l1/s107/public/ozzmodz_badges_featured_badges_macros.php(52): XF\Template\Templater->func('phrase_dynamic', Array, true)
#4 src/XF/Template/Templater.php(817): XF\Template\Templater->{closure}(Object(MaZ\AMP\XF\Template\XF22\Templater), Array, NULL)
#5 src/addons/MaZ/AMP/XF/Template/Templater.php(139): XF\Template\Templater->callMacro('ozzmodz_badges_...', 'featured_badges', Array, Array, Object(XF\Template\MacroState))
#6 internal_data/code_cache/templates/l1/s107/public/message_macros.php(53): MaZ\AMP\XF\Template\Templater->callMacro('ozzmodz_badges_...', 'featured_badges', Array, Array)
#7 src/XF/Template/Templater.php(817): XF\Template\Templater->{closure}(Object(MaZ\AMP\XF\Template\XF22\Templater), Array, NULL)
#8 src/addons/MaZ/AMP/XF/Template/Templater.php(139): XF\Template\Templater->callMacro('message_macros', 'user_info', Array, Array, Object(XF\Template\MacroState))
#9 internal_data/code_cache/templates/l1/s107/public/post_macros.php(35): MaZ\AMP\XF\Template\Templater->callMacro('message_macros', 'user_info', Array, Array)
#10 src/XF/Template/Templater.php(980): XF\Template\Templater->{closure}(Object(MaZ\AMP\XF\Template\XF22\Templater), Array, Object(XF\Template\ExtensionSet))
#11 src/XF/Template/Templater.php(916): XF\Template\Templater->renderExtensionInternal('user_cell', Array, Array, Object(XF\Template\ExtensionSet))
#12 internal_data/code_cache/templates/l1/s107/public/post_macros.php(156): XF\Template\Templater->renderExtension('user_cell', Array, Object(XF\Template\ExtensionSet))
#13 src/XF/Template/Templater.php(980): XF\Template\Templater->{closure}(Object(MaZ\AMP\XF\Template\XF22\Templater), Array, Object(XF\Template\ExtensionSet))
#14 src/XF/Template/Templater.php(916): XF\Template\Templater->renderExtensionInternal('full_body', Array, Array, Object(XF\Template\ExtensionSet))
#15 internal_data/code_cache/templates/l1/s107/public/post_macros.php(192): XF\Template\Templater->renderExtension('full_body', Array, Object(XF\Template\ExtensionSet))
#16 src/XF/Template/Templater.php(817): XF\Template\Templater->{closure}(Object(MaZ\AMP\XF\Template\XF22\Templater), Array, Object(XF\Template\ExtensionSet))
#17 src/addons/MaZ/AMP/XF/Template/Templater.php(139): XF\Template\Templater->callMacro('post_macros', 'post', Array, Array, Object(XF\Template\MacroState))
#18 internal_data/code_cache/templates/l1/s107/public/thread_view.php(913): MaZ\AMP\XF\Template\Templater->callMacro(NULL, 'post_macros::po...', Array, Array)
#19 src/XF/Template/Templater.php(1644): XF\Template\Templater->{closure}(Object(MaZ\AMP\XF\Template\XF22\Templater), Array, Object(XF\Template\ExtensionSet))
#20 src/addons/MaZ/AMP/XF/Template/XF22/Templater.php(52): XF\Template\Templater->renderTemplate('thread_view', Array, true, NULL)
#21 src/XF/Template/Template.php(24): MaZ\AMP\XF\Template\XF22\Templater->renderTemplate('public:thread_v...', Array)
#22 src/XF/Mvc/Renderer/Html.php(48): XF\Template\Template->render()
#23 src/XF/Mvc/Dispatcher.php(458): XF\Mvc\Renderer\Html->renderView('XF:Thread\\View', 'public:thread_v...', Array)
#24 src/XF/Mvc/Dispatcher.php(440): XF\Mvc\Dispatcher->renderView(Object(XF\Mvc\Renderer\Html), Object(XF\Mvc\Reply\View))
#25 src/XF/Mvc/Dispatcher.php(400): XF\Mvc\Dispatcher->renderReply(Object(XF\Mvc\Renderer\Html), Object(XF\Mvc\Reply\View))
#26 src/XF/Mvc/Dispatcher.php(58): XF\Mvc\Dispatcher->render(Object(XF\Mvc\Reply\View), 'html')
#27 src/XF/App.php(2344): XF\Mvc\Dispatcher->run()
#28 src/XF.php(512): XF\App->run()
#29 index.php(20): XF::runApp('XF\\Pub\\App')
#30 {main}

Request state​


array(4) {
["url"] => string(39) "/threads/the-community-thread.26/page-2"
["referrer"] => string(55) "https://xxxxxx/threads/the-community-thread.26/"
["_GET"] => array(0) {
}
["_POST"] => array(0) {
}
}


Any idea what would be causing this?
I keep getting these errors - It seems to be a conflict with the uprade/import of the old addon?

Code:
InvalidArgumentException: Error rendering widget: Unknown column cmtv_badges_badge_count on XF:User src/XF/Mvc/Entity/Finder.php:1640

Stack trace -

Code:
#0 src/XF/Mvc/Entity/Finder.php(603): XF\Mvc\Entity\Finder->resolveFieldToTableAndColumn('cmtv_badges_bad...', true)
#1 src/XF/Mvc/Entity/Finder.php(1014): XF\Mvc\Entity\Finder->columnSqlName('cmtv_badges_bad...', true)
#2 src/addons/CMTV/Badges/MemberStat/MostBadges.php(18): XF\Mvc\Entity\Finder->order('cmtv_badges_bad...', 'DESC')
#3 [internal function]: CMTV\Badges\MemberStat\MostBadges::getBadgeUsers(Object(XF\Entity\MemberStat), Object(NF\Calendar\XF\Finder\User))
#4 src/XF/Service/MemberStat/Preparer.php(138): call_user_func_array(Array, Array)
#5 src/XF/Service/MemberStat/Preparer.php(201): XF\Service\MemberStat\Preparer->applyCallback('CMTV\\Badges\\Mem...', 'getBadgeUsers', Object(NF\Calendar\XF\Finder\User))
#6 src/XF/Service/MemberStat/Preparer.php(101): XF\Service\MemberStat\Preparer->getResultsData()
#7 src/XF/Entity/MemberStat.php(122): XF\Service\MemberStat\Preparer->getResults(true)
#8 src/XF/Widget/MemberStat.php(44): XF\Entity\MemberStat->getResults(true)
#9 internal_data/code_cache/widgets/_36_membersstat.php(5): XF\Widget\MemberStat->render()
#10 src/XF/Template/Templater.php(7472): XF\SubContainer\Widget->{closure}(Object(MaZ\AMP\XF\Template\XF22\Templater), Array, Array)
#11 src/XF/SubContainer/Widget.php(168): XF\Template\Templater->renderWidgetClosure(Object(Closure), Array)
#12 src/XF/Template/Templater.php(1903): XF\SubContainer\Widget->getCompiledWidget(Array, Array)
#13 internal_data/code_cache/templates/l1/s17/public/forum_list.php(219): XF\Template\Templater->widgetPosition('forum_list_side...', Array)
#14 src/XF/Template/Templater.php(1628): XF\Template\Templater->{closure}(Object(MaZ\AMP\XF\Template\XF22\Templater), Array, NULL)
#15 src/addons/MaZ/AMP/XF/Template/XF22/Templater.php(52): XF\Template\Templater->renderTemplate('forum_list', Array, true, NULL)
#16 src/XF/Template/Template.php(24): MaZ\AMP\XF\Template\XF22\Templater->renderTemplate('public:forum_li...', Array)
#17 src/XF/Mvc/Renderer/Html.php(48): XF\Template\Template->render()
#18 src/XF/Mvc/Dispatcher.php(458): XF\Mvc\Renderer\Html->renderView('XF:Forum\\Listin...', 'public:forum_li...', Array)
#19 src/XF/Mvc/Dispatcher.php(440): XF\Mvc\Dispatcher->renderView(Object(XF\Mvc\Renderer\Html), Object(XF\Mvc\Reply\View))
#20 src/XF/Mvc/Dispatcher.php(400): XF\Mvc\Dispatcher->renderReply(Object(XF\Mvc\Renderer\Html), Object(XF\Mvc\Reply\View))
#21 src/XF/Mvc/Dispatcher.php(58): XF\Mvc\Dispatcher->render(Object(XF\Mvc\Reply\View), 'html')
#22 src/XF/App.php(2337): XF\Mvc\Dispatcher->run()
#23 src/XF.php(488): XF\App->run()
#24 index.php(20): XF::runApp('XF\\Pub\\App')
#25 {main}

Thanks

Please try,
Manual cache rebuild required by adding or edit some badge.
Also to run "[OzzModz] Badges: Rebuild user badge cache" rebuild job.

That should solve the errors.
 

maxpower

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.
Agree with all these. Please allow repeating badges or even show number of times issued (x1,x5, etc) to a member
 

interforo

Active member
Feature request: can you add the option to hide certain badges if you receive one?
For example, I got 3 badges for users that are on the forum for 5-10-15 years

I'd like the ones who get the 15 years to not show 5 and 10 anymore
 

interforo

Active member
I get a lot of these errors

  • TypeError: Macro public:eek:zzmodz_badges_featured_badges_macros :: featured_badges() error: Argument 1 passed to XF\Template\Templater::phrase() must be of the type string, null given, called in /home/interfan/public_html/forum/src/XF/Template/Templater.php on line 3473
  • src/XF/Template/Templater.php:454
 
Top