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

Like posts via MySQL

Discussion in 'XenForo Development Discussions' started by Visual Studio, Oct 28, 2013.

  1. Visual Studio

    Visual Studio Member

    Is this possible because I noticed the like_users field is a blob in the database? I need a programmatic (PHP) way of adding a like to a post given 1 argument, which is the user_id.
  2. Jeremy

    Jeremy Well-Known Member

    Do you just want to increase a user's like count?
  3. Visual Studio

    Visual Studio Member

    No, I want there to be a visible like on a given post (forgot to mention that). So 2 arguments to the function post_id (post to like) and user_id (user that likes that post)
  4. Jeremy

    Jeremy Well-Known Member

    Use XenForo_Model_Like::likeContent('post', $postId, $userLikingPost['user_id']);
    Visual Studio and Jake Bunce like this.
  5. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Visual Studio likes this.
  6. Visual Studio

    Visual Studio Member

    Thanks for the quick responses, that's pretty much what I wanted (a bit easier than I thought it would be too XD)

Share This Page