Skip to:
Content
Pages
Categories
Search
Top
Bottom

Could anyone fix this code to count user posts?

  • Avatar of davidwood9999
    davidwood9999
    Participant

    @davidwood9999

    Hey guys – props to @3sixty for posting the below code.

    I wonder – could anyone possibly show me (a php noob I’m afraid) how to tweak this to show the user’s new forum topics:

    1) For a specific forum (e.g. forum_name=”Impact”), and

    2) Between STARTDATE and ENDDATE?

    3) How to show total for ALL users, for forum_name=”Impact” between STARTDATE and ENDDATE?

    Any help MUCH appreciated.

    <<<<>>>>>

    function get_new_forum_topic_count_by_user( $user_id ) {

    $args = array(

    ‘per_page’ => 10000,

    ‘show_hidden’ => true,

    ‘user_id’ => $user_id,

    ‘action’ => ‘new_forum_topic’

    );

    if ( bp_has_activities( $args ) ) {

    global $activities_template;

    $count = $activities_template->total_activity_count;

    } else {

    $count = 0;

    }

    return $count;

    }

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

You must be logged in to reply to this topic.