Skip to:
Content

BuddyPress.org

Ticket #2945: 2945.002.diff

File 2945.002.diff, 13.7 KB (added by cnorris23, 15 years ago)

untrailingslashit

  • bp-core/admin/bp-core-upgrade.php

     
    55
    66require_once( dirname( dirname( __FILE__ ) ) . '/bp-core-wpabstraction.php' );
    77
    8 register_theme_directory( WP_PLUGIN_DIR . '/buddypress/bp-themes' );
     8register_theme_directory( plugin_dir_path( BP_LOADER_FILE ) . 'bp-themes' );
    99
    1010// Install site options on activation
    1111bp_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 ) );
     
    295295                                        <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' ) ?>
    296296                                </div>
    297297
    298                                 <img src="<?php echo plugins_url( 'buddypress/screenshot-7.gif' ) ?>" alt="Activity Streams" />
     298                                <img src="<?php echo plugins_url( '/screenshot-7.gif', BP_LOADER_FILE ); ?>" alt="Activity Streams" />
    299299                                        <p><?php _e( "Track new blogs, new posts and new comments across your entire blog network.", 'buddypress' ) ?></p>
    300300                        </div>         
    301301                </div>
     
    339339                                        <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' ) ?>
    340340                                </div>
    341341
    342                                 <img src="<?php echo plugins_url( 'buddypress/screenshot-1.gif' ) ?>" alt="Activity Streams" />
     342                                <img src="<?php echo plugins_url( '/screenshot-1.gif', BP_LOADER_FILE ); ?>" alt="Activity Streams" />
    343343                                <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>
    344344                        </div>
    345345
     
    351351                                        <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' ) ?>
    352352                                </div>
    353353
    354                                 <img src="<?php echo plugins_url( 'buddypress/screenshot-3.gif' ) ?>" alt="Activity Streams" />
     354                                <img src="<?php echo plugins_url( '/screenshot-3.gif', BP_LOADER_FILE ); ?>" alt="Activity Streams" />
    355355                                <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>
    356356                        </div>
    357357
     
    363363                                        <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' ) ?>
    364364                                </div>
    365365
    366                                 <img src="<?php echo plugins_url( 'buddypress/screenshot-5.gif' ) ?>" alt="Activity Streams" />
     366                                <img src="<?php echo plugins_url( '/screenshot-5.gif', BP_LOADER_FILE ); ?>" alt="Activity Streams" />
    367367                                <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>
    368368                        </div>
    369369
     
    377377                                        <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' ) ?>
    378378                                </div>
    379379
    380                                 <img src="<?php echo plugins_url( 'buddypress/screenshot-7.gif' ) ?>" alt="Activity Streams" />
     380                                <img src="<?php echo plugins_url( '/screenshot-7.gif', BP_LOADER_FILE ); ?>" alt="Activity Streams" />
    381381                                        <p><?php _e( "Track new blogs, new posts and new comments across your entire blog network.", 'buddypress' ) ?></p>
    382382                        </div>
    383383                        <?php else: ?>
     
    395395                                        <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' ) ?>
    396396                                </div>
    397397
    398                                 <img src="<?php echo plugins_url( 'buddypress/screenshot-2.gif' ) ?>" alt="Activity Streams" />
     398                                <img src="<?php echo plugins_url( '/screenshot-2.gif', BP_LOADER_FILE ); ?>" alt="Activity Streams" />
    399399                                <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>
    400400                        </div>
    401401
     
    407407                                        <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' ) ?>
    408408                                </div>
    409409
    410                                 <img src="<?php echo plugins_url( 'buddypress/screenshot-4.gif' ) ?>" alt="Activity Streams" />
     410                                <img src="<?php echo plugins_url( '/screenshot-4.gif', BP_LOADER_FILE ); ?>" alt="Activity Streams" />
    411411                                <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>
    412412                        </div>
    413413
     
    419419                                        <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' ) ?>
    420420                                </div>
    421421
    422                                 <img src="<?php echo plugins_url( 'buddypress/screenshot-6.gif' ) ?>" alt="Activity Streams" />
     422                                <img src="<?php echo plugins_url( '/screenshot-6.gif', BP_LOADER_FILE ); ?>" alt="Activity Streams" />
    423423                                <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>
    424424                        </div>
    425425
     
    680680                        <tr>
    681681                                <th>
    682682                                        <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" />
     683                                        <img src="<?php echo plugins_url( '/bp-core/images/default.jpg', BP_LOADER_FILE ); ?>" alt="bp-default" />
    684684                                </th>
    685685                                <td>
    686686                                        <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>
     
    692692                        <tr>
    693693                                <th>
    694694                                        <h5>Automatically Upgrade My WordPress Theme</h5>
    695                                         <img src="<?php echo plugins_url( '/buddypress/bp-core/images/auto_theme.jpg' ) ?>" alt="bp-default" />
     695                                        <img src="<?php echo plugins_url( '/bp-core/images/auto_theme.jpg', BP_LOADER_FILE ); ?>" alt="bp-default" />
    696696                                </th>
    697697                                <td>
    698698                                        <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>
     
    705705                        <tr>
    706706                                <th>
    707707                                        <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" />
     708                                        <img src="<?php echo plugins_url( '/bp-core/images/manual_theme.jpg', BP_LOADER_FILE ); ?>" alt="bp-default" />
    709709                                </th>
    710710                                <td>
    711711                                        <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>
     
    723723                        <tr>
    724724                                <th>
    725725                                        <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" />
     726                                        <img src="<?php echo plugins_url( '/bp-core/images/find.jpg', BP_LOADER_FILE ); ?>" alt="bp-default" />
    727727                                </th>
    728728                                <td>
    729729                                        <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>
     
    12781278
    12791279function bp_core_add_admin_menu_styles() {
    12801280        if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG )
    1281                 wp_enqueue_style( 'bp-admin-css', apply_filters( 'bp_core_admin_css', plugins_url( $path = '/buddypress' ) . '/bp-core/css/admin.dev.css' ) );
     1281                wp_enqueue_style( 'bp-admin-css', apply_filters( 'bp_core_admin_css', plugins_url( '/bp-core/css/admin.dev.css', BP_LOADER_FILE ) ) );
    12821282        else
    1283                 wp_enqueue_style( 'bp-admin-css', apply_filters( 'bp_core_admin_css', plugins_url( $path = '/buddypress' ) . '/bp-core/css/admin.css' ) );
     1283                wp_enqueue_style( 'bp-admin-css', apply_filters( 'bp_core_admin_css', plugins_url( '/bp-core/css/admin.css', BP_LOADER_FILE ) ) );
    12841284
    12851285        wp_enqueue_script( 'thickbox' );
    12861286        wp_enqueue_style( 'thickbox' );
    12871287?>
    12881288        <style type="text/css">
    1289                 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; }
     1289                ul#adminmenu li.toplevel_page_bp-wizard .wp-menu-image a { background-image: url( <?php echo plugins_url( '/bp-core/images/admin_menu_icon.png', BP_LOADER_FILE ); ?> ) !important; background-position: -1px -32px; }
    12901290                ul#adminmenu li.toplevel_page_bp-wizard:hover .wp-menu-image a { background-position: -1px 0; }
    12911291                ul#adminmenu li.toplevel_page_bp-wizard .wp-menu-image a img { display: none; }
    12921292        </style>
  • bp-loader.php

     
    1111
    1212define( 'BP_VERSION', '1.3-bleeding' );
    1313define( 'BP_DB_VERSION', 1225 );
     14define( 'BP_LOADER_FILE', __FILE__ );
    1415
    1516// Define on which blog ID BuddyPress should run
    1617if ( !defined( 'BP_ROOT_BLOG' ) )
     
    2122 * since an upgrade. If so, load the install/upgrade routine only.
    2223 */
    2324if ( get_site_option( 'bp-db-version' ) < constant( 'BP_DB_VERSION' ) ) {
    24         require_once( WP_PLUGIN_DIR . '/buddypress/bp-core/admin/bp-core-upgrade.php' );
     25        require_once( plugin_dir_path( __FILE__ ) . 'bp-core/admin/bp-core-upgrade.php' );
    2526
    2627/***
    2728 * If the install or upgrade routine is completed and everything is up to date
     
    3233         * This file will load in each BuddyPress component based on which
    3334         * of the components have been activated on the "BuddyPress" admin menu.
    3435         */
    35         require_once( WP_PLUGIN_DIR . '/buddypress/bp-core.php' );
     36        require_once( plugin_dir_path( __FILE__ ) . 'bp-core.php' );
    3637        $bp_deactivated = apply_filters( 'bp_deactivated_components', get_site_option( 'bp-deactivated-components' ) );
    3738
    3839        do_action( 'bp_core_loaded' );
     
    151152
    152153        do_action( 'bp_loader_activate' );
    153154}
    154 register_activation_hook( 'buddypress/bp-loader.php', 'bp_loader_activate' );
     155register_activation_hook( plugin_basename( __FILE__ ), 'bp_loader_activate' );
    155156
    156157/* Deactivation Function */
    157158function bp_loader_deactivate() {
    158159        do_action( 'bp_loader_deactivate' );
    159160}
    160 register_deactivation_hook( 'buddypress/bp-loader.php', 'bp_loader_deactivate' );
     161register_deactivation_hook( plugin_basename( __FILE__ ), 'bp_loader_deactivate' );
    161162
    162163?>
  • bp-forums/bp-forums-admin.php

     
    8585                default:
    8686                        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
  • 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', untrailingslashit( plugin_dir_path( __FILE__ ) ) );
     9define( 'BP_PLUGIN_URL', untrailingslashit( plugin_dir_url ( __FILE__ ) ) );
    1010
    1111/* Load the WP abstraction file so BuddyPress can run on all WordPress setups. */
    1212require ( BP_PLUGIN_DIR . '/bp-core/bp-core-wpabstraction.php' );
     
    4343        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" .... */
     
    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-' . plugin_basename( BP_LOADER_FILE ), 'bp_core_update_message' );
    19251925
    19261926/**
    19271927 * bp_core_activation_notice()