Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
09/10/2010 08:12:08 PM (14 years ago)
Author:
johnjamesjacoby
Message:

Clean-up pagination in all components. Fixes #2625. Props BenFremer on your first trac ticket!

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/1.2/bp-blogs/bp-blogs-templatetags.php

    r3149 r3245  
    3737
    3838        if ( $max ) {
    39             if ( $max >= count($this->blogs) )
    40                 $this->blog_count = count($this->blogs);
    41             else
     39            if ( $max >= count($this->blogs) ) {
     40                $this->blog_count = count( $this->blogs );
     41            } else {
    4242                $this->blog_count = (int)$max;
     43            }
    4344        } else {
    44             $this->blog_count = count($this->blogs);
    45         }
    46 
    47         $this->pag_links = paginate_links( array(
    48             'base' => add_query_arg( 'bpage', '%#%' ),
    49             'format' => '',
    50             'total' => ceil( (int) $this->total_blog_count / (int) $this->pag_num ),
    51             'current' => (int) $this->pag_page,
    52             'prev_text' => '←',
    53             'next_text' => '→',
    54             'mid_size' => 1
    55         ));
     45            $this->blog_count = count( $this->blogs );
     46        }
     47
     48        if ( (int)$this->total_blog_count && (int)$this->pag_num ) {
     49            $this->pag_links = paginate_links( array(
     50                'base'      => add_query_arg( 'bpage', '%#%' ),
     51                'format'    => '',
     52                'total'     => ceil( (int)$this->total_blog_count / (int)$this->pag_num ),
     53                'current'   => (int)$this->pag_page,
     54                'prev_text' => '←',
     55                'next_text' => '→',
     56                'mid_size'  => 1
     57            ) );
     58        }
    5659    }
    5760
Note: See TracChangeset for help on using the changeset viewer.