Changeset 1750
- Timestamp:
- 09/01/2009 02:12:35 AM (16 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-activity.php
r1749 r1750 324 324 if ( !BP_Activity_Activity::delete_for_user_by_component( $user_id, $component_name ) ) 325 325 return false; 326 326 327 327 do_action( 'bp_activity_delete_for_user_by_component', $user_id, $component_name ); 328 328 -
trunk/bp-blogs.php
r1749 r1750 118 118 $bp->blogs->slug = BP_BLOGS_SLUG; 119 119 120 /* Register the activity stream actions for this component */121 bp_blogs_register_activity_action( 'new_blog', __( 'New blog created', 'buddypress' ) );122 bp_blogs_register_activity_action( 'new_blog_post', __( 'New blog post published', 'buddypress' ) );123 bp_blogs_register_activity_action( 'new_blog_comment', __( 'New blog post comment posted', 'buddypress' ) );124 125 120 /* Register this in the active components array */ 126 121 $bp->active_components[$bp->blogs->slug] = $bp->blogs->id; … … 225 220 */ 226 221 222 function bp_blogs_register_activity_actions() { 223 global $bp; 224 225 if ( !function_exists( 'bp_activity_set_action' ) ) 226 return false; 227 228 bp_activity_set_action( $bp->blogs->id, 'new_blog', __( 'New blog created', 'buddypress' ) ); 229 bp_activity_set_action( $bp->blogs->id, 'new_blog_post', __( 'New blog post published', 'buddypress' ) ); 230 bp_activity_set_action( $bp->blogs->id, 'new_blog_comment', __( 'New blog post comment posted', 'buddypress' ) ); 231 232 do_action( 'bp_blogs_register_activity_actions' ); 233 } 234 add_action( 'plugins_loaded', 'bp_blogs_register_activity_actions' ); 235 227 236 function bp_blogs_record_activity( $args = '' ) { 228 237 global $bp; … … 261 270 } 262 271 263 function bp_blogs_register_activity_action( $key, $value ) {264 global $bp;265 266 if ( !function_exists( 'bp_activity_set_action' ) )267 return false;268 269 return apply_filters( 'bp_blogs_register_activity_action', bp_activity_set_action( $bp->blogs->id, $key, $value ), $key, $value );270 }271 272 272 /******************************************************************************** 273 273 * Business Functions … … 329 329 'content' => 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>' ), 330 330 'primary_link' => get_blog_option( $recorded_blog->blog_id, 'siteurl' ), 331 'component_action' => $bp->activity->actions->blogs['new_blog'],331 'component_action' => 'new_blog', 332 332 'item_id' => $recorded_blog_id 333 333 ) ); … … 377 377 '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>' ), 378 378 'primary_link' => $post_permalink, 379 'component_action' => $bp->activity->actions->blogs['new_blog_post'],379 'component_action' => 'new_blog_post', 380 380 'item_id' => $recorded_post->id, 381 381 'recorded_time' => $recorded_post->date_created … … 412 412 '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>' ), 413 413 'primary_link' => $post_permalink, 414 'component_action' => $bp->activity->actions->blogs['new_blog_post'],414 'component_action' => 'new_blog_post', 415 415 'item_id' => $existing_post->id, 416 416 'recorded_time' => $existing_post->date_created … … 458 458 'content' => $content, 459 459 'primary_link' => $comment_link, 460 'component_action' => $bp->activity->actions->blogs['new_blog_comment'],460 'component_action' => 'new_blog_comment', 461 461 'item_id' => $recorded_comment->blog_id, 462 462 'recorded_time' => $recorded_comment->date_created … … 482 482 'content' => $content, 483 483 'primary_link' => $comment_link, 484 'component_action' => $bp->activity->actions->blogs['new_blog_comment'],484 'component_action' => 'new_blog_comment', 485 485 'item_id' => $recorded_comment->blog_id, 486 486 'recorded_time' => $recorded_comment->date_created -
trunk/bp-friends.php
r1749 r1750 47 47 $bp->friends->format_notification_function = 'friends_format_notifications'; 48 48 $bp->friends->slug = BP_FRIENDS_SLUG; 49 50 /* Register the activity stream actions for this component */ 51 friends_register_activity_action( 'friendship_created', __( 'New friendship created', 'buddypress' ) ); 52 49 53 50 /* Register this in the active components array */ 54 51 $bp->active_components[$bp->friends->slug] = $bp->friends->id; … … 326 323 } 327 324 328 function friends_register_activity_action ( $key, $value) {325 function friends_register_activity_actions() { 329 326 global $bp; 330 327 331 328 if ( !function_exists( 'bp_activity_set_action' ) ) 332 329 return false; 333 334 return apply_filters( 'friends_register_activity_action', bp_activity_set_action( $bp->friends->id, $key, $value ), $key, $value ); 335 } 330 331 bp_activity_set_action( $bp->friends->id, 'friends_register_activity_action', __( 'New friendship created', 'buddypress' ) ); 332 333 do_action( 'friends_register_activity_actions' ); 334 } 335 add_action( 'plugins_loaded', 'friends_register_activity_actions' ); 336 336 337 337 function friends_format_notifications( $action, $item_id, $secondary_item_id, $total_items ) { -
trunk/bp-groups.php
r1749 r1750 148 148 149 149 $bp->groups->valid_status = apply_filters( 'groups_valid_status', array( 'public', 'private', 'hidden' ) ); 150 151 /* Register the activity stream actions for this component */152 groups_register_activity_action( 'created_group', __( 'Created a group', 'buddypress' ) );153 groups_register_activity_action( 'joined_group', __( 'Joined a group', 'buddypress' ) );154 groups_register_activity_action( 'new_wire_post', __( 'New group wire post', 'buddypress' ) );155 groups_register_activity_action( 'new_forum_topic', __( 'New group forum topic', 'buddypress' ) );156 groups_register_activity_action( 'new_forum_post', __( 'New group forum post', 'buddypress' ) );157 150 } 158 151 add_action( 'plugins_loaded', 'groups_setup_globals', 5 ); … … 1374 1367 */ 1375 1368 1369 function groups_register_activity_actions() { 1370 global $bp; 1371 1372 if ( !function_exists( 'bp_activity_set_action' ) ) 1373 return false; 1374 1375 bp_activity_set_action( $bp->groups->id, 'created_group', __( 'Created a group', 'buddypress' ) ); 1376 bp_activity_set_action( $bp->groups->id, 'joined_group', __( 'Joined a group', 'buddypress' ) ); 1377 bp_activity_set_action( $bp->groups->id, 'new_wire_post', __( 'New group wire post', 'buddypress' ) ); 1378 bp_activity_set_action( $bp->groups->id, 'new_forum_topic', __( 'New group forum topic', 'buddypress' ) ); 1379 bp_activity_set_action( $bp->groups->id, 'new_forum_post', __( 'New group forum post', 'buddypress' ) ); 1380 1381 do_action( 'groups_register_activity_actions' ); 1382 } 1383 add_action( 'plugins_loaded', 'groups_register_activity_actions' ); 1384 1376 1385 function groups_record_activity( $args = '' ) { 1377 1386 global $bp; … … 1400 1409 1401 1410 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 ) ); 1402 }1403 1404 function groups_register_activity_action( $key, $value ) {1405 global $bp;1406 1407 if ( !function_exists( 'bp_activity_set_action' ) )1408 return false;1409 1410 return apply_filters( 'groups_register_activity_action', bp_activity_set_action( $bp->groups->id, $key, $value ), $key, $value );1411 1411 } 1412 1412 … … 1677 1677 /* Delete the activity stream item */ 1678 1678 if ( function_exists( 'bp_activity_delete_by_item_id' ) ) { 1679 bp_activity_delete_by_item_id( array( 'item_id' => $group_id, 'component_name' => 'groups', 'component_action' => $bp->activity->actions->groups['created_group']) );1679 bp_activity_delete_by_item_id( array( 'item_id' => $group_id, 'component_name' => 'groups', 'component_action' => 'created_group' ) ); 1680 1680 } 1681 1681 … … 1992 1992 /* Delete the activity stream item */ 1993 1993 if ( function_exists( 'bp_activity_delete_by_item_id' ) ) { 1994 bp_activity_delete_by_item_id( array( 'item_id' => $wire_post_id, 'component_name' => 'groups', 'component_action' => $bp->activity->actions->groups['new_wire_post']) );1994 bp_activity_delete_by_item_id( array( 'item_id' => $wire_post_id, 'component_name' => 'groups', 'component_action' => 'new_wire_post' ) ); 1995 1995 } 1996 1996 … … 2080 2080 if ( $topic = bp_forums_update_topic( array( 'topic_title' => $topic_title, 'topic_text' => $topic_text, 'topic_id' => $topic_id ) ) ) { 2081 2081 /* Update the activity stream item */ 2082 bp_activity_delete_by_item_id( array( 'item_id' => $topic_id, 'component_name' => 'groups', 'component_action' => $bp->activity->actions->groups['new_forum_topic']) );2082 bp_activity_delete_by_item_id( array( 'item_id' => $topic_id, 'component_name' => 'groups', 'component_action' => 'new_forum_topic' ) ); 2083 2083 2084 2084 $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>' ); … … 2110 2110 /* Delete the activity stream item */ 2111 2111 if ( function_exists( 'bp_activity_delete_by_item_id' ) ) { 2112 bp_activity_delete_by_item_id( array( 'item_id' => $topic_id, 'component_name' => 'groups', 'component_action' => $bp->activity->actions->groups['new_forum_topic']) );2112 bp_activity_delete_by_item_id( array( 'item_id' => $topic_id, 'component_name' => 'groups', 'component_action' => 'new_forum_topic' ) ); 2113 2113 bp_activity_delete_by_item_id( array( 'item_id' => $topic_id, 'component_name' => 'groups', 'component_action' => 'new_forum_post' ) ); 2114 2114 } -
trunk/bp-status.php
r1749 r1750 13 13 $bp->status->slug = BP_STATUS_SLUG; 14 14 15 /* Register the activity stream actions for this component */16 bp_status_register_activity_action( 'new_status', __( 'New status update', 'buddypress' ) );17 18 15 /* Register this in the active components array */ 19 16 $bp->active_components[$bp->status->slug] = $bp->status->id; … … 29 26 * notifications for the user and for this specific component. 30 27 */ 28 29 function bp_status_register_activity_actions() { 30 global $bp; 31 32 if ( !function_exists( 'bp_activity_set_action' ) ) 33 return false; 34 35 /* Register the activity stream actions for this component */ 36 bp_activity_set_action( $bp->status->id, 'new_status', __( 'New status update', 'buddypress' ) ); 37 38 do_action( 'bp_status_register_activity_actions' ); 39 } 40 add_action( 'plugins_loaded', 'bp_status_register_activity_actions' ); 31 41 32 42 function bp_status_record_activity( $user_id, $content, $primary_link, $component_action = 'new_status' ) { -
trunk/bp-xprofile.php
r1749 r1750 140 140 $bp->profile->format_notification_function = 'xprofile_format_notifications'; 141 141 $bp->profile->slug = BP_XPROFILE_SLUG; 142 143 /* Register the activity stream actions for this component */144 xprofile_register_activity_action( 'new_wire_post', __( 'New profile wire post', 'buddypress' ) );145 142 146 143 /* Register this in the active components array */ … … 580 577 */ 581 578 579 function xprofile_register_activity_actions() { 580 global $bp; 581 582 if ( !function_exists( 'bp_activity_set_action' ) ) 583 return false; 584 585 /* Register the activity stream actions for this component */ 586 bp_activity_set_action( $bp->profile->id, 'new_wire_post', __( 'New profile wire post', 'buddypress' ) ); 587 588 do_action( 'xprofile_register_activity_actions' ); 589 } 590 add_action( 'plugins_loaded', 'xprofile_register_activity_actions' ); 591 582 592 /** 583 593 * xprofile_record_activity()
Note: See TracChangeset
for help on using the changeset viewer.