Content Ratings

Content Ratings [Paid] 2.7.6

No permission to buy ($35.00)
Some icon sets (i.e. a series of icons with the same styling) would be preferable but not sure what people are currently using.
 
I am facing a little problem with the number of likes for each user.

I tried rebuilding the cache for the likes count but still, my likes count for example, decreased by 80%.

Anything i should do to fix this?
 
Rebuilding the Like count can result in reduced counts, because it actually counts Likes recorded by the user. Hard deleted content will cause this value to be reduced. (or if the count has been manually fiddled with, or imported from an old system).

I've got some fixes where it may lose trace of ratings/likes when doing the recount. But this isn't going to make the number dramatically different.
 
Rebuilding the Like count can result in reduced counts, because it actually counts Likes recorded by the user. Hard deleted content will cause this value to be reduced. (or if the count has been manually fiddled with, or imported from an old system).

I've got some fixes where it may lose trace of ratings/likes when doing the recount. But this isn't going to make the number dramatically different.
So what should i do to fix this?
 
So what should i do to fix this?
Do you have a database backup? This is kinda "by design" that doing a user rating re-count, Like totals received can be adjusted.

The process does take some time.

Only the user given recount is kicked off on update purely for this reason. It actually needs to be kicked off after a clean install too, but that is missing.
 
Do you have a database backup? This is kinda "by design" that doing a user rating re-count, Like totals received can be adjusted.

The process does take some time.

Only the user given recount is kicked off on update purely for this reason. It actually needs to be kicked off after a clean install too, but that is missing.
Yes i have a database backup, how will this help?

I cannot restore the whole database though.
 
Just to make things clearer here @Xon;

Ratings were reduced from 10,000 to 2,000 ... not by a small amount. I am not sure what caused this, but this is before i did the post rating cache rebuild.

I hope there is a solution for this because this really sucks :)
 
Xon updated Content Ratings for XF2 with a new update entry:

1.0.0 - Release

1.0.0 release, as this has been production ready for most of the 0.14.x release version.


Changes from 0.14.4
  • Harden rating rebuild counts to prevent losing ratings when performing a rebuild (slightly slower)
  • Add warning that rating totals can be reduced when running rebuild tasks.
    • Option to allow rating totals to be decreased on a rebuild, disabled by default.
  • Ensure rebuild task correctly rebuilds Given Like totals.

Read the rest of this update entry...
 
Regarding this setting:
  • Not visible & usable - only the person giving the rating can see their own rating, allowing a "private rating"
Should you be able to see your own rating on a post? Where the other ratings appear? It seems to be hidden to me, even though I made the vote. I can see the link to remove my rating but not the 'invisible' rating I've left. So does this setting mean it is hidden for everyone?
 
Regarding this setting:
  • Not visible & usable - only the person giving the rating can see their own rating, allowing a "private rating"
Should you be able to see your own rating on a post? Where the other ratings appear? It seems to be hidden to me, even though I made the vote. I can see the link to remove my rating but not the 'invisible' rating I've left. So does this setting mean it is hidden for everyone?
It should allow the user to see their own rating, but not others. I'm guessing this function got broken at some stage.
 
Last edited:
Ah, OK. Yes, it seems to be hidden for me as well (the person leaving the rating).
The visibility flag isn't properly respected atm, I'll push out a fix soon-ish.

Currently in is bugged in the following ways:
  • If a user has issued a rating, it leaks to other users who have issued the same rating.
    • via the per-content category breakdowns
    • via the per-content rating list
  • You can't see your own ratings
 
The visibility flag isn't properly respected atm, I'll push out a fix soon-ish.

Currently in is bugged in the following ways:
  • If a user has issued a rating, it leaks to other users who have issued the same rating.
    • via the per-content category breakdowns
    • via the per-content rating list
  • You can't see your own ratings

OK, thanks.

Another query....

I can't see it now but in the add-on description, was there a mention of using ratings to hide posts? If so, is this still something you're still intending to add?
 
I've also just discovered a server error.

I'm using some code in my thread_list_macros template. This seems to be causing some issues with this add-on...

Code:
Server error log
[LIST]
[*]ErrorException: Template error: Illegal string offset 'node_id'
[*]internal_data/code_cache/templates/l1/s24/public/thread_list_macros.php:302
[*]Generated by: Case
[*]30 Jan 2018 at 3:30 PM
[/LIST]
Stack trace
#0 internal_data/code_cache/templates/l1/s24/public/thread_list_macros.php(302): XF\Template\Templater->handleTemplateError(2, 'Illegal string ...', '/srv/users/serv...', 302, Array)
#1 src/XF/Template/Templater.php(643): XF\Template\Templater->{closure}(Object(SV\ContentRatings\XF\Template\Templater), Array, Array)
#2 internal_data/code_cache/templates/l1/s24/public/wntpl_widget_new_threads_prefix_limit.php(28): XF\Template\Templater->callMacro('thread_list_mac...', 'item', Array, Array)
#3 src/XF/Template/Templater.php(1230): XF\Template\Templater->{closure}(Object(SV\ContentRatings\XF\Template\Templater), Array)
#4 src/XF/Widget/WidgetRenderer.php(62): XF\Template\Templater->renderTemplate('wntpl_widget_ne...', Array)
#5 src/XF/Widget/WidgetRenderer.php(67): XF\Widget\WidgetRenderer->render()
#6 src/XF/Template/Templater.php(1506): XF\Widget\WidgetRenderer->__toString()
#7 internal_data/code_cache/templates/l1/s24/public/forum_list.php(209): XF\Template\Templater->widgetPosition('forum_list_abov...', Array)
#8 src/XF/Template/Templater.php(1230): XF\Template\Templater->{closure}(Object(SV\ContentRatings\XF\Template\Templater), Array)
#9 src/XF/Template/Template.php(24): XF\Template\Templater->renderTemplate('forum_list', Array)
#10 src/XF/Mvc/Renderer/Html.php(48): XF\Template\Template->render()
#11 src/XF/Mvc/Dispatcher.php(332): XF\Mvc\Renderer\Html->renderView('XF:Forum\\Listin...', 'public:forum_li...', Array)
#12 src/XF/Mvc/Dispatcher.php(303): XF\Mvc\Dispatcher->renderView(Object(XF\Mvc\Renderer\Html), Object(XF\Mvc\Reply\View))
#13 src/XF/Mvc/Dispatcher.php(44): XF\Mvc\Dispatcher->render(Object(XF\Mvc\Reply\View), 'html')
#14 src/XF/App.php(1880): XF\Mvc\Dispatcher->run()
#15 src/XF.php(328): XF\App->run()
#16 index.php(13): XF::runApp('XF\\Pub\\App')
#17 {main}
Request state
array(4) {
["url"] => string(8) "/forum2/"
["referrer"] => string(67) "https://<removed>/forum2/threads/hide-rating.22241/"
["_GET"] => array(0) {
}
["_POST"] => array(0) {
}
}
 
I can't see it now but in the add-on description, was there a mention of using ratings to hide posts? If so, is this still something you're still intending to add?
This is planned for 1.1.x, it isn't yet implemented.

I've also just discovered a server error.

I'm using some code in my thread_list_macros template. This seems to be causing some issues with this add-on...

Code:
Server error log
[LIST]
[*]ErrorException: Template error: Illegal string offset 'node_id'
[*]internal_data/code_cache/templates/l1/s24/public/thread_list_macros.php:302
[*]Generated by: Case
[*]30 Jan 2018 at 3:30 PM
[/LIST]
Stack trace
#0 internal_data/code_cache/templates/l1/s24/public/thread_list_macros.php(302): XF\Template\Templater->handleTemplateError(2, 'Illegal string ...', '/srv/users/serv...', 302, Array)
#1 src/XF/Template/Templater.php(643): XF\Template\Templater->{closure}(Object(SV\ContentRatings\XF\Template\Templater), Array, Array)
#2 internal_data/code_cache/templates/l1/s24/public/wntpl_widget_new_threads_prefix_limit.php(28): XF\Template\Templater->callMacro('thread_list_mac...', 'item', Array, Array)
#3 src/XF/Template/Templater.php(1230): XF\Template\Templater->{closure}(Object(SV\ContentRatings\XF\Template\Templater), Array)
#4 src/XF/Widget/WidgetRenderer.php(62): XF\Template\Templater->renderTemplate('wntpl_widget_ne...', Array)
#5 src/XF/Widget/WidgetRenderer.php(67): XF\Widget\WidgetRenderer->render()
#6 src/XF/Template/Templater.php(1506): XF\Widget\WidgetRenderer->__toString()
#7 internal_data/code_cache/templates/l1/s24/public/forum_list.php(209): XF\Template\Templater->widgetPosition('forum_list_abov...', Array)
#8 src/XF/Template/Templater.php(1230): XF\Template\Templater->{closure}(Object(SV\ContentRatings\XF\Template\Templater), Array)
#9 src/XF/Template/Template.php(24): XF\Template\Templater->renderTemplate('forum_list', Array)
#10 src/XF/Mvc/Renderer/Html.php(48): XF\Template\Template->render()
#11 src/XF/Mvc/Dispatcher.php(332): XF\Mvc\Renderer\Html->renderView('XF:Forum\\Listin...', 'public:forum_li...', Array)
#12 src/XF/Mvc/Dispatcher.php(303): XF\Mvc\Dispatcher->renderView(Object(XF\Mvc\Renderer\Html), Object(XF\Mvc\Reply\View))
#13 src/XF/Mvc/Dispatcher.php(44): XF\Mvc\Dispatcher->render(Object(XF\Mvc\Reply\View), 'html')
#14 src/XF/App.php(1880): XF\Mvc\Dispatcher->run()
#15 src/XF.php(328): XF\App->run()
#16 index.php(13): XF::runApp('XF\\Pub\\App')
#17 {main}
Request state
array(4) {
["url"] => string(8) "/forum2/"
["referrer"] => string(67) "https://<removed>/forum2/threads/hide-rating.22241/"
["_GET"] => array(0) {
}
["_POST"] => array(0) {
}
}
Can you PM me the contents of internal_data/code_cache/templates/l1/s24/public/thread_list_macros.php and the thread_list_macros you've edited?

XF2 lacks the ability to show all templates modifications applied to a template, which is rather frustrating.

Note; this add-on doesn't touch the thread_list_macros template. But that doesn't mean it isn't breaking somehow
 
Last edited:
Xon updated Content Ratings for XF2 with a new update entry:

1.0.1 - Bugfix update

  • Tweaks for rating building to reduce deadlocks
  • Fix cases where a non-visible rating would leak when the viewer has also issued rated the content with the same type.
    • For a usable but not visible rating, a user can see their own ratings.
    • Content rating lists can indicate via the category grouping overall percentage IF there are multiple categories. ie; positive ratings are visible but negative ratings are private.
    • Other users will not receive alerts or be able to see who gave them a...

Read the rest of this update entry...
 
Top Bottom