XF 1.1 Problem: How to remove likes from a user?

MrC

Active member
I am using a trophy system based on likes. And some users kept creating new accounts and liked every post on my forums. I am not sure if they were aiming to "destroy" the trophy system or doing it for "fun"!

So I used the spam button. But it did not remove likes from the users.
Is there any query I can use to solve this?

Cheers
 
You can manually adjust the Like count for individual users in the ACP.

You can't easily remove the Likes from the content though.

Personally speaking I would warn the users and if that doesn't stop them, take further action.
 
I need a way to mass remove Likes from content. Otherwise I will have to manually adjust like counts for all members who posted on the forums and liked by the spammers. The "spammers" would create new accounts and like all posts again (until I stop them temporarily by Ip ban).

PS: the users did not aim to increase their own account's like counts. They aimed to increase all members's like counts and hence making the like system useless.
 
Run this query to delete the likes given by the specified user_id:

Rich (BB code):
DELETE
FROM xf_liked_content
WHERE like_user_id = 2;

Then run this query to recalculate the like_count for all users (big query, might take some time):

Code:
UPDATE xf_user AS u
SET like_count = (
	SELECT COUNT(*)
	FROM xf_liked_content AS lc
	WHERE lc.content_user_id = u.user_id
	GROUP BY lc.content_user_id
);

This will correct the user like counts, but it won't correct the like counts in the posts themselves.
 
Thanks a lot Jake, I will try it in off peak times. I think the troublesome members will stop doing that when they know that "I" know how to deal with the problem.
 
Top Bottom