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-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
Note: See TracChangeset for help on using the changeset viewer.