Nevermind 🙂 I have figured this out by using
global $wpdb;
$topuser = array();
$html = "";
// query points by each user
$users = $wpdb->get_results("SELECT ID FROM $wpdb->users ORDER BY ID");
foreach ( $users as $user ) {
$views = get_user_meta( $user->ID, 'rfp_post_karma', 1 );
$topuser[] = array( 'id' => $user->ID, 'views' => $views);
wp_reset_query();
}
// function to sort array based on views count
function sortViews($a, $b) {
return $b['views'] - $a['views'];
}
usort($topuser, 'sortViews'); // sort the array
hey hornets2002
Would you mind to tell me where did you put your code and how did you pull the results (eg. widget?)
As you can see here http://wordpress.org/support/topic/widget-and-possible-bbpress?replies=2 i´d like to use this on a project.
Thanks