Content Ratings

Content Ratings [Paid] 2.7.6

No permission to buy ($35.00)
I've updated the demo site to the latest release of Content Ratings and have also installed the media gallery & resource manager: https://xf2.nixfifty.com/

The latest version of Content Ratings supports XFRM and XFMG so I've sprinkled some "sample" content around with various ratings in use (a mix between font awesome and imported smilies). Feel free to have a play.

View attachment 165347
How did you insert the default font awesome thumbs up? I imagine it goes in the CSS Icon box
Code:
<span class="far fa-thumbs-up"></span>
 
How did you insert the default font awesome thumbs up? I imagine it goes in the CSS Icon box
Code:
<span class="far fa-thumbs-up"></span>
Close! In the CSS icon textbox, enter the following: fa fa-thumbs-up

That'll let you use the Font Awesome thumbs up icon. Keep in mind, you can use the same format for other Font Awesome icons too like fa fa-rocket.
 
Content Ratings 1.1.x will have improved criteria support;

1520869847356.webp

You can chain as main of the rating/rating category criteria together (AND) with operations supported being at least/at most, forgiven/received ratings/categories.

(Also supports user rating to message ratio, and specific rating to total ratings ratio)
 
I don't know if this is possible (or if it's to special). It would be great if we could have experts per forum node (maybe as a widget in the sidebar or as something that shows up in the profile).

So if someone has the most helpful ratings in a forum node (maybe time based?) he's in expert in there.
 
I haven't really looked into widget bits, it is planned for in the future. That request would be doable, but needs some work to perform well.

I'm working on the 1.1.x feature set currently, which hasn't had widgets as a priority. The major focus has been on adding more restrictions, permissions and user criteria.
 
Any thoughts on this please which I think is related to selecting "Show ratings on thread list"

  • InvalidArgumentException: Accessed unknown getter 'Likes' on XF:Thread[273287]
  • src/XF/Mvc/Entity/Entity.php:182
  • Generated by: Electromagnetic
  • Mar 5, 2018 at 3:55 PM
Stack trace
#0 src/XF/Mvc/Entity/Entity.php(95): XF\Mvc\Entity\Entity->get('Likes')
#1 src/addons/SV/ContentRatings/Entity/Ratable.php(252): XF\Mvc\Entity\Entity->__get('Likes')
#2 src/XF/Mvc/Entity/Entity.php(142): SV\ContentRatings\XF\Entity\Thread->getVisitorRating()
#3 src/XF/Mvc/Entity/Entity.php(95): XF\Mvc\Entity\Entity->get('visitor_rating')
#4 src/addons/SV/ContentRatings/Listener.php(316): XF\Mvc\Entity\Entity->__get('visitor_rating')
#5 [internal function]: SV\ContentRatings\Listener::templaterMacroPreRender(Object(SV\ContentRatings\XF\Template\Templater), 'public', 'sv_contentratin...', 'rating_bar', Array, Array)
#6 src/XF/Extension.php(50): call_user_func_array(Array, Array)
#7 src/XF/App.php(2350): XF\Extension->fire('templater_macro...', Array, 'public:sv_conte...')
#8 src/XF/Template/Templater.php(641): XF\App->fire('templater_macro...', Array, 'public:sv_conte...')
#9 internal_data/code_cache/templates/l1/s11/public/thread_list_macros_content_ratings.php(16): XF\Template\Templater->callMacro('sv_contentratin...', 'rating_bar', Array, Array)
#10 src/XF/Template/Templater.php(1246): XF\Template\Templater->{closure}(Object(SV\ContentRatings\XF\Template\Templater), Array)
#11 src/XF/Template/Templater.php(1320): XF\Template\Templater->renderTemplate('public:thread_l...', Array)
#12 internal_data/code_cache/templates/l1/s11/public/thread_list_macros.php(159): XF\Template\Templater->includeTemplate('thread_list_mac...', Array)
#13 src/XF/Template/Templater.php(659): XF\Template\Templater->{closure}(Object(SV\ContentRatings\XF\Template\Templater), Array, Array)
#14 internal_data/code_cache/templates/l1/s11/public/whats_new_posts.php(261): XF\Template\Templater->callMacro('thread_list_mac...', 'item', Array, Array)
#15 src/XF/Template/Templater.php(659): XF\Template\Templater->{closure}(Object(SV\ContentRatings\XF\Template\Templater), Array, Array)
#16 internal_data/code_cache/templates/l1/s11/public/whats_new_posts.php(383): XF\Template\Templater->callMacro(NULL, 'results', Array, Array)
#17 src/XF/Template/Templater.php(1246): XF\Template\Templater->{closure}(Object(SV\ContentRatings\XF\Template\Templater), Array)
#18 src/XF/Template/Template.php(24): XF\Template\Templater->renderTemplate('public:whats_ne...', Array)
#19 src/XF/Mvc/Renderer/Html.php(48): XF\Template\Template->render()
#20 src/XF/Mvc/Dispatcher.php(332): XF\Mvc\Renderer\Html->renderView('XF:WhatsNew\\Pos...', 'public:whats_ne...', Array)
#21 src/XF/Mvc/Dispatcher.php(303): XF\Mvc\Dispatcher->renderView(Object(XF\Mvc\Renderer\Html), Object(XF\Mvc\Reply\View))
#22 src/XF/Mvc/Dispatcher.php(44): XF\Mvc\Dispatcher->render(Object(XF\Mvc\Reply\View), 'html')
#23 src/XF/App.php(1889): XF\Mvc\Dispatcher->run()
#24 src/XF.php(328): XF\App->run()
#25 index.php(13): XF::runApp('XF\\Pub\\App')
#26 {main}

Many thanks to @Xon for solving this problem almost instantly that I provided all the information he has asked for. That level of support is pretty impressive - just like this Add On
 
Hey I'm getting a pretty nasty error which is flooding my error log like crazy (getting about 20 per second, the thing is 1.9gb now lol). Anyway the forum is slowing to a crawl because of it. I thought it might be that one of my admins had messed around with the templates but I can't see any changes made, anyway here goes:

Error message is:

Macro public:sv_contentratings_macros:rating_summary is unknown

filename
  • src/XF/Template/Templater.php:538


Trace string:

#0 [internal function]: XF\Template\Templater->handleTemplateError(512, 'Macro public:sv...', '/home/xfvtepdm/...', 538, Array)
#1 src/XF/Template/Templater.php(538): trigger_error('Macro public:sv...', 512)
#2 src/XF/Template/Templater.php(642): XF\Template\Templater->getTemplateMacro('public', 'sv_contentratin...', 'rating_summary')
#3 internal_data/code_cache/templates/l1/s17/public/sv_contentratings_message_macros_user_info_numeric.php(10): XF\Template\Templater->callMacro('sv_contentratin...', 'rating_summary', Array, Array)
#4 src/XF/Template/Templater.php(1230): XF\Template\Templater->{closure}(Object(SV\ContentRatings\XF\Template\Templater), Array)
#5 src/XF/Template/Templater.php(1304): XF\Template\Templater->renderTemplate('public:sv_conte...', Array)
#6 internal_data/code_cache/templates/l1/s17/public/message_macros.php(173): XF\Template\Templater->includeTemplate('sv_contentratin...', Array)
#7 src/XF/Template/Templater.php(643): XF\Template\Templater->{closure}(Object(SV\ContentRatings\XF\Template\Templater), Array, Array)
#8 internal_data/code_cache/templates/l1/s17/public/post_macros.php(38): XF\Template\Templater->callMacro('message_macros', 'user_info', Array, Array)
#9 src/XF/Template/Templater.php(643): XF\Template\Templater->{closure}(Object(SV\ContentRatings\XF\Template\Templater), Array, Array)
#10 internal_data/code_cache/templates/l1/s17/public/thread_view.php(580): XF\Template\Templater->callMacro('post_macros', 'post', Array, Array)
#11 src/XF/Template/Templater.php(1230): XF\Template\Templater->{closure}(Object(SV\ContentRatings\XF\Template\Templater), Array)
#12 src/XF/Template/Template.php(24): XF\Template\Templater->renderTemplate('public:thread_v...', Array)
#13 src/XF/Mvc/Renderer/Html.php(48): XF\Template\Template->render()
#14 src/XF/Mvc/Dispatcher.php(332): XF\Mvc\Renderer\Html->renderView('XF:Thread\\View', 'public:thread_v...', Array)
#15 src/XF/Mvc/Dispatcher.php(303): XF\Mvc\Dispatcher->renderView(Object(XF\Mvc\Renderer\Html), Object(XF\Mvc\Reply\View))
#16 src/XF/Mvc/Dispatcher.php(44): XF\Mvc\Dispatcher->render(Object(XF\Mvc\Reply\View), 'html')
#17 src/XF/App.php(1880): XF\Mvc\Dispatcher->run()
#18 src/XF.php(328): XF\App->run()
#19 index.php(13): XF::runApp('XF\\Pub\\App')
#20 {main}
 
Last edited:
@skullmund You will likely need to reset the template sv_contentratings_macros to default.

If that doesn't work you will need to use the "rebuild" option on the add-on.
 
Received an error today:
Code:
Server error log

    ErrorException: [E_NOTICE] Trying to get property of non-object src/addons/SV/ContentRatings/XF/Like/ProfilePost.php:38

    Generated by: Unknown account Mar 20, 2018 at 6:42 PM

Stack trace

#0 src/addons/SV/ContentRatings/XF/Like/ProfilePost.php(38): XF::handlePhpError(8, '[E_NOTICE] Tryi...', '/home/rfcom/pub...', 38, Array)
#1 src/addons/SV/ContentRatings/Pub/Controller/Ratings.php(107): SV\ContentRatings\XF\Like\ProfilePost->ratingsListSetup(Object(SV\ContentRatings\Pub\Controller\Ratings), Object(SV\ContentRatings\XF\Entity\ProfilePost), Array, NULL, Array)
#2 src/XF/Mvc/Dispatcher.php(249): SV\ContentRatings\Pub\Controller\Ratings->actionList(Object(XF\Mvc\ParameterBag))
#3 src/XF/Mvc/Dispatcher.php(88): XF\Mvc\Dispatcher->dispatchClass('SV\\ContentRatin...', 'List', 'json', Object(XF\Mvc\ParameterBag), '', Object(SV\ContentRatings\Pub\Controller\Ratings), NULL)
#4 src/XF/Mvc/Dispatcher.php(41): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#5 src/XF/App.php(1891): XF\Mvc\Dispatcher->run()
#6 src/XF.php(328): XF\App->run()
#7 index.php(13): XF::runApp('XF\\Pub\\App')
#8 {main}

Request state

array(4) {
  ["url"] => string(212) "/rating/list?content_type=profile_post&content_id=1754&rating_type_category_id=3&_xfRequestUri=%2Fmembers%2Frobinsm.107%2F&_xfWithData=1&_xfToken=1521531668%2Ced80797cd57256161af066951ee35433&_xfResponseType=json"
  ["referrer"] => string(55) "https://www.recreationalflying.com/members/robinsm.107/"
  ["_GET"] => array(7) {
    ["content_type"] => string(12) "profile_post"
    ["content_id"] => string(4) "1754"
    ["rating_type_category_id"] => string(1) "3"
    ["_xfRequestUri"] => string(21) "/members/robinsm.107/"
    ["_xfWithData"] => string(1) "1"
    ["_xfToken"] => string(43) "1521531668,ed80797cd57256161af066951ee35433"
    ["_xfResponseType"] => string(4) "json"
  }
  ["_POST"] => array(0) {
  }
}
 
I'm upgrading our live site from XF1 to XF2 tomorrow. Can someone remind me how to import the ratings from Post Ratings into this via the CLI tools?
 
I'm upgrading our live site from XF1 to XF2 tomorrow. Can someone remind me how to import the ratings from Post Ratings into this via the CLI tools?
Last time I used the importer, you start it via the GUI and then it gives you the option to complete it via the GUI or CLI. You then switch to CLI and run the command it lists.

(Recommend running inside screen or similar)
 
Cheers

I've mentioned it before but the % counter in the importer is buggy and doesn't report the right value. I don't know if that's a bug on the XF side or yours.

It starts at something like 46% and 3 thousand ratings and then goes up very slowly. 30k is no where near half of the number of ratings we have (we have millions).

- Step 4 of 4: Ratings 00:02:47 [29,779] 47.62%
 
What that is reporting is ~47% of posts have had their ratings imported. I forgot about updating it to be more accurate on what it is actually doing.

The more ratings a post has, the slow it is to import due to the scattered nature of the ratings that need to be gathered and then copied.
 
Top Bottom