Changeset 2822
- Timestamp:
- 03/08/2010 04:20:25 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 16 edited
-
bp-activity.php (modified) (6 diffs)
-
bp-activity/bp-activity-classes.php (modified) (2 diffs)
-
bp-activity/bp-activity-templatetags.php (modified) (1 diff)
-
bp-blogs/bp-blogs-templatetags.php (modified) (1 diff)
-
bp-core.php (modified) (1 diff)
-
bp-core/bp-core-signup.php (modified) (1 diff)
-
bp-core/bp-core-templatetags.php (modified) (1 diff)
-
bp-friends.php (modified) (8 diffs)
-
bp-groups.php (modified) (9 diffs)
-
bp-messages/bp-messages-templatetags.php (modified) (1 diff)
-
bp-themes/bp-default/activity/index.php (modified) (1 diff)
-
bp-themes/bp-default/groups/single/plugins.php (modified) (1 diff)
-
bp-themes/bp-default/header.php (modified) (1 diff)
-
bp-themes/bp-default/members/single/activity.php (modified) (1 diff)
-
bp-themes/bp-default/members/single/plugins.php (modified) (2 diffs)
-
bp-xprofile.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-activity.php
r2761 r2822 248 248 if ( !$has_access ) { 249 249 bp_core_add_message( __( 'You do not have access to this activity.', 'buddypress' ), 'error' ); 250 bp_core_redirect( $bp->loggedin_user->domain ); 250 251 if ( is_user_logged_in() ) 252 bp_core_redirect( $bp->loggedin_user->domain ); 253 else 254 bp_core_redirect( site_url( 'wp-login.php?redirect_to=' . clean_url( $bp->root_domain . '/' . $bp->activity->slug . '/p/' . $bp->current_action ) ) ); 251 255 } 252 256 … … 312 316 if ( $activity->component == $bp->groups->id ) { 313 317 if ( $activity->user_id ) 314 $redirect = bp_core_get_user_domain( $activity->user_id, $activity->user_nicename, $activity->user_login ) . $bp->activity->slug . '/' . $activity->id ;318 $redirect = bp_core_get_user_domain( $activity->user_id, $activity->user_nicename, $activity->user_login ) . $bp->activity->slug . '/' . $activity->id . '/'; 315 319 else { 316 320 if ( $group = groups_get_group( array( 'group_id' => $activity->item_id ) ) ) 317 $redirect = bp_get_group_permalink( $group ) . $bp->activity->slug . '/' . $activity->id ;321 $redirect = bp_get_group_permalink( $group ) . $bp->activity->slug . '/' . $activity->id . '/'; 318 322 } 319 323 } else 320 324 $redirect = bp_core_get_user_domain( $activity->user_id, $activity->user_nicename, $activity->user_login ) . $bp->activity->slug . '/' . $activity->id; 321 325 326 $redirect = apply_filters( 'bp_activity_permalink_redirect_url', $redirect, &$activity ); 327 322 328 if ( !$redirect ) 323 329 bp_core_redirect( $bp->root_domain ); 324 330 325 331 /* Redirect to the actual activity permalink page */ 326 bp_core_redirect( apply_filters( 'bp_activity_action_permalink_url', $redirect . '/', &$activity ));332 bp_core_redirect( $redirect ); 327 333 } 328 334 add_action( 'wp', 'bp_activity_action_permalink_router', 3 ); … … 715 721 716 722 $defaults = array( 723 'id' => false, 717 724 'content' => false, 718 725 'user_id' => $bp->loggedin_user->id, … … 736 743 /* Insert the activity comment */ 737 744 $comment_id = bp_activity_add( array( 745 'id' => $id, 738 746 'action' => apply_filters( 'bp_activity_comment_action', sprintf( __( '%s posted a new activity comment:', 'buddypress' ), bp_core_get_userlink( $user_id ) ) ), 739 747 'content' => apply_filters( 'bp_activity_comment_content', $content ), … … 773 781 'secondary_item_id' => false, 774 782 'action' => false, 775 'content' => false 783 'content' => false, 784 'date_recorded' => false, 776 785 ); 777 786 … … 779 788 extract( $r, EXTR_SKIP ); 780 789 781 return apply_filters( 'bp_activity_get_activity_id', BP_Activity_Activity::get_id( $user_id, $component, $type, $item_id, $secondary_item_id, $action, $content ) );790 return apply_filters( 'bp_activity_get_activity_id', BP_Activity_Activity::get_id( $user_id, $component, $type, $item_id, $secondary_item_id, $action, $content, $date_recorded ) ); 782 791 } 783 792 -
trunk/bp-activity/bp-activity-classes.php
r2692 r2822 199 199 } 200 200 201 function get_id( $user_id, $component, $type, $item_id, $secondary_item_id, $action, $content ) {201 function get_id( $user_id, $component, $type, $item_id, $secondary_item_id, $action, $content, $date_recorded ) { 202 202 global $bp, $wpdb; 203 203 … … 224 224 if ( !empty( $content ) ) 225 225 $where_args[] = $wpdb->prepare( "content = %s", $content ); 226 227 if ( !empty( $date_recorded ) ) 228 $where_args[] = $wpdb->prepare( "date_recorded = %s", $date_recorded ); 226 229 227 230 if ( !empty( $where_args ) ) -
trunk/bp-activity/bp-activity-templatetags.php
r2784 r2822 541 541 542 542 function bp_activity_is_favorite() { 543 echo bp_get_ is_activity_favorite();543 echo bp_get_activity_is_favorite(); 544 544 } 545 545 function bp_get_activity_is_favorite() { -
trunk/bp-blogs/bp-blogs-templatetags.php
r2702 r2822 468 468 469 469 if ( bp_is_my_profile() ) { 470 echo apply_filters( 'bp_create_blog_link', '<a href="' . $bp-> loggedin_user->domain . $bp->blogs->slug . '/create-a-blog">' . __('Create a Blog', 'buddypress') . '</a>' );470 echo apply_filters( 'bp_create_blog_link', '<a href="' . $bp->root_domain . '/' . $bp->blogs->slug . '/create">' . __('Create a Blog', 'buddypress') . '</a>' ); 471 471 } 472 472 } -
trunk/bp-core.php
r2761 r2822 2104 2104 return $redirect_to; 2105 2105 2106 if ( !empty( $_REQUEST['redirect_to'] ) &&strpos( $_REQUEST['redirect_to'], 'wp-admin' ) )2106 if ( !empty( $_REQUEST['redirect_to'] ) || strpos( $_REQUEST['redirect_to'], 'wp-admin' ) ) 2107 2107 return $redirect_to; 2108 2108 -
trunk/bp-core/bp-core-signup.php
r2695 r2822 235 235 $bp->signup->username = $user_login; 236 236 237 do_action( 'bp_core_signup_user', $user_id, $user_login, $user_password, $user_email, $usermeta ); 238 237 239 return $user_id; 238 240 } -
trunk/bp-core/bp-core-templatetags.php
r2740 r2822 1693 1693 global $bp; 1694 1694 1695 if ( BP_BLOGS_SLUG == $bp->current_component && 'create -a-blog' == $bp->current_action )1695 if ( BP_BLOGS_SLUG == $bp->current_component && 'create' == $bp->current_action ) 1696 1696 return true; 1697 1697 -
trunk/bp-friends.php
r2761 r2822 99 99 100 100 // Delete any friendship acceptance notifications for the user when viewing a profile 101 bp_core_delete_notifications_for_user_by_type( $bp->loggedin_user->id, 'friends', 'friendship_accepted' );101 bp_core_delete_notifications_for_user_by_type( $bp->loggedin_user->id, $bp->friends->id, 'friendship_accepted' ); 102 102 103 103 do_action( 'friends_screen_my_friends' ); … … 133 133 134 134 do_action( 'friends_screen_requests' ); 135 136 if ( isset( $_GET['new'] ) ) 137 bp_core_delete_notifications_for_user_by_type( $bp->loggedin_user->id, $bp->friends->id, 'friendship_request' ); 135 138 136 139 bp_core_load_template( apply_filters( 'friends_template_requests', 'members/single/home' ) ); … … 318 321 case 'friendship_request': 319 322 if ( (int)$total_items > 1 ) { 320 return apply_filters( 'bp_friends_multiple_friendship_request_notification', '<a href="' . $bp->loggedin_user->domain . $bp->friends->slug . '/requests " title="' . __( 'Friendship requests', 'buddypress' ) . '">' . sprintf( __('You have %d pending friendship requests', 'buddypress' ), (int)$total_items ) . '</a>', $total_items );323 return apply_filters( 'bp_friends_multiple_friendship_request_notification', '<a href="' . $bp->loggedin_user->domain . $bp->friends->slug . '/requests/?new" title="' . __( 'Friendship requests', 'buddypress' ) . '">' . sprintf( __('You have %d pending friendship requests', 'buddypress' ), (int)$total_items ) . '</a>', $total_items ); 321 324 } else { 322 325 $user_fullname = bp_core_get_user_displayname( $item_id ); 323 326 $user_url = bp_core_get_user_domain( $item_id ); 324 return apply_filters( 'bp_friends_single_friendship_request_notification', '<a href="' . $bp->loggedin_user->domain . $bp->friends->slug . '/requests " title="' . __( 'Friendship requests', 'buddypress' ) . '">' . sprintf( __('You have a friendship request from %s', 'buddypress' ), $user_fullname ) . '</a>', $user_fullname );327 return apply_filters( 'bp_friends_single_friendship_request_notification', '<a href="' . $bp->loggedin_user->domain . $bp->friends->slug . '/requests/?new" title="' . __( 'Friendship requests', 'buddypress' ) . '">' . sprintf( __('You have a friendship request from %s', 'buddypress' ), $user_fullname ) . '</a>', $user_fullname ); 325 328 } 326 329 break; … … 363 366 if ( !$force_accept ) { 364 367 // Add the on screen notification 365 bp_core_add_notification( $friendship->initiator_user_id, $friendship->friend_user_id, 'friends', 'friendship_request' );368 bp_core_add_notification( $friendship->initiator_user_id, $friendship->friend_user_id, $bp->friends->id, 'friendship_request' ); 366 369 367 370 // Send the email notification … … 409 412 410 413 /* Remove the friend request notice */ 411 bp_core_delete_notifications_for_user_by_item_id( $friendship->friend_user_id, $friendship->initiator_user_id, 'friends', 'friendship_request' );414 bp_core_delete_notifications_for_user_by_item_id( $friendship->friend_user_id, $friendship->initiator_user_id, $bp->friends->id, 'friendship_request' ); 412 415 413 416 /* Add a friend accepted notice for the initiating user */ 414 bp_core_add_notification( $friendship->friend_user_id, $friendship->initiator_user_id, 'friends', 'friendship_accepted' );417 bp_core_add_notification( $friendship->friend_user_id, $friendship->initiator_user_id, $bp->friends->id, 'friendship_accepted' ); 415 418 416 419 $initiator_link = bp_core_get_userlink( $friendship->initiator_user_id ); … … 450 453 if ( !$friendship->is_confirmed && BP_Friends_Friendship::reject( $friendship_id ) ) { 451 454 // Remove the friend request notice 452 bp_core_delete_notifications_for_user_by_item_id( $friendship->friend_user_id, $friendship->initiator_user_id, 'friends', 'friendship_request' );455 bp_core_delete_notifications_for_user_by_item_id( $friendship->friend_user_id, $friendship->initiator_user_id, $bp->friends->id, 'friendship_request' ); 453 456 454 457 do_action( 'friends_friendship_rejected', $friendship_id, &$friendship ); … … 598 601 599 602 /* Remove friendship requests FROM user */ 600 bp_core_delete_notifications_from_user( $user_id, $bp->friends-> slug, 'friendship_request' );603 bp_core_delete_notifications_from_user( $user_id, $bp->friends->id, 'friendship_request' ); 601 604 602 605 do_action( 'friends_remove_data', $user_id ); … … 632 635 633 636 if ( isset($_GET['new']) ) 634 bp_core_delete_notifications_for_user_by_type( $bp-> loggedin_user->id, 'friends', 'friendship_accepted' );637 bp_core_delete_notifications_for_user_by_type( $bp->displayed_user->id, $bp->friends->id, 'friendship_accepted' ); 635 638 } 636 639 add_action( 'bp_activity_screen_my_activity', 'friends_clear_friend_notifications' ); -
trunk/bp-groups.php
r2784 r2822 269 269 if ( isset($_GET['n']) ) { 270 270 // Delete group request notifications for the user 271 bp_core_delete_notifications_for_user_by_type( $bp->loggedin_user->id, $bp->groups-> slug, 'membership_request_accepted' );272 bp_core_delete_notifications_for_user_by_type( $bp->loggedin_user->id, $bp->groups-> slug, 'membership_request_rejected' );273 bp_core_delete_notifications_for_user_by_type( $bp->loggedin_user->id, $bp->groups-> slug, 'member_promoted_to_mod' );274 bp_core_delete_notifications_for_user_by_type( $bp->loggedin_user->id, $bp->groups-> slug, 'member_promoted_to_admin' );271 bp_core_delete_notifications_for_user_by_type( $bp->loggedin_user->id, $bp->groups->id, 'membership_request_accepted' ); 272 bp_core_delete_notifications_for_user_by_type( $bp->loggedin_user->id, $bp->groups->id, 'membership_request_rejected' ); 273 bp_core_delete_notifications_for_user_by_type( $bp->loggedin_user->id, $bp->groups->id, 'member_promoted_to_mod' ); 274 bp_core_delete_notifications_for_user_by_type( $bp->loggedin_user->id, $bp->groups->id, 'member_promoted_to_admin' ); 275 275 } 276 276 … … 322 322 323 323 // Remove notifications 324 bp_core_delete_notifications_for_user_by_type( $bp->loggedin_user->id, $bp->groups-> slug, 'group_invite' );324 bp_core_delete_notifications_for_user_by_type( $bp->loggedin_user->id, $bp->groups->id, 'group_invite' ); 325 325 326 326 do_action( 'groups_screen_group_invites', $group_id ); … … 335 335 if ( isset($_GET['n']) ) { 336 336 // Delete group request notifications for the user 337 bp_core_delete_notifications_for_user_by_type( $bp->loggedin_user->id, $bp->groups-> slug, 'membership_request_accepted' );338 bp_core_delete_notifications_for_user_by_type( $bp->loggedin_user->id, $bp->groups-> slug, 'membership_request_rejected' );339 bp_core_delete_notifications_for_user_by_type( $bp->loggedin_user->id, $bp->groups-> slug, 'member_promoted_to_mod' );340 bp_core_delete_notifications_for_user_by_type( $bp->loggedin_user->id, $bp->groups-> slug, 'member_promoted_to_admin' );337 bp_core_delete_notifications_for_user_by_type( $bp->loggedin_user->id, $bp->groups->id, 'membership_request_accepted' ); 338 bp_core_delete_notifications_for_user_by_type( $bp->loggedin_user->id, $bp->groups->id, 'membership_request_rejected' ); 339 bp_core_delete_notifications_for_user_by_type( $bp->loggedin_user->id, $bp->groups->id, 'member_promoted_to_mod' ); 340 bp_core_delete_notifications_for_user_by_type( $bp->loggedin_user->id, $bp->groups->id, 'member_promoted_to_admin' ); 341 341 } 342 342 … … 873 873 874 874 // Remove any screen notifications 875 bp_core_delete_notifications_for_user_by_type( $bp->loggedin_user->id, $bp->groups-> slug, 'new_membership_request' );875 bp_core_delete_notifications_for_user_by_type( $bp->loggedin_user->id, $bp->groups->id, 'new_membership_request' ); 876 876 877 877 $request_action = $bp->action_variables[1]; … … 1545 1545 } 1546 1546 1547 groups_update_groupmeta( $group->id, 'last_activity', gmdate( "Y-m-d H:i:s" ) ); 1547 1548 do_action( 'groups_settings_updated', $group->id ); 1548 1549 … … 1842 1843 'content' => false, 1843 1844 'user_id' => $bp->loggedin_user->id, 1844 'group_id' => false1845 'group_id' => $bp->groups->current_group->id 1845 1846 ); 1846 1847 … … 1866 1867 'content' => apply_filters( 'groups_activity_new_update_content', $activity_content ), 1867 1868 'type' => 'activity_update', 1868 'item_id' => $ bp->groups->current_group->id1869 'item_id' => $group_id 1869 1870 ) ); 1870 1871 … … 2159 2160 groups_update_groupmeta( $group_id, 'last_activity', gmdate( "Y-m-d H:i:s" ) ); 2160 2161 2161 bp_core_delete_notifications_for_user_by_item_id( $user_id, $group_id, $bp->groups-> slug, 'group_invite' );2162 bp_core_delete_notifications_for_user_by_item_id( $user_id, $group_id, $bp->groups->id, 'group_invite' ); 2162 2163 2163 2164 do_action( 'groups_accept_invite', $user_id, $group_id ); … … 2180 2181 2181 2182 if ( $delete ) 2182 bp_core_delete_notifications_for_user_by_item_id( $user_id, $group_id, $bp->groups-> slug, 'group_invite' );2183 bp_core_delete_notifications_for_user_by_item_id( $user_id, $group_id, $bp->groups->id, 'group_invite' ); 2183 2184 2184 2185 return $delete; -
trunk/bp-messages/bp-messages-templatetags.php
r2687 r2822 162 162 } else { 163 163 if ( 'inbox' == $bp->current_action ) 164 bp_core_delete_notifications_for_user_by_type( $bp->loggedin_user->id, 'messages', 'new_message' );164 bp_core_delete_notifications_for_user_by_type( $bp->loggedin_user->id, $bp->messages->id, 'new_message' ); 165 165 166 166 if ( 'sentbox' == $bp->current_action ) -
trunk/bp-themes/bp-default/activity/index.php
r2689 r2822 66 66 <option value="-1"><?php _e( 'No Filter', 'buddypress' ) ?></option> 67 67 <option value="activity_update"><?php _e( 'Show Updates', 'buddypress' ) ?></option> 68 <option value="new_blog_post"><?php _e( 'Show Blog Posts', 'buddypress' ) ?></option> 69 <option value="new_blog_comment"><?php _e( 'Show Blog Comments', 'buddypress' ) ?></option> 68 69 <?php if ( bp_is_active( 'blogs' ) ) : ?> 70 <option value="new_blog_post"><?php _e( 'Show Blog Posts', 'buddypress' ) ?></option> 71 <option value="new_blog_comment"><?php _e( 'Show Blog Comments', 'buddypress' ) ?></option> 72 <?php endif; ?> 70 73 71 74 <?php if ( bp_is_active( 'forums' ) ) : ?> -
trunk/bp-themes/bp-default/groups/single/plugins.php
r2379 r2822 12 12 13 13 <div id="item-nav"> 14 <div class="item-list-tabs no-ajax" id=" sub-nav">14 <div class="item-list-tabs no-ajax" id="object-nav"> 15 15 <ul> 16 16 <?php bp_get_options_nav() ?> -
trunk/bp-themes/bp-default/header.php
r2695 r2822 64 64 </li> 65 65 66 <?php if ( bp_is_active( 'forums' ) && bp_is_active( 'groups' ) &&( function_exists( 'bp_forums_is_installed_correctly' ) && !(int) bp_get_option( 'bp-disable-forum-directory' ) ) && bp_forums_is_installed_correctly() ) : ?>66 <?php if ( bp_is_active( 'forums' ) && ( function_exists( 'bp_forums_is_installed_correctly' ) && !(int) bp_get_option( 'bp-disable-forum-directory' ) ) && bp_forums_is_installed_correctly() ) : ?> 67 67 <li<?php if ( bp_is_page( BP_FORUMS_SLUG ) ) : ?> class="selected"<?php endif; ?>> 68 68 <a href="<?php echo site_url() ?>/<?php echo BP_FORUMS_SLUG ?>/" title="<?php _e( 'Forums', 'buddypress' ) ?>"><?php _e( 'Forums', 'buddypress' ) ?></a> -
trunk/bp-themes/bp-default/members/single/activity.php
r2539 r2822 9 9 10 10 <?php if ( 'groups' != bp_current_action() ) : ?> 11 <option value="new_blog_post"><?php _e( 'Show Blog Posts', 'buddypress' ) ?></option> 12 <option value="new_blog_comment"><?php _e( 'Show Blog Comments', 'buddypress' ) ?></option> 11 <?php if ( bp_is_active( 'blogs' ) ) : ?> 12 <option value="new_blog_post"><?php _e( 'Show Blog Posts', 'buddypress' ) ?></option> 13 <option value="new_blog_comment"><?php _e( 'Show Blog Comments', 'buddypress' ) ?></option> 14 <?php endif; ?> 13 15 14 16 <?php if ( bp_is_active( 'friends' ) ) : ?> -
trunk/bp-themes/bp-default/members/single/plugins.php
r2695 r2822 14 14 <ul> 15 15 <?php bp_get_displayed_user_nav() ?> 16 17 <?php do_action( 'bp_members_directory_member_types' ) ?>18 16 </ul> 19 17 </div> … … 25 23 <ul> 26 24 <?php bp_get_options_nav() ?> 25 26 <?php do_action( 'bp_member_plugin_options_nav' ) ?> 27 27 </ul> 28 28 </div> 29 29 30 30 <?php do_action( 'bp_template_content' ) ?> 31 32 <?php do_action( 'bp_directory_members_content' ) ?>33 31 34 32 </div><!-- #item-body --> -
trunk/bp-xprofile.php
r2802 r2822 899 899 * @package BuddyPress Core 900 900 */ 901 function xprofile_sync_wp_profile( ) {901 function xprofile_sync_wp_profile( $user_id = false ) { 902 902 global $bp, $wpdb; 903 903 … … 905 905 return true; 906 906 907 $fullname = xprofile_get_field_data( BP_XPROFILE_FULLNAME_FIELD_NAME, $bp->loggedin_user->id ); 907 if ( empty( $user_id ) ) 908 $user_id = $bp->loggedin_user->id; 909 910 if ( empty( $user_id ) ) 911 return false; 912 913 $fullname = xprofile_get_field_data( BP_XPROFILE_FULLNAME_FIELD_NAME, $user_id ); 908 914 $space = strpos( $fullname, ' ' ); 909 915 … … 916 922 } 917 923 918 update_usermeta( $ bp->loggedin_user->id, 'nickname', $fullname );919 update_usermeta( $ bp->loggedin_user->id, 'first_name', $firstname );920 update_usermeta( $ bp->loggedin_user->id, 'last_name', $lastname );921 922 $wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->users} SET display_name = %s WHERE ID = %d", $fullname, $ bp->loggedin_user->id ) );923 $wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->users} SET user_url = %s WHERE ID = %d", bp_core_get_user_domain( $ bp->loggedin_user->id ), $bp->loggedin_user->id ) );924 update_usermeta( $user_id, 'nickname', $fullname ); 925 update_usermeta( $user_id, 'first_name', $firstname ); 926 update_usermeta( $user_id, 'last_name', $lastname ); 927 928 $wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->users} SET display_name = %s WHERE ID = %d", $fullname, $user_id ) ); 929 $wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->users} SET user_url = %s WHERE ID = %d", bp_core_get_user_domain( $user_id ), $user_id ) ); 924 930 } 925 931 add_action( 'xprofile_updated_profile', 'xprofile_sync_wp_profile' ); 926 932 add_action( 'bp_core_signup_user', 'xprofile_sync_wp_profile' ); 927 933 928 934 /**
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)