Skip to:
Content

BuddyPress.org

Changeset 1817


Ignore:
Timestamp:
09/08/2009 01:35:28 AM (15 years ago)
Author:
apeatling
Message:

Division by zero prevention.

File:
1 edited

Legend:

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

    r1814 r1817  
    5151        $this->full_name = $bp->displayed_user->fullname;
    5252
    53         $this->pag_links = paginate_links( array(
    54             'base' => add_query_arg( 'acpage', '%#%' ),
    55             'format' => '',
    56             'total' => ceil( (int)$this->total_activity_count / (int)$this->pag_num ),
    57             'current' => (int)$this->pag_page,
    58             'prev_text' => '«',
    59             'next_text' => '»',
    60             'mid_size' => 1
    61         ));
     53        if ( (int) $this->total_activity_count && (int) $this->page_num ) {
     54            $this->pag_links = paginate_links( array(
     55                'base' => add_query_arg( 'acpage', '%#%' ),
     56                'format' => '',
     57                'total' => ceil( (int)$this->total_activity_count / (int)$this->pag_num ),
     58                'current' => (int)$this->pag_page,
     59                'prev_text' => '«',
     60                'next_text' => '»',
     61                'mid_size' => 1
     62            ));
     63        }
    6264    }
    6365   
Note: See TracChangeset for help on using the changeset viewer.