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

Is there any way to exclude certain forums from likes?

Discussion in 'XenForo Questions and Support' started by Lone Wolf, Apr 4, 2012.

  1. Lone Wolf

    Lone Wolf Well-Known Member

    I have a chat forum which doesnt count towards a users posts but that doesnt stop them spamming each other with likes in that forum. Is there any way to switch likes off for a certain forum or to exclude that forum from the likes sytem?
     
  2. M@rc

    M@rc Well-Known Member

    Set the permissions for that forum so that members can't "like" a post, ;)
     
    Lone Wolf likes this.
  3. Lone Wolf

    Lone Wolf Well-Known Member

    Haha. So simple that I totally looked past it.

    Does anyone know how to run a query to remove all likes given in certain forums?
     
  4. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Code:
    DELETE lc.*
    FROM xf_liked_content AS lc
    LEFT JOIN xf_post AS p ON (p.post_id = lc.content_id)
    LEFT JOIN xf_thread AS t ON (t.thread_id = p.thread_id)
    WHERE lc.content_type = 'post'
    AND t.node_id IN (1,2,3);
    
    You need to specify the node_ids.

    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.
     
    Valhalla and Lone Wolf like this.
  5. Lone Wolf

    Lone Wolf Well-Known Member

    What would be nice if likes were still active but not counted. So you could show appreciation in the chat forum without it messing up the quality content likes count.
     
    Digital Doctor likes this.
  6. Digital Doctor

    Digital Doctor Well-Known Member

    Use the Like extension thing ? But that might not work in just one forum ?

    I think this need could make a nice addon.

    How about a "Thanks" addon ? or a Smile addon ? or a Thumbs up addon ? ... as well strip out the LIKE button in that forum.

    Maybe the word Like would be replace with a Thumbs up icon ... and clicking it would give a
     
    Lone Wolf likes this.
  7. Lone Wolf

    Lone Wolf Well-Known Member

    Does this work for subforums within that node? I have a forum which is numbered 30 but the subforums dont show any number.
     
  8. Lone Wolf

    Lone Wolf Well-Known Member

    Never mind the node numbers are available in the ACP, they just dont show in the frontend
     
  9. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Better solution to replace this step:

    https://xenforo.com/community/threa...t-profile-post-like-caches.42384/#post-457352
     
    Valhalla and Lone Wolf like this.
  10. Lone Wolf

    Lone Wolf Well-Known Member

Share This Page