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

Add-on Amount of Posts/Threads in certain forum

Discussion in 'Resource and Add-on Requests' started by Gobee129, Sep 24, 2013.

  1. Gobee129

    Gobee129 Member

    Hey,

    I would like to see the amount of posts and/or threads, that a certain user has made on a certain forum only.

    Let's say User ABC has made 100 posts total, 50 in forum X, 30 in forum Y and 20 in forum Z. So far,I can only see his total amount of posts. Is there a way to see this distribution for the individual forums??

    I want to implement Achievements, e.g. a Gamer-Achievement, and for that I need to see how many posts a user has made on the forum "forum games", etc.

    Thx
     
  2. Rigel Kentaurus

    Rigel Kentaurus Well-Known Member

    This query will give you how many post a user has made in a particular forum

    Code:
    SELECT count(*) total
    FROM xf_post post
    INNER JOIN xf_thread thread ON post.thread_id = thread.thread_id
    WHERE
        post.user_id = <USER_ID> AND
        thread.node_id = <FORUM_ID>
    
    This is not default functionality in the forum though, you could not add this as a trophy condition
     
  3. Rigel Kentaurus

    Rigel Kentaurus Well-Known Member

    And if you say "ok, that is great, but I want to know how many posts a user has in each of the forums", this query will give you a forum -> total for a user

    Code:
    SELECT node.node_id, node.title, count(*) total
    FROM xf_post post
    INNER JOIN xf_thread thread ON post.thread_id = thread.thread_id
    INNER JOIN xf_node node ON thread.node_id = node.node_id
    WHERE
        post.user_id = 1
    GROUP BY
        node.node_id
    ORDER BY
        node.title;
    
     
  4. Gobee129

    Gobee129 Member

    okay, trophy conditon is not a problem ;)

    but what is a query?^^ I'm very new to the admin business haha so what do I do with your code?
     
  5. Rigel Kentaurus

    Rigel Kentaurus Well-Known Member

    I would say get a developer :) If you don't know what to do with it it's useless to you :) You need an add-on developer to create that logic for you, it can't be done with the software out of the box

    If your server provides PHPMyAdmin, or you can install it, you can go there, go to the SQL query section, and just run the query I just gave you, it will give you the posts a user has on a given forum :)
     
  6. Gobee129

    Gobee129 Member

    I'm not the true Admin/Server host. Can I still make it work? Install PHPMyAdmin and access the server from my pc?
     
  7. Rigel Kentaurus

    Rigel Kentaurus Well-Known Member

    Maybe, if the Mysql server is accepting remote connections. Most likely, no.
     

Share This Page