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

Is it possible to delete likes?

Discussion in 'General XenForo Discussion and Feedback' started by Jaxel, Jul 9, 2011.

  1. Jaxel

    Jaxel Well-Known Member

    Would it be okay if I ran this SQL?
    DELETE FROM xf_liked_content WHERE content_user_id = 792
    Would this be all that's needed to delete likes from the system? Would this be safe? Would this automatically lower the likes count of a user? Would it happen after a cron job runs? Would it happen AT ALL? Are likes even counted like that at all? Or are they simply added and subtracted from a user's profile as they happen?
  2. Rigel Kentaurus

    Rigel Kentaurus Well-Known Member

    Check Model/Like.php, method likeContent() line ~140

                        UPDATE xf_user
                        SET like_count = like_count + 1
                        WHERE user_id = ?
    So, to answer your question, that would delete the like, but it would not decrement the amount of likes from the user. Nor it would decrement on a cron job.

    There is another count in the like column of the content type. For example, the xf_post table has a likes column, same with xf_profile_post
  3. Brogan

    Brogan XenForo Moderator Staff Member

    You can manually adjust the like count of a user in the ACP, via the Profile Info tab.

Share This Page