Hello, I’ll like to create a widget that displays the sum of point of each group in a leaderboard. I’m using myCred for the points an BuddyPress for the groups.
I was able to make a query that gives me the total number of all the members of a group. I should be able to make a for() for each of the group_id of all the groups but I’m not sure how to create a widget for that nor am I very good at WordPress.
SELECT SUM(us.meta_value) AS meta_value_total FROM 'wp_bp_groups_members' AS ww
INNER JOIN wp_usermeta us
ON ww.user_id = us.user_id
WHERE ww.group_id = 1 AND us.meta_key ="mycred_default"
any idea or help? please
-
This topic was modified 9 years, 6 months ago by
mnicdpc.