Trophy Essentials

Trophy Essentials [Paid] 1.0.5

No permission to buy (£30.00)
On Admin > Batch update users
Trophy points between doesn't work as expected.

I tried to view how many users have 10k points, but it doesn't return anything.
But viewing /members/?key=m2n_most_points does return several users.
 
Feature request:
Be able to hide some cumulative trophy stats for a user from public view.

I want to hide those cumulative trophies that have negative rewards from everyone except Moderatos/Admin.
 
I got this error while rebuilding the default trophies. Is this related to this addon?
I cannot continue the rebuild.

PHP:
Server error log
XF\Db\Exception: MySQL query error [1264]: Out of range value for column 'trophy_points' at row 1 src/XF/Db/AbstractStatement.php:230
Generated by: Admin Mar 16, 2023 at 10:49 PM

Stack trace
UPDATE  `xf_user` SET `trophy_points` = ? WHERE `user_id` = 470491
------------

#0 src/XF/Db/Mysqli/Statement.php(198): XF\Db\AbstractStatement->getException('MySQL query err...', 1264, '22003')
#1 src/XF/Db/Mysqli/Statement.php(79): XF\Db\Mysqli\Statement->getException('MySQL query err...', 1264, '22003')
#2 src/XF/Db/AbstractAdapter.php(96): XF\Db\Mysqli\Statement->execute()
#3 src/XF/Db/AbstractAdapter.php(324): XF\Db\AbstractAdapter->query('UPDATE  `xf_use...', Array)
#4 src/XF/Mvc/Entity/Entity.php(1357): XF\Db\AbstractAdapter->update('xf_user', Array, '`user_id` = 470...')
#5 src/XF/Repository/Trophy.php(89): XF\Mvc\Entity\Entity->fastUpdate('trophy_points', -32)
#6 src/addons/M2N/TrophyEssentials/XF/Repository/Trophy.php(14): XF\Repository\Trophy->awardTrophyToUser(Object(XF\Entity\Trophy), Object(OzzModz\EmailWhitelist\XF\Entity\User))
#7 src/XF/Repository/Trophy.php(72): M2N\TrophyEssentials\XF\Repository\Trophy->awardTrophyToUser(Object(XF\Entity\Trophy), Object(OzzModz\EmailWhitelist\XF\Entity\User))
#8 src/XF/Job/Trophy.php(60): XF\Repository\Trophy->updateTrophiesForUser(Object(OzzModz\EmailWhitelist\XF\Entity\User), Array, Object(XF\Mvc\Entity\ArrayCollection))
#9 src/XF/Job/Manager.php(260): XF\Job\Trophy->run(30)
#10 src/XF/Job/Manager.php(202): XF\Job\Manager->runJobInternal(Array, 30)
#11 src/XF/Job/Manager.php(118): XF\Job\Manager->runJobEntry(Array, 30)
#12 src/XF/Admin/Controller/Tools.php(122): XF\Job\Manager->runByIds(Array, 30)
#13 src/XF/Mvc/Dispatcher.php(352): XF\Admin\Controller\Tools->actionRunJob(Object(XF\Mvc\ParameterBag))
#14 src/XF/Mvc/Dispatcher.php(259): XF\Mvc\Dispatcher->dispatchClass('XF:Tools', 'RunJob', Object(XF\Mvc\RouteMatch), Object(Truonglv\ImageOptimizer\XF\Admin\Controller\Tools), NULL)
#15 src/XF/Mvc/Dispatcher.php(115): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(Truonglv\ImageOptimizer\XF\Admin\Controller\Tools), NULL)
#16 src/XF/Mvc/Dispatcher.php(57): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#17 src/XF/App.php(2483): XF\Mvc\Dispatcher->run()
#18 src/XF.php(524): XF\App->run()
#19 admin.php(13): XF::runApp('XF\\Admin\\App')
#20 {main}

Request state
array(4) {
  ["url"] => string(24) "/admin.php?tools/run-job"
  ["referrer"] => string(44) "https://xf.com/admin.php?tools/run-job"
  ["_GET"] => array(1) {
    ["tools/run-job"] => string(0) ""
  }
  ["_POST"] => array(3) {
    ["_xfRedirect"] => string(54) "https://xf.com/admin.php?tools/rebuild&success=1"
    ["_xfToken"] => string(8) "********"
    ["only_ids"] => string(7) "3852159"
  }
}
 
XF\Db\Exception: MySQL query error [1264]: Out of range value for column 'trophy_points' at row 1 src/XF/Db/AbstractStatement.php:230
This happens during the rebuild of default XF trophies and the user has none-expiring warning points.
 
Is this expected?

After the add-on rebuilt the stats, the default Xenforo Most Points are off, not sorted correctly, and not the same value as the Most Trophy Points this add-on provides.

I'm aware of this note:
Yes, that's why we need to remove the Most Points list and replace it with the Most Trophy Points list.

@rdn I will investigate and get back to you on all your points.
 
  • Like
Reactions: rdn
I have some users with wrong trophy point data; how can I manually fix it?
I've already rebuilt "milestone trophy points" and "cumulative trophy points" but I still got the wrong total of points.
Milestones should have only been below 70 points.

1679105175647.png

It's not editable on the admin panel either.

Edit: Fixed after rebuilding the user's cache.
 
Last edited:
This add-on seems incompatible with forums where guest posting is allowed?
PHP:
Server error log
TypeError: M2N\TrophyEssentials\Repository\CumulativeTrophy::logCumulativeTrophyAction(): Argument #2 ($user) must be of type XF\Entity\User, null given, called in /xf.com/public/src/addons/M2N/TrophyEssentials/XF/Entity/Thread.php on line 28 src/addons/M2N/TrophyEssentials/Repository/CumulativeTrophy.php:338
Generated by: Unknown account Mar 24, 2023 at 10:50 AM
    
Stack trace
#0 src/addons/M2N/TrophyEssentials/XF/Entity/Thread.php(28): M2N\TrophyEssentials\Repository\CumulativeTrophy::logCumulativeTrophyAction('m2n_post_new_th...', NULL)
#1 src/addons/XFES/XF/Entity/Thread.php(11): M2N\TrophyEssentials\XF\Entity\Thread->_postSave()
#2 src/XF/Mvc/Entity/Entity.php(1277): XFES\XF\Entity\Thread->_postSave()
#3 src/XF/Service/Thread/Creator.php(494): XF\Mvc\Entity\Entity->save(true, false)
#4 src/XF/Service/ValidateAndSavableTrait.php(42): XF\Service\Thread\Creator->_save()
#5 src/XF/Pub/Controller/Forum.php(920): XF\Service\Thread\Creator->save()
#6 src/addons/AVForums/TagEssentials/XF/Pub/Controller/Forum.php(24): XF\Pub\Controller\Forum->actionPostThread(Object(XF\Mvc\ParameterBag))
#7 src/XF/Mvc/Dispatcher.php(352): AVForums\TagEssentials\XF\Pub\Controller\Forum->actionPostThread(Object(XF\Mvc\ParameterBag))
#8 src/XF/Mvc/Dispatcher.php(259): XF\Mvc\Dispatcher->dispatchClass('XF:Forum', 'PostThread', Object(XF\Mvc\RouteMatch), Object(SV\RedisCache\XF\Pub\Controller\Forum), NULL)
#9 src/XF/Mvc/Dispatcher.php(115): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(SV\RedisCache\XF\Pub\Controller\Forum), NULL)
#10 src/XF/Mvc/Dispatcher.php(57): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#11 src/XF/App.php(2483): XF\Mvc\Dispatcher->run()
#12 src/XF.php(524): XF\App->run()
#13 index.php(20): XF::runApp('XF\\Pub\\App')
#14 {main}
    
Request state
array(4) {
  ["url"] => string(44) "/forums/contact-us.123/post-thread"
  ["referrer"] => string(64) "https://xf.com/forums/contact-us.123/post-thread"
  ["_GET"] => array(1) {
    ["/forums/contact-us_123/post-thread"] => string(0) ""
  }
  ["_POST"] => array(11) {
    ["_xfToken"] => string(8) "********"
    ["prefix_id"] => string(1) "8"
    ["title"] => string(11) "Kontak"
    ["discussion_type"] => string(10) "discussion"
    ["message"] => string(13) "Kontak Thread"
    ["_xfUsername"] => string(12) "Kontak12aszx"
    ["cf-turnstile-response"] => string(496) "0.T1CZ_dxlZzs7oGa39AEVEzf_Yte-CPyxkg_OztecjxJ3lOoSswuu4dI1suVGUyizmlXnUKhyKta8isLDQdxbc2Y5LQetkIjNJZXgnrNH8flpEvk9QSUWLKRSxH5PaXCfUs2i4iufV8D8zWFZQbq3yfM4MEbDgYBavfsL53LgFPkub5WGHS7owbM9n3_m6YB2w5zzJFbGVuMk9RBuM09egEekr54tkvTQCQb5lMnZgctpSXZGvtKlBDxIGlMpVZcp0Ar_39OfV38uZmpcySCiaysp-M2XTHscArNF6j1FWviC_1d9Q7e23xnjihENobQ2vdySLcUPRThRG3IlATLxwGIFAabB_7yiPhGqU0CTGireJlCNJrWP9OAQ7-2CBhxhv7SDdkpnwkd20OMrfA_1RA.Ec36K-Rb9G3J588jffwxIA.15aa1c208d05cc72c36872ce9214cd7d7b3aceabfaec0f9bff2df2e6ceb2ff18"
    ["nodeId"] => string(3) "123"
    ["_xfRequestUri"] => string(44) "/forums/contact-us.123/post-thread"
    ["_xfWithData"] => string(1) "1"
    ["_xfResponseType"] => string(4) "json"
  }
}
 
This add-on seems incompatible with forums where guest posting is allowed?
PHP:
Server error log
TypeError: M2N\TrophyEssentials\Repository\CumulativeTrophy::logCumulativeTrophyAction(): Argument #2 ($user) must be of type XF\Entity\User, null given, called in /xf.com/public/src/addons/M2N/TrophyEssentials/XF/Entity/Thread.php on line 28 src/addons/M2N/TrophyEssentials/Repository/CumulativeTrophy.php:338
Generated by: Unknown account Mar 24, 2023 at 10:50 AM
   
Stack trace
#0 src/addons/M2N/TrophyEssentials/XF/Entity/Thread.php(28): M2N\TrophyEssentials\Repository\CumulativeTrophy::logCumulativeTrophyAction('m2n_post_new_th...', NULL)
#1 src/addons/XFES/XF/Entity/Thread.php(11): M2N\TrophyEssentials\XF\Entity\Thread->_postSave()
#2 src/XF/Mvc/Entity/Entity.php(1277): XFES\XF\Entity\Thread->_postSave()
#3 src/XF/Service/Thread/Creator.php(494): XF\Mvc\Entity\Entity->save(true, false)
#4 src/XF/Service/ValidateAndSavableTrait.php(42): XF\Service\Thread\Creator->_save()
#5 src/XF/Pub/Controller/Forum.php(920): XF\Service\Thread\Creator->save()
#6 src/addons/AVForums/TagEssentials/XF/Pub/Controller/Forum.php(24): XF\Pub\Controller\Forum->actionPostThread(Object(XF\Mvc\ParameterBag))
#7 src/XF/Mvc/Dispatcher.php(352): AVForums\TagEssentials\XF\Pub\Controller\Forum->actionPostThread(Object(XF\Mvc\ParameterBag))
#8 src/XF/Mvc/Dispatcher.php(259): XF\Mvc\Dispatcher->dispatchClass('XF:Forum', 'PostThread', Object(XF\Mvc\RouteMatch), Object(SV\RedisCache\XF\Pub\Controller\Forum), NULL)
#9 src/XF/Mvc/Dispatcher.php(115): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(SV\RedisCache\XF\Pub\Controller\Forum), NULL)
#10 src/XF/Mvc/Dispatcher.php(57): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#11 src/XF/App.php(2483): XF\Mvc\Dispatcher->run()
#12 src/XF.php(524): XF\App->run()
#13 index.php(20): XF::runApp('XF\\Pub\\App')
#14 {main}
   
Request state
array(4) {
  ["url"] => string(44) "/forums/contact-us.123/post-thread"
  ["referrer"] => string(64) "https://xf.com/forums/contact-us.123/post-thread"
  ["_GET"] => array(1) {
    ["/forums/contact-us_123/post-thread"] => string(0) ""
  }
  ["_POST"] => array(11) {
    ["_xfToken"] => string(8) "********"
    ["prefix_id"] => string(1) "8"
    ["title"] => string(11) "Kontak"
    ["discussion_type"] => string(10) "discussion"
    ["message"] => string(13) "Kontak Thread"
    ["_xfUsername"] => string(12) "Kontak12aszx"
    ["cf-turnstile-response"] => string(496) "0.T1CZ_dxlZzs7oGa39AEVEzf_Yte-CPyxkg_OztecjxJ3lOoSswuu4dI1suVGUyizmlXnUKhyKta8isLDQdxbc2Y5LQetkIjNJZXgnrNH8flpEvk9QSUWLKRSxH5PaXCfUs2i4iufV8D8zWFZQbq3yfM4MEbDgYBavfsL53LgFPkub5WGHS7owbM9n3_m6YB2w5zzJFbGVuMk9RBuM09egEekr54tkvTQCQb5lMnZgctpSXZGvtKlBDxIGlMpVZcp0Ar_39OfV38uZmpcySCiaysp-M2XTHscArNF6j1FWviC_1d9Q7e23xnjihENobQ2vdySLcUPRThRG3IlATLxwGIFAabB_7yiPhGqU0CTGireJlCNJrWP9OAQ7-2CBhxhv7SDdkpnwkd20OMrfA_1RA.Ec36K-Rb9G3J588jffwxIA.15aa1c208d05cc72c36872ce9214cd7d7b3aceabfaec0f9bff2df2e6ceb2ff18"
    ["nodeId"] => string(3) "123"
    ["_xfRequestUri"] => string(44) "/forums/contact-us.123/post-thread"
    ["_xfWithData"] => string(1) "1"
    ["_xfResponseType"] => string(4) "json"
  }
}
Investigating, thanks.
 
  • Like
Reactions: rdn
To celebrate the launch of Trophy Essentials, I'm offering a 50% discount for the first 10 purchasers.
Use the code trophies50 at checkout.

[Edit 7th March 2023 - thanks to all those who purchased. For anyone thinking about it, there are still a small number of discounts left.]

Thanks
Just one 50% discount voucher left if someone wants to nab it.

Am I allowed to invite people to co-fund development of a new feature?
Feature request:
Monthly Top Users with the Highest Cumulative Points (count only the points they received for the last month)

Similar to this add-on, but for total cumulative points:
@rdn is happy to chip in towards this. Just need one more person to contribute and I'll green light the development.
Everyone who contributes gets a lifetime license. Message me for info.
 
Last edited:
  • Love
Reactions: rdn
Suggestion: Different points for different kinds of threads

Like 0.50 for question-type threads, 1.00 for discussion, poll, and suggestion-type threads, and 1.50 for article-type threads.
Thanks!
 
Suggestion: Different points for different kinds of threads

Like 0.50 for question-type threads, 1.00 for discussion, poll, and suggestion-type threads, and 1.50 for article-type threads.
Thanks!
Interesting idea. What happens if this is implemented and the thread type is changed later?
And it would presumably need to support additional thread types from other addons?
In principle, I can see how article and maybe suggestion type threads might be worth more than discussion types.
But question type threads are the life blood of a forum. They are the basis for the creation of a repository of useful answers and the reason why many people visit forums in the first place. So I would think twice about valuing them less.
 
Last edited:
  • Like
Reactions: rdn
The latest version of xF (2.2.13) rounds down all the numbers on the members stats page (members/?key=m2n_most_points).

24,333 becomes 24
10,656 becomes 10
7,323 becomes 7

etc etc..

(Number is still shown correctly in their profile)
 
The latest version of xF (2.2.13) rounds down all the numbers on the members stats page (members/?key=m2n_most_points).

24,333 becomes 24
10,656 becomes 10
7,323 becomes 7

etc etc..

(Number is still shown correctly in their profile)
I noticed that. Have messaged the developer about it. Expect a fix incoming soon.
 
Thank you for this product @Stuart Wright
That's a great add-on!

I would love to see trophy points granted for posting in a specific thread.
I have added a thread "Suggestion" for my new forum. And I would like to grant trophy points for users that post in this thread and help me with the development of the forum.

Would love to see such option added.
 
Thank you for this product @Stuart Wright
That's a great add-on!

I would love to see trophy points granted for posting in a specific thread.
I have added a thread "Suggestion" for my new forum. And I would like to grant trophy points for users that post in this thread and help me with the development of the forum.

Would love to see such option added.
Kind words, thank you.
Can you be more specific about your request? Points are already awarded (by default) for posting in threads.
Are you wanting to award points to specific threads only? This would be complex and not something I would consider.
Or different points for different thread types? This is something I'd consider, but not right now. If you wanted it, you could get together with other Trophy Essentials users to fund it.
 
Last edited:
Thank you for your response, and I appreciate your willingness to help.

I am aware that your addon already awards points by default for posting in threads. However, what I am specifically looking for is the ability to grant extra trophy points to users who post in a specific thread.

The purpose of this thread, which I have titled 'Suggestion,' is to encourage users to provide feedback, suggestions, and assistance with the development of my forum. I believe that by offering trophy points as an incentive, it will motivate users to actively engage in that particular thread and contribute valuable insights to enhance the forum.

I understand that it is a lot of coding. But i just put it here as a suggestion if someday you have time for this. ;)
 
So we could have an admin option to add an additional number of points to all people who reply to a specific thread.
I'd call it bonus points, maybe.
And if you're using this to motivate people, we'd have to display a note to people that bonus points will be awarded when they reply.
Although you know that people might reply with garbage just for the points.
It's not a bad idea, but not something I would pay to code at this time. If you would like the enhancement, I can ask what the cost would be to code it. Contact me privately if you're interested in this.
 
Top Bottom