Changeset 5259 for trunk/bp-activity/bp-activity-template.php
- Timestamp:
- 10/24/2011 02:00:04 PM (15 years ago)
- File:
-
- 1 edited
-
trunk/bp-activity/bp-activity-template.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-activity/bp-activity-template.php
r5258 r5259 105 105 var $full_name; 106 106 107 function bp_activity_template( $page, $per_page, $max, $include, $sort, $filter, $search_terms, $display_comments, $show_hidden, $exclude = false, $in = false ) { 108 $this->__construct( $page, $per_page, $max, $include, $sort, $filter, $search_terms, $display_comments, $show_hidden, $exclude, $in ); 109 } 110 111 function __construct( $page, $per_page, $max, $include, $sort, $filter, $search_terms, $display_comments, $show_hidden, $exclude = false, $in = false ) { 107 function __construct( $page, $per_page, $max, $include, $sort, $filter, $search_terms, $display_comments, $show_hidden, $exclude = false, $in = false, $hide_spam = true ) { 112 108 global $bp; 113 109 … … 123 119 // Fetch specific activity items based on ID's 124 120 if ( !empty( $include ) ) 125 $this->activities = bp_activity_get_specific( array( 'activity_ids' => explode( ',', $include ), 'max' => $max, 'page' => $this->pag_page, 'per_page' => $this->pag_num, 'sort' => $sort, 'display_comments' => $display_comments, 'show_hidden' => $show_hidden ) ); 121 $this->activities = bp_activity_get_specific( array( 'activity_ids' => explode( ',', $include ), 'max' => $max, 'page' => $this->pag_page, 'per_page' => $this->pag_num, 'sort' => $sort, 'display_comments' => $display_comments, 'show_hidden' => $show_hidden, 'hide_spam' => $hide_spam ) ); 122 126 123 // Fetch all activity items 127 124 else 128 $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 ) );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, 'hide_spam' => $hide_spam ) ); 129 126 130 127 if ( !$max || $max >= (int)$this->activities['total'] ) … … 302 299 'max' => false, // max number to return 303 300 'show_hidden' => $show_hidden, // Show activity items that are hidden site-wide? 301 'hide_spam' => true, // Don't retrieve items marked as spam? 304 302 305 303 // Scope - pre-built activity filters for a user (friends/groups/favorites/mentions) … … 385 383 $filter = false; 386 384 387 $activities_template = new BP_Activity_Template( $page, $per_page, $max, $include, $sort, $filter, $search_terms, $display_comments, $show_hidden, $exclude, $in ); 385 // If specific activity items have been requested, override the $hide_spam argument. This prevents backpat errors with AJAX. 386 if ( !empty( $include ) && $hide_spam ) 387 $hide_spam = false; 388 389 $activities_template = new BP_Activity_Template( $page, $per_page, $max, $include, $sort, $filter, $search_terms, $display_comments, $show_hidden, $exclude, $in, $hide_spam ); 388 390 389 391 return apply_filters( 'bp_has_activities', $activities_template->has_activities(), $activities_template );
Note: See TracChangeset
for help on using the changeset viewer.