Skip to:
Content

BuddyPress.org

Changeset 1538


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.

Location:
trunk
Files:
7 edited

Legend:

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

    r1532 r1538  
    3434                        $this->activities = bp_activity_get_friends_activity( $user_id, $max, $timeframe, false, $this->pag_num, $this->pag_page );
    3535               
    36                 if ( !$max )
     36                if ( !$max || $max >= (int)$this->activities['total'] )
    3737                        $this->total_activity_count = (int)$this->activities['total'];
    3838                else
  • trunk/bp-blogs/bp-blogs-templatetags.php

    r1449 r1538  
    222222                }
    223223               
    224                 if ( !$max )
     224                if ( !$max || $max >= (int)$this->blogs['count'] )
    225225                        $this->total_blog_count = (int)$this->blogs['count'];
    226226                else
     
    398398                }
    399399               
    400                 if ( !$max )
     400                if ( !$max || $max >= (int)$this->posts['count'] )
    401401                        $this->total_post_count = (int)$this->posts['count'];
    402402                else
     
    832832                }
    833833               
    834                 if ( !$max )
     834                if ( !$max || $max >= (int)$this->comments['count'] )
    835835                        $this->total_comment_count = (int)$this->comments['count'];
    836836                else
     
    10851085                }
    10861086               
    1087                 if ( !$max )
     1087                if ( !$max || $max >= (int)$this->blogs['total'] )
    10881088                        $this->total_blog_count = (int)$this->blogs['total'];
    10891089                else
  • trunk/bp-core/bp-core-templatetags.php

    r1518 r1538  
    798798                }
    799799               
    800                 if ( !$max )
     800                if ( !$max || $max >= (int)$this->members['total'] )
    801801                        $this->total_member_count = (int)$this->members['total'];
    802802                else
  • trunk/bp-forums/bp-forums-templatetags.php

    r1448 r1538  
    3131                        $this->total_topic_count = 0;
    3232                } else {
    33                         if ( !$max )
    34                                 $this->total_topic_count = count( bp_forums_get_topics( $forum_id ) );
     33                        $forum_count = count( bp_forums_get_topics( $forum_id ) );
     34                       
     35                        if ( !$max || $max >= $forum_count )
     36                                $this->total_topic_count = $forum_count;
    3537                        else
    3638                                $this->total_topic_count = (int)$max;
     
    395397                        $this->total_post_count = 0;
    396398                } else {
    397                         if ( !$max )
     399                        if ( !$max || $max >= (int) $forum_template->topic->topic_posts )
    398400                                $this->total_post_count = (int) $forum_template->topic->topic_posts;
    399401                        else
  • trunk/bp-friends/bp-friends-templatetags.php

    r1473 r1538  
    4747                        $this->friendship_count = count($this->friendships);
    4848                } else {
    49                         if ( !$max )
     49                        if ( !$max || $max >= (int)$this->friendships['total'] )
    5050                                $this->total_friend_count = (int)$this->friendships['total'];
    5151                        else
  • trunk/bp-groups/bp-groups-templatetags.php

    r1529 r1538  
    468468                        $this->group_count = 1;
    469469                } else {
    470                         if ( !$max )
     470                        if ( !$max || $max >= (int)$this->groups['total'] )
    471471                                $this->total_group_count = (int)$this->groups['total'];
    472472                        else
     
    16421642                $this->members = BP_Groups_Member::get_all_for_group( $group_id, $this->pag_num, $this->pag_page, $exclude_admins_mods, $exclude_banned );
    16431643               
    1644                 if ( !$max )
     1644                if ( !$max || $max >= (int)$this->members['count'] )
    16451645                        $this->total_member_count = (int)$this->members['count'];
    16461646                else
     
    19181918                }
    19191919               
    1920                 if ( !$max )
     1920                if ( !$max || $max >= (int)$this->groups['total'] )
    19211921                        $this->total_group_count = (int)$this->groups['total'];
    19221922                else
     
    22232223                $this->requests = BP_Groups_Group::get_membership_requests( $group_id, $this->pag_num, $this->pag_page );               
    22242224
    2225                 if ( !$max )
     2225                if ( !$max || $max >= (int)$this->requests['total'] )
    22262226                        $this->total_request_count = (int)$this->requests['total'];
    22272227                else
  • 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.