Skip to:
Content

BuddyPress.org

Ticket #1757: 1757.2.diff

File 1757.2.diff, 1.3 KB (added by boonebgorges, 14 years ago)
  • bp-themes/bp-default/activity/activity-loop.php

     
    2222
    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>
    2828                </li>
  • bp-activity/bp-activity-templatetags.php

     
    316316                return apply_filters( 'bp_get_activity_pagination_links', $activities_template->pag_links );
    317317        }
    318318
     319function bp_activity_has_more_items() {
     320        global $activities_template;
     321       
     322        $remaining_pages = floor( ( $activities_template->total_activity_count - 1 ) / ( $activities_template->pag_num * $activities_template->pag_page ) );
     323       
     324        $has_more_items = (int)$remaining_pages ? true : false;
     325       
     326        return apply_filters( 'bp_activity_has_more_items', $has_more_items );
     327}
     328
    319329function bp_activity_count() {
    320330        echo bp_get_activity_count();
    321331}