• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Can I run a query to remove likes given by poster X

Lone Wolf

Well-known member
#1
I have had a few users sign up and then sign up additional accounts and use the other accounts to give themselves tons of likes
 

Lone Wolf

Well-known member
#3
Thanks Jake. Is there any way to delete likes between certain posters. Eg delete only the likes poster A gave to poster X but not to poster Y or poster Z
 

Lone Wolf

Well-known member
#5
Is there any way to find how many likes poster X gave to poster Y?

Is it just the last query posted by jake with FIND instead of DELETE?
 

Lone Wolf

Well-known member
#12
he said SELECT * <---- you left out the *

Code:
SELECT *
FROM xf_liked_content
WHERE like_user_id = 2
AND content_user_id = 3;
Ok I tried that but now I'm getting this error...

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'LIMIT 0, 30' at line 5
 

Lone Wolf

Well-known member
#14
Are you running this via PhpMyAdmin? There is no limit clause in the above query, but try removing the semi-colon.
Yes I am and removing the semi-colon worked, thanks. But it doesn't show me the posts which were liked. All I get is a content id. How do I convert this into the liked post. I want to see what was liked.
 

Chris D

XenForo developer
Staff member
#15
The content ID is the post ID.

This query is a little bit more complete:

Code:
SELECT liked.*, post.*, thread.*
FROM xf_liked_content AS liked
INNER JOIN xf_post AS post ON
    (liked.content_id = post.post_id)
INNER JOIN xf_thread AS thread ON
    (post.thread_id = thread.thread_id)
WHERE content_type = 'post'
    AND like_user_id = 2
    AND content_user_id = 3
That will show you the entire details of the like, the entire details of the post that was liked and the entire details of the thread that post was in.
 

Lone Wolf

Well-known member
#16
Thanks Chris. The legends of your ninja xen skills are not exaggerated!

Is there any way to search xf_post for a word or phrase and then display the post content via a query
 

Chris D

XenForo developer
Staff member
#17
Code:
SELECT post.post_id, post.thread_id, post.message, thread.title
FROM xf_post AS post
INNER JOIN xf_thread AS thread ON
    (thread.thread_id = post.thread_id)
WHERE post.message LIKE '%resource%'
:)

Will display any post where the post content contains the word "resource". Will display the post_id, thread_id, message and the thread title.