Changeset 2287 for trunk/bp-activity.php
- Timestamp:
- 01/10/2010 08:42:42 PM (16 years ago)
- File:
-
- 1 edited
-
trunk/bp-activity.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-activity.php
r2285 r2287 194 194 195 195 function bp_activity_screen_notification_settings() { 196 global $ current_user; ?>196 global $bp; ?> 197 197 <table class="notification-settings" id="activity-notification-settings"> 198 198 <tr> … … 205 205 <tr> 206 206 <td></td> 207 <td><?php printf( __( 'A member mentions you in an update using "@%s"', 'buddypress' ), $current_user->user_login) ?></td>208 <td class="yes"><input type="radio" name="notifications[notification_activity_new_mention]" value="yes" <?php if ( !get_usermeta( $ current_user->id, 'notification_activity_new_mention' ) || 'yes' == get_usermeta( $current_user->id, 'notification_activity_new_mention' ) ) { ?>checked="checked" <?php } ?>/></td>209 <td class="no"><input type="radio" name="notifications[notification_activity_new_mention]" value="no" <?php if ( 'no' == get_usermeta( $ current_user->id, 'notification_activity_new_mention' ) ) { ?>checked="checked" <?php } ?>/></td>207 <td><?php printf( __( 'A member mentions you in an update using "@%s"', 'buddypress' ), bp_core_get_username( $bp->displayed_user->user_id, $bp->displayed_user->userdata->user_nicename, $bp->displayed_user->userdata->user_login ) ) ?></td> 208 <td class="yes"><input type="radio" name="notifications[notification_activity_new_mention]" value="yes" <?php if ( !get_usermeta( $bp->loggedin_user->id, 'notification_activity_new_mention' ) || 'yes' == get_usermeta( $bp->loggedin_user->id, 'notification_activity_new_mention' ) ) { ?>checked="checked" <?php } ?>/></td> 209 <td class="no"><input type="radio" name="notifications[notification_activity_new_mention]" value="no" <?php if ( 'no' == get_usermeta( $bp->loggedin_user->id, 'notification_activity_new_mention' ) ) { ?>checked="checked" <?php } ?>/></td> 210 210 </tr> 211 211 <tr> 212 212 <td></td> 213 213 <td><?php printf( __( "A member replies to an update you've posted", 'buddypress' ), $current_user->user_login ) ?></td> 214 <td class="yes"><input type="radio" name="notifications[notification_activity_new_reply]" value="yes" <?php if ( !get_usermeta( $ current_user->id, 'notification_activity_new_reply' ) || 'yes' == get_usermeta( $current_user->id, 'notification_activity_new_reply' ) ) { ?>checked="checked" <?php } ?>/></td>215 <td class="no"><input type="radio" name="notifications[notification_activity_new_reply]" value="no" <?php if ( 'no' == get_usermeta( $ current_user->id, 'notification_activity_new_reply' ) ) { ?>checked="checked" <?php } ?>/></td>214 <td class="yes"><input type="radio" name="notifications[notification_activity_new_reply]" value="yes" <?php if ( !get_usermeta( $bp->loggedin_user->id, 'notification_activity_new_reply' ) || 'yes' == get_usermeta( $bp->loggedin_user->id, 'notification_activity_new_reply' ) ) { ?>checked="checked" <?php } ?>/></td> 215 <td class="no"><input type="radio" name="notifications[notification_activity_new_reply]" value="no" <?php if ( 'no' == get_usermeta( $bp->loggedin_user->id, 'notification_activity_new_reply' ) ) { ?>checked="checked" <?php } ?>/></td> 216 216 </tr> 217 217 … … 444 444 } 445 445 446 function bp_activity_post_update( $args = '' ) { 447 global $bp; 448 449 $defaults = array( 450 'content' => false, 451 'user_id' => $bp->loggedin_user->id 452 ); 453 454 $r = wp_parse_args( $args, $defaults ); 455 extract( $r, EXTR_SKIP ); 456 457 if ( empty($content) || empty($content) ) 458 return false; 459 460 /* Record this on the user's profile */ 461 $from_user_link = bp_core_get_userlink( $user_id ); 462 $activity_content = sprintf( __('%s posted an update:', 'buddypress'), $from_user_link ); 463 $activity_content .= '<div class="activity-inner">' . $content . '</div>'; 464 465 $primary_link = bp_core_get_userlink( $user_id, false, true ); 466 467 /* Now write the values */ 468 $activity_id = bp_activity_add( array( 469 'user_id' => $user_id, 470 'content' => apply_filters( 'bp_activity_new_update_content', $activity_content ), 471 'primary_link' => apply_filters( 'bp_activity_new_update_primary_link', $primary_link ), 472 'component_name' => $bp->activity->id, 473 'component_action' => 'new_wire_post' 474 ) ); 475 476 /* Add this update to the "latest update" usermeta so it can be fetched anywhere. */ 477 update_usermeta( $bp->loggedin_user->id, 'bp_latest_update', array( 'id' => $activity_id, 'content' => wp_filter_kses( $content ) ) ); 478 479 do_action( 'bp_activity_posted_update', $content, $user_id, $activity_id ); 480 481 return $activity_id; 482 } 483 446 484 function bp_activity_new_comment( $args = '' ) { 447 485 global $bp;
Note: See TracChangeset
for help on using the changeset viewer.