Changeset 2381
- Timestamp:
- 01/20/2010 04:21:20 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-activity.php
r2362 r2381 1 1 <?php 2 2 3 define ( 'BP_ACTIVITY_DB_VERSION', '20 20' );3 define ( 'BP_ACTIVITY_DB_VERSION', '2031' ); 4 4 5 5 /* Define the slug for the component */ … … 18 18 19 19 /* Rename the old user activity cached table if needed. */ 20 $wpdb->query( "RENAME TABLE {$wpdb->base_prefix}bp_activity_user_activity_cached TO {$bp->activity->table_name}" ); 21 20 if ( $wpdb->get_var( "SHOW TABLES LIKE '%{$wpdb->base_prefix}bp_activity_user_activity_cached%'" ) ) { 21 $wpdb->query( "RENAME TABLE {$wpdb->base_prefix}bp_activity_user_activity_cached TO {$bp->activity->table_name}" ); 22 } 23 24 /* Rename fields from pre BP 1.2 */ 25 if ( $wpdb->get_var( "SHOW TABLES LIKE '%{$bp->activity->table_name}%'" ) ) { 26 $wpdb->query( "ALTER TABLE {$bp->activity->table_name} CHANGE type type varchar(75) NOT NULL" ); 27 $wpdb->query( "ALTER TABLE {$bp->activity->table_name} CHANGE component component varchar(75) NOT NULL" ); 28 } 29 30 /** 31 * Build the tables 32 */ 22 33 $sql[] = "CREATE TABLE {$bp->activity->table_name} ( 23 34 id bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY, 24 35 user_id bigint(20) NOT NULL, 25 component_name varchar(75) NOT NULL, 26 component_action varchar(75) NOT NULL, 36 component varchar(75) NOT NULL, 37 type varchar(75) NOT NULL, 38 action text NOT NULL 27 39 content longtext NOT NULL, 28 40 primary_link varchar(150) NOT NULL, 29 41 item_id varchar(75) NOT NULL, 30 secondary_item_id varchar(75) NOT NULL,42 secondary_item_id varchar(75) DEFAULT NULL, 31 43 date_recorded datetime NOT NULL, 32 44 hide_sitewide bool DEFAULT 0, … … 36 48 KEY user_id (user_id), 37 49 KEY item_id (item_id), 38 KEY component _name (component_name)50 KEY component (component) 39 51 ) {$charset_collate};"; 40 52 … … 167 179 $has_access = true; 168 180 /* Redirect based on the type of activity */ 169 if ( $activity->component _name== $bp->groups->id ) {181 if ( $activity->component == $bp->groups->id ) { 170 182 if ( !function_exists( 'groups_get_group' ) ) 171 183 bp_core_redirect( $bp->root_domain ); … … 248 260 $redirect = false; 249 261 /* Redirect based on the type of activity */ 250 if ( $activity->component _name== $bp->groups->id ) {262 if ( $activity->component == $bp->groups->id ) { 251 263 if ( $activity->user_id ) 252 264 $redirect = bp_core_get_user_domain( $activity->user_id, $activity->user_nicename, $activity->user_login ) . $bp->activity->slug . '/' . $activity->id; … … 445 457 'id' => false, // Pass an existing activity ID to update an existing entry. 446 458 447 'content' => false, // The content of the activity item 448 'primary_link' => false, // The primary URL for this item in RSS feeds 449 'component_name' => false, // The name/ID of the component e.g. groups, profile, mycomponent 450 'component_action' => false, // The component action e.g. activity_update, profile_updated 459 'action' => '', // The activity action - e.g. "Jon Doe posted an update" 460 'content' => '', // Optional: The content of the activity item e.g. "BuddyPress is awesome guys!" 461 462 'component' => false, // The name/ID of the component e.g. groups, profile, mycomponent 463 'type' => false, // The activity type e.g. activity_update, profile_updated 464 'primary_link' => '', // Optional: The primary URL for this item in RSS feeds (defaults to activity permalink) 451 465 452 466 'user_id' => $bp->loggedin_user->id, // Optional: The user to record the activity for, can be false if this activity is not for a user. … … 460 474 extract( $params, EXTR_SKIP ); 461 475 462 /* Insert the "time-since" placeholder */ 463 if ( $content ) 476 /* Make sure we are backwards compatible */ 477 if ( empty( $component ) && !empty( $component_name ) ) 478 $component = $component_name; 479 480 if ( empty( $type ) && !empty( $component_action ) ) 481 $type = $component_action; 482 483 /* Insert the "time-since" placeholder (use content if action empty for backwards compat) */ 484 if ( !empty( $action ) ) 485 $action = bp_activity_add_timesince_placeholder( $action ); 486 else if ( empty( $action ) && !empty( $content ) ) 464 487 $content = bp_activity_add_timesince_placeholder( $content ); 465 488 489 /* Remove any images and replace the first image with a thumbnail */ 490 //$content = bp_activity_thumbnail_images( $content ); 491 466 492 $activity = new BP_Activity_Activity( $id ); 467 493 468 494 $activity->user_id = $user_id; 495 $activity->component = $component; 496 $activity->type = $type; 497 $activity->action = $action; 469 498 $activity->content = $content; 470 499 $activity->primary_link = $primary_link; 471 $activity->component_name = $component_name;472 $activity->component_action = $component_action;473 500 $activity->item_id = $item_id; 474 501 $activity->secondary_item_id = $secondary_item_id; … … 480 507 481 508 /* If this is an activity comment, rebuild the tree */ 482 if ( 'activity_comment' == $activity-> component_action)509 if ( 'activity_comment' == $activity->type ) 483 510 BP_Activity_Activity::rebuild_activity_comment_tree( $activity->item_id ); 484 511 … … 499 526 extract( $r, EXTR_SKIP ); 500 527 501 if ( empty( $content) || empty($content) )528 if ( empty( $content ) ) 502 529 return false; 503 530 504 531 /* Record this on the user's profile */ 505 532 $from_user_link = bp_core_get_userlink( $user_id ); 506 $activity_ content = sprintf( __('%s posted an update:', 'buddypress'), $from_user_link );507 $activity_content .= '<div class="activity-inner">' . $content . '</div>';533 $activity_action = sprintf( __( '%s posted an update:', 'buddypress' ), $from_user_link ); 534 $activity_content = '<div class="activity-inner">' . $content . '</div>'; 508 535 509 536 $primary_link = bp_core_get_userlink( $user_id, false, true ); … … 512 539 $activity_id = bp_activity_add( array( 513 540 'user_id' => $user_id, 541 'action' => apply_filters( 'bp_activity_new_update_action', $activity_action ), 514 542 'content' => apply_filters( 'bp_activity_new_update_content', $activity_content ), 515 543 'primary_link' => apply_filters( 'bp_activity_new_update_primary_link', $primary_link ), 516 'component _name' => $bp->activity->id,517 ' component_action' => 'activity_update'544 'component' => $bp->activity->id, 545 'type' => 'activity_update' 518 546 ) ); 519 547 … … 552 580 'content' => apply_filters( 'bp_activity_comment_content', $comment_header . '<div class="activity-inner">' . $content . '</div>' ), 553 581 'primary_link' => '', 554 'component _name' => $bp->activity->id,555 ' component_action' => 'activity_comment',582 'component' => $bp->activity->id, 583 'type' => 'activity_comment', 556 584 'user_id' => $user_id, 557 585 'item_id' => $activity_id, … … 588 616 $defaults = array( 589 617 'item_id' => false, 590 'component _name' => false,591 ' component_action' => false, // optional618 'component' => false, 619 'type' => false, // optional 592 620 'user_id' => false, // optional 593 621 'secondary_item_id' => false // optional … … 597 625 extract( $r, EXTR_SKIP ); 598 626 599 if ( !$activity_ids_deleted = BP_Activity_Activity::delete_by_item_id( $item_id, $component _name, $component_action, $user_id, $secondary_item_id ) )600 return false; 601 602 do_action( 'bp_activity_delete_by_item_id', $item_id, $component _name, $component_action, $user_id, $secondary_item_id );627 if ( !$activity_ids_deleted = BP_Activity_Activity::delete_by_item_id( $item_id, $component, $type, $user_id, $secondary_item_id ) ) 628 return false; 629 630 do_action( 'bp_activity_delete_by_item_id', $item_id, $component, $type, $user_id, $secondary_item_id ); 603 631 do_action( 'bp_activity_deleted_activities', $activity_ids_deleted ); 604 632 … … 616 644 } 617 645 618 function bp_activity_delete_by_content( $user_id, $content, $component _name, $component_action) {646 function bp_activity_delete_by_content( $user_id, $content, $component, $type ) { 619 647 /* Insert the "time-since" placeholder to match the existing content in the DB */ 620 648 $content = bp_activity_add_timesince_placeholder( $content ); 621 649 622 if ( !$activity_ids_deleted = BP_Activity_Activity::delete_by_content( $user_id, $content, $component _name, $component_action) )623 return false; 624 625 do_action( 'bp_activity_delete_by_content', $user_id, $content, $component _name, $component_action);650 if ( !$activity_ids_deleted = BP_Activity_Activity::delete_by_content( $user_id, $content, $component, $type ) ) 651 return false; 652 653 do_action( 'bp_activity_delete_by_content', $user_id, $content, $component, $type ); 626 654 do_action( 'bp_activity_deleted_activities', $activity_ids_deleted ); 627 655 … … 629 657 } 630 658 631 function bp_activity_delete_for_user_by_component( $user_id, $component _name) {632 if ( !$activity_ids_deleted = BP_Activity_Activity::delete_for_user_by_component( $user_id, $component _name) )633 return false; 634 635 do_action( 'bp_activity_delete_for_user_by_component', $user_id, $component _name);659 function bp_activity_delete_for_user_by_component( $user_id, $component ) { 660 if ( !$activity_ids_deleted = BP_Activity_Activity::delete_for_user_by_component( $user_id, $component ) ) 661 return false; 662 663 do_action( 'bp_activity_delete_for_user_by_component', $user_id, $component ); 636 664 do_action( 'bp_activity_deleted_activities', $activity_ids_deleted ); 637 665 … … 645 673 $activity_obj = new BP_Activity_Activity( $activity_id ); 646 674 647 if ( 'new_blog_post' == $activity_obj-> component_action || 'new_blog_comment' == $activity_obj->component_action || 'new_forum_topic' == $activity_obj->component_action || 'new_forum_post' == $activity_obj->component_action)675 if ( 'new_blog_post' == $activity_obj->type || 'new_blog_comment' == $activity_obj->type || 'new_forum_topic' == $activity_obj->type || 'new_forum_post' == $activity_obj->type ) 648 676 $link = $activity_obj->primary_link; 649 677 else { 650 if ( 'activity_comment' == $activity_obj-> component_action)678 if ( 'activity_comment' == $activity_obj->type ) 651 679 $link = $bp->root_domain . '/' . BP_ACTIVITY_SLUG . '/p/' . $activity_obj->item_id . '/'; 652 680 else … … 682 710 } 683 711 712 function bp_activity_thumbnail_images( $content ) { 713 preg_match_all( '/<img[^>]*>/Ui', $content, $matches ); 714 $content = preg_replace('/<img[^>]*>/Ui', '', $content ); 715 716 if ( !empty( $matches ) ) { 717 /* Get the SRC value */ 718 preg_match( '/<img.*?(src\=[\'|"]{0,1}.*?[\'|"]{0,1})[\s|>]{1}/i', $matches[0][0], $src ); 719 720 if ( !empty( $src ) ) { 721 $src = substr( substr( str_replace( 'src=', '', $src[1] ), 0, -1 ), 1 ); 722 $pos = strpos( $content, '<blockquote>' ); 723 $before = substr( $content, 0, (int) $pos ); 724 $after = substr( $content, (int) $pos, strlen( $content ) ); 725 726 $content = $before . '<img src="' . esc_attr( $src) . '" width="100" height="100" alt="thumb" class="align-left thumbnail" />' . $after; 727 } 728 } 729 730 return $content; 731 } 732 684 733 function bp_activity_set_action( $component_id, $key, $value ) { 685 734 global $bp; -
trunk/bp-activity/bp-activity-classes.php
r2369 r2381 7 7 var $user_id; 8 8 var $primary_link; 9 var $component_name; 10 var $component_action; 9 var $component; 10 var $type; 11 var $action; 12 var $content; 11 13 var $date_recorded; 12 14 var $hide_sitewide = false; … … 24 26 global $wpdb, $bp; 25 27 26 $ activity= $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$bp->activity->table_name} WHERE id = %d", $this->id ) );28 $row = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$bp->activity->table_name} WHERE id = %d", $this->id ) ); 27 29 28 30 if ( $activity ) { 29 $this->id = $activity->id; 30 $this->item_id = $activity->item_id; 31 $this->secondary_item_id = $activity->secondary_item_id; 32 $this->user_id = $activity->user_id; 33 $this->content = $activity->content; 34 $this->primary_link = $activity->primary_link; 35 $this->component_name = $activity->component_name; 36 $this->component_action = $activity->component_action; 37 $this->date_recorded = $activity->date_recorded; 38 $this->hide_sitewide = $activity->hide_sitewide; 31 $this->id = $row->id; 32 $this->item_id = $row->item_id; 33 $this->secondary_item_id = $row->secondary_item_id; 34 $this->user_id = $row->user_id; 35 $this->primary_link = $row->primary_link; 36 $this->component = $row->component; 37 $this->type = $row->type; 38 $this->action = $row->type; 39 $this->content = $row->content; 40 $this->date_recorded = $row->date_recorded; 41 $this->hide_sitewide = $row->hide_sitewide; 39 42 } 40 43 } … … 45 48 do_action( 'bp_activity_before_save', $this ); 46 49 47 if ( !$this->component _name || !$this->component_action)50 if ( !$this->component || !$this->type ) 48 51 return false; 49 52 … … 53 56 /* If we have an existing ID, update the activity item, otherwise insert it. */ 54 57 if ( $this->id ) 55 $q = $wpdb->prepare( "UPDATE {$bp->activity->table_name} SET user_id = %d, component _name = %s, component_action = %s, content = %s, primary_link = %s, date_recorded = FROM_UNIXTIME(%d), item_id = %s, secondary_item_id = %s, hide_sitewide = %d WHERE id = %d", $this->user_id, $this->component_name, $this->component_action, $this->content, $this->primary_link, $this->date_recorded, $this->item_id, $this->secondary_item_id, $this->hide_sitewide, $this->id );58 $q = $wpdb->prepare( "UPDATE {$bp->activity->table_name} SET user_id = %d, component = %s, type = %s, action = %s, content = %s, primary_link = %s, date_recorded = FROM_UNIXTIME(%d), item_id = %s, secondary_item_id = %s, hide_sitewide = %d WHERE id = %d", $this->user_id, $this->component, $this->type, $this->action, $this->content, $this->primary_link, $this->date_recorded, $this->item_id, $this->secondary_item_id, $this->hide_sitewide, $this->id ); 56 59 else 57 $q = $wpdb->prepare( "INSERT INTO {$bp->activity->table_name} ( user_id, component _name, component_action, content, primary_link, date_recorded, item_id, secondary_item_id, hide_sitewide ) VALUES ( %d, %s, %s, %s, %s, FROM_UNIXTIME(%d), %s, %s, %d )", $this->user_id, $this->component_name, $this->component_action, $this->content, $this->primary_link, $this->date_recorded, $this->item_id, $this->secondary_item_id, $this->hide_sitewide );60 $q = $wpdb->prepare( "INSERT INTO {$bp->activity->table_name} ( user_id, component, type, action, content, primary_link, date_recorded, item_id, secondary_item_id, hide_sitewide ) VALUES ( %d, %s, %s, %s, %s, %s, FROM_UNIXTIME(%d), %s, %s, %d )", $this->user_id, $this->component, $this->type, $this->action, $this->content, $this->primary_link, $this->date_recorded, $this->item_id, $this->secondary_item_id, $this->hide_sitewide ); 58 61 59 62 if ( !$wpdb->query( $q ) ) … … 68 71 /* Static Functions */ 69 72 70 function delete( $item_id, $component _name, $component_action, $user_id = false, $secondary_item_id = false ) {73 function delete( $item_id, $component, $type, $user_id = false, $secondary_item_id = false ) { 71 74 global $wpdb, $bp; 72 75 … … 74 77 $secondary_sql = $wpdb->prepare( "AND secondary_item_id = %s", $secondary_item_id ); 75 78 76 if ( $ component_action)77 $ component_action_sql = $wpdb->prepare( "AND component_action = %s", $component_action);79 if ( $type ) 80 $type_sql = $wpdb->prepare( "AND type = %s", $type ); 78 81 79 82 if ( $user_id ) … … 81 84 82 85 /* Fetch the activity IDs so we can delete any comments for this activity item */ 83 $activity_ids = $wpdb->get_col( $wpdb->prepare( "SELECT id FROM {$bp->activity->table_name} WHERE item_id = %s {$secondary_sql} AND component _name = %s {$component_action_sql} {$user_sql}", $item_id, $component_name) );84 85 error_log( $wpdb->prepare( "DELETE FROM {$bp->activity->table_name} WHERE item_id = %s {$secondary_sql} AND component _name = %s {$component_action_sql} {$user_sql}", $item_id, $component_name) );86 87 if ( !$wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->activity->table_name} WHERE item_id = %s {$secondary_sql} AND component _name = %s {$component_action_sql} {$user_sql}", $item_id, $component_name) ) )86 $activity_ids = $wpdb->get_col( $wpdb->prepare( "SELECT id FROM {$bp->activity->table_name} WHERE item_id = %s {$secondary_sql} AND component = %s {$type_sql} {$user_sql}", $item_id, $component ) ); 87 88 error_log( $wpdb->prepare( "DELETE FROM {$bp->activity->table_name} WHERE item_id = %s {$secondary_sql} AND component = %s {$type_sql} {$user_sql}", $item_id, $component ) ); 89 90 if ( !$wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->activity->table_name} WHERE item_id = %s {$secondary_sql} AND component = %s {$type_sql} {$user_sql}", $item_id, $component ) ) ) 88 91 return false; 89 92 … … 98 101 } 99 102 100 function delete_by_item_id( $item_id, $component _name, $component_action, $user_id = false, $secondary_item_id = false ) {101 return BP_Activity_Activity::delete( $item_id, $component _name, $component_action, $user_id, $secondary_item_id );103 function delete_by_item_id( $item_id, $component, $type, $user_id = false, $secondary_item_id = false ) { 104 return BP_Activity_Activity::delete( $item_id, $component, $type, $user_id, $secondary_item_id ); 102 105 } 103 106 … … 115 118 } 116 119 117 function delete_by_content( $user_id, $content, $component _name, $component_action) {120 function delete_by_content( $user_id, $content, $component, $type ) { 118 121 global $bp, $wpdb; 119 122 120 123 /* Fetch the activity ID so we can delete any comments for this activity item */ 121 $activity_ids = $wpdb->get_col( $wpdb->prepare( "SELECT id FROM {$bp->activity->table_name} WHERE user_id = %d AND content = %s AND component _name = %s AND component_action = %s", $user_id, $content, $component_name, $component_action) );122 123 if ( !$wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->activity->table_name} WHERE user_id = %d AND content = %s AND component _name = %s AND component_action = %s", $user_id, $content, $component_name, $component_action) ) )124 $activity_ids = $wpdb->get_col( $wpdb->prepare( "SELECT id FROM {$bp->activity->table_name} WHERE user_id = %d AND content = %s AND component = %s AND type = %s", $user_id, $content, $component, $type ) ); 125 126 if ( !$wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->activity->table_name} WHERE user_id = %d AND content = %s AND component = %s AND type = %s", $user_id, $content, $component, $type ) ) ) 124 127 return false; 125 128 … … 134 137 } 135 138 136 function delete_for_user_by_component( $user_id, $component _name) {139 function delete_for_user_by_component( $user_id, $component ) { 137 140 global $bp, $wpdb; 138 141 139 142 /* Fetch the activity IDs so we can delete any comments for this activity item */ 140 $activity_ids = $wpdb->get_col( $wpdb->prepare( "SELECT id FROM {$bp->activity->table_name} WHERE user_id = %d AND component _name = %s", $user_id, $component_name) );141 142 if ( !$wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->activity->table_name} WHERE user_id = %d AND component _name = %s", $user_id, $component_name) ) )143 $activity_ids = $wpdb->get_col( $wpdb->prepare( "SELECT id FROM {$bp->activity->table_name} WHERE user_id = %d AND component = %s", $user_id, $component ) ); 144 145 if ( !$wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->activity->table_name} WHERE user_id = %d AND component = %s", $user_id, $component ) ) ) 143 146 return false; 144 147 … … 178 181 $activity_ids = $wpdb->escape( $activity_ids ); 179 182 180 return $wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->activity->table_name} WHERE component_action= 'activity_comment' AND item_id IN ({$activity_ids})" ) );183 return $wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->activity->table_name} WHERE type = 'activity_comment' AND item_id IN ({$activity_ids})" ) ); 181 184 } 182 185 … … 238 241 /* Alter the query based on whether we want to show activity item comments in the stream like normal comments or threaded below the activity */ 239 242 if ( !$display_comments || 'threaded' == $display_comments ) { 240 $where_conditions[] = "a. component_action!= 'activity_comment'";243 $where_conditions[] = "a.type != 'activity_comment'"; 241 244 } 242 245 … … 268 271 $activity_ids = $wpdb->escape( $activity_ids ); 269 272 273 if ( empty( $activity_ids ) ) 274 return false; 275 270 276 if ( $per_page && $page ) 271 277 $pag_sql = $wpdb->prepare( "LIMIT %d, %d", intval( ( $page - 1 ) * $per_page ), intval( $per_page ) ); … … 294 300 /* Now fetch the activity comments and parse them into the correct position in the activities array. */ 295 301 foreach( $activities as $activity ) { 296 if ( 'activity_comment' != $activity-> component_action&& $activity->mptt_left && $activity->mptt_right )302 if ( 'activity_comment' != $activity->type && $activity->mptt_left && $activity->mptt_right ) 297 303 $activity_comments[$activity->id] = BP_Activity_Activity::get_activity_comments( $activity->id, $activity->mptt_left, $activity->mptt_right ); 298 304 } … … 320 326 } 321 327 322 $descendants = $wpdb->get_results( $wpdb->prepare( "SELECT a.*, u.user_email, u.user_nicename, u.user_login, u.display_name{$fullname_select} FROM {$bp->activity->table_name} a, {$wpdb->users} u{$fullname_from} WHERE u.ID = a.user_id {$fullname_where} AND a. component_action= 'activity_comment' AND a.item_id = %d AND a.mptt_left BETWEEN %d AND %d ORDER BY a.date_recorded ASC", $activity_id, $left, $right ) );328 $descendants = $wpdb->get_results( $wpdb->prepare( "SELECT a.*, u.user_email, u.user_nicename, u.user_login, u.display_name{$fullname_select} FROM {$bp->activity->table_name} a, {$wpdb->users} u{$fullname_from} WHERE u.ID = a.user_id {$fullname_where} AND a.type = 'activity_comment' AND a.item_id = %d AND a.mptt_left BETWEEN %d AND %d ORDER BY a.date_recorded ASC", $activity_id, $left, $right ) ); 323 329 324 330 /* Loop descendants and build an assoc array */ … … 348 354 349 355 /* Get all descendants of this node */ 350 $descendants = $wpdb->get_results( $wpdb->prepare( "SELECT id FROM {$bp->activity->table_name} WHERE component_action= 'activity_comment' AND secondary_item_id = %d", $parent_id ) );356 $descendants = $wpdb->get_results( $wpdb->prepare( "SELECT id FROM {$bp->activity->table_name} WHERE type = 'activity_comment' AND secondary_item_id = %d", $parent_id ) ); 351 357 352 358 /* Loop the descendants and recalculate the left and right values */ … … 358 364 $wpdb->query( $wpdb->prepare( "UPDATE {$bp->activity->table_name} SET mptt_left = %d, mptt_right = %d WHERE id = %d", $left, $right, $parent_id ) ); 359 365 else 360 $wpdb->query( $wpdb->prepare( "UPDATE {$bp->activity->table_name} SET mptt_left = %d, mptt_right = %d WHERE component_action= 'activity_comment' AND id = %d", $left, $right, $parent_id ) );366 $wpdb->query( $wpdb->prepare( "UPDATE {$bp->activity->table_name} SET mptt_left = %d, mptt_right = %d WHERE type = 'activity_comment' AND id = %d", $left, $right, $parent_id ) ); 361 367 362 368 /* Return the right value of this node + 1 */ … … 364 370 } 365 371 366 function get_recorded_component _names() {367 global $wpdb, $bp; 368 369 return $wpdb->get_col( $wpdb->prepare( "SELECT DISTINCT component _name FROM {$bp->activity->table_name} ORDER BY component_nameASC" ) );372 function get_recorded_components() { 373 global $wpdb, $bp; 374 375 return $wpdb->get_col( $wpdb->prepare( "SELECT DISTINCT component FROM {$bp->activity->table_name} ORDER BY component ASC" ) ); 370 376 } 371 377 … … 414 420 $counter = 1; 415 421 foreach( (array) $object_filter as $object ) { 416 $object_sql .= $wpdb->prepare( "a.component _name= %s", trim( $object ) );422 $object_sql .= $wpdb->prepare( "a.component = %s", trim( $object ) ); 417 423 418 424 if ( $counter != count( $object_filter ) ) … … 432 438 $counter = 1; 433 439 foreach( (array) $action_filter as $action ) { 434 $action_sql .= $wpdb->prepare( "a. component_action= %s", trim( $action ) );440 $action_sql .= $wpdb->prepare( "a.type = %s", trim( $action ) ); 435 441 436 442 if ( $counter != count( $action_filter ) ) -
trunk/bp-activity/bp-activity-templatetags.php
r2375 r2381 266 266 function bp_get_activity_object_name() { 267 267 global $activities_template; 268 return apply_filters( 'bp_get_activity_object_name', $activities_template->activity->component_name ); 269 } 270 271 function bp_activity_action_name() { 272 echo bp_get_activity_action_name(); 273 } 274 function bp_get_activity_action_name() { 275 global $activities_template; 276 return apply_filters( 'bp_get_activity_action_name', $activities_template->activity->component_action ); 277 } 268 return apply_filters( 'bp_get_activity_object_name', $activities_template->activity->component ); 269 } 270 271 function bp_activity_type() { 272 echo bp_get_activity_type(); 273 } 274 function bp_get_activity_type() { 275 global $activities_template; 276 return apply_filters( 'bp_get_activity_type', $activities_template->activity->type ); 277 } 278 function bp_activity_action_name() { echo bp_activity_type(); } 279 function bp_get_activity_action_name() { return bp_get_activity_type(); } 278 280 279 281 function bp_activity_user_id() { … … 310 312 311 313 $object = 'user'; 312 if ( $bp->groups->id == $activities_template->activity->component _name&& !(int) $activities_template->activity->user_id )314 if ( $bp->groups->id == $activities_template->activity->component && !(int) $activities_template->activity->user_id ) 313 315 $object = 'group'; 314 if ( $bp->blogs->id == $activities_template->activity->component _name&& !(int) $activities_template->activity->user_id )316 if ( $bp->blogs->id == $activities_template->activity->component && !(int) $activities_template->activity->user_id ) 315 317 $object = 'blog'; 316 318 317 $object = apply_filters( 'bp_get_activity_avatar_object_' . $activities_template->activity->component _name, $object );319 $object = apply_filters( 'bp_get_activity_avatar_object_' . $activities_template->activity->component, $object ); 318 320 319 321 /* If this is a user object pass the users' email address for Gravatar so we don't have to refetch it. */ … … 324 326 } 325 327 328 function bp_activity_action() { 329 echo bp_get_activity_action(); 330 } 331 function bp_get_activity_action() { 332 global $activities_template; 333 334 return apply_filters( 'bp_get_activity_action', bp_activity_content_filter( $activities_template->activity->action, $activities_template->activity->date_recorded ), $activities_template->activity->component, $activities_template->activity->type ); 335 } 336 337 function bp_activity_content_body() { 338 echo bp_get_activity_content_body(); 339 } 340 function bp_get_activity_content_body() { 341 global $activities_template; 342 343 if ( empty( $activities_template->activity->action ) ) 344 $activities_template->activity->content = bp_activity_content_filter( $activities_template->activity->content, $activities_template->activity->date_recorded ); 345 346 return apply_filters( 'bp_get_activity_content_body', $activities_template->activity->content ); 347 } 348 326 349 function bp_activity_content() { 327 350 echo bp_get_activity_content(); 328 351 } 329 352 function bp_get_activity_content() { 330 global $activities_template, $allowed_tags, $bp; 331 332 if ( bp_is_home() && $activities_template->activity_type == 'personal' ) 333 $content = bp_activity_content_filter( $activities_template->activity->content, $activities_template->activity->date_recorded, $activities_template->full_name ); 334 else 335 $content = bp_activity_content_filter( $activities_template->activity->content, $activities_template->activity->date_recorded, $activities_template->full_name, true, false, false ); 336 337 return apply_filters( 'bp_get_activity_content', $content, $activities_template->activity->component_name, $activities_template->activity->component_action ); 338 } 339 340 function bp_activity_content_filter( $content, $date_recorded, $full_name, $insert_time = true, $filter_words = true, $filter_you = true ) { 353 global $activities_template; 354 355 if ( empty( $activities_template->activity->action ) ) 356 $content = bp_activity_content_filter( $activities_template->activity->content, $activities_template->activity->date_recorded ); 357 else { 358 $content = bp_activity_content_filter( $activities_template->activity->action, $activities_template->activity->date_recorded ); 359 $content .= $activities_template->activity->content; 360 } 361 362 return apply_filters( 'bp_get_activity_content', $content, $activities_template->activity->component, $activities_template->activity->type ); 363 } 364 365 function bp_activity_content_filter( $content, $date_recorded ) { 341 366 global $activities_template, $bp; 342 367 … … 351 376 352 377 /* Insert the time since */ 353 if ( $insert_time ) 354 $content[0] = bp_activity_insert_time_since( $content[0], $date_recorded ); 355 356 // The "You" and "Your" conversion is only done in english, if a translation file is present 357 // then do not translate as it causes problems in other languages. 358 if ( '' == get_locale() ) { 359 /* Switch 'their/your' depending on whether the user is logged in or not and viewing their profile */ 360 if ( $filter_words ) { 361 $content[0] = preg_replace( '/their\s/', 'your ', $content[0] ); 362 } 363 364 /* Remove the 'You' and replace if with the persons name */ 365 if ( $filter_you && $full_name != '' ) { 366 $content[0] = preg_replace( "/{$full_name}[<]/", 'You<', $content[0], 1 ); 367 } 368 } 378 $content[0] = bp_activity_insert_time_since( $content[0], $date_recorded ); 369 379 370 380 /* Add the permalink */ … … 559 569 560 570 $class = ''; 561 if ( in_array( $activities_template->activity-> component_action, (array)$mini_activity_actions ) )571 if ( in_array( $activities_template->activity->type, (array)$mini_activity_actions ) ) 562 572 $class = ' mini'; 563 573 … … 565 575 $class .= ' has-comments'; 566 576 567 return apply_filters( 'bp_get_activity_css_class', $activities_template->activity->component _name . ' ' . $activities_template->activity->component_action. $class );577 return apply_filters( 'bp_get_activity_css_class', $activities_template->activity->component . ' ' . $activities_template->activity->type . $class ); 568 578 } 569 579 … … 609 619 610 620 /* Fetch the names of components that have activity recorded in the DB */ 611 $component _names = BP_Activity_Activity::get_recorded_component_names();612 613 if ( !$component _names )621 $components = BP_Activity_Activity::get_recorded_components(); 622 623 if ( !$components ) 614 624 return false; 615 625 616 foreach ( (array) $component _names as $component_name) {626 foreach ( (array) $components as $component ) { 617 627 /* Skip the activity comment filter */ 618 if ( 'activity' == $component _name)628 if ( 'activity' == $component ) 619 629 continue; 620 630 621 if ( isset( $_GET['afilter'] ) && $component _name== $_GET['afilter'] )631 if ( isset( $_GET['afilter'] ) && $component == $_GET['afilter'] ) 622 632 $selected = ' class="selected"'; 623 633 else 624 634 unset($selected); 625 635 626 $component _name = attribute_escape( $component_name);636 $component = attribute_escape( $component ); 627 637 628 638 switch ( $style ) { 629 639 case 'list': 630 640 $tag = 'li'; 631 $before = '<li id="afilter-' . $component _name. '"' . $selected . '>';641 $before = '<li id="afilter-' . $component . '"' . $selected . '>'; 632 642 $after = '</li>'; 633 643 break; 634 644 case 'paragraph': 635 645 $tag = 'p'; 636 $before = '<p id="afilter-' . $component _name. '"' . $selected . '>';646 $before = '<p id="afilter-' . $component . '"' . $selected . '>'; 637 647 $after = '</p>'; 638 648 break; 639 649 case 'span': 640 650 $tag = 'span'; 641 $before = '<span id="afilter-' . $component _name. '"' . $selected . '>';651 $before = '<span id="afilter-' . $component . '"' . $selected . '>'; 642 652 $after = '</span>'; 643 653 break; 644 654 } 645 655 646 $link = add_query_arg( 'afilter', $component _name);656 $link = add_query_arg( 'afilter', $component ); 647 657 $link = remove_query_arg( 'acpage' , $link ); 648 658 649 $link = apply_filters( 'bp_get_activity_filter_link_href', $link, $component _name);659 $link = apply_filters( 'bp_get_activity_filter_link_href', $link, $component ); 650 660 651 661 /* Make sure all core internal component names are translatable */ 652 $translatable_component _names = array( __( 'profile', 'buddypress'), __( 'friends', 'buddypress' ), __( 'groups', 'buddypress' ), __( 'status', 'buddypress' ), __( 'blogs', 'buddypress' ) );653 654 $component_links[] = $before . '<a href="' . attribute_escape( $link ) . '">' . ucwords( __( $component _name, 'buddypress' ) ) . '</a>' . $after;662 $translatable_components = array( __( 'profile', 'buddypress'), __( 'friends', 'buddypress' ), __( 'groups', 'buddypress' ), __( 'status', 'buddypress' ), __( 'blogs', 'buddypress' ) ); 663 664 $component_links[] = $before . '<a href="' . attribute_escape( $link ) . '">' . ucwords( __( $component, 'buddypress' ) ) . '</a>' . $after; 655 665 } 656 666 … … 745 755 global $activities_template; 746 756 747 $content = explode( '<span', $activities_template->activity->content ); 757 if ( !empty( $activities_template->activity->action ) ) 758 $content = $activities_template->activity->action; 759 else 760 $content = $activities_template->activity->content; 761 762 $content = explode( '<span', $content ); 748 763 $title = trim( strip_tags( html_entity_decode( $content[0] ) ) ); 749 764 … … 751 766 $title = substr( $title, 0, -1 ); 752 767 753 if ( 'activity_update' == $activities_template->activity-> component_action) {768 if ( 'activity_update' == $activities_template->activity->type ) { 754 769 $content = explode( '<div class="activity-inner">', $activities_template->activity->content ); 755 770 $title .= ': ' . strip_tags( bp_create_excerpt( $content[1], 15 )); … … 783 798 global $activities_template; 784 799 785 return apply_filters( 'bp_get_activity_feed_item_description', html_entity_decode( str_replace( '%s', '', $activities_template->activity->content ), ENT_COMPAT, 'UTF-8' ) ); 800 if ( empty( $activities_template->activity->action ) ) 801 $content = $activities_template->activity->content; 802 else 803 $content = $activities_template->activity->action . $activities_template->activity->content; 804 805 return apply_filters( 'bp_get_activity_feed_item_description', html_entity_decode( str_replace( '%s', '', $content ), ENT_COMPAT, 'UTF-8' ) ); 786 806 } 787 807 -
trunk/bp-blogs.php
r2328 r2381 246 246 $defaults = array( 247 247 'user_id' => $bp->loggedin_user->id, 248 'content' => false, 249 'primary_link' => false, 250 'component_name' => $bp->blogs->id, 251 'component_action' => false, 248 'action' => '', 249 'content' => '', 250 'primary_link' => '', 251 'component' => $bp->blogs->id, 252 'type' => false, 252 253 'item_id' => false, 253 254 'secondary_item_id' => false, … … 259 260 extract( $r, EXTR_SKIP ); 260 261 261 return bp_activity_add( array( 'user_id' => $user_id, ' content' => $content, 'primary_link' => $primary_link, 'component_name' => $component_name, 'component_action' => $component_action, 'item_id' => $item_id, 'secondary_item_id' => $secondary_item_id, 'recorded_time' => $recorded_time, 'hide_sitewide' => $hide_sitewide ) );262 return bp_activity_add( array( 'user_id' => $user_id, 'action' => $action, 'content' => $content, 'primary_link' => $primary_link, 'component' => $component, 'type' => $type, 'item_id' => $item_id, 'secondary_item_id' => $secondary_item_id, 'recorded_time' => $recorded_time, 'hide_sitewide' => $hide_sitewide ) ); 262 263 } 263 264 … … 268 269 $defaults = array( 269 270 'item_id' => false, 270 'component _name' => $bp->blogs->id,271 ' component_action' => false,271 'component' => $bp->blogs->id, 272 'type' => false, 272 273 'user_id' => false, 273 274 'secondary_item_id' => false … … 279 280 bp_activity_delete_by_item_id( array( 280 281 'item_id' => $item_id, 281 'component _name' => $component_name,282 ' component_action' => $component_action,282 'component' => $component, 283 'type' => $type, 283 284 'user_id' => $user_id, 284 285 'secondary_item_id' => $secondary_item_id … … 341 342 bp_blogs_record_activity( array( 342 343 'user_id' => $recorded_blog->user_id, 343 ' content' => apply_filters( 'bp_blogs_activity_created_blog', sprintf( __( '%s created the blog %s', 'buddypress'), bp_core_get_userlink( $recorded_blog->user_id ), '<a href="' . get_blog_option( $recorded_blog->blog_id, 'siteurl' ) . '">' . attribute_escape( $name ) . '</a>' ), &$recorded_blog, $name, $description ),344 'action' => apply_filters( 'bp_blogs_activity_created_blog_action', sprintf( __( '%s created the blog %s', 'buddypress'), bp_core_get_userlink( $recorded_blog->user_id ), '<a href="' . get_blog_option( $recorded_blog->blog_id, 'siteurl' ) . '">' . attribute_escape( $name ) . '</a>' ), &$recorded_blog, $name, $description ), 344 345 'primary_link' => apply_filters( 'bp_blogs_activity_created_blog_primary_link', get_blog_option( $recorded_blog->blog_id, 'siteurl' ), $recorded_blog->blog_id ), 345 ' component_action' => 'new_blog',346 'type' => 'new_blog', 346 347 'item_id' => $recorded_blog->blog_id 347 348 ) ); … … 389 390 $post_permalink = bp_post_get_permalink( $post, $blog_id ); 390 391 391 $activity_ content= sprintf( __( '%s wrote a new blog post: %s', 'buddypress' ), bp_core_get_userlink( (int)$post->post_author ), '<a href="' . $post_permalink . '">' . $post->post_title . '</a>' );392 $activity_content .= "<blockquote>" . bp_create_excerpt( $post->post_content ) . "</blockquote>";392 $activity_action = sprintf( __( '%s wrote a new blog post: %s', 'buddypress' ), bp_core_get_userlink( (int)$post->post_author ), '<a href="' . $post_permalink . '">' . $post->post_title . '</a>' ); 393 $activity_content = "<blockquote>" . bp_create_excerpt( $post->post_content ) . "</blockquote>"; 393 394 394 395 bp_blogs_record_activity( array( 395 396 'user_id' => (int)$post->post_author, 396 'content' => apply_filters( 'bp_blogs_activity_new_post', $activity_content, &$post, $post_permalink ), 397 'action' => apply_filters( 'bp_blogs_activity_new_post_action', $activity_action, &$post, $post_permalink ), 398 'content' => apply_filters( 'bp_blogs_activity_new_post_content', $activity_content, &$post, $post_permalink ), 397 399 'primary_link' => apply_filters( 'bp_blogs_activity_new_post_primary_link', $post_permalink, $post_id ), 398 ' component_action' => 'new_blog_post',400 'type' => 'new_blog_post', 399 401 'item_id' => $blog_id, 400 402 'secondary_item_id' => $post_id, … … 407 409 408 410 /* Delete and the activity stream item as we are probably going to re-add it later with new info. */ 409 bp_blogs_delete_activity( array( 'item_id' => $existing_post->id, 'component _name' => $bp->blogs->slug, 'component_action' => 'new_blog_post' ) );411 bp_blogs_delete_activity( array( 'item_id' => $existing_post->id, 'component' => $bp->blogs->slug, 'type' => 'new_blog_post' ) ); 410 412 411 413 /* Delete the recorded post if the status is not published or it is password protected */ … … 426 428 $post_permalink = bp_post_get_permalink( $post, $blog_id ); 427 429 428 $activity_ content= sprintf( __( '%s wrote a new blog post: %s', 'buddypress' ), bp_core_get_userlink( (int)$post->post_author ), '<a href="' . $post_permalink . '">' . $post->post_title . '</a>' );429 $activity_content .= "<blockquote>" . bp_create_excerpt( $post->post_content ) . "</blockquote>";430 $activity_action = sprintf( __( '%s wrote a new blog post: %s', 'buddypress' ), bp_core_get_userlink( (int)$post->post_author ), '<a href="' . $post_permalink . '">' . $post->post_title . '</a>' ); 431 $activity_content = "<blockquote>" . bp_create_excerpt( $post->post_content ) . "</blockquote>"; 430 432 431 433 /* Record this in activity streams */ 432 434 bp_blogs_record_activity( array( 433 435 'user_id' => (int)$post->post_author, 434 'content' => apply_filters( 'bp_blogs_activity_new_post', $activity_content, &$post, $post_permalink ), 436 'action' => apply_filters( 'bp_blogs_activity_new_post_action', $activity_action, &$post, $post_permalink ), 437 'content' => apply_filters( 'bp_blogs_activity_new_post_content', $activity_content, &$post, $post_permalink ), 435 438 'primary_link' => apply_filters( 'bp_blogs_activity_new_post_primary_link', $post_permalink, $post_id ), 436 ' component_action' => 'new_blog_post',439 'type' => 'new_blog_post', 437 440 'item_id' => $blog_id, 438 441 'secondary_item_id' => $existing_post->id, … … 483 486 /* Record in activity streams */ 484 487 $comment_link = bp_post_get_permalink( $comment->post, $wpdb->blogid ) . '#comment-' . $comment_id; 485 $activity_ content= sprintf( __( '%s commented on the blog post %s', 'buddypress' ), bp_core_get_userlink( $user_id ), '<a href="' . $comment_link . '#comment-' . $comment->comment_ID . '">' . $comment->post->post_title . '</a>' );486 $activity_content .= '<blockquote>' . bp_create_excerpt( $comment->comment_content ) . '</blockquote>';488 $activity_action = sprintf( __( '%s commented on the blog post %s', 'buddypress' ), bp_core_get_userlink( $user_id ), '<a href="' . $comment_link . '#comment-' . $comment->comment_ID . '">' . $comment->post->post_title . '</a>' ); 489 $activity_content = '<blockquote>' . bp_create_excerpt( $comment->comment_content ) . '</blockquote>'; 487 490 488 491 /* Record this in activity streams */ 489 492 bp_blogs_record_activity( array( 490 493 'user_id' => $user_id, 491 'content' => apply_filters( 'bp_blogs_activity_new_comment', $activity_content, &$comment, &$recorded_comment, $comment_link ), 494 'action' => apply_filters( 'bp_blogs_activity_new_comment_action', $activity_action, &$comment, &$recorded_comment, $comment_link ), 495 'content' => apply_filters( 'bp_blogs_activity_new_comment_content', $activity_content, &$comment, &$recorded_comment, $comment_link ), 492 496 'primary_link' => apply_filters( 'bp_blogs_activity_new_comment_primary_link', $comment_link, &$comment, &$recorded_comment ), 493 ' component_action' => 'new_blog_comment',497 'type' => 'new_blog_comment', 494 498 'item_id' => $wpdb->blogid, 495 499 'secondary_item_id' => $comment_id, … … 530 534 531 535 // Delete activity stream item 532 bp_blogs_delete_activity( array( 'item_id' => $blog_id, 'component _name' => $bp->blogs->slug, 'component_action' => 'new_blog' ) );536 bp_blogs_delete_activity( array( 'item_id' => $blog_id, 'component' => $bp->blogs->slug, 'type' => 'new_blog' ) ); 533 537 534 538 do_action( 'bp_blogs_remove_blog', $blog_id ); … … 545 549 546 550 // Delete activity stream item 547 bp_blogs_delete_activity( array( 'item_id' => $blog_id, 'component _name' => $bp->blogs->slug, 'component_action' => 'new_blog' ) );551 bp_blogs_delete_activity( array( 'item_id' => $blog_id, 'component' => $bp->blogs->slug, 'type' => 'new_blog' ) ); 548 552 549 553 do_action( 'bp_blogs_remove_blog_for_user', $blog_id, $user_id ); … … 566 570 567 571 // Delete activity stream item 568 bp_blogs_delete_activity( array( 'item_id' => $wpdb->blogid, 'component _name' => $existing_post->id, 'component_action' => 'new_blog_post' ) );572 bp_blogs_delete_activity( array( 'item_id' => $wpdb->blogid, 'component' => $existing_post->id, 'type' => 'new_blog_post' ) ); 569 573 570 574 do_action( 'bp_blogs_remove_post', $blog_id, $post_id, $post->user_id ); … … 579 583 580 584 // Delete activity stream item 581 bp_blogs_delete_activity( array( 'item_id' => $wpdb->blogid, 'secondary_item_id' => $comment_id, ' component_action' => 'new_blog_comment' ) );585 bp_blogs_delete_activity( array( 'item_id' => $wpdb->blogid, 'secondary_item_id' => $comment_id, 'type' => 'new_blog_comment' ) ); 582 586 583 587 do_action( 'bp_blogs_remove_comment', $blog_id, $comment_id, $bp->loggedin_user->id ); … … 608 612 609 613 // Delete activity stream item 610 bp_blogs_delete_activity( array( 'item_id' => $blog_id, 'component _name' => $bp->blogs->slug, 'component_action' => false ) );614 bp_blogs_delete_activity( array( 'item_id' => $blog_id, 'component' => $bp->blogs->slug, 'type' => false ) ); 611 615 612 616 do_action( 'bp_blogs_remove_data_for_blog', $blog_id ); -
trunk/bp-core.php
r2375 r2381 246 246 247 247 /* Add names of root components to the banned blog list to avoid conflicts */ 248 bp_core_add_illegal_names(); 248 if ( bp_core_is_multisite() ) 249 bp_core_add_illegal_names(); 249 250 250 251 update_site_option( 'bp-core-db-version', BP_CORE_DB_VERSION ); -
trunk/bp-core/bp-core-activation.php
r2274 r2381 55 55 bp_activity_add( array( 56 56 'user_id' => $signup['user_id'], 57 'content' => apply_filters( 'bp_core_activity_registered_member', sprintf( __( '%s became a registered member', 'buddypress' ), $userlink ), $signup['user_id'] ), 58 'primary_link' => apply_filters( 'bp_core_actiivty_registered_member_primary_link', $userlink ), 59 'component_name' => 'profile', 60 'component_action' => 'new_member' 57 'action' => apply_filters( 'bp_core_activity_registered_member_action', sprintf( __( '%s became a registered member', 'buddypress' ), $userlink ), $signup['user_id'] ), 58 'component' => 'profile', 59 'type' => 'new_member' 61 60 ) ); 62 61 } -
trunk/bp-friends.php
r2369 r2381 269 269 $defaults = array( 270 270 'user_id' => $bp->loggedin_user->id, 271 'content' => false, 272 'primary_link' => false, 273 'component_name' => $bp->friends->id, 274 'component_action' => false, 271 'action' => '', 272 'content' => '', 273 'primary_link' => '', 274 'component' => $bp->friends->id, 275 'type' => false, 275 276 'item_id' => false, 276 277 'secondary_item_id' => false, … … 282 283 extract( $r, EXTR_SKIP ); 283 284 284 return bp_activity_add( array( 'user_id' => $user_id, ' content' => $content, 'primary_link' => $primary_link, 'component_name' => $component_name, 'component_action' => $component_action, 'item_id' => $item_id, 'secondary_item_id' => $secondary_item_id, 'recorded_time' => $recorded_time, 'hide_sitewide' => $hide_sitewide ) );285 return bp_activity_add( array( 'user_id' => $user_id, 'action' => $action, 'content' => $content, 'primary_link' => $primary_link, 'component' => $component, 'type' => $type, 'item_id' => $item_id, 'secondary_item_id' => $secondary_item_id, 'recorded_time' => $recorded_time, 'hide_sitewide' => $hide_sitewide ) ); 285 286 } 286 287 … … 288 289 if ( function_exists('bp_activity_delete_by_item_id') ) { 289 290 extract( (array)$args ); 290 bp_activity_delete_by_item_id( array( 'item_id' => $item_id, 'component _name' => $bp->friends->id, 'component_action' => $component_action, 'user_id' => $user_id, 'secondary_item_id' => $secondary_item_id ) );291 bp_activity_delete_by_item_id( array( 'item_id' => $item_id, 'component' => $bp->friends->id, 'type' => $type, 'user_id' => $user_id, 'secondary_item_id' => $secondary_item_id ) ); 291 292 } 292 293 } … … 389 390 390 391 // Remove the activity stream item for the user who canceled the friendship 391 friends_delete_activity( array( 'item_id' => $friendship_id, ' component_action' => 'friendship_accepted', 'user_id' => $bp->displayed_user->id ) );392 friends_delete_activity( array( 'item_id' => $friendship_id, 'type' => 'friendship_accepted', 'user_id' => $bp->displayed_user->id ) ); 392 393 393 394 do_action( 'friends_friendship_deleted', $friendship_id, $initiator_userid, $friend_userid ); … … 418 419 $initiator_link = bp_core_get_userlink( $friendship->initiator_user_id ); 419 420 $friend_link = bp_core_get_userlink( $friendship->friend_user_id ); 420 421 $primary_link = apply_filters( 'friends_activity_friendship_accepted_primary_link', bp_core_get_user_domain( $friendship->initiator_user_id ), &$friendship );422 421 423 422 /* Record in activity streams for the initiator */ 424 423 friends_record_activity( array( 425 424 'user_id' => $friendship->initiator_user_id, 426 'component_action' => 'friendship_created', 427 'content' => apply_filters( 'friends_activity_friendship_accepted', sprintf( __( '%s and %s are now friends', 'buddypress' ), $initiator_link, $friend_link ), &$friendship ), 428 'primary_link' => $primary_link, 425 'type' => 'friendship_created', 426 'action' => apply_filters( 'friends_activity_friendship_accepted_action', sprintf( __( '%s and %s are now friends', 'buddypress' ), $initiator_link, $friend_link ), &$friendship ), 429 427 'item_id' => $friendship_id 430 428 ) ); … … 433 431 friends_record_activity( array( 434 432 'user_id' => $friendship->friend_user_id, 435 'component_action' => 'friendship_created', 436 'content' => apply_filters( 'friends_activity_friendship_accepted', sprintf( __( '%s and %s are now friends', 'buddypress' ), $friend_link, $initiator_link ), &$friendship ), 437 'primary_link' => $primary_link, 433 'type' => 'friendship_created', 434 'action' => apply_filters( 'friends_activity_friendship_accepted_action', sprintf( __( '%s and %s are now friends', 'buddypress' ), $friend_link, $initiator_link ), &$friendship ), 438 435 'item_id' => $friendship_id, 439 436 'hide_sitewide' => true /* We've already got the first entry site wide */ -
trunk/bp-groups.php
r2352 r2381 306 306 307 307 groups_record_activity( array( 308 'content' => apply_filters( 'groups_activity_accepted_invite', sprintf( __( '%s joined the group %s', 'buddypress'), bp_core_get_userlink( $bp->loggedin_user->id ), '<a href="' . bp_get_group_permalink( $group ) . '">' . attribute_escape( $group->name ) . '</a>' ), $bp->loggedin_user->id, &$group ), 309 'primary_link' => apply_filters( 'groups_activity_accepted_invite_primary_link', bp_get_group_permalink( $group ), &$group ), 310 'component_action' => 'joined_group', 308 'action' => apply_filters( 'groups_activity_accepted_invite_action', sprintf( __( '%s joined the group %s', 'buddypress'), bp_core_get_userlink( $bp->loggedin_user->id ), '<a href="' . bp_get_group_permalink( $group ) . '">' . attribute_escape( $group->name ) . '</a>' ), $bp->loggedin_user->id, &$group ), 309 'type' => 'joined_group', 311 310 'item_id' => $group->id 312 311 ) ); … … 1155 1154 /* Once we compelete all steps, record the group creation in the activity stream. */ 1156 1155 groups_record_activity( array( 1157 'content' => apply_filters( 'groups_activity_created_group', sprintf( __( '%s created the group %s', 'buddypress'), bp_core_get_userlink( $bp->loggedin_user->id ), '<a href="' . bp_get_group_permalink( $bp->groups->current_group ) . '">' . attribute_escape( $bp->groups->current_group->name ) . '</a>' ) ), 1158 'primary_link' => apply_filters( 'groups_activity_created_group_primary_link', bp_get_group_permalink( $bp->groups->current_group ) ), 1159 'component_action' => 'created_group', 1156 'action' => apply_filters( 'groups_activity_created_group_action', sprintf( __( '%s created the group %s', 'buddypress'), bp_core_get_userlink( $bp->loggedin_user->id ), '<a href="' . bp_get_group_permalink( $bp->groups->current_group ) . '">' . attribute_escape( $bp->groups->current_group->name ) . '</a>' ) ), 1157 'type' => 'created_group', 1160 1158 'item_id' => $bp->groups->new_group_id 1161 1159 ) ); … … 1321 1319 $defaults = array( 1322 1320 'user_id' => $bp->loggedin_user->id, 1323 'content' => false, 1324 'primary_link' => false, 1325 'component_name' => $bp->groups->id, 1326 'component_action' => false, 1321 'action' => '', 1322 'content' => '', 1323 'primary_link' => '', 1324 'component' => $bp->groups->id, 1325 'type' => false, 1327 1326 'item_id' => false, 1328 1327 'secondary_item_id' => false, … … 1334 1333 extract( $r, EXTR_SKIP ); 1335 1334 1336 return bp_activity_add( array( 'user_id' => $user_id, ' content' => $content, 'primary_link' => $primary_link, 'component_name' => $component_name, 'component_action' => $component_action, 'item_id' => $item_id, 'secondary_item_id' => $secondary_item_id, 'recorded_time' => $recorded_time, 'hide_sitewide' => $hide_sitewide ) );1335 return bp_activity_add( array( 'user_id' => $user_id, 'action' => $action, 'content' => $content, 'primary_link' => $primary_link, 'component' => $component, 'type' => $type, 'item_id' => $item_id, 'secondary_item_id' => $secondary_item_id, 'recorded_time' => $recorded_time, 'hide_sitewide' => $hide_sitewide ) ); 1337 1336 } 1338 1337 … … 1602 1601 /* Delete all group activity from activity streams */ 1603 1602 if ( function_exists( 'bp_activity_delete_by_item_id' ) ) { 1604 bp_activity_delete_by_item_id( array( 'item_id' => $group_id, 'component _name' => $bp->groups->id ) );1603 bp_activity_delete_by_item_id( array( 'item_id' => $group_id, 'component' => $bp->groups->id ) ); 1605 1604 } 1606 1605 … … 1702 1701 /* Record this in activity streams */ 1703 1702 groups_record_activity( array( 1704 'content' => apply_filters( 'groups_activity_joined_group', sprintf( __( '%s joined the group %s', 'buddypress'), bp_core_get_userlink( $user_id ), '<a href="' . bp_get_group_permalink( $bp->groups->current_group ) . '">' . attribute_escape( $bp->groups->current_group->name ) . '</a>' ) ), 1705 'primary_link' => apply_filters( 'groups_activity_joined_group_primary_link', bp_get_group_permalink( $bp->groups->current_group ) ), 1706 'component_action' => 'joined_group', 1703 'action' => apply_filters( 'groups_activity_joined_group', sprintf( __( '%s joined the group %s', 'buddypress'), bp_core_get_userlink( $user_id ), '<a href="' . bp_get_group_permalink( $bp->groups->current_group ) . '">' . attribute_escape( $bp->groups->current_group->name ) . '</a>' ) ), 1704 'type' => 'joined_group', 1707 1705 'item_id' => $group_id 1708 1706 ) ); … … 1894 1892 1895 1893 /* Record this in activity streams */ 1896 $activity_ content= sprintf( __( '%s posted an update in the group %s:', 'buddypress'), bp_core_get_userlink( $user_id ), '<a href="' . bp_get_group_permalink( $bp->groups->current_group ) . '">' . attribute_escape( $bp->groups->current_group->name ) . '</a>' );1897 $activity_content .= '<div class="activity-inner">' . $content . '</div>';1894 $activity_action = sprintf( __( '%s posted an update in the group %s:', 'buddypress'), bp_core_get_userlink( $user_id ), '<a href="' . bp_get_group_permalink( $bp->groups->current_group ) . '">' . attribute_escape( $bp->groups->current_group->name ) . '</a>' ); 1895 $activity_content = '<div class="activity-inner">' . $content . '</div>'; 1898 1896 1899 1897 $activity_id = groups_record_activity( array( 1900 1898 'user_id' => $user_id, 1899 'action' => apply_filters( 'groups_activity_new_update_action', $activity_action ), 1901 1900 'content' => apply_filters( 'groups_activity_new_update_content', $activity_content ), 1902 'primary_link' => apply_filters( 'groups_activity_new_update_primary_link', bp_get_group_permalink( $bp->groups->current_group ) ), 1903 'component_action' => 'activity_update', 1901 'type' => 'activity_update', 1904 1902 'item_id' => $bp->groups->current_group->id 1905 1903 ) ); … … 1941 1939 $topic = bp_forums_get_topic_details( $topic_id ); 1942 1940 1943 $activity_ content= sprintf( __( '%s posted on the forum topic %s in the group %s:', 'buddypress'), bp_core_get_userlink( $bp->loggedin_user->id ), '<a href="' . bp_get_group_permalink( $bp->groups->current_group ) . 'forum/topic/' . $topic->topic_slug .'/">' . attribute_escape( $topic->topic_title ) . '</a>', '<a href="' . bp_get_group_permalink( $bp->groups->current_group ) . '">' . attribute_escape( $bp->groups->current_group->name ) . '</a>' );1944 $activity_content .= '<blockquote>' . bp_create_excerpt( $post_text ) . '</blockquote>';1941 $activity_action = sprintf( __( '%s posted on the forum topic %s in the group %s:', 'buddypress'), bp_core_get_userlink( $bp->loggedin_user->id ), '<a href="' . bp_get_group_permalink( $bp->groups->current_group ) . 'forum/topic/' . $topic->topic_slug .'/">' . attribute_escape( $topic->topic_title ) . '</a>', '<a href="' . bp_get_group_permalink( $bp->groups->current_group ) . '">' . attribute_escape( $bp->groups->current_group->name ) . '</a>' ); 1942 $activity_content = '<blockquote>' . bp_create_excerpt( $post_text ) . '</blockquote>'; 1945 1943 1946 1944 /* Record this in activity streams */ 1947 1945 groups_record_activity( array( 1948 'content' => apply_filters( 'groups_activity_new_forum_post', $activity_content, $post_text, &$topic, &$forum_post ), 1946 'action' => apply_filters( 'groups_activity_new_forum_post_action', $activity_action, $post_text, &$topic, &$forum_post ), 1947 'content' => apply_filters( 'groups_activity_new_forum_post_content', $activity_content, $post_text, &$topic, &$forum_post ), 1949 1948 'primary_link' => apply_filters( 'groups_activity_new_forum_post_primary_link', bp_get_group_permalink( $bp->groups->current_group ) . 'forum/topic/' . $topic->topic_slug . '/' ), 1950 ' component_action' => 'new_forum_post',1949 'type' => 'new_forum_post', 1951 1950 'item_id' => $bp->groups->current_group->id, 1952 1951 'secondary_item_id' => $forum_post … … 1975 1974 $topic = bp_forums_get_topic_details( $topic_id ); 1976 1975 1977 $activity_ content= sprintf( __( '%s started the forum topic %s in the group %s:', 'buddypress'), bp_core_get_userlink( $bp->loggedin_user->id ), '<a href="' . bp_get_group_permalink( $bp->groups->current_group ) . 'forum/topic/' . $topic->topic_slug .'/">' . attribute_escape( $topic->topic_title ) . '</a>', '<a href="' . bp_get_group_permalink( $bp->groups->current_group ) . '">' . attribute_escape( $bp->groups->current_group->name ) . '</a>' );1978 $activity_content .= '<blockquote>' . bp_create_excerpt( $topic_text ) . '</blockquote>';1976 $activity_action = sprintf( __( '%s started the forum topic %s in the group %s:', 'buddypress'), bp_core_get_userlink( $bp->loggedin_user->id ), '<a href="' . bp_get_group_permalink( $bp->groups->current_group ) . 'forum/topic/' . $topic->topic_slug .'/">' . attribute_escape( $topic->topic_title ) . '</a>', '<a href="' . bp_get_group_permalink( $bp->groups->current_group ) . '">' . attribute_escape( $bp->groups->current_group->name ) . '</a>' ); 1977 $activity_content = '<blockquote>' . bp_create_excerpt( $topic_text ) . '</blockquote>'; 1979 1978 1980 1979 /* Record this in activity streams */ 1981 1980 groups_record_activity( array( 1982 'content' => apply_filters( 'groups_activity_new_forum_topic', $activity_content, $topic_text, &$topic ), 1981 'action' => apply_filters( 'groups_activity_new_forum_topic_action', $activity_action, $topic_text, &$topic ), 1982 'content' => apply_filters( 'groups_activity_new_forum_topic_content', $activity_content, $topic_text, &$topic ), 1983 1983 'primary_link' => apply_filters( 'groups_activity_new_forum_topic_primary_link', bp_get_group_permalink( $bp->groups->current_group ) . 'forum/topic/' . $topic->topic_slug . '/' ), 1984 ' component_action' => 'new_forum_topic',1984 'type' => 'new_forum_topic', 1985 1985 'item_id' => $bp->groups->current_group->id, 1986 1986 'secondary_item_id' => $topic->topic_id … … 2004 2004 /* Update the activity stream item */ 2005 2005 if ( function_exists( 'bp_activity_delete_by_item_id' ) ) 2006 bp_activity_delete_by_item_id( array( 'item_id' => $bp->groups->current_group->id, 'secondary_item_id' => $topic_id, 'component _name' => $bp->groups->id, 'component_action' => 'new_forum_topic' ) );2007 2008 $activity_ content= sprintf( __( '%s started the forum topic %s in the group %s:', 'buddypress'), bp_core_get_userlink( $topic->topic_poster ), '<a href="' . bp_get_group_permalink( $bp->groups->current_group ) . 'forum/topic/' . $topic->topic_slug .'/">' . attribute_escape( $topic->topic_title ) . '</a>', '<a href="' . bp_get_group_permalink( $bp->groups->current_group ) . '">' . attribute_escape( $bp->groups->current_group->name ) . '</a>' );2009 $activity_content .= '<blockquote>' . bp_create_excerpt( $topic_text ) . '</blockquote>';2006 bp_activity_delete_by_item_id( array( 'item_id' => $bp->groups->current_group->id, 'secondary_item_id' => $topic_id, 'component' => $bp->groups->id, 'type' => 'new_forum_topic' ) ); 2007 2008 $activity_action = sprintf( __( '%s started the forum topic %s in the group %s:', 'buddypress'), bp_core_get_userlink( $topic->topic_poster ), '<a href="' . bp_get_group_permalink( $bp->groups->current_group ) . 'forum/topic/' . $topic->topic_slug .'/">' . attribute_escape( $topic->topic_title ) . '</a>', '<a href="' . bp_get_group_permalink( $bp->groups->current_group ) . '">' . attribute_escape( $bp->groups->current_group->name ) . '</a>' ); 2009 $activity_content = '<blockquote>' . bp_create_excerpt( $topic_text ) . '</blockquote>'; 2010 2010 2011 2011 /* Record this in activity streams */ 2012 2012 groups_record_activity( array( 2013 'content' => apply_filters( 'groups_activity_new_forum_topic', $activity_content, $topic_text, &$topic ), 2013 'action' => apply_filters( 'groups_activity_new_forum_topic_action', $activity_action, $topic_text, &$topic ), 2014 'content' => apply_filters( 'groups_activity_new_forum_topic_content', $activity_content, $topic_text, &$topic ), 2014 2015 'primary_link' => apply_filters( 'groups_activity_new_forum_topic_primary_link', bp_get_group_permalink( $bp->groups->current_group ) . 'forum/topic/' . $topic->topic_slug . '/' ), 2015 ' component_action' => 'new_forum_topic',2016 'type' => 'new_forum_topic', 2016 2017 'item_id' => (int)$bp->groups->current_group->id, 2017 2018 'user_id' => (int)$topic->topic_poster, … … 2041 2042 /* Update the activity stream item */ 2042 2043 if ( function_exists( 'bp_activity_delete_by_item_id' ) ) 2043 bp_activity_delete_by_item_id( array( 'item_id' => $bp->groups->current_group->id, 'secondary_item_id' => $post_id, 'component _name' => $bp->groups->id, 'component_action' => 'new_forum_post' ) );2044 2045 $activity_ content= sprintf( __( '%s posted on the forum topic %s in the group %s:', 'buddypress'), bp_core_get_userlink( $post->poster_id ), '<a href="' . bp_get_group_permalink( $bp->groups->current_group ) . 'forum/topic/' . $topic->topic_slug .'">' . attribute_escape( $topic->topic_title ) . '</a>', '<a href="' . bp_get_group_permalink( $bp->groups->current_group ) . '">' . attribute_escape( $bp->groups->current_group->name ) . '</a>' );2046 $activity_content .= '<blockquote>' . bp_create_excerpt( $post_text ) . '</blockquote>';2044 bp_activity_delete_by_item_id( array( 'item_id' => $bp->groups->current_group->id, 'secondary_item_id' => $post_id, 'component' => $bp->groups->id, 'type' => 'new_forum_post' ) ); 2045 2046 $activity_action = sprintf( __( '%s posted on the forum topic %s in the group %s:', 'buddypress'), bp_core_get_userlink( $post->poster_id ), '<a href="' . bp_get_group_permalink( $bp->groups->current_group ) . 'forum/topic/' . $topic->topic_slug .'">' . attribute_escape( $topic->topic_title ) . '</a>', '<a href="' . bp_get_group_permalink( $bp->groups->current_group ) . '">' . attribute_escape( $bp->groups->current_group->name ) . '</a>' ); 2047 $activity_content = '<blockquote>' . bp_create_excerpt( $post_text ) . '</blockquote>'; 2047 2048 2048 2049 /* Record this in activity streams */ 2049 2050 groups_record_activity( array( 2050 'content' => apply_filters( 'groups_activity_new_forum_post', $activity_content, $post_text, &$topic, &$forum_post ), 2051 'action' => apply_filters( 'groups_activity_new_forum_post_action', $activity_action, $post_text, &$topic, &$forum_post ), 2052 'content' => apply_filters( 'groups_activity_new_forum_post_content', $activity_content, $post_text, &$topic, &$forum_post ), 2051 2053 'primary_link' => apply_filters( 'groups_activity_new_forum_post_primary_link', bp_get_group_permalink( $bp->groups->current_group ) ), 2052 ' component_action' => 'new_forum_post',2054 'type' => 'new_forum_post', 2053 2055 'item_id' => (int)$bp->groups->current_group->id, 2054 2056 'user_id' => (int)$post->poster_id, … … 2071 2073 /* Delete the activity stream item */ 2072 2074 if ( function_exists( 'bp_activity_delete_by_item_id' ) ) { 2073 bp_activity_delete_by_item_id( array( 'item_id' => $topic_id, 'component _name' => $bp->groups->id, 'component_action' => 'new_forum_topic' ) );2074 bp_activity_delete_by_item_id( array( 'item_id' => $topic_id, 'component _name' => $bp->groups->id, 'component_action' => 'new_forum_post' ) );2075 bp_activity_delete_by_item_id( array( 'item_id' => $topic_id, 'component' => $bp->groups->id, 'type' => 'new_forum_topic' ) ); 2076 bp_activity_delete_by_item_id( array( 'item_id' => $topic_id, 'component' => $bp->groups->id, 'type' => 'new_forum_post' ) ); 2075 2077 } 2076 2078 … … 2089 2091 /* Delete the activity stream item */ 2090 2092 if ( function_exists( 'bp_activity_delete_by_item_id' ) ) { 2091 bp_activity_delete_by_item_id( array( 'item_id' => $bp->groups->current_group->id, 'secondary_item_id' => $post_id, 'component _name' => $bp->groups->id, 'component_action' => 'new_forum_post' ) );2093 bp_activity_delete_by_item_id( array( 'item_id' => $bp->groups->current_group->id, 'secondary_item_id' => $post_id, 'component' => $bp->groups->id, 'type' => 'new_forum_post' ) ); 2092 2094 } 2093 2095 … … 2344 2346 2345 2347 groups_record_activity( array( 2346 'content' => apply_filters( 'groups_activity_membership_accepted', sprintf( __( '%s joined the group %s', 'buddypress'), bp_core_get_userlink( $user_id ), '<a href="' . bp_get_group_permalink( $group ) . '">' . attribute_escape( $group->name ) . '</a>' ), $user_id, &$group ), 2347 'primary_link' => apply_filters( 'groups_activity_membership_accepted_primary_link', bp_get_group_permalink( $group ), &$group ), 2348 'component_action' => 'joined_group', 2348 'action' => apply_filters( 'groups_activity_membership_accepted_action', sprintf( __( '%s joined the group %s', 'buddypress'), bp_core_get_userlink( $user_id ), '<a href="' . bp_get_group_permalink( $group ) . '">' . attribute_escape( $group->name ) . '</a>' ), $user_id, &$group ), 2349 'type' => 'joined_group', 2349 2350 'item_id' => $group->id, 2350 2351 'user_id' => $user_id -
trunk/bp-themes/bp-default/_inc/css/default.css
r2376 r2381 1483 1483 div.post { 1484 1484 margin: 0 0 60px 0; 1485 overflow: auto; 1485 1486 } 1486 1487 div.post div.author-box, div.comment-avatar-box { … … 1507 1508 font-size: 26px; 1508 1509 margin-bottom: 5px; 1510 margin-top: 0; 1509 1511 line-height: 120%; 1510 1512 } … … 1526 1528 div.post p.postmetadata { 1527 1529 margin-top: 15px; 1530 clear: left; 1528 1531 overflow: hidden; 1529 1532 } -
trunk/bp-themes/bp-default/_inc/global.js
r2378 r2381 287 287 /* Update the feed link */ 288 288 if ( null != response.feed_url ) 289 j(' div#subnav li.feed a').attr('href', response.feed_url);289 j('.directory div#subnav li.feed a').attr('href', response.feed_url); 290 290 291 291 j('div.item-list-tabs li.selected').removeClass('loading'); -
trunk/bp-themes/bp-default/activity/entry.php
r2363 r2381 30 30 </div> 31 31 32 <?php if ( 'activity_comment' == bp_get_activity_ action_name() ) : ?>32 <?php if ( 'activity_comment' == bp_get_activity_type() ) : ?> 33 33 <div class="activity-inreplyto"> 34 34 <strong><?php _e( 'In reply to', 'buddypress' ) ?></strong> - <?php bp_activity_parent_content() ?> · -
trunk/bp-themes/bp-default/activity/index.php
r2344 r2381 72 72 // If you're concerned about no-script functionality, uncomment the following line. 73 73 74 // 74 //locate_template( array( 'activity/activity-loop.php' ), true ); 75 75 ?> 76 76 </div><!-- .activity --> -
trunk/bp-themes/bp-sn-parent/_inc/ajax.php
r2344 r2381 449 449 'content' => apply_filters( 'xprofile_activity_update', $activity_content, &$wire_post ), 450 450 'primary_link' => apply_filters( 'xprofile_activity_update_primary_link', $primary_link ), 451 ' component_action' => 'activity_update'451 'type' => 'activity_update' 452 452 ) ); 453 453 … … 464 464 'content' => apply_filters( 'groups_activity_update', $activity_content ), 465 465 'primary_link' => apply_filters( 'groups_activity_update_primary_link', bp_get_group_permalink( $bp->groups->current_group ) ), 466 ' component_action' => 'activity_update',466 'type' => 'activity_update', 467 467 'item_id' => $item_id 468 468 ) ); … … 512 512 'content' => apply_filters( 'bp_activity_comment_content', $comment_header . '<div class="activity-inner">' . $_POST['content'] . '</div>' ), 513 513 'primary_link' => '', 514 'component _name' => $bp->activity->id,515 ' component_action' => 'activity_comment',514 'component' => $bp->activity->id, 515 'type' => 'activity_comment', 516 516 'user_id' => $bp->loggedin_user->id, 517 517 'item_id' => $_POST['form_id'], -
trunk/bp-xprofile.php
r2359 r2381 484 484 $defaults = array( 485 485 'user_id' => $bp->loggedin_user->id, 486 'content' => false, 487 'primary_link' => false, 488 'component_name' => $bp->profile->id, 489 'component_action' => false, 486 'action' => '', 487 'content' => '', 488 'primary_link' => '', 489 'component' => $bp->profile->id, 490 'type' => false, 490 491 'item_id' => false, 491 492 'secondary_item_id' => false, … … 497 498 extract( $r, EXTR_SKIP ); 498 499 499 return bp_activity_add( array( 'user_id' => $user_id, ' content' => $content, 'primary_link' => $primary_link, 'component_name' => $component_name, 'component_action' => $component_action, 'item_id' => $item_id, 'secondary_item_id' => $secondary_item_id, 'recorded_time' => $recorded_time, 'hide_sitewide' => $hide_sitewide ) );500 return bp_activity_add( array( 'user_id' => $user_id, 'action' => $action, 'content' => $content, 'primary_link' => $primary_link, 'component' => $component, 'type' => $type, 'item_id' => $item_id, 'secondary_item_id' => $secondary_item_id, 'recorded_time' => $recorded_time, 'hide_sitewide' => $hide_sitewide ) ); 500 501 } 501 502 … … 516 517 if ( function_exists('bp_activity_delete_by_item_id') ) { 517 518 extract($args); 518 bp_activity_delete_by_item_id( array( 'item_id' => $item_id, 'component _name' => $bp->profile->id, 'component_action' => $component_action, 'user_id' => $user_id, 'secondary_item_id' => $secondary_item_id ) );519 bp_activity_delete_by_item_id( array( 'item_id' => $item_id, 'component' => $bp->profile->id, 'type' => $type, 'user_id' => $user_id, 'secondary_item_id' => $secondary_item_id ) ); 519 520 } 520 521 }
Note: See TracChangeset
for help on using the changeset viewer.