Changeset 5262 for trunk/bp-activity/bp-activity-template.php
- Timestamp:
- 11/01/2011 11:21:59 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-activity/bp-activity-template.php
r5259 r5262 105 105 var $full_name; 106 106 107 function __construct( $page, $per_page, $max, $include, $sort, $filter, $search_terms, $display_comments, $show_hidden, $exclude = false, $in = false, $ hide_spam = true) {107 function __construct( $page, $per_page, $max, $include, $sort, $filter, $search_terms, $display_comments, $show_hidden, $exclude = false, $in = false, $spam = 'ham_only' ) { 108 108 global $bp; 109 109 … … 119 119 // Fetch specific activity items based on ID's 120 120 if ( !empty( $include ) ) 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 ) );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, 'spam' => $spam ) ); 122 122 123 123 // Fetch all activity items 124 124 else 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 ) );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 127 if ( !$max || $max >= (int)$this->activities['total'] ) … … 299 299 'max' => false, // max number to return 300 300 'show_hidden' => $show_hidden, // Show activity items that are hidden site-wide? 301 ' hide_spam' => true, // Don't retrieve items marked as spam?301 'spam' => 'ham_only', // Hide spammed items 302 302 303 303 // Scope - pre-built activity filters for a user (friends/groups/favorites/mentions) … … 384 384 385 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 );386 if ( !empty( $include ) && 'ham_only' == $spam ) 387 $spam = 'all'; 388 389 $activities_template = new BP_Activity_Template( $page, $per_page, $max, $include, $sort, $filter, $search_terms, $display_comments, $show_hidden, $exclude, $in, $spam ); 390 390 391 391 return apply_filters( 'bp_has_activities', $activities_template->has_activities(), $activities_template );
Note: See TracChangeset
for help on using the changeset viewer.