Changeset 864
- Timestamp:
- 01/18/2009 01:48:57 AM (16 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-activity.php
r849 r864 3 3 4 4 define ( 'BP_ACTIVITY_IS_INSTALLED', 1 ); 5 define ( 'BP_ACTIVITY_VERSION', '1.0b1 ' );5 define ( 'BP_ACTIVITY_VERSION', '1.0b1.1' ); 6 6 7 7 /* How long before activity items in streams are re-cached? */ … … 38 38 component_action varchar(75) NOT NULL, 39 39 date_recorded datetime NOT NULL, 40 is_private tinyint(1) NOT NULL, 40 is_private tinyint(1) NOT NULL DEFAULT 0, 41 no_sitewide_cache tinyint(1) NOT NULL DEFAULT 0, 41 42 KEY item_id (item_id), 42 43 KEY user_id (user_id), … … 55 56 date_cached datetime NOT NULL, 56 57 date_recorded datetime NOT NULL, 57 is_private tinyint(1) NOT NULL ,58 is_private tinyint(1) NOT NULL DEFAULT 0, 58 59 KEY date_cached (date_cached), 59 60 KEY date_recorded (date_recorded), … … 240 241 $activity->date_recorded = $recorded_time; 241 242 $activity->is_private = $is_private; 242 243 243 244 // We don't want to record this on the sitewide stream, otherwise we will get duplicates. 244 $activity->no_sitewide_ recording= true;245 $activity->no_sitewide_cache = true; 245 246 246 247 $secondary_user_save = $activity->save(); -
trunk/bp-activity/bp-activity-classes.php
r849 r864 10 10 var $component_action; 11 11 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; 15 14 16 15 var $table_name; … … 41 40 $this->date_recorded = $activity->date_recorded; 42 41 $this->is_private = $activity->is_private; 42 $this->no_sitewide_cache = $activity->no_sitewide_cache; 43 43 } 44 44 … … 55 55 if ( !$this->exists() ) { 56 56 // 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 ) ); 58 58 59 59 // Fetch the formatted activity content so we can add it to the cache. … … 67 67 68 68 // Add the cached version of the activity to the sitewide activity table. 69 if ( !$this->no_sitewide_ recording)69 if ( !$this->no_sitewide_cache ) 70 70 $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 ) ); 71 71 … … 168 168 $activities_formatted[$i]['component_action'] = $activities[$i]->component_action; 169 169 $activities_formatted[$i]['is_private'] = $activities[$i]->is_private; 170 $activities_formatted[$i]['no_sitewide_cache'] = $activities[$i]->no_sitewide_cache; 170 171 } 171 172 } … … 320 321 321 322 // 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'] ) 323 324 $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'] ) ); 324 325 }
Note: See TracChangeset
for help on using the changeset viewer.