Skip to:
Content

BuddyPress.org

Changeset 3670


Ignore:
Timestamp:
01/08/2011 04:51:59 PM (14 years ago)
Author:
boonebgorges
Message:

Corrects logic for showing 'Load More' link on activity loop. Fixes #1757

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-activity/bp-activity-templatetags.php

    r3647 r3670  
    316316        return apply_filters( 'bp_get_activity_pagination_links', $activities_template->pag_links );
    317317    }
     318
     319/**
     320 * Returns true when there are more activity items to be shown than currently appear
     321 *
     322 * @package BuddyPress Activity
     323 * @since 1.3
     324 *
     325 * @global $activities_template The activity data loop object created in bp_has_activities()
     326 */
     327function bp_activity_has_more_items() {
     328    global $activities_template;
     329   
     330    $remaining_pages = floor( ( $activities_template->total_activity_count - 1 ) / ( $activities_template->pag_num * $activities_template->pag_page ) );
     331   
     332    $has_more_items = (int)$remaining_pages ? true : false;
     333   
     334    return apply_filters( 'bp_activity_has_more_items', $has_more_items );
     335}
    318336
    319337function bp_activity_count() {
  • trunk/bp-themes/bp-default/activity/activity-loop.php

    r2712 r3670  
    2323    <?php endwhile; ?>
    2424
    25     <?php if ( bp_get_activity_count() == bp_get_activity_per_page() ) : ?>
     25    <?php if ( bp_activity_has_more_items() ) : ?>
    2626        <li class="load-more">
    2727            <a href="#more"><?php _e( 'Load More', 'buddypress' ) ?></a> &nbsp; <span class="ajax-loader"></span>
Note: See TracChangeset for help on using the changeset viewer.