Skip to:
Content
Pages
Categories
Search
Top
Bottom

Pull bbpress data to wordpress

  • I have a script that I made that pulls the count of posts a user does on bbpress and displays it on wordpress page template. For some reason I can’t get it to work. I know I need to add something to wordpress but I am not sure what. Here is the script so far.

    function get_user_posts_forums1($user_id) {

    global $wpdb; // I know I need to change this

    $count = $bbdb->get_results(“

    SELECT COUNT( * ) AS total

    FROM {$bbdb->posts}

    WHERE poster_id = {$user_id};”, object);

    return $count[0]->total;

    }

    Any ideas?

You must be logged in to reply to this topic.