Skip to:
Content
Pages
Categories
Search
Top
Bottom

Query for thread with no new answers.


  • robertosalemi
    Participant

    @robertosalemi

    Hi,
    I’m using the plugin WP Business Intelligence for show custom report about my blog.

    I would show the topic/thread that not have new answers from 1 month.

    For this plugin, I must write custom SQL Query.
    I studied bbPress database schema, but I can not find where the answers are saved for each thread.

    Who can help me to write my query?

    Thanks.

Viewing 3 replies - 1 through 3 (of 3 total)

  • Robin W
    Moderator

    @robin-w

    Lots of info stored against a topic in wp_postmeta and several parameters you could use, but the most obvious is

    _bbp_last_active_time

    so your sql statement would search through wp_posts for a post type of topic where postmeta post id _bbp_last_active_time was greater than a month.

    Easiest way to get you head round this is to look at a forum topic in your website that has replies, and make a note of the topic number in the heading (the #nnnn eg #15108 bit!).

    Then using phpmyadmin, go into wp_postmeta table and type the following into the sql query

    SELECT * FROM wp_postmeta WHERE post_id=15108

    where 15108 is the topic id number.

    You’ll see all the data stored against it, and the above should become clearer.

    post type is stored in the wp-posts table

    SELECT * FROM wp_posts WHERE post_type=’topic’


    robertosalemi
    Participant

    @robertosalemi

    Hi @robin-w,
    thanks for your support.

    I resolved my problem.

    Roberto.


    Robin W
    Moderator

    @robin-w

    great – glad you’re fixed !

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.
Skip to toolbar