Changeset 3245 for branches/1.2/bp-messages/bp-messages-templatetags.php
- Timestamp:
- 09/10/2010 08:12:08 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/1.2/bp-messages/bp-messages-templatetags.php
r3206 r3245 22 22 function bp_messages_box_template( $user_id, $box, $per_page, $max, $type ) { 23 23 $this->pag_page = isset( $_GET['mpage'] ) ? intval( $_GET['mpage'] ) : 1; 24 $this->pag_num = isset( $_GET['num'] ) ? intval( $_GET['num'] ) : $per_page;25 26 $this->user_id = $user_id;27 $this->box = $box;28 $this->type = $type;29 30 if ( 'notices' == $this->box ) 24 $this->pag_num = isset( $_GET['num'] ) ? intval( $_GET['num'] ) : $per_page; 25 26 $this->user_id = $user_id; 27 $this->box = $box; 28 $this->type = $type; 29 30 if ( 'notices' == $this->box ) { 31 31 $this->threads = BP_Messages_Notice::get_notices(); 32 else {32 } else { 33 33 $threads = BP_Messages_Thread::get_current_threads_for_user( $this->user_id, $this->box, $this->type, $this->pag_num, $this->pag_page ); 34 34 35 $this->threads = $threads['threads'];35 $this->threads = $threads['threads']; 36 36 $this->total_thread_count = $threads['total']; 37 37 } 38 38 39 39 if ( !$this->threads ) { 40 $this->thread_count = 0;40 $this->thread_count = 0; 41 41 $this->total_thread_count = 0; 42 42 } else { … … 44 44 45 45 if ( !$max || $max >= (int)$total_notice_count ) { 46 if ( 'notices' == $this->box ) 46 if ( 'notices' == $this->box ) { 47 47 $this->total_thread_count = (int)$total_notice_count; 48 } 48 49 } else { 49 50 $this->total_thread_count = (int)$max; … … 51 52 52 53 if ( $max ) { 53 if ( $max >= count($this->threads) ) 54 if ( $max >= count($this->threads) ) { 54 55 $this->thread_count = count($this->threads); 55 else56 } else { 56 57 $this->thread_count = (int)$max; 58 } 57 59 } else { 58 60 $this->thread_count = count($this->threads); … … 60 62 } 61 63 62 $this->pag_links = paginate_links( array( 63 'base' => add_query_arg( 'mpage', '%#%' ), 64 'format' => '', 65 'total' => ceil($this->total_thread_count / $this->pag_num), 66 'current' => $this->pag_page, 67 'prev_text' => '←', 68 'next_text' => '→', 69 'mid_size' => 1 70 )); 64 if ( (int)$this->total_topic_count && (int)$this->pag_num ) { 65 $this->pag_links = paginate_links( array( 66 'base' => add_query_arg( 'mpage', '%#%' ), 67 'format' => '', 68 'total' => ceil( (int)$this->total_thread_count / (int)$this->pag_num ), 69 'current' => $this->pag_page, 70 'prev_text' => '←', 71 'next_text' => '→', 72 'mid_size' => 1 73 ) ); 74 } 71 75 } 72 76
Note: See TracChangeset
for help on using the changeset viewer.