Changeset 2397 for trunk/bp-activity/bp-activity-classes.php
- Timestamp:
- 01/21/2010 03:47:02 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-activity/bp-activity-classes.php
r2381 r2397 295 295 } 296 296 297 function get_id( $user_id, $component, $type, $item_id, $secondary_item_id ) { 298 global $bp, $wpdb; 299 300 $where_args = false; 301 302 if ( !empty( $user_id ) ) 303 $where_args[] = $wpdb->prepare( "user_id = %d", $user_id ); 304 305 if ( !empty( $component ) ) 306 $where_args[] = $wpdb->prepare( "component = %s", $component ); 307 308 if ( !empty( $type ) ) 309 $where_args[] = $wpdb->prepare( "type = %s", $type ); 310 311 if ( !empty( $item_id ) ) 312 $where_args[] = $wpdb->prepare( "item_id = %s", $item_id ); 313 314 if ( !empty( $secondary_item_id ) ) 315 $where_args[] = $wpdb->prepare( "secondary_item_id = %s", $secondary_item_id ); 316 317 if ( !empty( $where_args ) ) 318 $where_sql = 'WHERE ' . join( ' AND ', $where_args ); 319 else 320 return false; 321 322 return $wpdb->get_var( "SELECT id FROM {$bp->activity->table_name} {$where_sql}" ); 323 } 324 297 325 function append_comments( $activities ) { 298 326 global $bp, $wpdb;
Note: See TracChangeset
for help on using the changeset viewer.