Post Ratings - taking likes to the next level [Deleted]

Does anyone know if it's possible to avoid like's being sent to recent activity when it regards a thread post? The recent activity page always ends up with 2 entries for likes.

20120331043327707.jpeg
 
I noticed a couple issues with the total ratings count for a user. You're able to add an infinite number of positive/negative ratings of a certain rating by simply opening the rating link in a new tab multiple times. Easiest way probably would be repeatedly middle clicking the link with a mouse that has that key set to open a new tab. I could increase/decrease one's rating by 100 in less than a minute. It also seems that clicking a like rating increases the rating count by 2 instead of 1. Luckily a recount solves both these issues.
 
Does anyone know if it's possible to avoid like's being sent to recent activity when it regards a thread post? The recent activity page always ends up with 2 entries for likes.

20120331043327707.jpeg

That shouldn't happen, how do your settings compare to these (disregarding opacity)?

y16a.png



I noticed a couple issues with the total ratings count for a user. You're able to add an infinite number of positive/negative ratings of a certain rating by simply opening the rating link in a new tab multiple times. Easiest way probably would be repeatedly middle clicking the link with a mouse that has that key set to open a new tab. I could increase/decrease one's rating by 100 in less than a minute. It also seems that clicking a like rating increases the rating count by 2 instead of 1. Luckily a recount solves both these issues.

Will double check that
 
Will double check that
For the first issue I mentioned, incase it saves you some time, I think the problem is from line 341 and 347 of the base model. You're using INSERT ON DUPLICATE KEY UPDATE, so if a user has previously voted it will increase the total count regardless of whether they rated or not already. I guess an extra check is required to ensure they haven't actually rated that post yet.
 
For the first issue I mentioned, incase it saves you some time, I think the problem is from line 341 of the base model. You're using INSERT ON DUPLICATE KEY UPDATE, so if a user has previously voted it will increase the total count regardless of whether they rated or not already. I guess an extra check is required to ensure they haven't actually rated that post yet.

Yeah it's fixed now ready for the next update, the issue must have been introduced when I was considering supporting multiple ratings, as the code to decrease rating counts was only running for undo rating, rather than when any previous rating existed (as extra ratings should replace the previous)
 
Yeah it's fixed now ready for the next update, the issue must have been introduced when I was considering supporting multiple ratings, as the code to decrease rating counts was only running for undo rating, rather than when any previous rating existed (as extra ratings should replace the previous)
Great. :) And oops I was just editing my post to include that this also affects line 347 as well, so both the count given and count received of the two users, but maybe you already noticed and fixed that as well.

For the other issue, were you able to confirm that a regular like (the other ratings are fine, I guess it has to do with usign both xf like system plus ratings) adds 2 points instead of 1?
 
Great. :) And oops I was just editing my post to include that this also affects line 347 as well, so both the count given and count received of the two users, but maybe you already noticed and fixed that as well.

For the other issue, were you able to confirm that a regular like (the other ratings are fine, I guess it has to do with usign both xf like system plus ratings) adds 2 points instead of 1?

Fixed that as well :)

Same as what you have. :confused:

Not quite sure why you're getting that, I'll keep looking into it
 
Fixed that as well :)



Not quite sure why you're getting that, I'll keep looking into it
was it something that was fixed in the recent update or was that just to move the template edits over to TMS? Just wondering since I'm not currently on the latest yet which utilizes TMS, I'm on the one prior.
 
Just looked at recent activity again, someone liked a post, and only the the regular like showed this time, no post rating like:

20120401035902744.jpeg

Odd...
 
Just looked at recent activity again, someone liked a post, and only the the regular like showed this time, no post rating like:

20120401035902744.jpeg

Odd...

I suspect it's a race condition of sorts when two like requests are made in quick succession, it should be fixed with the latest changes I've made which I'll be releasing soon :)
 
I've been getting reports of an oddity with Recent Activity as well...

Dual listings / Echo

dfaccee4c7.png


a81f3a2e98.png
 
Hmm, I have my own content type that uses the regular XF like system and noticed that liking content will also increase the totals of this addon. Is it possible to only count the likes of the thread content type? Maybe some people would prefer it also to count other content types, but since it's a "post rating" it makes more sense for me to leave non post likes out. Not sure how many people it would effect, but maybe have an option for which content types to include/exclude when counting the totals?
 
Hmm, I have my own content type that uses the regular XF like system and noticed that liking content will also increase the totals of this addon. Is it possible to only count the likes of the thread content type? Maybe some people would prefer it also to count other content types, but since it's a "post rating" it makes more sense for me to leave non post likes out. Not sure how many people it would effect, but maybe have an option for which content types to include/exclude when counting the totals?

That's not easily possible, but here is one alternative solution:

  1. Take a database backup, this hasn't been extensively tested.
  2. Recount ratings
  3. Change 'like rating' in the Post Ratings options to Disabled, taking note of the rating that was selected previously
  4. Run this query, replacing '1' with the ID of your like rating (can be found in the url when editing a rating):
    Code:
    insert ignore into dark_postrating (select null, content_id, like_user_id, content_user_id, 1, like_date from xf_liked_content where content_type='post');
  5. Run these queries:
    Code:
    update xf_user u set like_count = like_count - (select count(*) from xf_liked_content where content_user_id = u.user_id and content_type='post');
    delete from xf_liked_content where content_type='post';
  6. Recount ratings again
This will basically convert your previous likes into actual ratings, which will solve your problem of the positive rating total showing likes from all content types since with like rating set to disabled traditional likes are not included in the count
 
Last edited:
Hi Darkimmortal,

Can I ask for another enhancement to the next update please? At the moment you have the mod not display any negative ratings if they are deleted from the system, can you change it to also not include ratings of a particular type if they are all set to disabled? I don't want to delete anything as I may refer to or activate them at a later date and don't want to have to recreate them from scratch.

Currently disabled ratings are included in totals so it might go against the expected behaviour slightly, but on the other hand there would arguably be little point in a total if no ratings of that type were available to use...

I think the best solution is to make an option to force hide positive/neutral/negative totals separately, which I'll add in the next update :)
 
Top Bottom