Skip to:
Content

BuddyPress.org

Changeset 2822


Ignore:
Timestamp:
03/08/2010 04:20:25 PM (16 years ago)
Author:
apeatling
Message:

Merge 1.2 branch with trunk

Location:
trunk
Files:
16 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-activity.php

    r2761 r2822  
    248248        if ( !$has_access ) {
    249249                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 ) ) );
    251255        }
    252256
     
    312316        if ( $activity->component == $bp->groups->id ) {
    313317                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 . '/';
    315319                else {
    316320                        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 . '/';
    318322                }
    319323        } else
    320324                $redirect = bp_core_get_user_domain( $activity->user_id, $activity->user_nicename, $activity->user_login ) . $bp->activity->slug . '/' . $activity->id;
    321325
     326        $redirect = apply_filters( 'bp_activity_permalink_redirect_url', $redirect, &$activity );
     327
    322328        if ( !$redirect )
    323329                bp_core_redirect( $bp->root_domain );
    324330
    325331        /* 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 );
    327333}
    328334add_action( 'wp', 'bp_activity_action_permalink_router', 3 );
     
    715721
    716722        $defaults = array(
     723                'id' => false,
    717724                'content' => false,
    718725                'user_id' => $bp->loggedin_user->id,
     
    736743        /* Insert the activity comment */
    737744        $comment_id = bp_activity_add( array(
     745                'id' => $id,
    738746                'action' => apply_filters( 'bp_activity_comment_action', sprintf( __( '%s posted a new activity comment:', 'buddypress' ), bp_core_get_userlink( $user_id ) ) ),
    739747                'content' => apply_filters( 'bp_activity_comment_content', $content ),
     
    773781                'secondary_item_id' => false,
    774782                'action' => false,
    775                 'content' => false
     783                'content' => false,
     784                'date_recorded' => false,
    776785        );
    777786
     
    779788        extract( $r, EXTR_SKIP );
    780789
    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 ) );
    782791}
    783792
  • trunk/bp-activity/bp-activity-classes.php

    r2692 r2822  
    199199        }
    200200
    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 ) {
    202202                global $bp, $wpdb;
    203203
     
    224224                if ( !empty( $content ) )
    225225                        $where_args[] = $wpdb->prepare( "content = %s", $content );
     226
     227                if ( !empty( $date_recorded ) )
     228                        $where_args[] = $wpdb->prepare( "date_recorded = %s", $date_recorded );
    226229
    227230                if ( !empty( $where_args ) )
  • trunk/bp-activity/bp-activity-templatetags.php

    r2784 r2822  
    541541
    542542function bp_activity_is_favorite() {
    543         echo bp_get_is_activity_favorite();
     543        echo bp_get_activity_is_favorite();
    544544}
    545545        function bp_get_activity_is_favorite() {
  • trunk/bp-blogs/bp-blogs-templatetags.php

    r2702 r2822  
    468468
    469469        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>' );
    471471        }
    472472}
  • trunk/bp-core.php

    r2761 r2822  
    21042104                return $redirect_to;
    21052105
    2106         if ( !empty( $_REQUEST['redirect_to'] ) && strpos( $_REQUEST['redirect_to'], 'wp-admin' ) )
     2106        if ( !empty( $_REQUEST['redirect_to'] ) || strpos( $_REQUEST['redirect_to'], 'wp-admin' ) )
    21072107                return $redirect_to;
    21082108
  • trunk/bp-core/bp-core-signup.php

    r2695 r2822  
    235235        $bp->signup->username = $user_login;
    236236
     237        do_action( 'bp_core_signup_user', $user_id, $user_login, $user_password, $user_email, $usermeta );
     238
    237239        return $user_id;
    238240}
  • trunk/bp-core/bp-core-templatetags.php

    r2740 r2822  
    16931693        global $bp;
    16941694
    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 )
    16961696                return true;
    16971697
  • trunk/bp-friends.php

    r2761 r2822  
    9999
    100100        // 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' );
    102102
    103103        do_action( 'friends_screen_my_friends' );
     
    133133
    134134        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' );
    135138
    136139        bp_core_load_template( apply_filters( 'friends_template_requests', 'members/single/home' ) );
     
    318321                case 'friendship_request':
    319322                        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 );
    321324                        } else {
    322325                                $user_fullname = bp_core_get_user_displayname( $item_id );
    323326                                $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 );
    325328                        }
    326329                break;
     
    363366                if ( !$force_accept ) {
    364367                        // 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' );
    366369
    367370                        // Send the email notification
     
    409412
    410413                /* 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' );
    412415
    413416                /* 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' );
    415418
    416419                $initiator_link = bp_core_get_userlink( $friendship->initiator_user_id );
     
    450453        if ( !$friendship->is_confirmed && BP_Friends_Friendship::reject( $friendship_id ) ) {
    451454                // 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' );
    453456
    454457                do_action( 'friends_friendship_rejected', $friendship_id, &$friendship );
     
    598601
    599602        /* 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' );
    601604
    602605        do_action( 'friends_remove_data', $user_id );
     
    632635
    633636        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' );
    635638}
    636639add_action( 'bp_activity_screen_my_activity', 'friends_clear_friend_notifications' );
  • trunk/bp-groups.php

    r2784 r2822  
    269269        if ( isset($_GET['n']) ) {
    270270                // 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' );
    275275        }
    276276
     
    322322
    323323        // 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' );
    325325
    326326        do_action( 'groups_screen_group_invites', $group_id );
     
    335335                if ( isset($_GET['n']) ) {
    336336                        // 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' );
    341341                }
    342342
     
    873873
    874874                // 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' );
    876876
    877877                $request_action = $bp->action_variables[1];
     
    15451545        }
    15461546
     1547        groups_update_groupmeta( $group->id, 'last_activity', gmdate( "Y-m-d H:i:s" ) );
    15471548        do_action( 'groups_settings_updated', $group->id );
    15481549
     
    18421843                'content' => false,
    18431844                'user_id' => $bp->loggedin_user->id,
    1844                 'group_id' => false
     1845                'group_id' => $bp->groups->current_group->id
    18451846        );
    18461847
     
    18661867                'content' => apply_filters( 'groups_activity_new_update_content', $activity_content ),
    18671868                'type' => 'activity_update',
    1868                 'item_id' => $bp->groups->current_group->id
     1869                'item_id' => $group_id
    18691870        ) );
    18701871
     
    21592160        groups_update_groupmeta( $group_id, 'last_activity', gmdate( "Y-m-d H:i:s" ) );
    21602161
    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' );
    21622163
    21632164        do_action( 'groups_accept_invite', $user_id, $group_id );
     
    21802181
    21812182        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' );
    21832184
    21842185        return $delete;
  • trunk/bp-messages/bp-messages-templatetags.php

    r2687 r2822  
    162162        } else {
    163163                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' );
    165165
    166166                if ( 'sentbox' == $bp->current_action )
  • trunk/bp-themes/bp-default/activity/index.php

    r2689 r2822  
    6666                                                        <option value="-1"><?php _e( 'No Filter', 'buddypress' ) ?></option>
    6767                                                        <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; ?>
    7073
    7174                                                        <?php if ( bp_is_active( 'forums' ) ) : ?>
  • trunk/bp-themes/bp-default/groups/single/plugins.php

    r2379 r2822  
    1212
    1313                        <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">
    1515                                        <ul>
    1616                                                <?php bp_get_options_nav() ?>
  • trunk/bp-themes/bp-default/header.php

    r2695 r2822  
    6464                                        </li>
    6565
    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() ) : ?>
    6767                                                <li<?php if ( bp_is_page( BP_FORUMS_SLUG ) ) : ?> class="selected"<?php endif; ?>>
    6868                                                        <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  
    99
    1010                                <?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; ?>
    1315
    1416                                        <?php if ( bp_is_active( 'friends' ) ) : ?>
  • trunk/bp-themes/bp-default/members/single/plugins.php

    r2695 r2822  
    1414                                        <ul>
    1515                                                <?php bp_get_displayed_user_nav() ?>
    16 
    17                                                 <?php do_action( 'bp_members_directory_member_types' ) ?>
    1816                                        </ul>
    1917                                </div>
     
    2523                                        <ul>
    2624                                                <?php bp_get_options_nav() ?>
     25
     26                                                <?php do_action( 'bp_member_plugin_options_nav' ) ?>
    2727                                        </ul>
    2828                                </div>
    2929
    3030                                <?php do_action( 'bp_template_content' ) ?>
    31 
    32                                 <?php do_action( 'bp_directory_members_content' ) ?>
    3331
    3432                        </div><!-- #item-body -->
  • trunk/bp-xprofile.php

    r2802 r2822  
    899899 * @package BuddyPress Core
    900900 */
    901 function xprofile_sync_wp_profile() {
     901function xprofile_sync_wp_profile( $user_id = false ) {
    902902        global $bp, $wpdb;
    903903
     
    905905                return true;
    906906
    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 );
    908914        $space = strpos( $fullname, ' ' );
    909915
     
    916922        }
    917923
    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 ) );
    924930}
    925931add_action( 'xprofile_updated_profile', 'xprofile_sync_wp_profile' );
    926 
     932add_action( 'bp_core_signup_user', 'xprofile_sync_wp_profile' );
    927933
    928934/**
Note: See TracChangeset for help on using the changeset viewer.