Skip to:
Content

BuddyPress.org

Ticket #2945: 2945.001.diff

File 2945.001.diff, 64.2 KB (added by cnorris23, 15 years ago)
  • bp-friends.php

     
    66if ( !defined( 'BP_FRIENDS_SLUG' ) )
    77        define ( 'BP_FRIENDS_SLUG', 'friends' );
    88
    9 require ( BP_PLUGIN_DIR . '/bp-friends/bp-friends-classes.php' );
    10 require ( BP_PLUGIN_DIR . '/bp-friends/bp-friends-templatetags.php' );
     9require ( BP_PLUGIN_DIR . 'bp-friends/bp-friends-classes.php' );
     10require ( BP_PLUGIN_DIR . 'bp-friends/bp-friends-templatetags.php' );
    1111
    1212function friends_setup_globals() {
    1313        global $bp;
     
    340340                        bp_core_add_notification( $friendship->initiator_user_id, $friendship->friend_user_id, $bp->friends->id, 'friendship_request' );
    341341
    342342                        // Send the email notification
    343                         require_once( BP_PLUGIN_DIR . '/bp-friends/bp-friends-notifications.php' );
     343                        require_once( BP_PLUGIN_DIR . 'bp-friends/bp-friends-notifications.php' );
    344344                        friends_notification_new_request( $friendship->id, $friendship->initiator_user_id, $friendship->friend_user_id );
    345345
    346346                        do_action( 'friends_friendship_requested', $friendship->id, $friendship->initiator_user_id, $friendship->friend_user_id );
     
    411411                ) );
    412412
    413413                // Send the email notification
    414                 require_once( BP_PLUGIN_DIR . '/bp-friends/bp-friends-notifications.php' );
     414                require_once( BP_PLUGIN_DIR . 'bp-friends/bp-friends-notifications.php' );
    415415                friends_notification_accepted_request( $friendship->id, $friendship->initiator_user_id, $friendship->friend_user_id );
    416416
    417417                do_action( 'friends_friendship_accepted', $friendship->id, $friendship->initiator_user_id, $friendship->friend_user_id );
     
    569569
    570570function friends_remove_data( $user_id ) {
    571571        global $bp;
    572        
     572
    573573        BP_Friends_Friendship::delete_all_for_user($user_id);
    574574
    575575        /* Remove usermeta */
  • bp-activity.php

     
    11<?php
    2 require ( BP_PLUGIN_DIR . '/bp-activity/bp-activity-classes.php' );
    3 require ( BP_PLUGIN_DIR . '/bp-activity/bp-activity-templatetags.php' );
    4 require ( BP_PLUGIN_DIR . '/bp-activity/bp-activity-filters.php' );
     2require ( BP_PLUGIN_DIR . 'bp-activity/bp-activity-classes.php' );
     3require ( BP_PLUGIN_DIR . 'bp-activity/bp-activity-templatetags.php' );
     4require ( BP_PLUGIN_DIR . 'bp-activity/bp-activity-filters.php' );
    55
    66function bp_activity_setup_globals() {
    77        global $bp, $current_blog;
     
    508508 *
    509509 * @package BuddyPress Activity
    510510 * @since 1.3
    511  * 
     511 *
    512512 * @param $content The content of the activity, usually found in $activity->content
    513513 * @return array $usernames Array of the found usernames that match existing users
    514514 */
    515515function bp_activity_find_mentions( $content ) {
    516516        $pattern = '/[@]+([A-Za-z0-9-_\.]+)/';
    517517        preg_match_all( $pattern, $content, $usernames );
    518        
     518
    519519        // Make sure there's only one instance of each username
    520520        if ( !$usernames = array_unique( $usernames[1] ) )
    521521                return false;
    522                
     522
    523523        return $usernames;
    524524}
    525525
     
    530530 *
    531531 * @package BuddyPress Activity
    532532 * @since 1.3
    533  * 
     533 *
    534534 * @param $activity_id The unique id for the activity item
    535535 */
    536536function bp_activity_reduce_mention_count( $activity_id ) {
    537537        $activity = new BP_Activity_Activity( $activity_id );
    538        
    539         if ( $usernames = bp_activity_find_mentions( strip_tags( $activity->content ) ) ) {     
     538
     539        if ( $usernames = bp_activity_find_mentions( strip_tags( $activity->content ) ) ) {
    540540                include_once( ABSPATH . WPINC . '/registration.php' );
    541                
    542                 foreach( (array)$usernames as $username ) { 
     541
     542                foreach( (array)$usernames as $username ) {
    543543                        if ( !$user_id = username_exists( $username ) )
    544544                                continue;
    545        
     545
    546546                        // Decrease the number of new @ mentions for the user
    547547                        $new_mention_count = (int)get_user_meta( $user_id, 'bp_new_mention_count', true );
    548548                        update_user_meta( $user_id, 'bp_new_mention_count', $new_mention_count - 1 );
     
    577577                                return apply_filters( 'bp_activity_multiple_at_mentions_notification', '<a href="' . $at_mention_link . '" title="' . $at_mention_title . '">' . sprintf( __( 'You have %1$d new activity mentions', 'buddypress' ), (int)$total_items ) . '</a>', $at_mention_link, $total_items, $activity_id, $poster_user_id );
    578578                        } else {
    579579                                $user_fullname = bp_core_get_user_displayname( $poster_user_id );
    580                                
     580
    581581                                return apply_filters( 'bp_activity_single_at_mentions_notification', '<a href="' . $at_mention_link . '" title="' . $at_mention_title . '">' . sprintf( __( '%1$s mentioned you in an activity update', 'buddypress' ), $user_fullname ) . '</a>', $at_mention_link, $total_items, $activity_id, $poster_user_id );
    582582                        }
    583583                break;
     
    745745        update_user_meta( $bp->loggedin_user->id, 'bp_latest_update', array( 'id' => $activity_id, 'content' => wp_filter_kses( $content ) ) );
    746746
    747747        /* Require the notifications code so email notifications can be set on the 'bp_activity_posted_update' action. */
    748         require_once( BP_PLUGIN_DIR . '/bp-activity/bp-activity-notifications.php' );
     748        require_once( BP_PLUGIN_DIR . 'bp-activity/bp-activity-notifications.php' );
    749749
    750750        do_action( 'bp_activity_posted_update', $content, $user_id, $activity_id );
    751751
     
    790790        ) );
    791791
    792792        /* Send an email notification if settings allow */
    793         require_once( BP_PLUGIN_DIR . '/bp-activity/bp-activity-notifications.php' );
     793        require_once( BP_PLUGIN_DIR . 'bp-activity/bp-activity-notifications.php' );
    794794        bp_activity_new_comment_notification( $comment_id, $user_id, $params );
    795795
    796796        /* Clear the comment cache for this activity */
     
    998998                        $new_width = $new_height * $ratio;
    999999
    10001000                        $image = '<img src="' . esc_attr( $src ) . '" width="' . $new_width . '" height="' . $new_height . '" alt="' . __( 'Thumbnail', 'buddypress' ) . '" class="align-left thumbnail" />';
    1001                        
     1001
    10021002                        if ( !empty( $link ) ) {
    10031003                                $image = '<a href="' . $link . '">' . $image . '</a>';
    10041004                        }
     
    12231223
    12241224/**
    12251225 * updates_register_activity_actions()
    1226  * 
     1226 *
    12271227 * Register the activity stream actions for updates
    1228  * 
     1228 *
    12291229 * @global array $bp
    12301230 */
    12311231function updates_register_activity_actions() {
  • bp-xprofile/bp-xprofile-cssjs.php

     
    11<?php
    22function xprofile_add_admin_css() {
    33        if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG )
    4                 wp_enqueue_style( 'xprofile-admin-css', BP_PLUGIN_URL . '/bp-xprofile/admin/css/admin.dev.css' );
     4                wp_enqueue_style( 'xprofile-admin-css', BP_PLUGIN_URL . 'bp-xprofile/admin/css/admin.dev.css' );
    55        else
    6                 wp_enqueue_style( 'xprofile-admin-css', BP_PLUGIN_URL . '/bp-xprofile/admin/css/admin.css' );
     6                wp_enqueue_style( 'xprofile-admin-css', BP_PLUGIN_URL . 'bp-xprofile/admin/css/admin.css' );
    77}
    88add_action( 'admin_menu', 'xprofile_add_admin_css' );
    99
     
    1717                wp_enqueue_script( 'jquery-ui-sortable' );
    1818
    1919                if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG )
    20                         wp_enqueue_script( 'xprofile-admin-js', BP_PLUGIN_URL . '/bp-xprofile/admin/js/admin.dev.js', array( 'jquery', 'jquery-ui-sortable' ) );
     20                        wp_enqueue_script( 'xprofile-admin-js', BP_PLUGIN_URL . 'bp-xprofile/admin/js/admin.dev.js', array( 'jquery', 'jquery-ui-sortable' ) );
    2121                else
    22                         wp_enqueue_script( 'xprofile-admin-js', BP_PLUGIN_URL . '/bp-xprofile/admin/js/admin.js', array( 'jquery', 'jquery-ui-sortable' ) );
     22                        wp_enqueue_script( 'xprofile-admin-js', BP_PLUGIN_URL . 'bp-xprofile/admin/js/admin.js', array( 'jquery', 'jquery-ui-sortable' ) );
    2323        }
    2424}
    2525add_action( 'admin_menu', 'xprofile_add_admin_js', 1 );
  • bp-core/bp-core-widgets.php

     
    1717
    1818                if ( is_active_widget( false, false, $this->id_base ) ) {
    1919                        if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG )
    20                                 wp_enqueue_script( 'bp_core_widget_members-js', BP_PLUGIN_URL . '/bp-core/js/widget-members.dev.js', array( 'jquery' ) );
     20                                wp_enqueue_script( 'bp_core_widget_members-js', BP_PLUGIN_URL . 'bp-core/js/widget-members.dev.js', array( 'jquery' ) );
    2121                        else
    22                                 wp_enqueue_script( 'bp_core_widget_members-js', BP_PLUGIN_URL . '/bp-core/js/widget-members.js', array( 'jquery' ) );
     22                                wp_enqueue_script( 'bp_core_widget_members-js', BP_PLUGIN_URL . 'bp-core/js/widget-members.js', array( 'jquery' ) );
    2323                }
    2424        }
    2525
     
    6363                                                                <span class="activity">
    6464                                                                <?php
    6565                                                                        if ( 'newest' == $instance['member_default'] )
    66                                                                                 bp_member_registered();                                                         
     66                                                                                bp_member_registered();
    6767                                                                        if ( 'active' == $instance['member_default'] )
    6868                                                                                bp_member_last_active();
    6969                                                                        if ( 'popular' == $instance['member_default'] )
     
    107107                        'member_default' => 'active'
    108108                );
    109109                $instance = wp_parse_args( (array) $instance, $defaults );
    110                
     110
    111111                $title = strip_tags( $instance['title'] );
    112112                $max_members = strip_tags( $instance['max_members'] );
    113113                $member_default = strip_tags( $instance['member_default'] );
     
    116116                <p><label for="bp-core-widget-title"><?php _e('Title:', 'buddypress'); ?> <input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" style="width: 100%" /></label></p>
    117117
    118118                <p><label for="bp-core-widget-members-max"><?php _e('Max members to show:', 'buddypress'); ?> <input class="widefat" id="<?php echo $this->get_field_id( 'max_members' ); ?>" name="<?php echo $this->get_field_name( 'max_members' ); ?>" type="text" value="<?php echo esc_attr( $max_members ); ?>" style="width: 30%" /></label></p>
    119                                
     119
    120120                <p>
    121                         <label for="bp-core-widget-groups-default"><?php _e('Default members to show:', 'buddypress'); ?> 
     121                        <label for="bp-core-widget-groups-default"><?php _e('Default members to show:', 'buddypress'); ?>
    122122                        <select name="<?php echo $this->get_field_name( 'member_default' ) ?>">
    123123                                <option value="newest" <?php if ( $member_default == 'newest' ) : ?>selected="selected"<?php endif; ?>><?php _e( 'Newest', 'buddypress' ) ?></option>
    124124                                <option value="active" <?php if ( $member_default == 'active' ) : ?>selected="selected"<?php endif; ?>><?php _e( 'Active', 'buddypress' ) ?></option>
    125125                                <option value="popular"  <?php if ( $member_default == 'popular' ) : ?>selected="selected"<?php endif; ?>><?php _e( 'Popular', 'buddypress' ) ?></option>
    126                         </select>                       
     126                        </select>
    127127                        </label>
    128128                </p>
    129        
     129
    130130        <?php
    131131        }
    132132}
     
    183183                        'max_members' => 15
    184184                );
    185185                $instance = wp_parse_args( (array) $instance, $defaults );
    186                
     186
    187187                $title = strip_tags( $instance['title'] );
    188188                $max_members = strip_tags( $instance['max_members'] );
    189189                ?>
     
    247247                        'max_members' => 15
    248248                );
    249249                $instance = wp_parse_args( (array) $instance, $defaults );
    250                
     250
    251251                $title = strip_tags( $instance['title'] );
    252252                $max_members = strip_tags( $instance['max_members'] );
    253253                ?>
     
    298298                                                <?php if ( 'active' == $type ) : ?>
    299299                                                        <div class="item-meta"><span class="activity"><?php bp_member_last_active() ?></span></div>
    300300                                                <?php elseif ( 'newest' == $type ) : ?>
    301                                                         <div class="item-meta"><span class="activity"><?php bp_member_registered() ?></span></div> 
     301                                                        <div class="item-meta"><span class="activity"><?php bp_member_registered() ?></span></div>
    302302                                                <?php elseif ( bp_is_active( 'friends' ) ) : ?>
    303303                                                        <div class="item-meta"><span class="activity"><?php bp_member_total_friend_count() ?></span></div>
    304304                                                <?php endif; ?>
  • bp-core/admin/bp-core-upgrade.php

     
    33if ( !defined( 'BP_ROOT_BLOG' ) )
    44        define( 'BP_ROOT_BLOG', 1 );
    55
     6if ( !defined( 'BP_PLUGIN_DIR' ) )
     7        define( 'BP_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
     8
     9if ( !defined( 'BP_PLUGIN_URL' ) )
     10        define( 'BP_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
     11
    612require_once( dirname( dirname( __FILE__ ) ) . '/bp-core-wpabstraction.php' );
    713
    8 register_theme_directory( WP_PLUGIN_DIR . '/buddypress/bp-themes' );
     14register_theme_directory( BP_PLUGIN_DIR . 'bp-themes' );
    915
    1016// Install site options on activation
    1117bp_core_activate_site_options( array( 'bp-disable-account-deletion' => 0, 'bp-disable-avatar-uploads' => 0, 'bp-disable-blogforum-comments' => 0,  'bp-disable-forum-directory' => 0,  'bp-disable-profile-sync' => 0 ) );
    12  
     18
    1319/**
    1420 * bp_core_activate_site_options()
    1521 *
     
    5561                if ( !$this->current_version = get_site_option( 'bp-db-version' ) )
    5662                        if ( $this->current_version = get_option( 'bp-db-version' ) )
    5763                                $this->is_network_activate = true;
    58                
     64
    5965                $this->new_version = constant( 'BP_DB_VERSION' );
    6066                $this->setup_type = ( empty( $this->current_version ) && !(int)get_site_option( 'bp-core-db-version' ) ) ? 'new' : 'upgrade';
    6167                $this->current_step = $this->current_step();
     
    103109                        }
    104110                } else {
    105111                        // Upgrade wizard steps
    106                        
     112
    107113                        if ( $this->is_network_activate )
    108114                                $steps[] = __( 'Multisite Upgrade', 'buddypress' );
    109                        
     115
    110116                        if ( $this->current_version < $this->new_version )
    111117                                $steps[] = __( 'Database Upgrade', 'buddypress' );
    112118
     
    242248                </div>
    243249        <?php
    244250        }
    245        
     251
    246252        function step_ms_upgrade() {
    247253                if ( !current_user_can( 'activate_plugins' ) )
    248254                        return false;
     
    251257                        $blogs_slug = constant( 'BP_BLOGS_SLUG' );
    252258                else
    253259                        $blogs_slug = __( 'blogs', 'buddypress' );
    254                
     260
    255261                if ( !defined( 'BP_ENABLE_MULTIBLOG' ) && is_multisite() )
    256262                        $existing_pages = get_blog_option( BP_ROOT_BLOG, 'bp-pages' );
    257263                else
     
    261267                <div class="prev-next submit clear">
    262268                        <p><input type="submit" value="<?php _e( 'Save &amp; Next &rarr;', 'buddypress' ) ?>" name="submit" /></p>
    263269                </div>
    264                
     270
    265271                <p><?php printf( __( 'It looks like you have just activated WordPress Multisite mode, which allows members of your BuddyPress community to have their own WordPress blogs. You can enable or disable this feature at any time at <a href="%s">Network Options</a>.', 'buddypress' ), admin_url( 'ms-options.php' ) ); ?></p>
    266                
     272
    267273                <p><?php _e( "Please select the WordPress page you would like to use to display the blog directory. You can either choose an existing page or let BuddyPress auto-create a page for you. If you'd like to manually create pages, please go ahead and do that now, you can come back to this step once you are finished.", 'buddypress' ) ?></p>
    268274
    269275                <p><strong><?php _e( 'Please Note:', 'buddypress' ) ?></strong> <?php _e( "If you have manually added BuddyPress navigation links in your theme you may need to remove these from your header.php to avoid duplicate links.", 'buddypress' ) ?></p>
     
    280286                                        <p><input type="radio" name="bp_pages[blogs]" checked="checked" value="<?php echo $blogs_slug ?>" /> <?php _e( 'Automatically create a page at:', 'buddypress' ) ?> <?php echo site_url( $blogs_slug ) ?>/</p>
    281287                                </td>
    282288                        </tr>
    283                        
     289
    284290                </table>
    285                
     291
    286292                <p><?php _e( 'Would you like to enable blog tracking, which tracks blog activity across your network?', 'buddypress' ); ?></p>
    287                
     293
    288294                <div class="left-col">
    289                        
     295
    290296                        <div class="component">
    291297                                <h5><?php _e( "Blog Tracking", 'buddypress' ) ?></h5>
    292298
     
    295301                                        <input type="radio" name="bp_components[bp-blogs.php]" value="0"<?php if ( isset( $disabled_components['bp-blogs.php'] ) ) : ?> checked="checked" <?php endif; ?>/> <?php _e( 'Disabled', 'buddypress' ) ?>
    296302                                </div>
    297303
    298                                 <img src="<?php echo plugins_url( 'buddypress/screenshot-7.gif' ) ?>" alt="Activity Streams" />
     304                                <img src="<?php echo BP_PLUGIN_URL . 'screenshot-7.gif'; ?>" alt="Activity Streams" />
    299305                                        <p><?php _e( "Track new blogs, new posts and new comments across your entire blog network.", 'buddypress' ) ?></p>
    300                         </div>         
     306                        </div>
    301307                </div>
    302                
     308
    303309                <div class="submit clear">
    304310                        <p><input type="submit" value="<?php _e( 'Save &amp; Next &rarr;', 'buddypress' ) ?>" name="submit" /></p>
    305311
     
    307313                        <input type="hidden" name="step" value="<?php echo esc_attr( $this->current_step ) ?>" />
    308314                        <?php wp_nonce_field( 'bpwizard_ms_upgrade' ) ?>
    309315                </div>
    310                
     316
    311317                <script type="text/javascript">
    312318                        jQuery('select').click( function() {
    313319                                jQuery(this).parent().children('input').attr( 'checked', 'checked' );
     
    339345                                        <input type="radio" name="bp_components[bp-activity.php]" value="0"<?php if ( isset( $disabled_components['bp-activity.php'] ) ) : ?> checked="checked" <?php endif; ?>/> <?php _e( 'Disabled', 'buddypress' ) ?>
    340346                                </div>
    341347
    342                                 <img src="<?php echo plugins_url( 'buddypress/screenshot-1.gif' ) ?>" alt="Activity Streams" />
     348                                <img src="<?php echo BP_PLUGIN_URL . 'screenshot-1.gif'; ?>" alt="Activity Streams" />
    343349                                <p><?php _e( "Global, personal and group activity streams with threaded commenting, direct posting, favoriting and @mentions. All with full RSS feed and email notification support.", 'buddypress' ) ?></p>
    344350                        </div>
    345351
     
    351357                                        <input type="radio" name="bp_components[bp-groups.php]" value="0"<?php if ( isset( $disabled_components['bp-groups.php'] ) ) : ?> checked="checked" <?php endif; ?>/> <?php _e( 'Disabled', 'buddypress' ) ?>
    352358                                </div>
    353359
    354                                 <img src="<?php echo plugins_url( 'buddypress/screenshot-3.gif' ) ?>" alt="Activity Streams" />
     360                                <img src="<?php echo BP_PLUGIN_URL . 'screenshot-3.gif'; ?>" alt="Activity Streams" />
    355361                                <p><?php _e( "Powerful public, private or hidden groups allow your users to break the discussion down into specific topics with a separate activity stream and member listing.", 'buddypress' ) ?></p>
    356362                        </div>
    357363
     
    363369                                        <input type="radio" name="bp_components[bp-messages.php]" value="0"<?php if ( isset( $disabled_components['bp-messages.php'] ) ) : ?> checked="checked" <?php endif; ?>/> <?php _e( 'Disabled', 'buddypress' ) ?>
    364370                                </div>
    365371
    366                                 <img src="<?php echo plugins_url( 'buddypress/screenshot-5.gif' ) ?>" alt="Activity Streams" />
     372                                <img src="<?php echo BP_PLUGIN_URL . 'screenshot-5.gif'; ?>" alt="Activity Streams" />
    367373                                <p><?php _e( "Private messaging will allow your users to talk to each other directly, and in private. Not just limited to one on one discussions, your users can send messages to multiple recipients.", 'buddypress' ) ?></p>
    368374                        </div>
    369375
     
    377383                                        <input type="radio" name="bp_components[bp-blogs.php]" value="0"<?php if ( isset( $disabled_components['bp-blogs.php'] ) ) : ?> checked="checked" <?php endif; ?>/> <?php _e( 'Disabled', 'buddypress' ) ?>
    378384                                </div>
    379385
    380                                 <img src="<?php echo plugins_url( 'buddypress/screenshot-7.gif' ) ?>" alt="Activity Streams" />
     386                                <img src="<?php echo BP_PLUGIN_URL . 'screenshot-7.gif'; ?>" alt="Activity Streams" />
    381387                                        <p><?php _e( "Track new blogs, new posts and new comments across your entire blog network.", 'buddypress' ) ?></p>
    382388                        </div>
    383389                        <?php else: ?>
     
    395401                                        <input type="radio" name="bp_components[bp-xprofile.php]" value="0"<?php if ( isset( $disabled_components['bp-xprofile.php'] ) ) : ?> checked="checked" <?php endif; ?>/> <?php _e( 'Disabled', 'buddypress' ) ?>
    396402                                </div>
    397403
    398                                 <img src="<?php echo plugins_url( 'buddypress/screenshot-2.gif' ) ?>" alt="Activity Streams" />
     404                                <img src="<?php echo BP_PLUGIN_URL . 'screenshot-2.gif'; ?>" alt="Activity Streams" />
    399405                                <p><?php _e( "Fully editable profile fields allow you to define the fields users can fill in to describe themselves. Tailor profile fields to suit your audience.", 'buddypress' ) ?></p>
    400406                        </div>
    401407
     
    407413                                        <input type="radio" name="bp_components[bp-friends.php]" value="0"<?php if ( isset( $disabled_components['bp-friends.php'] ) ) : ?> checked="checked" <?php endif; ?>/> <?php _e( 'Disabled', 'buddypress' ) ?>
    408414                                </div>
    409415
    410                                 <img src="<?php echo plugins_url( 'buddypress/screenshot-4.gif' ) ?>" alt="Activity Streams" />
     416                                <img src="<?php echo BP_PLUGIN_URL . 'screenshot-4.gif'; ?>" alt="Activity Streams" />
    411417                                <p><?php _e( "Let your users make connections so they can track the activity of others, or filter on only those users they care about the most.", 'buddypress' ) ?></p>
    412418                        </div>
    413419
     
    419425                                        <input type="radio" name="bp_components[bp-forums.php]" value="0"<?php if ( isset( $disabled_components['bp-forums.php'] ) ) : ?> checked="checked" <?php endif; ?>/> <?php _e( 'Disabled', 'buddypress' ) ?>
    420426                                </div>
    421427
    422                                 <img src="<?php echo plugins_url( 'buddypress/screenshot-6.gif' ) ?>" alt="Activity Streams" />
     428                                <img src="<?php echo BP_PLUGIN_URL . 'screenshot-6.gif'; ?>" alt="Activity Streams" />
    423429                                <p><?php _e( "Full powered discussion forums built directly into groups allow for more conventional in-depth conversations. <strong>NOTE: This will require an extra (but easy) setup step.</strong>", 'buddypress' ) ?></p>
    424430                        </div>
    425431
     
    680686                        <tr>
    681687                                <th>
    682688                                        <h5><?php _e( 'Use the Default Theme', 'buddypress' ) ?></h5>
    683                                         <img src="<?php echo plugins_url( '/buddypress/bp-core/images/default.jpg' ) ?>" alt="bp-default" />
     689                                        <img src="<?php echo BP_PLUGIN_URL . 'bp-core/images/default.jpg'; ?>" alt="bp-default" />
    684690                                </th>
    685691                                <td>
    686692                                        <p><?php _e( 'The default theme contains everything you need to get up and running out of the box. It supports all features and is highly customizable.', 'buddypress' ) ?></p>
     
    692698                        <tr>
    693699                                <th>
    694700                                        <h5>Automatically Upgrade My WordPress Theme</h5>
    695                                         <img src="<?php echo plugins_url( '/buddypress/bp-core/images/auto_theme.jpg' ) ?>" alt="bp-default" />
     701                                        <img src="<?php echo BP_PLUGIN_URL . 'bp-core/images/auto_theme.jpg'; ?>" alt="bp-default" />
    696702                                </th>
    697703                                <td>
    698704                                        <p>The BuddyPress [plugin name] plugin will automatically upgrade your existing WordPress theme so it can display BuddyPress pages. Your existing theme's page.php template file will be used to show BuddyPress content.</p>
     
    705711                        <tr>
    706712                                <th>
    707713                                        <h5><?php _e( 'Manually Upgrade My WordPress Theme', 'buddypress' ) ?>'</h5>
    708                                         <img src="<?php echo plugins_url( '/buddypress/bp-core/images/manual_theme.jpg' ) ?>" alt="bp-default" />
     714                                        <img src="<?php echo BP_PLUGIN_URL . 'bp-core/images/manual_theme.jpg'; ?>" alt="bp-default" />
    709715                                </th>
    710716                                <td>
    711717                                        <p><?php _e( 'The BuddyPress template pack plugin will run you through the process of manually upgrading your existing WordPress theme. This usually involves following the step by step instructions and copying the BuddyPress template files into your theme then tweaking the HTML to match.', 'buddypress' ) ?></p>
     
    723729                        <tr>
    724730                                <th>
    725731                                        <h5><?php _e( 'Find a BuddyPress Theme', 'buddypress' ) ?></h5>
    726                                         <img src="<?php echo plugins_url( '/buddypress/bp-core/images/find.jpg' ) ?>" alt="bp-default" />
     732                                        <img src="<?php echo BP_PLUGIN_URL . 'bp-core/images/find.jpg'; ?>" alt="bp-default" />
    727733                                </th>
    728734                                <td>
    729735                                        <p><?php _e( "There's growing number of BuddyPress themes available for you to download and use. Browse through the list of available themes to see if there is one that matches your needs.", 'buddypress' ) ?></p>
     
    837843                                // Make sure that the pages are created on the BP_ROOT_BLOG, no matter which Dashboard the setup is being run on
    838844                                if ( $current_blog->blog_id != BP_ROOT_BLOG && !defined( 'BP_ENABLE_MULTIBLOG' ) )
    839845                                        switch_to_blog( BP_ROOT_BLOG );
    840        
     846
    841847                                $existing_pages = get_option( 'bp-pages' );
    842848
    843849                                $bp_pages = $this->setup_pages( (array)$_POST['bp_pages'] );
    844                                
     850
    845851                                $bp_pages = array_merge( (array)$existing_pages, (array)$bp_pages );
    846        
     852
    847853                                update_option( 'bp-pages', $bp_pages );
    848854
    849855                                if ( $current_blog->blog_id != BP_ROOT_BLOG )
    850856                                        restore_current_blog();
    851                        
     857
    852858                                unset( $disabled['bp-blogs.php'] );
    853                                
     859
    854860                                bp_core_install( $disabled );
    855861                        }
    856                        
     862
    857863                        update_site_option( 'bp-deactivated-components', $disabled );
    858864
    859865                        return true;
     
    10421048
    10431049                return false;
    10441050        }
    1045        
     1051
    10461052        function setup_pages( $pages ) {
    10471053                foreach ( $pages as $key => $value ) {
    10481054                        if ( 'page' == $value ) {
     
    10561062                                $bp_pages[$key] = wp_insert_post( array( 'post_title' => ucwords( $value ), 'post_status' => 'publish', 'post_type' => 'page' ) );
    10571063                        }
    10581064                }
    1059                
     1065
    10601066                return $bp_pages;
    10611067        }
    10621068
     
    12761282
    12771283function bp_core_add_admin_menu_styles() {
    12781284        if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG )
    1279                 wp_enqueue_style( 'bp-admin-css', apply_filters( 'bp_core_admin_css', plugins_url( $path = '/buddypress' ) . '/bp-core/css/admin.dev.css' ) );
     1285                wp_enqueue_style( 'bp-admin-css', apply_filters( 'bp_core_admin_css', BP_PLUGIN_URL . 'bp-core/css/admin.dev.css' ) );
    12801286        else
    1281                 wp_enqueue_style( 'bp-admin-css', apply_filters( 'bp_core_admin_css', plugins_url( $path = '/buddypress' ) . '/bp-core/css/admin.css' ) );
     1287                wp_enqueue_style( 'bp-admin-css', apply_filters( 'bp_core_admin_css', BP_PLUGIN_URL . 'bp-core/css/admin.css' ) );
    12821288
    12831289        wp_enqueue_script( 'thickbox' );
    12841290        wp_enqueue_style( 'thickbox' );
    12851291?>
    12861292        <style type="text/css">
    1287                 ul#adminmenu li.toplevel_page_bp-wizard .wp-menu-image a { background-image: url( <?php echo plugins_url( 'buddypress/bp-core/images/admin_menu_icon.png' ) ?> ) !important; background-position: -1px -32px; }
     1293                ul#adminmenu li.toplevel_page_bp-wizard .wp-menu-image a { background-image: url( <?php echo BP_PLUGIN_URL . 'bp-core/images/admin_menu_icon.png';s ?> ) !important; background-position: -1px -32px; }
    12881294                ul#adminmenu li.toplevel_page_bp-wizard:hover .wp-menu-image a { background-position: -1px 0; }
    12891295                ul#adminmenu li.toplevel_page_bp-wizard .wp-menu-image a img { display: none; }
    12901296        </style>
  • bp-core/admin/bp-core-admin.php

     
    179179
    180180                        <table class="form-table" style="width: 80%">
    181181                        <tbody>
    182                                 <?php if ( file_exists( BP_PLUGIN_DIR . '/bp-activity.php') ) : ?>
     182                                <?php if ( file_exists( BP_PLUGIN_DIR . 'bp-activity.php') ) : ?>
    183183                                <tr>
    184184                                        <td><h3><?php _e( 'Activity Streams', 'buddypress' ) ?></h3><p><?php _e( 'Allow users to post activity updates and track all activity across the entire site.', 'buddypress' ) ?></p></td>
    185185                                        <td>
     
    188188                                        </td>
    189189                                </tr>
    190190                                <?php endif; ?>
    191                                 <?php if ( file_exists( BP_PLUGIN_DIR . '/bp-blogs.php') && is_multisite() ) : ?>
     191                                <?php if ( file_exists( BP_PLUGIN_DIR . 'bp-blogs.php') && is_multisite() ) : ?>
    192192                                <tr>
    193193                                        <td><h3><?php _e( 'Blog Tracking', 'buddypress' ) ?></h3><p><?php _e( 'Tracks blogs, blog posts and blogs comments for a user across a WPMU installation.', 'buddypress' ) ?></p></td>
    194194                                        <td>
     
    199199                                <?php else: ?>
    200200                                        <input type="hidden" name="bp_components[bp-blogs.php]" value="0" />
    201201                                <?php endif; ?>
    202                                 <?php if ( file_exists( BP_PLUGIN_DIR . '/bp-forums.php') ) : ?>
     202                                <?php if ( file_exists( BP_PLUGIN_DIR . 'bp-forums.php') ) : ?>
    203203                                <tr>
    204204                                        <td><h3><?php _e( 'bbPress Forums', 'buddypress' ) ?></h3><p><?php _e( 'Activates bbPress forum support within BuddyPress groups or any other custom component.', 'buddypress' ) ?></p></td>
    205205                                        <td>
     
    208208                                        </td>
    209209                                </tr>
    210210                                <?php endif; ?>
    211                                 <?php if ( file_exists( BP_PLUGIN_DIR . '/bp-friends.php') ) : ?>
     211                                <?php if ( file_exists( BP_PLUGIN_DIR . 'bp-friends.php') ) : ?>
    212212                                <tr>
    213213                                        <td><h3><?php _e( 'Friends', 'buddypress' ) ?></h3><p><?php _e( 'Allows the creation of friend connections between users.', 'buddypress' ) ?></p></td>
    214214                                        <td>
     
    217217                                        </td>
    218218                                </tr>
    219219                                <?php endif; ?>
    220                                 <?php if ( file_exists( BP_PLUGIN_DIR . '/bp-groups.php') ) : ?>
     220                                <?php if ( file_exists( BP_PLUGIN_DIR . 'bp-groups.php') ) : ?>
    221221                                <tr>
    222222                                        <td><h3><?php _e( 'Groups', 'buddypress' ) ?></h3><p><?php _e( 'Let users create, join and participate in groups.', 'buddypress' ) ?></p></td>
    223223                                        <td>
     
    226226                                        </td>
    227227                                </tr>
    228228                                <?php endif; ?>
    229                                 <?php if ( file_exists( BP_PLUGIN_DIR . '/bp-messages.php') ) : ?>
     229                                <?php if ( file_exists( BP_PLUGIN_DIR . 'bp-messages.php') ) : ?>
    230230                                <tr>
    231231                                        <td><h3><?php _e( 'Private Messaging', 'buddypress' ) ?></h3><p><?php _e( 'Let users send private messages to one another. Site admins can also send site-wide notices.', 'buddypress' ) ?></p></td>
    232232                                        <td>
     
    235235                                        </td>
    236236                                </tr>
    237237                                <?php endif; ?>
    238                                 <?php if ( file_exists( BP_PLUGIN_DIR . '/bp-xprofile.php') ) : ?>
     238                                <?php if ( file_exists( BP_PLUGIN_DIR . 'bp-xprofile.php') ) : ?>
    239239                                <tr>
    240240                                        <td><h3><?php _e( 'Extended Profiles', 'buddypress' ) ?></h3><p><?php _e( 'Activates customizable profiles and avatars for site users.', 'buddypress' ) ?></p></td>
    241241                                        <td width="45%">
     
    262262
    263263function bp_core_add_admin_menu_styles() {
    264264        if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG )
    265                 wp_enqueue_style( 'bp-admin-css', apply_filters( 'bp_core_admin_css', BP_PLUGIN_URL . '/bp-core/css/admin.dev.css' ) );
     265                wp_enqueue_style( 'bp-admin-css', apply_filters( 'bp_core_admin_css', BP_PLUGIN_URL . 'bp-core/css/admin.dev.css' ) );
    266266        else
    267                 wp_enqueue_style( 'bp-admin-css', apply_filters( 'bp_core_admin_css', BP_PLUGIN_URL . '/bp-core/css/admin.css' ) );
     267                wp_enqueue_style( 'bp-admin-css', apply_filters( 'bp_core_admin_css', BP_PLUGIN_URL . 'bp-core/css/admin.css' ) );
    268268
    269269        wp_enqueue_script( 'thickbox' );
    270270        wp_enqueue_style( 'thickbox' );
  • bp-core/bp-core-cssjs.php

     
    2020                if ( file_exists( WP_CONTENT_DIR . '/themes/' . $stylesheet . '/_inc/css/adminbar.css' ) )
    2121                        wp_enqueue_style( 'bp-admin-bar', apply_filters( 'bp_core_admin_bar_css', WP_CONTENT_URL . '/themes/' . $stylesheet . '/_inc/css/adminbar.css' ) );
    2222                else
    23                         wp_enqueue_style( 'bp-admin-bar', apply_filters( 'bp_core_admin_bar_css', BP_PLUGIN_URL . '/bp-themes/bp-default/_inc/css/adminbar.css' ) );
     23                        wp_enqueue_style( 'bp-admin-bar', apply_filters( 'bp_core_admin_bar_css', BP_PLUGIN_URL . 'bp-themes/bp-default/_inc/css/adminbar.css' ) );
    2424        }
    2525}
    2626add_action( 'init', 'bp_core_add_admin_bar_css' );
     
    3737?>
    3838
    3939        <style type="text/css">
    40                 ul#adminmenu li.toplevel_page_bp-general-settings .wp-menu-image a { background-image: url( <?php echo BP_PLUGIN_URL . '/bp-core/images/admin_menu_icon.png' ?> ) !important; background-position: -1px -32px; }
     40                ul#adminmenu li.toplevel_page_bp-general-settings .wp-menu-image a { background-image: url( <?php echo BP_PLUGIN_URL . 'bp-core/images/admin_menu_icon.png'; ?> ) !important; background-position: -1px -32px; }
    4141                ul#adminmenu li.toplevel_page_bp-general-settings:hover .wp-menu-image a, ul#adminmenu li.toplevel_page_bp-general-settings.wp-has-current-submenu .wp-menu-image a { background-position: -1px 0; }
    4242                ul#adminmenu li.toplevel_page_bp-general-settings .wp-menu-image a img { display: none; }
    4343        </style>
     
    141141
    142142        <style type="text/css">
    143143                .jcrop-holder { float: left; margin: 0 20px 20px 0; text-align: left; }
    144                 .jcrop-vline, .jcrop-hline { font-size: 0; position: absolute; background: white top left repeat url( <?php echo BP_PLUGIN_URL ?>/bp-core/images/Jcrop.gif ); }
     144                .jcrop-vline, .jcrop-hline { font-size: 0; position: absolute; background: white top left repeat url( <?php echo BP_PLUGIN_URL ?>bp-core/images/Jcrop.gif ); }
    145145                .jcrop-vline { height: 100%; width: 1px !important; }
    146146                .jcrop-hline { width: 100%; height: 1px !important; }
    147147                .jcrop-handle { font-size: 1px; width: 7px !important; height: 7px !important; border: 1px #eee solid; background-color: #333; *width: 9px; *height: 9px; }
  • bp-core/bp-core-templatetags.php

     
    704704}
    705705        function bp_get_avatar_admin_step() {
    706706                global $bp;
    707                
     707
    708708                if ( isset( $bp->avatar_admin->step ) )
    709709                        $step = $bp->avatar_admin->step;
    710710                else
     
    718718}
    719719        function bp_get_avatar_to_crop() {
    720720                global $bp;
    721                
     721
    722722                if ( isset( $bp->avatar_admin->image->url ) )
    723723                        $url = $bp->avatar_admin->image->url;
    724724                else
     
    10231023        global $bp;
    10241024
    10251025        $options = array();
    1026        
     1026
    10271027        if ( bp_is_active( 'xprofile' ) )
    10281028                $options['members'] = __( 'Members', 'buddypress' );
    10291029
     
    12551255                        if ( empty( $bp->grav_default->user ) ) {
    12561256                                $default_grav = 'wavatar';
    12571257                        } else if ( 'mystery' == $bp->grav_default->user ) {
    1258                                 $default_grav = BP_PLUGIN_URL . '/bp-core/images/mystery-man.jpg';
     1258                                $default_grav = BP_PLUGIN_URL . 'bp-core/images/mystery-man.jpg';
    12591259                        } else {
    12601260                                $default_grav = $bp->grav_default->user;
    12611261                        }
     
    15301530                $path = bp_core_get_site_path();
    15311531        else
    15321532                $path = $current_blog->path;
    1533                
     1533
    15341534        if ( 'page' != get_option( 'show_on_front' ) || !$component || empty( $bp->pages->{$component} ) || $_SERVER['REQUEST_URI'] != $path )
    15351535                return false;
    15361536
  • bp-core/bp-core-avatars.php

     
    3939        }
    4040
    4141        if ( !defined( 'BP_AVATAR_DEFAULT' ) )
    42                 define( 'BP_AVATAR_DEFAULT', BP_PLUGIN_URL . '/bp-core/images/mystery-man.jpg' );
     42                define( 'BP_AVATAR_DEFAULT', BP_PLUGIN_URL . 'bp-core/images/mystery-man.jpg' );
    4343
    4444        if ( !defined( 'BP_AVATAR_DEFAULT_THUMB' ) )
    45                 define( 'BP_AVATAR_DEFAULT_THUMB', BP_PLUGIN_URL . '/bp-core/images/mystery-man-50.jpg' );
     45                define( 'BP_AVATAR_DEFAULT_THUMB', BP_PLUGIN_URL . 'bp-core/images/mystery-man-50.jpg' );
    4646}
    4747add_action( 'bp_loaded', 'bp_core_set_avatar_constants', 8 );
    4848
     
    484484 */
    485485function bp_core_fetch_avatar_filter( $avatar, $user, $size, $default, $alt ) {
    486486        global $pagenow;
    487        
     487
    488488        // Do not filter if inside WordPress options page
    489489        if ( 'options-discussion.php' == $pagenow )
    490490                return $avatar;
    491        
     491
    492492        // If passed an object, assume $user->user_id
    493493        if ( is_object( $user ) )
    494494                $id = $user->user_id;
  • bp-loader.php

     
    1616if ( !defined( 'BP_ROOT_BLOG' ) )
    1717        define( 'BP_ROOT_BLOG', 1 );
    1818
     19if ( !defined( 'BP_PLUGIN_BASENAME' ) )
     20        define( 'BP_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
     21
    1922/***
    2023 * Check if this is the first time BuddyPress has been loaded, or the first time
    2124 * since an upgrade. If so, load the install/upgrade routine only.
    2225 */
    2326if ( get_site_option( 'bp-db-version' ) < constant( 'BP_DB_VERSION' ) ) {
    24         require_once( WP_PLUGIN_DIR . '/buddypress/bp-core/admin/bp-core-upgrade.php' );
     27        require_once( plugin_dir_path( __FILE__ ) . 'bp-core/admin/bp-core-upgrade.php' );
    2528
    2629/***
    2730 * If the install or upgrade routine is completed and everything is up to date
     
    3235         * This file will load in each BuddyPress component based on which
    3336         * of the components have been activated on the "BuddyPress" admin menu.
    3437         */
    35         require_once( WP_PLUGIN_DIR . '/buddypress/bp-core.php' );
     38        require_once( BP_PLUGIN_DIR . 'bp-core.php' );
    3639        $bp_deactivated = apply_filters( 'bp_deactivated_components', get_site_option( 'bp-deactivated-components' ) );
    3740
    3841        do_action( 'bp_core_loaded' );
    3942
    4043        /* Activity Streams */
    41         if ( !isset( $bp_deactivated['bp-activity.php'] ) && file_exists( BP_PLUGIN_DIR . '/bp-activity.php') )
    42                 include( BP_PLUGIN_DIR . '/bp-activity.php' );
     44        if ( !isset( $bp_deactivated['bp-activity.php'] ) && file_exists( BP_PLUGIN_DIR . 'bp-activity.php') )
     45                include( BP_PLUGIN_DIR . 'bp-activity.php' );
    4346
    4447        /* Blog Tracking */
    45         if ( !isset( $bp_deactivated['bp-blogs.php'] ) && file_exists( BP_PLUGIN_DIR . '/bp-blogs.php') )
    46                 include( BP_PLUGIN_DIR . '/bp-blogs.php' );
     48        if ( !isset( $bp_deactivated['bp-blogs.php'] ) && file_exists( BP_PLUGIN_DIR . 'bp-blogs.php') )
     49                include( BP_PLUGIN_DIR . 'bp-blogs.php' );
    4750
    4851        /* bbPress Forum Integration */
    49         if ( !isset( $bp_deactivated['bp-forums.php'] ) && file_exists( BP_PLUGIN_DIR . '/bp-forums.php') )
    50                 include( BP_PLUGIN_DIR . '/bp-forums.php' );
     52        if ( !isset( $bp_deactivated['bp-forums.php'] ) && file_exists( BP_PLUGIN_DIR . 'bp-forums.php') )
     53                include( BP_PLUGIN_DIR . 'bp-forums.php' );
    5154
    5255        /* Friend Connections */
    53         if ( !isset( $bp_deactivated['bp-friends.php'] ) && file_exists( BP_PLUGIN_DIR . '/bp-friends.php') )
    54                 include( BP_PLUGIN_DIR . '/bp-friends.php' );
     56        if ( !isset( $bp_deactivated['bp-friends.php'] ) && file_exists( BP_PLUGIN_DIR . 'bp-friends.php') )
     57                include( BP_PLUGIN_DIR . 'bp-friends.php' );
    5558
    5659        /* Groups Support */
    57         if ( !isset( $bp_deactivated['bp-groups.php'] ) && file_exists( BP_PLUGIN_DIR . '/bp-groups.php') )
    58                 include( BP_PLUGIN_DIR . '/bp-groups.php' );
     60        if ( !isset( $bp_deactivated['bp-groups.php'] ) && file_exists( BP_PLUGIN_DIR . 'bp-groups.php') )
     61                include( BP_PLUGIN_DIR . 'bp-groups.php' );
    5962
    6063        /* Private Messaging */
    61         if ( !isset( $bp_deactivated['bp-messages.php'] ) && file_exists( BP_PLUGIN_DIR . '/bp-messages.php') )
    62                 include( BP_PLUGIN_DIR . '/bp-messages.php' );
     64        if ( !isset( $bp_deactivated['bp-messages.php'] ) && file_exists( BP_PLUGIN_DIR . 'bp-messages.php') )
     65                include( BP_PLUGIN_DIR . 'bp-messages.php' );
    6366
    6467        /* Extended Profiles */
    65         if ( !isset( $bp_deactivated['bp-xprofile.php'] ) && file_exists( BP_PLUGIN_DIR . '/bp-xprofile.php') )
    66                 include( BP_PLUGIN_DIR . '/bp-xprofile.php' );
     68        if ( !isset( $bp_deactivated['bp-xprofile.php'] ) && file_exists( BP_PLUGIN_DIR . 'bp-xprofile.php') )
     69                include( BP_PLUGIN_DIR . 'bp-xprofile.php' );
    6770
    6871        add_action( 'plugins_loaded', 'bp_loaded', 20 );
    6972}
     
    112115                'registration',
    113116                'fileupload_maxk'
    114117        ) );
    115        
     118
    116119        // These options always come from the options table of BP_ROOT_BLOG
    117120        $root_blog_options = apply_filters( 'bp_core_root_blog_options', array(
    118121                'avatar_default'
     
    124127                $site_meta = $wpdb->get_results( "SELECT meta_key AS name, meta_value AS value FROM {$wpdb->sitemeta} WHERE meta_key IN ({$meta_keys}) AND site_id = {$wpdb->siteid}" );
    125128        else
    126129                $site_meta = $wpdb->get_results( "SELECT option_name AS name, option_value AS value FROM {$wpdb->options} WHERE option_name IN ({$meta_keys})" );
    127                
     130
    128131        $root_blog_meta_keys = "'" . implode( "','", (array)$root_blog_options ) ."'";
    129        
     132
    130133        $root_blog_meta_table = BP_ROOT_BLOG == 1 ? $wpdb->base_prefix . 'options' : $wpdb->base_prefix . BP_ROOT_BLOG . '_options';
    131134        $root_blog_meta = $wpdb->get_results( $wpdb->prepare( "SELECT option_name AS name, option_value AS value FROM {$root_blog_meta_table} WHERE option_name IN ({$root_blog_meta_keys})" ) );
    132135
     
    151154
    152155        do_action( 'bp_loader_activate' );
    153156}
    154 register_activation_hook( 'buddypress/bp-loader.php', 'bp_loader_activate' );
     157register_activation_hook( BP_PLUGIN_BASENAME, 'bp_loader_activate' );
    155158
    156159/* Deactivation Function */
    157160function bp_loader_deactivate() {
     
    170173
    171174        do_action( 'bp_loader_deactivate' );
    172175}
    173 register_deactivation_hook( 'buddypress/bp-loader.php', 'bp_loader_deactivate' );
     176register_deactivation_hook( BP_PLUGIN_BASENAME, 'bp_loader_deactivate' );
    174177
    175178?>
     179 No newline at end of file
  • bp-blogs.php

     
    11<?php
    2 require ( BP_PLUGIN_DIR . '/bp-blogs/bp-blogs-classes.php' );
    3 require ( BP_PLUGIN_DIR . '/bp-blogs/bp-blogs-templatetags.php' );
     2require ( BP_PLUGIN_DIR . 'bp-blogs/bp-blogs-classes.php' );
     3require ( BP_PLUGIN_DIR . 'bp-blogs/bp-blogs-templatetags.php' );
    44
    55/* Include the sitewide blog posts widget if this is a multisite installation */
    66if ( is_multisite() )
    7         require ( BP_PLUGIN_DIR . '/bp-blogs/bp-blogs-widgets.php' );
     7        require ( BP_PLUGIN_DIR . 'bp-blogs/bp-blogs-widgets.php' );
    88
    99function bp_blogs_setup_globals() {
    1010        global $bp, $wpdb;
     
    475475
    476476        if ( empty( $role ) ) {
    477477                $key = $wpdb->get_blog_prefix( $id ). 'capabilities';
    478                
     478
    479479                $roles = get_user_meta( $user_id, $key, true );
    480                
     480
    481481                if ( is_array( $roles ) )
    482482                        $role = array_search( 1, $roles );
    483483                else
  • bp-messages.php

     
    11<?php
    2 require ( BP_PLUGIN_DIR . '/bp-messages/bp-messages-classes.php' );
    3 require ( BP_PLUGIN_DIR . '/bp-messages/bp-messages-cssjs.php' );
    4 require ( BP_PLUGIN_DIR . '/bp-messages/bp-messages-templatetags.php' );
    5 require ( BP_PLUGIN_DIR . '/bp-messages/bp-messages-filters.php' );
     2require ( BP_PLUGIN_DIR . 'bp-messages/bp-messages-classes.php' );
     3require ( BP_PLUGIN_DIR . 'bp-messages/bp-messages-cssjs.php' );
     4require ( BP_PLUGIN_DIR . 'bp-messages/bp-messages-templatetags.php' );
     5require ( BP_PLUGIN_DIR . 'bp-messages/bp-messages-filters.php' );
    66
    77function messages_setup_globals() {
    88        global $bp;
     
    399399        }
    400400
    401401        if ( $message->send() ) {
    402                 require_once( BP_PLUGIN_DIR . '/bp-messages/bp-messages-notifications.php' );
     402                require_once( BP_PLUGIN_DIR . 'bp-messages/bp-messages-notifications.php' );
    403403
    404404                // Send screen notifications to the recipients
    405405                foreach ( (array)$message->recipients as $recipient )
  • bp-forums.php

     
    88        define( 'BP_FORUMS_SLUG', 'forums' );
    99
    1010if ( !defined( 'BB_PATH' ) )
    11         require ( BP_PLUGIN_DIR . '/bp-forums/bp-forums-bbpress.php' );
     11        require ( BP_PLUGIN_DIR . 'bp-forums/bp-forums-bbpress.php' );
    1212
    13 require ( BP_PLUGIN_DIR . '/bp-forums/bp-forums-templatetags.php' );
    14 require ( BP_PLUGIN_DIR . '/bp-forums/bp-forums-filters.php' );
     13require ( BP_PLUGIN_DIR . 'bp-forums/bp-forums-templatetags.php' );
     14require ( BP_PLUGIN_DIR . 'bp-forums/bp-forums-filters.php' );
    1515
    1616function bp_forums_setup() {
    1717        global $bp;
     
    1919        /* For internal identification */
    2020        $bp->forums->id = 'forums';
    2121
    22         $bp->forums->image_base = BP_PLUGIN_URL . '/bp-forums/images';
     22        $bp->forums->image_base = BP_PLUGIN_URL . 'bp-forums/images';
    2323        $bp->forums->slug = BP_FORUMS_SLUG;
    2424
    2525        if ( isset( $bp->site_options['bb-config-location'] ) )
     
    7272                                                $error_message = __( 'Please provide a title for your forum topic.', 'buddypress' );
    7373                                        else if ( empty( $_POST['topic_text'] ) )
    7474                                                $error_message = __( 'Forum posts cannot be empty. Please enter some text.', 'buddypress' );
    75                                        
     75
    7676                                        if ( $error_message ) {
    7777                                                bp_core_add_message( $error_message, 'error' );
    7878                                                $redirect = bp_get_group_permalink( $bp->groups->current_group ) . 'forum';
     
    8585                                                        $redirect = bp_get_group_permalink( $bp->groups->current_group ) . 'forum/topic/' . $topic->topic_slug . '/';
    8686                                                }
    8787                                        }
    88                                        
     88
    8989                                        bp_core_redirect( $redirect );
    90                                
     90
    9191                                } else {
    9292                                        bp_core_add_message( __( 'Please pick the group forum where you would like to post this topic.', 'buddypress' ), 'error' );
    9393                                }
     
    107107        if ( !is_super_admin() )
    108108                return false;
    109109
    110         require ( BP_PLUGIN_DIR . '/bp-forums/bp-forums-admin.php' );
     110        require ( BP_PLUGIN_DIR . 'bp-forums/bp-forums-admin.php' );
    111111
    112112        /* Add the administration tab under the "Site Admin" tab for site administrators */
    113113        add_submenu_page( 'bp-general-settings', __( 'Forums Setup', 'buddypress' ), __( 'Forums Setup', 'buddypress' ), 'manage_options', 'bb-forums-setup', "bp_forums_bbpress_admin" );
  • bp-groups.php

     
    11<?php
    2 require ( BP_PLUGIN_DIR . '/bp-groups/bp-groups-classes.php' );
    3 require ( BP_PLUGIN_DIR . '/bp-groups/bp-groups-templatetags.php' );
    4 require ( BP_PLUGIN_DIR . '/bp-groups/bp-groups-widgets.php' );
    5 require ( BP_PLUGIN_DIR . '/bp-groups/bp-groups-filters.php' );
     2require ( BP_PLUGIN_DIR . 'bp-groups/bp-groups-classes.php' );
     3require ( BP_PLUGIN_DIR . 'bp-groups/bp-groups-templatetags.php' );
     4require ( BP_PLUGIN_DIR . 'bp-groups/bp-groups-widgets.php' );
     5require ( BP_PLUGIN_DIR . 'bp-groups/bp-groups-filters.php' );
    66
    77function groups_setup_globals() {
    88        global $bp, $wpdb;
     
    486486                                        $error_message = __( 'Please provide a title for your forum topic.', 'buddypress' );
    487487                                else if ( empty( $_POST['topic_text'] ) )
    488488                                        $error_message = __( 'Forum posts cannot be empty. Please enter some text.', 'buddypress' );
    489                                
     489
    490490                                if ( isset( $error_message ) ) {
    491491                                        bp_core_add_message( $error_message, 'error' );
    492492                                        $redirect = bp_get_group_permalink( $bp->groups->current_group ) . 'forum';
     
    499499                                                $redirect = bp_get_group_permalink( $bp->groups->current_group ) . 'forum/topic/' . $topic->topic_slug . '/';
    500500                                        }
    501501                                }
    502                                
     502
    503503                                bp_core_redirect( $redirect );
    504                                
     504
    505505                        }
    506506
    507507                        do_action( 'groups_screen_group_forum', $topic_id, $forum_id );
     
    10301030                                bp_core_add_message( __( 'Please fill in all of the required fields', 'buddypress' ), 'error' );
    10311031                                bp_core_redirect( $bp->root_domain . '/' . $bp->groups->slug . '/create/step/' . $bp->groups->current_create_step . '/' );
    10321032                        }
    1033                        
     1033
    10341034                        $new_group_id = isset( $bp->groups->new_group_id ) ? $bp->groups->new_group_id : 0;
    10351035
    10361036                        if ( !$bp->groups->new_group_id = groups_create_group( array( 'group_id' => $new_group_id, 'name' => $_POST['group-name'], 'description' => $_POST['group-desc'], 'slug' => groups_check_slug( sanitize_title( esc_attr( $_POST['group-name'] ) ) ), 'date_created' => bp_core_current_time(), 'status' => 'public' ) ) ) {
     
    13221322
    13231323function groups_update_last_activity( $group_id = false ) {
    13241324        global $bp;
    1325        
     1325
    13261326        if ( !$group_id )
    13271327                $group_id = $bp->groups->current_group->id;
    1328                
     1328
    13291329        if ( !$group_id )
    13301330                return false;
    1331        
     1331
    13321332        groups_update_groupmeta( $group_id, 'last_activity', bp_core_current_time() );
    13331333}
    13341334add_action( 'groups_joined_group', 'groups_update_last_activity' );
     
    15401540                return false;
    15411541
    15421542        if ( $notify_members ) {
    1543                 require_once ( BP_PLUGIN_DIR . '/bp-groups/bp-groups-notifications.php' );
     1543                require_once ( BP_PLUGIN_DIR . 'bp-groups/bp-groups-notifications.php' );
    15441544                groups_notification_group_updated( $group->id );
    15451545        }
    15461546
     
    19111911        ) );
    19121912
    19131913        /* Require the notifications code so email notifications can be set on the 'bp_activity_posted_update' action. */
    1914         require_once( BP_PLUGIN_DIR . '/bp-groups/bp-groups-notifications.php' );
     1914        require_once( BP_PLUGIN_DIR . 'bp-groups/bp-groups-notifications.php' );
    19151915
    19161916        groups_update_groupmeta( $group_id, 'last_activity', bp_core_current_time() );
    19171917        do_action( 'bp_groups_posted_update', $content, $user_id, $group_id, $activity_id );
     
    22512251function groups_send_invites( $user_id, $group_id ) {
    22522252        global $bp;
    22532253
    2254         require_once ( BP_PLUGIN_DIR . '/bp-groups/bp-groups-notifications.php' );
     2254        require_once ( BP_PLUGIN_DIR . 'bp-groups/bp-groups-notifications.php' );
    22552255
    22562256        if ( !$user_id )
    22572257                $user_id = $bp->loggedin_user->id;
     
    23772377        if ( $requesting_user->save() ) {
    23782378                $admins = groups_get_group_admins( $group_id );
    23792379
    2380                 require_once ( BP_PLUGIN_DIR . '/bp-groups/bp-groups-notifications.php' );
     2380                require_once ( BP_PLUGIN_DIR . 'bp-groups/bp-groups-notifications.php' );
    23812381
    23822382                for ( $i = 0; $i < count( $admins ); $i++ ) {
    23832383                        // Saved okay, now send the email notification
     
    24232423        ) );
    24242424
    24252425        /* Send a notification to the user. */
    2426         require_once ( BP_PLUGIN_DIR . '/bp-groups/bp-groups-notifications.php' );
     2426        require_once ( BP_PLUGIN_DIR . 'bp-groups/bp-groups-notifications.php' );
    24272427        groups_notification_membership_request_completed( $membership->user_id, $membership->group_id, true );
    24282428
    24292429        do_action( 'groups_membership_accepted', $membership->user_id, $membership->group_id );
     
    24362436                return false;
    24372437
    24382438        // Send a notification to the user.
    2439         require_once ( BP_PLUGIN_DIR . '/bp-groups/bp-groups-notifications.php' );
     2439        require_once ( BP_PLUGIN_DIR . 'bp-groups/bp-groups-notifications.php' );
    24402440        groups_notification_membership_request_completed( $membership->user_id, $membership->group_id, false );
    24412441
    24422442        do_action( 'groups_membership_rejected', $membership->user_id, $membership->group_id );
  • bp-messages/bp-messages-cssjs.php

     
    88                add_action( 'wp_head', 'messages_autocomplete_init_jsblock' );
    99
    1010                if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) {
    11                         wp_enqueue_script( 'bp-jquery-autocomplete', BP_PLUGIN_URL . '/bp-messages/js/autocomplete/jquery.autocomplete.dev.js', array( 'jquery' ) );
    12                         wp_enqueue_script( 'bp-jquery-autocomplete-fb', BP_PLUGIN_URL . '/bp-messages/js/autocomplete/jquery.autocompletefb.dev.js' );
    13                         wp_enqueue_script( 'bp-jquery-bgiframe', BP_PLUGIN_URL . '/bp-messages/js/autocomplete/jquery.bgiframe.min.js' );
    14                         wp_enqueue_script( 'bp-jquery-dimensions', BP_PLUGIN_URL . '/bp-messages/js/autocomplete/jquery.dimensions.dev.js' );
     11                        wp_enqueue_script( 'bp-jquery-autocomplete', BP_PLUGIN_URL . 'bp-messages/js/autocomplete/jquery.autocomplete.dev.js', array( 'jquery' ) );
     12                        wp_enqueue_script( 'bp-jquery-autocomplete-fb', BP_PLUGIN_URL . 'bp-messages/js/autocomplete/jquery.autocompletefb.dev.js' );
     13                        wp_enqueue_script( 'bp-jquery-bgiframe', BP_PLUGIN_URL . 'bp-messages/js/autocomplete/jquery.bgiframe.min.js' );
     14                        wp_enqueue_script( 'bp-jquery-dimensions', BP_PLUGIN_URL . 'bp-messages/js/autocomplete/jquery.dimensions.dev.js' );
    1515
    1616                } else {
    17                         wp_enqueue_script( 'bp-jquery-autocomplete', BP_PLUGIN_URL . '/bp-messages/js/autocomplete/jquery.autocomplete.js', array( 'jquery' ) );
    18                         wp_enqueue_script( 'bp-jquery-autocomplete-fb', BP_PLUGIN_URL . '/bp-messages/js/autocomplete/jquery.autocompletefb.js' );
    19                         wp_enqueue_script( 'bp-jquery-bgiframe', BP_PLUGIN_URL . '/bp-messages/js/autocomplete/jquery.bgiframe.min.js' );
    20                         wp_enqueue_script( 'bp-jquery-dimensions', BP_PLUGIN_URL . '/bp-messages/js/autocomplete/jquery.dimensions.js' );
     17                        wp_enqueue_script( 'bp-jquery-autocomplete', BP_PLUGIN_URL . 'bp-messages/js/autocomplete/jquery.autocomplete.js', array( 'jquery' ) );
     18                        wp_enqueue_script( 'bp-jquery-autocomplete-fb', BP_PLUGIN_URL . 'bp-messages/js/autocomplete/jquery.autocompletefb.js' );
     19                        wp_enqueue_script( 'bp-jquery-bgiframe', BP_PLUGIN_URL . 'bp-messages/js/autocomplete/jquery.bgiframe.min.js' );
     20                        wp_enqueue_script( 'bp-jquery-dimensions', BP_PLUGIN_URL . 'bp-messages/js/autocomplete/jquery.dimensions.js' );
    2121                }
    2222        }
    2323}
     
    2828
    2929        if ( $bp->current_component == $bp->messages->slug && 'compose' == $bp->current_action ) {
    3030                if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG )
    31                         wp_enqueue_style( 'bp-messages-autocomplete', BP_PLUGIN_URL . '/bp-messages/css/autocomplete/jquery.autocompletefb.dev.css' );
     31                        wp_enqueue_style( 'bp-messages-autocomplete', BP_PLUGIN_URL . 'bp-messages/css/autocomplete/jquery.autocompletefb.dev.css' );
    3232                else
    33                         wp_enqueue_style( 'bp-messages-autocomplete', BP_PLUGIN_URL . '/bp-messages/css/autocomplete/jquery.autocompletefb.css' );
     33                        wp_enqueue_style( 'bp-messages-autocomplete', BP_PLUGIN_URL . 'bp-messages/css/autocomplete/jquery.autocompletefb.css' );
    3434
    3535                wp_print_styles();
    3636        }
  • bp-forums/bp-forums-admin.php

     
    8383                break;
    8484
    8585                default:
    86                         if ( !file_exists( BP_PLUGIN_DIR . '/bp-forums/bbpress/' ) ) { ?>
     86                        if ( !file_exists( BP_PLUGIN_DIR . 'bp-forums/bbpress/' ) ) { ?>
    8787                                <div id="message" class="error">
    88                                         <p><?php printf( __( 'bbPress files were not found. To install the forums component you must download a copy of bbPress and make sure it is in the folder: "%s"', 'buddypress' ), 'wp-content/plugins/buddypress/bp-forums/bbpress/' ) ?></p>
     88                                        <p><?php printf( __( 'bbPress files were not found. To install the forums component you must download a copy of bbPress and make sure it is in the folder: "%s"', 'buddypress' ), str_replace( ABSPATH, '', BP_PLUGIN_DIR ) . '/bp-forums/bbpress/' ) ?></p>
    8989                                </div>
    9090                        <?php } else { ?>
    9191
     
    129129
    130130        /* Create the bb-config.php file */
    131131        $initial_write = bp_forums_bbpress_write(
    132                 BP_PLUGIN_DIR . '/bp-forums/bbpress/bb-config-sample.php',
     132                BP_PLUGIN_DIR . 'bp-forums/bbpress/bb-config-sample.php',
    133133                ABSPATH . 'bb-config.php',
    134134                array(
    135135                        "define( 'BBDB_NAME',"                  => array( "'bbpress'",                          "'" . DB_NAME . "'" ),
     
    157157        $file = substr( $file, 0, -2 );
    158158        $file .= "\n" .   '$bb->custom_user_table = \'' . $wpdb->users . '\';';
    159159        $file .= "\n" .   '$bb->custom_user_meta_table = \'' . $wpdb->usermeta . '\';';
    160         $file .= "\n\n" . '$bb->uri = \'' . BP_PLUGIN_URL . '/bp-forums/bbpress/\';';
     160        $file .= "\n\n" . '$bb->uri = \'' . BP_PLUGIN_URL . 'bp-forums/bbpress/\';';
    161161        $file .= "\n" .   '$bb->name = \'' . get_blog_option( BP_ROOT_BLOG, 'name' ) . ' ' . __( 'Forums', 'buddypress' ) . '\';';
    162162
    163163        if ( is_multisite() )
  • bp-forums/bp-forums-bbpress.php

     
    1111        if ( !bp_forums_is_installed_correctly() )
    1212                return false;
    1313
    14         define( 'BB_PATH', BP_PLUGIN_DIR . '/bp-forums/bbpress/' );
    15         define( 'BACKPRESS_PATH', BP_PLUGIN_DIR . '/bp-forums/bbpress/bb-includes/backpress/' );
    16         define( 'BB_URL', BP_PLUGIN_URL . '/bp-forums/bbpress/' );
     14        define( 'BB_PATH', BP_PLUGIN_DIR . 'bp-forums/bbpress/' );
     15        define( 'BACKPRESS_PATH', BP_PLUGIN_DIR . 'bp-forums/bbpress/bb-includes/backpress/' );
     16        define( 'BB_URL', BP_PLUGIN_URL . 'bp-forums/bbpress/' );
    1717        define( 'BB_INC', 'bb-includes/' );
    1818
    1919        require_once( BB_PATH . BB_INC . 'class.bb-query.php' );
  • readme.txt

     
    4545
    4646== Installation ==
    4747
    48 You can download and install BuddyPress using the built in WordPress plugin installer. If you download BuddyPress manually, make sure it is uploaded to "/wp-content/plugins/buddypress/".
     48You can download and install BuddyPress using the built in WordPress plugin installer. If you download BuddyPress manually, make sure it is uploaded to your plugins folder, which is usually "/wp-content/plugins/".
    4949
    5050Activate BuddyPress in the "Plugins" admin panel using the "Activate" link.
    5151
  • bp-core.php

     
    55 * It is important to use plugins_url() core function to obtain
    66 * the correct scheme used (http or https).
    77 */
    8 define( 'BP_PLUGIN_DIR', WP_PLUGIN_DIR . '/buddypress' );
    9 define( 'BP_PLUGIN_URL', plugins_url( $path = '/buddypress' ) );
     8define( 'BP_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
     9define( 'BP_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
    1010
    1111/* Load the WP abstraction file so BuddyPress can run on all WordPress setups. */
    12 require ( BP_PLUGIN_DIR . '/bp-core/bp-core-wpabstraction.php' );
     12require ( BP_PLUGIN_DIR . 'bp-core/bp-core-wpabstraction.php' );
    1313
    1414/* Place your custom code (actions/filters) in a file called /plugins/bp-custom.php and it will be loaded before anything else. */
    15 if ( file_exists( WP_PLUGIN_DIR . '/bp-custom.php' ) )
    16         require( WP_PLUGIN_DIR . '/bp-custom.php' );
     15if ( file_exists( WP_PLUGIN_DIR . 'bp-custom.php' ) )
     16        require( WP_PLUGIN_DIR . 'bp-custom.php' );
    1717
    1818/* Define the user and usermeta table names, useful if you are using custom or shared tables. */
    1919if ( !defined( 'CUSTOM_USER_TABLE' ) )
     
    2727        define( 'BP_SEARCH_SLUG', 'search' );
    2828
    2929/* Load the files containing functions that we globally will need. */
    30 require ( BP_PLUGIN_DIR . '/bp-core/bp-core-catchuri.php' );
    31 require ( BP_PLUGIN_DIR . '/bp-core/bp-core-classes.php' );
    32 require ( BP_PLUGIN_DIR . '/bp-core/bp-core-filters.php' );
    33 require ( BP_PLUGIN_DIR . '/bp-core/bp-core-cssjs.php' );
    34 require ( BP_PLUGIN_DIR . '/bp-core/bp-core-avatars.php' );
    35 require ( BP_PLUGIN_DIR . '/bp-core/bp-core-templatetags.php' );
    36 require ( BP_PLUGIN_DIR . '/bp-core/bp-core-settings.php' );
    37 require ( BP_PLUGIN_DIR . '/bp-core/bp-core-widgets.php' );
    38 require ( BP_PLUGIN_DIR . '/bp-core/bp-core-notifications.php' );
    39 require ( BP_PLUGIN_DIR . '/bp-core/bp-core-signup.php' );
     30require ( BP_PLUGIN_DIR . 'bp-core/bp-core-catchuri.php' );
     31require ( BP_PLUGIN_DIR . 'bp-core/bp-core-classes.php' );
     32require ( BP_PLUGIN_DIR . 'bp-core/bp-core-filters.php' );
     33require ( BP_PLUGIN_DIR . 'bp-core/bp-core-cssjs.php' );
     34require ( BP_PLUGIN_DIR . 'bp-core/bp-core-avatars.php' );
     35require ( BP_PLUGIN_DIR . 'bp-core/bp-core-templatetags.php' );
     36require ( BP_PLUGIN_DIR . 'bp-core/bp-core-settings.php' );
     37require ( BP_PLUGIN_DIR . 'bp-core/bp-core-widgets.php' );
     38require ( BP_PLUGIN_DIR . 'bp-core/bp-core-notifications.php' );
     39require ( BP_PLUGIN_DIR . 'bp-core/bp-core-signup.php' );
    4040
    4141/* If BP_DISABLE_ADMIN_BAR is defined, do not load the global admin bar. */
    4242if ( !defined( 'BP_DISABLE_ADMIN_BAR' ) )
    43         require ( BP_PLUGIN_DIR . '/bp-core/bp-core-adminbar.php' );
     43        require ( BP_PLUGIN_DIR . 'bp-core/bp-core-adminbar.php' );
    4444
    4545/* Register BuddyPress themes contained within the bp-theme folder */
    46 register_theme_directory( WP_PLUGIN_DIR . '/buddypress/bp-themes' );
     46register_theme_directory( BP_PLUGIN_DIR . 'bp-themes' );
    4747
    4848
    4949/* "And now for something completely different" .... */
     
    290290        if ( !is_super_admin() )
    291291                return false;
    292292
    293         require ( BP_PLUGIN_DIR . '/bp-core/admin/bp-core-admin.php' );
     293        require ( BP_PLUGIN_DIR . 'bp-core/admin/bp-core-admin.php' );
    294294}
    295295add_action( 'admin_menu', 'bp_core_admin_menu_init' );
    296296
     
    18931893        $locale        = apply_filters( 'buddypress_locale', get_locale() );
    18941894        $mofile        = sprintf( 'buddypress-%s.mo', $locale );
    18951895        $mofile_global = WP_LANG_DIR . '/' . $mofile;
    1896         $mofile_local  = BP_PLUGIN_DIR . '/bp-languages/' . $mofile;
     1896        $mofile_local  = BP_PLUGIN_DIR . 'bp-languages/' . $mofile;
    18971897
    18981898        if ( file_exists( $mofile_global ) )
    18991899                return load_textdomain( 'buddypress', $mofile_global );
     
    19211921function bp_core_update_message() {
    19221922        echo '<p style="color: red; margin: 3px 0 0 0; border-top: 1px solid #ddd; padding-top: 3px">' . __( 'IMPORTANT: <a href="http://codex.buddypress.org/getting-started/upgrading-from-10x/">Read this before attempting to update BuddyPress</a>', 'buddypress' ) . '</p>';
    19231923}
    1924 add_action( 'in_plugin_update_message-buddypress/bp-loader.php', 'bp_core_update_message' );
     1924add_action( 'in_plugin_update_message-' . BP_PLUGIN_BASENAME, 'bp_core_update_message' );
    19251925
    19261926/**
    19271927 * bp_core_activation_notice()
  • bp-xprofile.php

     
    11<?php
    2 require ( BP_PLUGIN_DIR . '/bp-xprofile/bp-xprofile-admin.php' );
    3 require ( BP_PLUGIN_DIR . '/bp-xprofile/bp-xprofile-classes.php' );
    4 require ( BP_PLUGIN_DIR . '/bp-xprofile/bp-xprofile-filters.php' );
    5 require ( BP_PLUGIN_DIR . '/bp-xprofile/bp-xprofile-templatetags.php' );
    6 require ( BP_PLUGIN_DIR . '/bp-xprofile/bp-xprofile-cssjs.php' );
     2require ( BP_PLUGIN_DIR . 'bp-xprofile/bp-xprofile-admin.php' );
     3require ( BP_PLUGIN_DIR . 'bp-xprofile/bp-xprofile-classes.php' );
     4require ( BP_PLUGIN_DIR . 'bp-xprofile/bp-xprofile-filters.php' );
     5require ( BP_PLUGIN_DIR . 'bp-xprofile/bp-xprofile-templatetags.php' );
     6require ( BP_PLUGIN_DIR . 'bp-xprofile/bp-xprofile-cssjs.php' );
    77
    88/**
    99 * xprofile_setup_globals()
     
    633633        if ( is_array( $values ) ) {
    634634                $data = array();
    635635                foreach( (array)$values as $value ) {
    636                         $data[] = apply_filters( 'xprofile_get_field_data', $value ); 
     636                        $data[] = apply_filters( 'xprofile_get_field_data', $value );
    637637                }
    638638        } else {
    639639                $data = apply_filters( 'xprofile_get_field_data', $values );
    640640        }
    641        
     641
    642642        return $data;
    643643}
    644644
     
    927927
    928928        if ( !$object_id )
    929929                return false;
    930        
     930
    931931        if ( !isset( $object_type ) )
    932932                return false;
    933        
     933
    934934        if ( !in_array( $object_type, array( 'group', 'field', 'data' ) ) )
    935935                return false;
    936936
     
    961961
    962962        if ( !$object_id )
    963963                return false;
    964        
     964
    965965        if ( !isset( $object_type ) )
    966966                return false;
    967        
     967
    968968        if ( !in_array( $object_type, array( 'group', 'field', 'data' ) ) )
    969969                return false;
    970970
     
    10021002
    10031003        if ( !$object_id )
    10041004                return false;
    1005        
     1005
    10061006        if ( !isset( $object_type ) )
    10071007                return false;
    1008        
     1008
    10091009        if ( !in_array( $object_type, array( 'group', 'field', 'data' ) ) )
    10101010                return false;
    1011                
     1011
    10121012        $meta_key = preg_replace( '|[^a-z0-9_]|i', '', $meta_key );
    10131013
    10141014        if ( is_string( $meta_value ) )
     
    10181018
    10191019        if ( empty( $meta_value ) )
    10201020                return bp_xprofile_delete_meta( $object_id, $object_type, $meta_key );
    1021        
     1021
    10221022        $cur = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM " . $bp->profile->table_name_meta . " WHERE object_id = %d AND object_type = %s AND meta_key = %s", $object_id, $object_type, $meta_key ) );
    10231023
    10241024        if ( !$cur )
     
    10351035}
    10361036
    10371037function bp_xprofile_update_fieldgroup_meta( $field_group_id, $meta_key, $meta_value ) {
    1038         return bp_xprofile_update_meta( $field_group_id, 'group', $meta_key, $meta_value );     
     1038        return bp_xprofile_update_meta( $field_group_id, 'group', $meta_key, $meta_value );
    10391039}
    10401040
    10411041function bp_xprofile_update_field_meta( $field_id, $meta_key, $meta_value ) {
    1042         return bp_xprofile_update_meta( $field_id, 'field', $meta_key, $meta_value );   
     1042        return bp_xprofile_update_meta( $field_id, 'field', $meta_key, $meta_value );
    10431043}
    10441044
    10451045function bp_xprofile_update_fielddata_meta( $field_data_id, $meta_key, $meta_value ) {
    1046         return bp_xprofile_update_meta( $field_data_id, 'data', $meta_key, $meta_value );       
     1046        return bp_xprofile_update_meta( $field_data_id, 'data', $meta_key, $meta_value );
    10471047}
    10481048
    10491049/********************************************************************************
  • bp-groups/bp-groups-widgets.php

     
    1515
    1616                if ( is_active_widget( false, false, $this->id_base ) ) {
    1717                        if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG )
    18                                 wp_enqueue_script( 'groups_widget_groups_list-js', BP_PLUGIN_URL . '/bp-groups/js/widget-groups.dev.js', array( 'jquery' ) );
     18                                wp_enqueue_script( 'groups_widget_groups_list-js', BP_PLUGIN_URL . 'bp-groups/js/widget-groups.dev.js', array( 'jquery' ) );
    1919                        else
    20                                 wp_enqueue_script( 'groups_widget_groups_list-js', BP_PLUGIN_URL . '/bp-groups/js/widget-groups.js', array( 'jquery' ) );
     20                                wp_enqueue_script( 'groups_widget_groups_list-js', BP_PLUGIN_URL . 'bp-groups/js/widget-groups.js', array( 'jquery' ) );
    2121                }
    2222        }
    2323
    2424        function widget( $args, $instance ) {
    2525                global $bp;
    26                
     26
    2727                $user_id = apply_filters( 'bp_group_widget_user_id', '0' );
    2828
    2929                extract( $args );
     
    9999                        'title' => __( 'Groups', 'buddypress' ),
    100100                        'max_members' => 5,
    101101                        'group_default' => 'active'
    102                 );     
     102                );
    103103                $instance = wp_parse_args( (array) $instance, $defaults );
    104                
     104
    105105                $title = strip_tags( $instance['title'] );
    106106                $max_groups = strip_tags( $instance['max_groups'] );
    107107                $group_default = strip_tags( $instance['group_default'] );
    108108                ?>
    109                
     109
    110110                <p><label for="bp-groups-widget-title"><?php _e('Title:', 'buddypress'); ?> <input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" style="width: 100%" /></label></p>
    111111
    112112                <p><label for="bp-groups-widget-groups-max"><?php _e('Max groups to show:', 'buddypress'); ?> <input class="widefat" id="<?php echo $this->get_field_id( 'max_groups' ); ?>" name="<?php echo $this->get_field_name( 'max_groups' ); ?>" type="text" value="<?php echo esc_attr( $max_groups ); ?>" style="width: 30%" /></label></p>
    113                
     113
    114114                <p>
    115                         <label for="bp-groups-widget-groups-default"><?php _e('Default groups to show:', 'buddypress'); ?> 
     115                        <label for="bp-groups-widget-groups-default"><?php _e('Default groups to show:', 'buddypress'); ?>
    116116                        <select name="<?php echo $this->get_field_name( 'group_default' ); ?>">
    117117                                <option value="newest" <?php if ( $group_default == 'newest' ) : ?>selected="selected"<?php endif; ?>><?php _e( 'Newest', 'buddypress' ) ?></option>
    118118                                <option value="active" <?php if ( $group_default == 'active' ) : ?>selected="selected"<?php endif; ?>><?php _e( 'Active', 'buddypress' ) ?></option>
    119119                                <option value="popular"  <?php if ( $group_default == 'popular' ) : ?>selected="selected"<?php endif; ?>><?php _e( 'Popular', 'buddypress' ) ?></option>
    120                         </select>                       
     120                        </select>
    121121                        </label>
    122122                </p>
    123123        <?php