Content Ratings

Content Ratings [Paid] 2.7.6

No permission to buy ($35.00)
Unfortunately i dont find any dislike or neutral votes?
So i can add funny smilies, but "Angry" makes also a like?
Is there any plan to add "neutral" and "dislike" also, please?

...

Ok, sometimes i should read the discussions before to buy. :)

  1. Something I've been asking about in Post ratings was to make all positive ratings updating the like count by 1 rather than unioning the likes and the ratings. If I like something because its funny, i use the funny rating. It's still a positive like. This allows the like count to increment on the thread to sort.
  2. Allow different ratings on first post and replies.
  3. Ranking Algorithm for thread list, using the positive and negative ratings. and score the thread.

Yes, these are the options we are used with from the "extended rating" addon for XF1.
The text is done with phrases?
 
admin.php > content > rating types > add rating type category

Make positive, neutral, and negative categories. You can assign "angry" and "dislike" to whatever categories you want.

edited
 
  • Like
Reactions: Xon
Unfortunately i dont find any dislike or neutral votes?
So i can add funny smilies, but "Angry" makes also a like?
Is there any plan to add "neutral" and "dislike" also, please?

...
You need to add your own categories, it doesn't add them by default (likely will change that).

Something I've been asking about in Post ratings was to make all positive ratings updating the like count by 1 rather than unioning the likes and the ratings. If I like something because its funny, i use the funny rating. It's still a positive like. This allows the like count to increment on the thread to sort.
This isn't supported, as the design uses the XF Like counter to track actual Likes.

Allow different ratings on first post and replies.
There is a 'first post only' flag, but no 'only on replies' flag. It would be fairly easy to add this via custom development.

Ranking Algorithm for thread list, using the positive and negative ratings. and score the thread.
The design supports running actions after a rating is applied based off categories, but it doesn't support this without custom development.

The text is done with phrases?
Yes, everything is phrased. Even the rating category titles.
 
This isn't supported, as the design uses the XF Like counter to track actual Likes.
Yes. But shure people are hungry for the options of the
https://xenforo.com/community/resources/post-ratings-taking-likes-to-the-next-level.410/
with likes, dislikes, neutral

As i understood the concept of likes we have a table, where we only save a dataset, when there is a like.
Means that XF just count the existing rows.

Then it needs only one more field "vote_value"; where we save 0,1,2 or -1,0,1
We get rid of showing the normal likes (by count rows) and query instead:
count likes for post x with value = ? [0,1,2 or -1,0,1] and have three different values to show for the post and with three more queries for the user.
Maybe the results for the user should be saved somewhere else to have them as sum of likes, dislikes, neutral. But maybe this is done anyway, so we have to add only tow more fields for neutral and dislikes.

To make it more nice, we add another field type with nothing, resource, gallery (0,1,2) and have the base for RM and GM.


I have watched the tables; here
xf_sv_rating_cache_User

you have anyway the results for different icons; so we can add the like-fields, neutrals and dislikes or we add three more fields for the sum of likes/dislikes/neutrals.

also we have xf_user.like_count; so here we could save user_like_count2 and user_like_count3 for dislikes and neutrals.

Should be no big story, i think, and everyone would be happy to have back the wonderful: post ratings also with RM and GM!
If a budget is needed to develop this, please let me know. I am shure there are more people who really, really want to have it.
 
Last edited:
I'm getting this error quite a lot

Code:
ErrorException: Template error: Cannot call method isMemberOf on a non-object (NULL)
            
src/XF/Template/Templater.php:926
            
Generated by: Unknown account
          
Jun 28, 2018 at 6:24 PM

Stack trace
      
#0 [internal function]: XF\Template\Templater->handleTemplateError(512, 'Cannot call met...', '/home/sites/spu...', 926, Array)
#1 src/XF/Template/Templater.php(926): trigger_error('Cannot call met...', 512)
#2 internal_data/code_cache/templates/l1/s15/public/post_macros.php(18): XF\Template\Templater->method(NULL, 'isMemberOf', Array)
#3 src/XF/Template/Templater.php(662): XF\Template\Templater->{closure}(Object(SV\ContentRatings\XF\Template\Templater), Array, Array)
#4 internal_data/code_cache/templates/l1/s15/public/thread_view.php(540): XF\Template\Templater->callMacro('post_macros', 'post', Array, Array)
#5 src/XF/Template/Templater.php(1249): XF\Template\Templater->{closure}(Object(SV\ContentRatings\XF\Template\Templater), Array)
#6 src/XF/Template/Template.php(24): XF\Template\Templater->renderTemplate('public:thread_v...', Array)
#7 src/XF/Mvc/Renderer/Html.php(48): XF\Template\Template->render()
#8 src/XF/Mvc/Dispatcher.php(332): XF\Mvc\Renderer\Html->renderView('XF:Thread\\View', 'public:thread_v...', Array)
#9 src/XF/Mvc/Dispatcher.php(303): XF\Mvc\Dispatcher->renderView(Object(XF\Mvc\Renderer\Html), Object(XF\Mvc\Reply\View))
#10 src/XF/Mvc/Dispatcher.php(44): XF\Mvc\Dispatcher->render(Object(XF\Mvc\Reply\View), 'html')
#11 src/XF/App.php(1931): XF\Mvc\Dispatcher->run()
#12 src/XF.php(328): XF\App->run()
#13 index.php(13): XF::runApp('XF\\Pub\\App')
#14 {main}

Any thoughts?
 
I'm getting this error quite a lot

Code:
ErrorException: Template error: Cannot call method isMemberOf on a non-object (NULL)
           
src/XF/Template/Templater.php:926
           
Generated by: Unknown account
         
Jun 28, 2018 at 6:24 PM

Stack trace
     
#0 [internal function]: XF\Template\Templater->handleTemplateError(512, 'Cannot call met...', '/home/sites/spu...', 926, Array)
#1 src/XF/Template/Templater.php(926): trigger_error('Cannot call met...', 512)
#2 internal_data/code_cache/templates/l1/s15/public/post_macros.php(18): XF\Template\Templater->method(NULL, 'isMemberOf', Array)
#3 src/XF/Template/Templater.php(662): XF\Template\Templater->{closure}(Object(SV\ContentRatings\XF\Template\Templater), Array, Array)
#4 internal_data/code_cache/templates/l1/s15/public/thread_view.php(540): XF\Template\Templater->callMacro('post_macros', 'post', Array, Array)
#5 src/XF/Template/Templater.php(1249): XF\Template\Templater->{closure}(Object(SV\ContentRatings\XF\Template\Templater), Array)
#6 src/XF/Template/Template.php(24): XF\Template\Templater->renderTemplate('public:thread_v...', Array)
#7 src/XF/Mvc/Renderer/Html.php(48): XF\Template\Template->render()
#8 src/XF/Mvc/Dispatcher.php(332): XF\Mvc\Renderer\Html->renderView('XF:Thread\\View', 'public:thread_v...', Array)
#9 src/XF/Mvc/Dispatcher.php(303): XF\Mvc\Dispatcher->renderView(Object(XF\Mvc\Renderer\Html), Object(XF\Mvc\Reply\View))
#10 src/XF/Mvc/Dispatcher.php(44): XF\Mvc\Dispatcher->render(Object(XF\Mvc\Reply\View), 'html')
#11 src/XF/App.php(1931): XF\Mvc\Dispatcher->run()
#12 src/XF.php(328): XF\App->run()
#13 index.php(13): XF::runApp('XF\\Pub\\App')
#14 {main}

Any thoughts?
Do you use conditionals statement to show something if a user is a member of a user group?
In the affected places there are content of deleted accounts?
 
isMemberOf isn't used in XF2 templates normally, and this add-on doesn't do that either. (this add-on does call isMemberOf on $visitor in non-template php-code, but the visitor object should never ever be null).

This is likely caused by content with a deleted account, or a guest post/thread interacting with another add-on
 
  • Like
Reactions: DL6
Would this from @Chris D be causing it?

Yeah under the post macro which is inside the <xf:macro name="post" ... block.

Find:
Code:
message message--post js-post
And add directly after, something like:
Code:
{{ $post.User.isMemberOf('999') ? 'your-class-name' : '' }}
And of course change 999 to whatever your specific usergroup is, and add styling to extra.less, similar to:
Less:
.your-class-name
{
    background-color: red;
}

That's the only thing I'm aware of that'd added is isMemberOf outside of the couple of popular addons we use.
 
I am doing a test upgrade from XF v1 with Luke's Post Ratings installed to XF v2 with this addon installed. I have done an import of the existing Post ratings to this one and all went ok except for the "Like" given doesn't migrate yet all the other likes given do.

It it means anything I mapped the "like in the default install to the "Like" of the import

The given Like should be around 550 but it is showing 0
1.webp
 
@ibaker this sounds like the importer givern rating count rebuild task isn't working as expected. There is a CLI rebuild tool you can use.

Code:
php cmd.php xf-rebuild:svcr-user-given-counts

Make sure "Allow rebuild operations to reduce a user's rating counts" option is unticked before running.
 
If you look on the Tools -> Rebuild Cache there should also be a "Rebuild user given rating counts" option which does the same thing.
 
Thanks for getting back to me Xon its appreciated. I posted on my birthday and went off on one lol. All I have in the options is 'default rating type' but no "add" option? maybe I need to set permissions first? I'll check now...
 
Thanks for getting back to me Xon its appreciated. I posted on my birthday and went off on one lol. All I have in the options is 'default rating type' but no "add" option? maybe I need to set permissions first? I'll check now...
The option to add default rating types is on the rating type configuration page, not in the options.
 
Top Bottom