Could anyone fix this code to count user posts?
-
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;
}
- The topic ‘Could anyone fix this code to count user posts?’ is closed to new replies.