Changeset 5729 for trunk/bp-activity/bp-activity-template.php
- Timestamp:
- 02/11/2012 09:32:04 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-activity/bp-activity-template.php
r5705 r5729 125 125 $this->activities = bp_activity_get( array( 'display_comments' => $display_comments, 'max' => $max, 'per_page' => $this->pag_num, 'page' => $this->pag_page, 'sort' => $sort, 'search_terms' => $search_terms, 'filter' => $filter, 'show_hidden' => $show_hidden, 'exclude' => $exclude, 'in' => $in, 'spam' => $spam ) ); 126 126 127 if ( !$max || $max >= (int) $this->activities['total'] )128 $this->total_activity_count = (int) $this->activities['total'];127 if ( !$max || $max >= (int) $this->activities['total'] ) 128 $this->total_activity_count = (int) $this->activities['total']; 129 129 else 130 $this->total_activity_count = (int) $max;130 $this->total_activity_count = (int) $max; 131 131 132 132 $this->activities = $this->activities['activities']; … … 136 136 $this->activity_count = count( $this->activities ); 137 137 } else { 138 $this->activity_count = (int) $max;138 $this->activity_count = (int) $max; 139 139 } 140 140 } else { … … 145 145 146 146 // Fetch parent content for activity comments so we do not have to query in the loop 147 foreach ( (array) $this->activities as $activity ) {147 foreach ( (array) $this->activities as $activity ) { 148 148 if ( 'activity_comment' != $activity->type ) 149 149 continue; … … 162 162 } 163 163 164 if ( (int) $this->total_activity_count && (int)$this->pag_num ) {164 if ( (int) $this->total_activity_count && (int) $this->pag_num ) { 165 165 $this->pag_links = paginate_links( array( 166 166 'base' => add_query_arg( 'acpage', '%#%' ), 167 167 'format' => '', 168 'total' => ceil( (int) $this->total_activity_count / (int)$this->pag_num ),169 'current' => (int) $this->pag_page,168 'total' => ceil( (int) $this->total_activity_count / (int) $this->pag_num ), 169 'current' => (int) $this->pag_page, 170 170 'prev_text' => _x( '←', 'Activity pagination previous text', 'buddypress' ), 171 171 'next_text' => _x( '→', 'Activity pagination next text', 'buddypress' ), … … 277 277 278 278 // The default scope should recognize custom slugs 279 if ( array_key_exists( $bp->current_action, (array) $bp->loaded_components ) ) {279 if ( array_key_exists( $bp->current_action, (array) $bp->loaded_components ) ) { 280 280 $scope = $bp->loaded_components[$bp->current_action]; 281 281 } … … 337 337 return false; 338 338 339 $user_id = implode( ',', (array) $friends );339 $user_id = implode( ',', (array) $friends ); 340 340 break; 341 341 case 'groups': … … 346 346 347 347 $object = $bp->groups->id; 348 $primary_id = implode( ',', (array) $groups['groups'] );348 $primary_id = implode( ',', (array) $groups['groups'] ); 349 349 350 350 $user_id = 0; … … 356 356 return false; 357 357 358 $include = implode( ',', (array) $favs );358 $include = implode( ',', (array) $favs ); 359 359 $display_comments = true; 360 360 break; … … 497 497 498 498 $remaining_pages = floor( ( $activities_template->total_activity_count - 1 ) / ( $activities_template->pag_num * $activities_template->pag_page ) ); 499 $has_more_items = (int) $remaining_pages ? true : false;499 $has_more_items = (int) $remaining_pages ? true : false; 500 500 501 501 return apply_filters( 'bp_activity_has_more_items', $has_more_items ); … … 526 526 global $activities_template; 527 527 528 return apply_filters( 'bp_get_activity_count', (int) $activities_template->activity_count );528 return apply_filters( 'bp_get_activity_count', (int) $activities_template->activity_count ); 529 529 } 530 530 … … 553 553 global $activities_template; 554 554 555 return apply_filters( 'bp_get_activity_per_page', (int) $activities_template->pag_num );555 return apply_filters( 'bp_get_activity_per_page', (int) $activities_template->pag_num ); 556 556 } 557 557 … … 1323 1323 global $activities_template; 1324 1324 1325 return apply_filters( 'bp_get_activity_is_favorite', in_array( $activities_template->activity->id, (array) $activities_template->my_favs ) );1325 return apply_filters( 'bp_get_activity_is_favorite', in_array( $activities_template->activity->id, (array) $activities_template->my_favs ) ); 1326 1326 } 1327 1327 … … 1388 1388 1389 1389 echo '<ul>'; 1390 foreach ( (array) $comment->children as $comment_child ) {1390 foreach ( (array) $comment->children as $comment_child ) { 1391 1391 // Put the comment into the global so it's available to filters 1392 1392 $activities_template->activity->current_comment = $comment_child; … … 1682 1682 $count = bp_activity_recurse_comment_count( $activities_template->activity ); 1683 1683 1684 return apply_filters( 'bp_activity_get_comment_count', (int) $count );1684 return apply_filters( 'bp_activity_get_comment_count', (int) $count ); 1685 1685 } 1686 1686 … … 1947 1947 1948 1948 $class = ''; 1949 if ( in_array( $activities_template->activity->type, (array) $mini_activity_actions ) || empty( $activities_template->activity->content ) )1949 if ( in_array( $activities_template->activity->type, (array) $mini_activity_actions ) || empty( $activities_template->activity->content ) ) 1950 1950 $class = ' mini'; 1951 1951 … … 2158 2158 $can_comment = true; 2159 2159 2160 if ( false === $activities_template->disable_blogforum_replies || (int) $activities_template->disable_blogforum_replies ) {2160 if ( false === $activities_template->disable_blogforum_replies || (int) $activities_template->disable_blogforum_replies ) { 2161 2161 if ( 'new_blog_post' == bp_get_activity_action_name() || 'new_blog_comment' == bp_get_activity_action_name() || 'new_forum_topic' == bp_get_activity_action_name() || 'new_forum_post' == bp_get_activity_action_name() ) 2162 2162 $can_comment = false;
Note: See TracChangeset
for help on using the changeset viewer.