Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
04/21/2010 11:34:12 AM (16 years ago)
Author:
apeatling
Message:

Merging 1.2 branch with trunk

File:
1 edited

Legend:

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

    r2919 r2946  
    3535            $this->component = $row->component;
    3636            $this->type = $row->type;
    37             $this->action = $row->type;
     37            $this->action = $row->action;
    3838            $this->content = $row->content;
    3939            $this->date_recorded = $row->date_recorded;
     
    9898        $where_conditions = array();
    9999
     100        /* Filtering */
     101        if ( $filter && $filter_sql = BP_Activity_Activity::get_filter_sql( $filter ) )
     102            $where_conditions['filter_sql'] = $filter_sql;
     103
     104        /* Sorting */
     105        if ( $sort != 'ASC' && $sort != 'DESC' )
     106            $sort = 'DESC';
     107
     108        /* Hide Hidden Items? */
     109        if ( !$show_hidden )
     110            $where_conditions['hidden_sql'] = "a.hide_sitewide = 0";
     111
     112        /* Alter the query based on whether we want to show activity item comments in the stream like normal comments or threaded below the activity */
     113        if ( !$display_comments || 'threaded' == $display_comments ) {
     114            $where_conditions[] = "a.type != 'activity_comment'";
     115        }
     116
     117        $where_sql = 'WHERE ' . join( ' AND ', $where_conditions );
     118
    100119        /* Searching */
    101120        if ( $search_terms ) {
    102121            $search_terms = $wpdb->escape( $search_terms );
    103             $where_conditions['search_sql'] = "a.content LIKE '%%" . like_escape( $search_terms ) . "%%'";
    104         }
    105 
    106         /* Filtering */
    107         if ( $filter && $filter_sql = BP_Activity_Activity::get_filter_sql( $filter ) )
    108             $where_conditions['filter_sql'] = $filter_sql;
    109 
    110         /* Sorting */
    111         if ( $sort != 'ASC' && $sort != 'DESC' )
    112             $sort = 'DESC';
    113 
    114         /* Hide Hidden Items? */
    115         if ( !$show_hidden )
    116             $where_conditions['hidden_sql'] = "a.hide_sitewide = 0";
    117 
    118         /* Alter the query based on whether we want to show activity item comments in the stream like normal comments or threaded below the activity */
    119         if ( !$display_comments || 'threaded' == $display_comments ) {
    120             $where_conditions[] = "a.type != 'activity_comment'";
    121         }
    122 
    123         $where_sql = 'WHERE ' . join( ' AND ', $where_conditions );
     122
     123            if ( !empty( $filter['user_id'] ) )
     124                $where_sql .= ' OR ';
     125            else if ( !empty( $where_conditions ) )
     126                $where_sql .= ' AND ';
     127
     128            $where_sql .= "a.content LIKE '%%" . like_escape( $search_terms ) . "%%'";
     129        }
    124130
    125131        if ( $per_page && $page ) {
Note: See TracChangeset for help on using the changeset viewer.