Content Ratings

Content Ratings [Paid] 2.7.4

No permission to buy ($35.00)
Xon updated Content Ratings for XF2.1+ with a new update entry:

2.2.10 - Maintenance & minor feature update

  • Fix that "small" and "medium" reaction icon css was not implemented (ie reactions in alerts)
    To revert, edit sv_contentratings.less in your default style and remove the &.sv-rating-type--small { ... } and &.sv-rating-type--medium { ... } blocks
  • Fix "XF template" feature did not save a value
  • Support Svg Template add-on (free) in "XF Template" feature...

Read the rest of this update entry...
 
@Xon

future request please

1- Add ability for user based permission to use rating.
2- Log rating removal
3- add user widget in user profile that link all ratings to where they were received.
 
I'm ok with the reactions as they exist in the core of XF 2.2. But I'd like to have a page with the highest rated posts from the last day, week, month, etc. Will this addon do that?
 
Is it possible to somehow require confirmation when giving a negative rating? We often get people "accidentally" clicking them so asking for confirmation (only on the negative ones) would be really helpful. I assume it's not possible though?
 
I've updated this on our test site but the ratings aren't showing up.

My log is full of these errors:

Code:
#0 src/XF/Mvc/Entity/Entity.php(115): XF\Mvc\Entity\Entity->get('sprite_css')
#1 internal_data/code_cache/templates/l1/s22/public/sv_contentratings.less.php(105): XF\Mvc\Entity\Entity->offsetGet('sprite_css')
#2 src/XF/Template/Templater.php(1644): XF\Template\Templater->{closure}(Object(SV\StandardLib\XF\Template\Templater), Array, NULL)
#3 src/XF/CssRenderer.php(331): XF\Template\Templater->renderTemplate('sv_contentratin...', Array, false)
#4 src/XF/CssRenderer.php(258): XF\CssRenderer->renderTemplate('public:sv_conte...', NULL)
#5 src/XF/CssRenderer.php(116): XF\CssRenderer->renderTemplates(Array, Array, Array)
#6 src/XF/CssWriter.php(53): XF\CssRenderer->render(Array)
#7 css.php(30): XF\CssWriter->run(Array, 22, 1, 'c5f6f274baae70b...')
#8 {main}

and

Code:
#0 [internal function]: XF\Template\Templater->handleTemplateError(512, '[E_USER_WARNING...', '/home/sites/xf....', 199, Array)
#1 src/XF/Mvc/Entity/Entity.php(199): trigger_error('Accessed unknow...', 512)
#2 src/XF/Mvc/Entity/Entity.php(115): XF\Mvc\Entity\Entity->get('sprite_css')
#3 internal_data/code_cache/templates/l1/s22/public/sv_contentratings.less.php(105): XF\Mvc\Entity\Entity->offsetGet('sprite_css')
#4 src/XF/Template/Templater.php(1644): XF\Template\Templater->{closure}(Object(SV\StandardLib\XF\Template\Templater), Array, NULL)
#5 src/XF/CssRenderer.php(331): XF\Template\Templater->renderTemplate('sv_contentratin...', Array, false)
#6 src/XF/CssRenderer.php(258): XF\CssRenderer->renderTemplate('public:sv_conte...', NULL)
#7 src/XF/CssRenderer.php(116): XF\CssRenderer->renderTemplates(Array, Array, Array)
#8 src/XF/CssWriter.php(53): XF\CssRenderer->render(Array)
#9 css.php(30): XF\CssWriter->run(Array, 22, 1, 'c5f6f274baae70b...')
#10 {main}

Do I need to somehow clear the cache in internal_data?
 
It feels like something needs rebuilding somewhere.

In my style property list, rather than nice names the properties are just their raw names:

Screenshot 2021-08-07 at 22.18.49.png
 
On this test/staging website where you have any of the debug/development flags enabled?

If so there is a horrible foot-gun where the contents of _output are used instead of _data. And debug/development can trigger partial writes to the _output folder resulting in the add-on being put into a broken state.

Remove;
src/addons/SV/ContentRatings/_output

Then rebuild the add-on, this should fix your issues.
 
On this test/staging website where you have any of the debug/development flags enabled?

If so there is a horrible foot-gun where the contents of _output are used instead of _data. And debug/development can trigger partial writes to the _output folder resulting in the add-on being put into a broken state.

Remove;
src/addons/SV/ContentRatings/_output

Then rebuild the add-on, this should fix your issues.

Yep, on the test site we have debug enabled.

How do I force a rebuild of the addon? Will a disable/re-enable do that?
 
I tried to delete some Ratings (old ones we no longer use) and it's triggering this error:

Code:
ErrorException: [E_NOTICE] Undefined offset: 11 in src/XF/Reaction/AbstractHandler.php at line 93

    XF::handlePhpError() in src/XF/Reaction/AbstractHandler.php at line 93
    XF\Reaction\AbstractHandler->updateContentReactions() in src/addons/SV/ContentRatings/XF/Repository/Reaction.php at line 578
    SV\ContentRatings\XF\Repository\Reaction->svRebuildContentReactionCache() in src/addons/SV/ContentRatings/XF/Repository/Reaction.php at line 587
    SV\ContentRatings\XF\Repository\Reaction->rebuildContentReactionCache() in src/XF/Entity/ReactionContent.php at line 202
    XF\Entity\ReactionContent->rebuildContentReactionCache() in src/XF/Entity/ReactionContent.php at line 151
    XF\Entity\ReactionContent->_postDelete() in src/addons/SV/ContentRatings/XF/Entity/ReactionContent.php at line 191
    SV\ContentRatings\XF\Entity\ReactionContent->_postDelete() in src/XF/Mvc/Entity/Entity.php at line 1648
    XF\Mvc\Entity\Entity->delete() in src/XF/Job/ReactionDelete.php at line 48
    XF\Job\ReactionDelete->run() in src/XF/Job/Manager.php at line 258
    XF\Job\Manager->runJobInternal() in src/XF/Job/Manager.php at line 200
    XF\Job\Manager->runJobEntry() in src/XF/Job/Manager.php at line 84
    XF\Job\Manager->runQueue() in src/XF/Admin/Controller/Tools.php at line 139
    XF\Admin\Controller\Tools->actionRunJob() in src/XF/Mvc/Dispatcher.php at line 350
    XF\Mvc\Dispatcher->dispatchClass() in src/XF/Mvc/Dispatcher.php at line 261
    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 2344
    XF\App->run() in src/XF.php at line 512
    XF::runApp() in admin.php at line 13

It's not a big deal as we don't need to delete them (they're already disabled) but thought it was worth reporting.
 
Yeah, deleting reaction definitions is rather yuck. You basically need todo it one-by-one very slowly.

This looks to be my code calling things wrong, but ultimately I think the XF code that is being called also needs some hardening.
 
How do I re-do it? They've all (3 of them) gone from my reaction list so in that sense it succeded. I assume this is the cron that than tidies things up.
 
Does the “remove other reactions” permission give mods the permission to remove a reaction someone added to a post or have I misinterpreted? Does it work? I’ve added the permission but don’t see any UI to remove a reaction.
 
Does the “remove other reactions” permission give mods the permission to remove a reaction someone added to a post or have I misinterpreted? Does it work? I’ve added the permission but don’t see any UI to remove a reaction.
Yes, that is what the permission is for. It also effectively requires the view reaction list permission too.

Basically; open the reaction list for some reaction on a post and there will be a number of checkboxes and a 'delete' button at the bottom.
 
Last edited:
Top Bottom