Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
11/01/2011 11:21:59 PM (13 years ago)
Author:
djpaul
Message:

Second pass of Akismet support for the Activity component. See #3660

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-activity/bp-activity-template.php

    r5259 r5262  
    105105    var $full_name;
    106106
    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' ) {
    108108        global $bp;
    109109
     
    119119        // Fetch specific activity items based on ID's
    120120        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 ) );
    122122
    123123        // Fetch all activity items
    124124        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 ) );
    126126
    127127        if ( !$max || $max >= (int)$this->activities['total'] )
     
    299299        'max'              => false,        // max number to return
    300300        '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
    302302
    303303        // Scope - pre-built activity filters for a user (friends/groups/favorites/mentions)
     
    384384
    385385    // 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 );
    390390
    391391    return apply_filters( 'bp_has_activities', $activities_template->has_activities(), $activities_template );
Note: See TracChangeset for help on using the changeset viewer.