Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
01/18/2009 01:48:57 AM (18 years ago)
Author:
apeatling
Message:

Fixes #295

File:
1 edited

Legend:

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

    r849 r864  
    1010        var $component_action;
    1111        var $date_recorded;
    12         var $is_private;
    13        
    14         var $no_sitewide_recording = false;
     12        var $is_private = false;
     13        var $no_sitewide_cache = false;
    1514       
    1615        var $table_name;
     
    4140                $this->date_recorded = $activity->date_recorded;
    4241                $this->is_private = $activity->is_private;
     42                $this->no_sitewide_cache = $activity->no_sitewide_cache;
    4343        }
    4444       
     
    5555                if ( !$this->exists() ) {
    5656                        // Insert the new activity into the activity table.
    57                         $activity = $wpdb->query( $wpdb->prepare( "INSERT INTO " . $this->table_name . " ( item_id, secondary_item_id, user_id, component_name, component_action, date_recorded, is_private ) VALUES ( %d, %d, %d, %s, %s, FROM_UNIXTIME(%d), %d )", $this->item_id, $this->secondary_item_id, $this->user_id, $this->component_name, $this->component_action, $this->date_recorded, $this->is_private ) );
     57                        $activity = $wpdb->query( $wpdb->prepare( "INSERT INTO " . $this->table_name . " ( item_id, secondary_item_id, user_id, component_name, component_action, date_recorded, is_private, no_sitewide_cache ) VALUES ( %d, %d, %d, %s, %s, FROM_UNIXTIME(%d), %d, %d )", $this->item_id, $this->secondary_item_id, $this->user_id, $this->component_name, $this->component_action, $this->date_recorded, $this->is_private, $this->no_sitewide_cache ) );
    5858
    5959                        // Fetch the formatted activity content so we can add it to the cache.
     
    6767               
    6868                        // Add the cached version of the activity to the sitewide activity table.
    69                         if ( !$this->no_sitewide_recording )
     69                        if ( !$this->no_sitewide_cache )
    7070                                $sitewide_cached = $wpdb->query( $wpdb->prepare( "INSERT INTO " . $bp['activity']['table_name_sitewide'] . " ( user_id, item_id, secondary_item_id, content, primary_link, component_name, component_action, date_cached, date_recorded ) VALUES ( %d, %d, %d, %s, %s, %s, %s, FROM_UNIXTIME(%d), FROM_UNIXTIME(%d) )", $this->user_id, $this->item_id, $this->secondary_item_id, $activity_content['content'], $activity_content['primary_link'], $this->component_name, $this->component_action, time(), $this->date_recorded ) );
    7171                       
     
    168168                                                $activities_formatted[$i]['component_action'] = $activities[$i]->component_action;
    169169                                                $activities_formatted[$i]['is_private'] = $activities[$i]->is_private;
     170                                                $activities_formatted[$i]['no_sitewide_cache'] = $activities[$i]->no_sitewide_cache;
    170171                                        }
    171172                                }
     
    320321                       
    321322                        // Add to the sitewide activity stream
    322                         if ( !$activity_array[$i]['is_private'] )
     323                        if ( !$activity_array[$i]['is_private'] && !$activity_array[$i]['no_sitewide_cache'] )
    323324                                $wpdb->query( $wpdb->prepare( "INSERT INTO " . $bp['activity']['table_name_sitewide'] . " ( user_id, content, item_id, secondary_item_id, primary_link, component_name, component_action, date_cached, date_recorded ) VALUES ( %d, %s, %d, %d, %s, %s, %s, FROM_UNIXTIME(%d), %s )", $user_id, $activity_array[$i]['content'], $activity_array[$i]['item_id'], $activity_array[$i]['secondary_item_id'], $activity_array[$i]['primary_link'], $activity_array[$i]['component_name'], $activity_array[$i]['component_action'], time(), $activity_array[$i]['date_recorded'] ) );
    324325                }
Note: See TracChangeset for help on using the changeset viewer.