Changeset 2103 for branches/release-36/php/lib/block.mtentries.php
- Timestamp:
- 04/25/08 11:36:53 (19 months ago)
- Files:
-
- 1 modified
-
branches/release-36/php/lib/block.mtentries.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/release-36/php/lib/block.mtentries.php
r1926 r2103 39 39 } 40 40 41 if ( isset($args['offset']) && ($args['offset'] == 'auto') ) { 42 $l = 0; 43 if ( $args['limit'] ) { 44 if ( $args['limit'] == 'auto' ) { 45 if ( $_REQUEST['limit'] ) 46 $l = $_REQUEST['limit']; 47 else { 48 $blog_id = intval($ctx->stash('blog_id')); 49 $blog = $ctx->mt->db->fetch_blog($blog_id); 50 $l = $blog['blog_entries_on_index']; 51 } 52 } 53 else 54 $l = $args['limit']; 55 } 56 if ( !$l ) 57 $l = 20; 58 $ctx->stash('__pager_limit', $l); 59 if ( $_REQUEST['offset'] ) 60 $ctx->stash('__pager_offset', $_REQUEST['offset']); 61 } 62 41 63 $entries = $ctx->stash('entries'); 42 64 if (!isset($entries)) { … … 77 99 $args['tag'] or $args['tags'] or $args['tags'] = is_array($tag) ? $tag['tag_name'] : $tag; 78 100 } 79 $entries =& $ctx->mt->db->fetch_entries($args); 101 if ( isset($args['offset']) && ($args['offset'] == 'auto') ) 102 $total_count = 0; 103 $entries =& $ctx->mt->db->fetch_entries($args, $total_count); 104 if ( isset($args['offset']) && ($args['offset'] == 'auto') ) 105 $ctx->stash('__pager_total_count', $total_count); 80 106 $ctx->stash('entries', $entries); 81 107 }
