Changes between Initial Version and Version 1 of Ticket #16842
- Timestamp:
- 03/13/2011 03:57:37 AM (14 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #16842 – Description
initial v1 8 8 the if statement referenced is: 9 9 10 {{{ 10 11 if ( !$args['total_pages'] && $args['per_page'] > 0 ) { 11 $args['total_pages'] = ceil( $args['total_items'] / $args['per_page'] ); 12 } 12 $args['total_pages'] = ceil( $args['total_items'] / $args['per_page'] ); 13 } 14 }}} 15 13 16 I checked the variables, and they were set as so: 17 18 {{{ 14 19 $args['total_pages'] = 0 15 20 $args['per_page'] = 20 16 21 $args['total_items'] = ( array of items ) 22 }}} 23 17 24 Uh.. can't divide an array! 18 25 19 26 So I changed the if calculation to: 20 27 28 {{{ 21 29 if ( !$args['total_pages'] && $args['per_page'] > 0 ) { 22 $args['total_pages'] = ceil( count( $args['total_items'] ) / $args['per_page'] ); 23 } 30 $args['total_pages'] = ceil( count( $args['total_items'] ) / $args['per_page'] ); 31 } 32 }}} 33 24 34 and it works... 25 35