Forum Replies Created
-
Author
-
May 29, 2015 at 15:25 in reply to: Sort members by current balance (mycred) don't working with sweetdate #60510rudik2Participant
In 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,
TomaszJuly 14, 2014 at 14:54 in reply to: It is possible to hide register form in pc, but display in mobile? #22523rudik2ParticipantFor test that #register_form_front selector is tru i pasted this code:
COPY CODE@media screen and (min-width: 480px) { #register_form_front { display: none; } }
I see register form still in mobile, why?
July 11, 2014 at 12:47 in reply to: It is possible to hide register form in pc, but display in mobile? #22371rudik2ParticipantCOPY CODE@deskop only screen and (min-width: 480px) { .register_form_front { display: none; } }
will be ok? Please help
May 12, 2014 at 11:23 in reply to: How to change redirect quest from register page to register form #17552rudik2ParticipantIn sweetdate-child/function.php i have this code:
COPY CODE//Redirect only guests to register page add_filter('kleo_pmpro_url_redirect', 'kleo_my_custom_guest_redirect'); function kleo_my_custom_guest_redirect($redirect) { if (!is_user_logged_in()){ return home_url().'/register'; } else { return $redirect; } }
Maybe here a muste change something?
Where i can find ‘kleo_pmpro_url_redirect’, ‘kleo_my_custom_guest_redirect’ files?? -
AuthorPosts