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

How can I list liked posts ?

Discussion in 'XenForo Questions and Support' started by doli, Feb 14, 2012.

  1. doli

    doli New Member

    How can I list liked posts? I'd like to know what kind of posts people 'like', I know there are somes as it shows me likes in 'daily stats' but can't find a way to list them all ...
  2. Floris

    Floris Guest

    SELECT *
    FROM  `xf_liked_content`
    WHERE  `content_type` =  'post'
    That should give you a list of posts that have been liked.

    (Change content type to profile_post to find liked comments on profiles)

    You can use an inner join to get the 'message' field of the post_id from the xf_post table
    And another inner join to get the title of the thread to which that post belongs to.

    select everything from first table, as a, using content_id, inner join second table, as b, using post_id, where a.content_type is post.

    Soooooo, perhaps (untested)
    SELECT *
    FROM xf_liked_content a
    INNER JOIN xf_post b ON a.content_id = b.post_id
    WHERE a.content_type =  'post'
    I gave it a quick try,

    php code: (stand alone, edit to point to your xenforo database)


    note that bbcode etc isn't parsed, this is just 'brainstorming' and has no integration with the core engine of xenforo what so ever. but should get you started.
    Mikey and EQnoble like this.

Share This Page