-
Author
-
February 11, 2015 at 20:36 #45680rudik2Participant
Hi,
i would like to sort members results by current points from mycred plugins. Here is tutorial:
http://mycred.me/support/tutorials/buddypress-sort-members-by-current-balance/
but in sweetdate theme this don’t working. Please help.I tested with other instalation with buddypress but without sweetdate and all working ok.
February 15, 2015 at 04:52 #46123LauraModeratorHello, where have you added this code?
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionLaura Solanes - Graphic Designer and Web Designer
Please be patient as I try to answer each topic as fast as i can.
If you like the theme or the support you've received please consider leaving us a review on Themeforest!
Always happy to help you 🙂
February 17, 2015 at 09:53 #46343rudik2ParticipantI added this code in funcions.php files on the child theme.
February 19, 2015 at 15:24 #46696AndreiModeratorHi @rudik2,
I would need access to your wp instalation to see what happens around there.
Could you please leave me credentials to your wp-admin and a ftp user in a private reply ?Once I have those credentials I could give a look as soon as I can find some spare time.
Cheers
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionFebruary 26, 2015 at 01:13 #47663AndreiModeratorHi @rudik2,
Unfortunately we’ve been extremely busy with the latest major updates of buddypress and woocommerce.
As you can understand, this is an issue more related to the mycred plugin and not to our theme, but as soon as I will find some spare time I’ll give a look at your theme integrity and see if the error comes from our side.Looking forward.
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionMarch 2, 2015 at 08:35 #48327rudik2ParticipantAndrei will be grate. I tested this code on the buddypress (without sweetdate) and all working ok. I think that problem is in sweetdate.
May 25, 2015 at 15:39 #60043rudik2ParticipantAdmins please help with that problem. Will be greate then members are display in MEMBERS SITE by current balance.
Members maybe then will be more active on the site.May 29, 2015 at 15:25 #60510rudik2ParticipantIn file members-loop.php is code to display members results:
<?php if ( bp_has_members( bp_ajax_querystring( 'members' ). '&per_page='.sq_option('buddypress_perpage') ) ) : ?>
In MyCred tutorial i read that i must paste this code in function.php to have option “SORT MEMBERS BY CURRENT BALANCE”:
COPY CODE/** * Add Sort Members Option * @since 0.1 * @version 1.0 */ add_action( 'bp_members_directory_order_options', 'mycred_pro_add_sorting_options' ); function mycred_pro_add_sorting_options() { ?> <option value="points-asc">Points Balance (Ascending)</option> <option value="points-desc">Points Balance (Descending)</option> <?php } /** * Adjust BP User Query * @since 0.1 * @version 1.0 */ add_action( 'bp_pre_user_query', 'mycred_pro_pre_user_query' ); function mycred_pro_pre_user_query( $BP_User_Query ) { // Only run this if one of our custom options is selected if ( in_array( $BP_User_Query->query_vars['type'], array( 'points-asc', 'points-desc' ) ) ) { global $wpdb; // Adjust SELECT $BP_User_Query->uid_clauses['select'] = " SELECT DISTINCT u.{$BP_User_Query->uid_name} as id FROM {$wpdb->users} u INNER JOIN {$wpdb->usermeta} um ON ( u.{$BP_User_Query->uid_name} = um.user_id )"; // Adjust WHERE $BP_User_Query->uid_clauses['where'] = "WHERE um.meta_key = 'mycred_default'"; // Adjust ORDER BY $BP_User_Query->uid_clauses['orderby'] = "ORDER BY um.meta_value+0"; // Adjust ORDER $BP_User_Query->uid_clauses['order'] = ( $BP_User_Query->query_vars['type'] == 'points-asc' ) ? 'ASC' : 'DESC'; } }
I would like to display MEMBERS result by MyCred points balance. I think that i must change something in members-loop.php file in this line? :
<?php if ( bp_has_members( bp_ajax_querystring( 'members' ). '&per_page='.sq_option('buddypress_perpage') ) ) : ?>
Please help with this.
Regards,
Tomasz -
AuthorPosts
The forum ‘Feature requests’ is closed to new topics and replies.