Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
02/09/2012 10:10:47 PM (13 years ago)
Author:
johnjamesjacoby
Message:

Remove unneeded globals and clean up some code in Activity component. See #3989.

File:
1 edited

Legend:

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

    r5573 r5684  
    374374     * Append activity comments to their associated activity items
    375375     *
    376      * @global object $bp Global BuddyPress settings object
    377376     * @global wpdb $wpdb WordPress database object
    378377     * @param array $activities
     
    382381     */
    383382    function append_comments( $activities, $spam = 'ham_only' ) {
    384         global $bp, $wpdb;
     383        global $wpdb;
    385384
    386385        $activity_comments = array();
     
    498497
    499498    function get_sitewide_items_for_feed( $limit = 35 ) {
    500         global $wpdb, $bp;
    501 
    502         $activities = bp_activity_get_sitewide( array( 'max' => $limit ) );
     499        global $bp;
     500
     501        $activities    = bp_activity_get_sitewide( array( 'max' => $limit ) );
     502        $activity_feed = array();
    503503
    504504        for ( $i = 0, $count = count( $activities ); $i < $count; ++$i ) {
    505                 $title = explode( '<span', $activities[$i]['content'] );
    506 
    507                 $activity_feed[$i]['title'] = trim( strip_tags( $title[0] ) );
    508                 $activity_feed[$i]['link'] = $activities[$i]['primary_link'];
     505                $title                            = explode( '<span', $activities[$i]['content'] );
     506                $activity_feed[$i]['title']       = trim( strip_tags( $title[0] ) );
     507                $activity_feed[$i]['link']        = $activities[$i]['primary_link'];
    509508                $activity_feed[$i]['description'] = @sprintf( $activities[$i]['content'], '' );
    510                 $activity_feed[$i]['pubdate'] = $activities[$i]['date_recorded'];
     509                $activity_feed[$i]['pubdate']     = $activities[$i]['date_recorded'];
    511510        }
    512511
     
    539538
    540539    function get_filter_sql( $filter_array ) {
    541         global $wpdb;
     540
     541        $filter_sql = array();
    542542
    543543        if ( !empty( $filter_array['user_id'] ) ) {
     
    571571        }
    572572
    573         if ( empty($filter_sql) )
     573        if ( empty( $filter_sql ) )
    574574            return false;
    575575
Note: See TracChangeset for help on using the changeset viewer.