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.
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.
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.Will double check that
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.
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.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?
Same as what you have.
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.Fixed that as well
Not quite sure why you're getting that, I'll keep looking into it
Just looked at recent activity again, someone liked a post, and only the the regular like showed this time, no post rating like:
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?
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');
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';
Please expand post to view the changelog
1.2.0 to 1.2.1:
- Upload contents of upload folder to forum root, overwriting all files
- Upgrade addon using addon-PostRating.xml file
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.