Changeset 7537
- Timestamp:
- 11/08/2013 07:53:56 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-activity/bp-activity-screens.php
r7529 r7537 137 137 */ 138 138 function bp_activity_remove_screen_notifications() { 139 bp_core_mark_ all_notifications_by_type( bp_loggedin_user_id(), buddypress()->activity->id, 'new_at_mention' );139 bp_core_mark_notifications_by_type( bp_loggedin_user_id(), buddypress()->activity->id, 'new_at_mention' ); 140 140 } 141 141 add_action( 'bp_activity_screen_my_activity', 'bp_activity_remove_screen_notifications' ); -
trunk/bp-friends/bp-friends-cache.php
r7529 r7537 25 25 function friends_clear_friend_notifications() { 26 26 if ( isset( $_GET['new'] ) ) { 27 bp_core_mark_ all_notifications_by_type( bp_loggedin_user_id(), buddypress()->friends->id, 'friendship_accepted' );27 bp_core_mark_notifications_by_type( bp_loggedin_user_id(), buddypress()->friends->id, 'friendship_accepted' ); 28 28 } 29 29 } -
trunk/bp-friends/bp-friends-screens.php
r7529 r7537 18 18 19 19 // Delete any friendship acceptance notifications for the user when viewing a profile 20 bp_core_mark_ all_notifications_by_type( bp_loggedin_user_id(), buddypress()->friends->id, 'friendship_accepted' );20 bp_core_mark_notifications_by_type( bp_loggedin_user_id(), buddypress()->friends->id, 'friendship_accepted' ); 21 21 22 22 do_action( 'friends_screen_my_friends' ); … … 63 63 64 64 if ( isset( $_GET['new'] ) ) { 65 bp_core_mark_ all_notifications_by_type( bp_loggedin_user_id(), buddypress()->friends->id, 'friendship_request' );65 bp_core_mark_notifications_by_type( bp_loggedin_user_id(), buddypress()->friends->id, 'friendship_request' ); 66 66 } 67 67 -
trunk/bp-groups/bp-groups-screens.php
r7529 r7537 32 32 // Delete group request notifications for the user 33 33 if ( isset( $_GET['n'] ) ) { 34 bp_core_mark_ all_notifications_by_type( bp_loggedin_user_id(), $bp->groups->id, 'membership_request_accepted' );35 bp_core_mark_ all_notifications_by_type( bp_loggedin_user_id(), $bp->groups->id, 'membership_request_rejected' );36 bp_core_mark_ all_notifications_by_type( bp_loggedin_user_id(), $bp->groups->id, 'member_promoted_to_mod' );37 bp_core_mark_ all_notifications_by_type( bp_loggedin_user_id(), $bp->groups->id, 'member_promoted_to_admin' );34 bp_core_mark_notifications_by_type( bp_loggedin_user_id(), $bp->groups->id, 'membership_request_accepted' ); 35 bp_core_mark_notifications_by_type( bp_loggedin_user_id(), $bp->groups->id, 'membership_request_rejected' ); 36 bp_core_mark_notifications_by_type( bp_loggedin_user_id(), $bp->groups->id, 'member_promoted_to_mod' ); 37 bp_core_mark_notifications_by_type( bp_loggedin_user_id(), $bp->groups->id, 'member_promoted_to_admin' ); 38 38 } 39 39 … … 95 95 96 96 // Remove notifications 97 bp_core_mark_ all_notifications_by_type( bp_loggedin_user_id(), buddypress()->groups->id, 'group_invite' );97 bp_core_mark_notifications_by_type( bp_loggedin_user_id(), buddypress()->groups->id, 'group_invite' ); 98 98 99 99 do_action( 'groups_screen_group_invites', $group_id ); … … 110 110 111 111 if ( isset( $_GET['n'] ) ) { 112 bp_core_mark_ all_notifications_by_type( bp_loggedin_user_id(), $bp->groups->id, 'membership_request_accepted' );113 bp_core_mark_ all_notifications_by_type( bp_loggedin_user_id(), $bp->groups->id, 'membership_request_rejected' );114 bp_core_mark_ all_notifications_by_type( bp_loggedin_user_id(), $bp->groups->id, 'member_promoted_to_mod' );115 bp_core_mark_ all_notifications_by_type( bp_loggedin_user_id(), $bp->groups->id, 'member_promoted_to_admin' );112 bp_core_mark_notifications_by_type( bp_loggedin_user_id(), $bp->groups->id, 'membership_request_accepted' ); 113 bp_core_mark_notifications_by_type( bp_loggedin_user_id(), $bp->groups->id, 'membership_request_rejected' ); 114 bp_core_mark_notifications_by_type( bp_loggedin_user_id(), $bp->groups->id, 'member_promoted_to_mod' ); 115 bp_core_mark_notifications_by_type( bp_loggedin_user_id(), $bp->groups->id, 'member_promoted_to_admin' ); 116 116 } 117 117 … … 814 814 815 815 // Remove any screen notifications 816 bp_core_mark_ all_notifications_by_type( bp_loggedin_user_id(), $bp->groups->id, 'new_membership_request' );816 bp_core_mark_notifications_by_type( bp_loggedin_user_id(), $bp->groups->id, 'new_membership_request' ); 817 817 818 818 $request_action = (string)bp_action_variable( 1 ); -
trunk/bp-notifications/bp-notifications-functions.php
r7536 r7537 307 307 */ 308 308 function bp_notifications_mark_notifications_by_type( $user_id, $component_name, $component_action, $is_new = false ) { 309 return BP_Notifications_Notification::delete( array( 310 'user_id' => $user_id, 311 'component_name' => $component_name, 312 'component_action' => $component_action, 313 'is_new' => $is_new, 314 ) ); 309 return BP_Notifications_Notification::update( 310 array( 311 'is_new' => $is_new 312 ), 313 array( 314 'user_id' => $user_id, 315 'component_name' => $component_name, 316 'component_action' => $component_action 317 ) 318 ); 315 319 } 316 320 … … 332 336 */ 333 337 function bp_notifications_mark_notifications_by_item_id( $user_id, $item_id, $component_name, $component_action, $secondary_item_id = false, $is_new = false ) { 334 return BP_Notifications_Notification::delete( array( 335 'user_id' => $user_id, 336 'item_id' => $item_id, 337 'secondary_item_id' => $secondary_item_id, 338 'component_name' => $component_name, 339 'component_action' => $component_action, 340 'is_new' => $is_new, 341 ) ); 338 return BP_Notifications_Notification::update( 339 array( 340 'is_new' => $is_new 341 ), 342 array( 343 'user_id' => $user_id, 344 'item_id' => $item_id, 345 'secondary_item_id' => $secondary_item_id, 346 'component_name' => $component_name, 347 'component_action' => $component_action 348 ) 349 ); 342 350 } 343 351 … … 358 366 */ 359 367 function bp_notifications_mark_all_notifications_by_type( $item_id, $component_name, $component_action = false, $secondary_item_id = false, $is_new = false ) { 360 return BP_Notifications_Notification::delete( array( 361 'item_id' => $item_id, 362 'secondary_item_id' => $secondary_item_id, 363 'component_name' => $component_name, 364 'component_action' => $component_action, 365 'is_new' => $is_new, 366 ) ); 368 return BP_Notifications_Notification::update( 369 array( 370 'is_new' => $is_new 371 ), 372 array( 373 'item_id' => $item_id, 374 'secondary_item_id' => $secondary_item_id, 375 'component_name' => $component_name, 376 'component_action' => $component_action 377 ) 378 ); 367 379 } 368 380 … … 386 398 */ 387 399 function bp_notifications_mark_notifications_from_user( $user_id, $component_name, $component_action, $is_new = false ) { 388 return BP_Notifications_Notification::delete( array( 389 'item_id' => $user_id, 390 'component_name' => $component_name, 391 'component_action' => $component_action, 392 'is_new' => $is_new, 393 ) ); 400 return BP_Notifications_Notification::_update( 401 array( 402 'is_new' => $is_new 403 ), 404 array( 405 'item_id' => $user_id, 406 'component_name' => $component_name, 407 'component_action' => $component_action 408 ) 409 ); 394 410 } 395 411
Note: See TracChangeset
for help on using the changeset viewer.