This topic has 7 replies, 2 voices, and was last updated 7 years by Laura.

  • Author
  • #151499
     halfdan
    Participant

    Hi,

    I tried to post in this Ticket, but I think it’s corrupt or something else: https://archived.seventhqueen.com/forums/topic/members-how-to-list-them-alphabetically-and-not-by-last-active#post-151497

    Could you provide the code from the members-loop.php from the above post again? Unfortunately the code isn’t displayed correctly :).

    Thanks and best regards

    Thomas

     

    #151650
     Laura
    Moderator

    Hello, here is the code

    COPY CODE
    
    < ?php
    
    /**
     * BuddyPress - Members Loop
     *
     * Querystring is set via AJAX in _inc/ajax.php - bp_legacy_theme_object_filter()
     *
     * @package BuddyPress
     * @subpackage bp-legacy
     */
    
    ?>
    
    < ?php do_action( 'bp_before_members_loop' ); ?>
    
    < ?php
    if ( bp_ajax_querystring( 'members' ) == "")
    {
    $queryString = "type=alphabetical&action=alphabetical&page=1";
    }
    else {
    $queryString = bp_ajax_querystring( 'members' );
    }
    
     if ( bp_has_members(  $queryString. '&per_page='.sq_option('bp_members_perpage', 24)) ) : ?>
    
    	<div class="pagination">
    
    		<div class="pag-count">
    
    			< ?php bp_members_pagination_count(); ?>
    
    		</div>
    
    		<div class="pagination-links">
    
    			< ?php bp_members_pagination_links(); ?>
    
    		</div>
    
    	</div>
    
    	< ?php do_action( 'bp_before_directory_members_list' ); ?>
    
    	<ul id="members-list" class="item-list row kleo-isotope masonry">
    
    	< ?php while ( bp_members() ) : bp_the_member(); ?>
    
    		<li class="kleo-masonry-item">
        	<div class="member-inner-list animated animate-when-almost-visible bottom-to-top">
            <div class="item-avatar rounded">
              <a>">< ?php bp_member_avatar(); ?></a>
              < ?php do_action('bp_member_online_status', bp_get_member_user_id()); ?>
            </div>
      
            <div class="item">
              <div class="item-title">
                <a>">< ?php bp_member_name(); ?></a>
              </div>
              <div class="item-meta"><span class="activity">< ?php bp_member_last_active(); ?></span></div>
              
    		< ? /* LORNDAL RAUS <div class="item-meta"><span class="activity">< ?php bp_the_profile_field_name(); ?></span></div> */ ?>
    		
            < ? /* LORNDAL RAUS <span class="update"> < ?php bp_member_latest_update(); ?><span class="update">
              < ?php endif; */ ?>
      		< ?php /* do_action( 'bp_directory_members_item' ); */ ?>
      
              <span class="item-meta"><span class="activity"> < ?php
               /***
                * If you want to show specific profile fields here you can,
                * but it'll add an extra query for each member in the loop
                * (only one regardless of the number of fields you show):
                *
                * bp_member_profile_data( 'field=the field name' );
                */
              bp_member_profile_data( 'field=Current city');?>,  < ?php bp_member_profile_data( 'field=Current country' );
              ?></span></span><br /><br />
            </span></div>
      
            <div class="action">
      
              < ?php do_action( 'bp_directory_members_actions' ); ?>
      
            </div>
    
    			<!--end member-inner-list-->
    		</li>
    
    	< ?php endwhile; ?>
    
    	</ul>
    
    	< ?php do_action( 'bp_after_directory_members_list' ); ?>
    
    	< ?php bp_member_hidden_fields(); ?>
    
    	<div class="pagination">
    
    		<div class="pag-count">
    
    			< ?php bp_members_pagination_count(); ?>
    
    		</div>
    
    		<div class="pagination-links">
    
    			< ?php bp_members_pagination_links(); ?>
    
    		</div>
    
    	</div>
    
    < ?php else: ?>
    
    	<div class="info">
    		<p>< ?php _e( "Sorry, no members were found.", 'buddypress' ); ?></p>
    	</div>
    
    < ?php endif; ?>
    
    < ?php do_action( 'bp_after_members_loop' ); ?>
    
    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    Laura 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 🙂

    #151705
     halfdan
    Participant

    Good Morning Laura,

    thanks a lot. Unfortunately the code doesn’t work. I removed the blanks between < and ? and some <“ between the code, so that the site items are displayed largely correct, but then the links aren’t clickable anymore and the sort order is still standard. I tried to solve it myself, but I’m not really confirm with php – sorry :). It’s only “try and error” if I go on :).
    Could you check the code again?

    Many thanks in advance.
    Thomas

    #151830
     Laura
    Moderator

    Hello, sure, can you share ftp and admin access so i can test it? 🙂

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    Laura 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 🙂

    #151967
     halfdan
    Participant
    This reply has been set as private.
    #152197
     Laura
    Moderator

    Hello, fixed, i replaced the file for the original one and then replaced this

    COPY CODE
    
    <?php if ( bp_has_members( bp_ajax_querystring( 'members' ). '&per_page='.sq_option('bp_members_perpage', 24) ) ) : ?>
    

    with this

    COPY CODE
    
    <?php if ( bp_has_members( bp_ajax_querystring( 'members' ). '&per_page='.sq_option('bp_members_perpage', 24) . '&type=alphabetical' ) ) : ?>
    
    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    Laura 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 🙂

    #152200
     halfdan
    Participant

    Hi Laura,

    great, thank you very much :).
    Have a nice day.

    Best regards
    Thomas

    #152373
     Laura
    Moderator

    Glad to help 🙂

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    Laura 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 🙂

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

You must be logged in to reply to this topic.

Log in with your credentials

Forgot your details?