Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
06/10/2009 08:49:07 PM (17 years ago)
Author:
apeatling
Message:

Fixing bug where pagination links would break when the max value was more than the total number of items being returned.

File:
1 edited

Legend:

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

    r1534 r1538  
    3131            $this->total_thread_count = 0;
    3232        } else {
    33             if ( !$max ) {
     33            $total_notice_count = BP_Messages_Notice::get_total_notice_count();
     34           
     35            if ( !$max || $max >= (int)$total_notice_count ) {
    3436                if ( 'notices' == $this->box )
    35                     $this->total_thread_count = BP_Messages_Notice::get_total_notice_count();
     37                    $this->total_thread_count = (int)$total_notice_count;
    3638                else
    37                     $this->total_thread_count = BP_Messages_Thread::get_total_threads_for_user( $this->user_id, $this->box, $type );
     39                    $this->total_thread_count = (int)BP_Messages_Thread::get_total_threads_for_user( $this->user_id, $this->box, $type );
    3840            } else {
    3941                $this->total_thread_count = (int)$max;
Note: See TracChangeset for help on using the changeset viewer.