Hi Andrei,
This is quite hacky, I will try to incorporate some loose API-esque functions in the next veersiokn to avoid this… hackery! I will make it so the API functions will need to be activated, for those whom are worried about performance etc.I never built this plugin with the intention of it being used in such a way, but, as there have been multiple requests for this sort of functionality I will ensure to encorporate this into a future version.
If you add the following to your functions.php
file, you will be able to get a jist of what is happening and where the relevant data you need is. I have setup this example to include all of the relevant variables (users, posts and activity).
You could potentially hook this into a new widget, or setup a function and simply call it from your php file – down to you on that one.
function wp_28372873_bbpas_stats() {
$stats = bbPress_Advanced_Statistics::instance( __FILE__, BBPAS_VERS );
$activity_time = $stats->online->parent->option["user_activity_time"];
$online_stats = $stats->online->whois_online();
$online_stats = array( "inactive" => count( $online_stats["inactive"] ), "active" => count( $online_stats["active"] ) );
$formatted_stats = $stats->online->get_formatted_statistics();
echo "There has been {$online_stats['inactive']} users logged in over the past {$activity_time} hours, of which {$online_stats['active']} are currently active.";
echo "There are {$formatted_stats["user_count"]} users registered, we have {$formatted_stats["topic_count"]} topics and {$formatted_stats["reply_count"]} replies!";
}
add_action( 'init', 'wp_28372873_bbpas_stats' );
Or, alternatively, wait a few weeks until I get round to incorporating some API-esque functions into the next release.
Hope that helps!
Jake