Forum Replies Created

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  •  rudik2
    Participant

    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,
    Tomasz

     rudik2
    Participant

    For 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?

     rudik2
    Participant
    COPY CODE
    @deskop only screen and (min-width: 480px) {
     .register_form_front {
        display: none;
    }
    }

    will be ok? Please help

     rudik2
    Participant

    In 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??

Viewing 4 posts - 1 through 4 (of 4 total)

Log in with your credentials

Forgot your details?