Ticket #2945: 2945.002.diff
File 2945.002.diff, 13.7 KB (added by , 15 years ago) |
---|
-
bp-core/admin/bp-core-upgrade.php
5 5 6 6 require_once( dirname( dirname( __FILE__ ) ) . '/bp-core-wpabstraction.php' ); 7 7 8 register_theme_directory( WP_PLUGIN_DIR . '/buddypress/bp-themes' );8 register_theme_directory( plugin_dir_path( BP_LOADER_FILE ) . 'bp-themes' ); 9 9 10 10 // Install site options on activation 11 11 bp_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 ) ); … … 295 295 <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' ) ?> 296 296 </div> 297 297 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" /> 299 299 <p><?php _e( "Track new blogs, new posts and new comments across your entire blog network.", 'buddypress' ) ?></p> 300 300 </div> 301 301 </div> … … 339 339 <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' ) ?> 340 340 </div> 341 341 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" /> 343 343 <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> 344 344 </div> 345 345 … … 351 351 <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' ) ?> 352 352 </div> 353 353 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" /> 355 355 <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> 356 356 </div> 357 357 … … 363 363 <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' ) ?> 364 364 </div> 365 365 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" /> 367 367 <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> 368 368 </div> 369 369 … … 377 377 <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' ) ?> 378 378 </div> 379 379 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" /> 381 381 <p><?php _e( "Track new blogs, new posts and new comments across your entire blog network.", 'buddypress' ) ?></p> 382 382 </div> 383 383 <?php else: ?> … … 395 395 <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' ) ?> 396 396 </div> 397 397 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" /> 399 399 <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> 400 400 </div> 401 401 … … 407 407 <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' ) ?> 408 408 </div> 409 409 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" /> 411 411 <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> 412 412 </div> 413 413 … … 419 419 <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' ) ?> 420 420 </div> 421 421 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" /> 423 423 <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> 424 424 </div> 425 425 … … 680 680 <tr> 681 681 <th> 682 682 <h5><?php _e( 'Use the Default Theme', 'buddypress' ) ?></h5> 683 <img src="<?php echo plugins_url( '/b uddypress/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" /> 684 684 </th> 685 685 <td> 686 686 <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> … … 692 692 <tr> 693 693 <th> 694 694 <h5>Automatically Upgrade My WordPress Theme</h5> 695 <img src="<?php echo plugins_url( '/b uddypress/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" /> 696 696 </th> 697 697 <td> 698 698 <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> … … 705 705 <tr> 706 706 <th> 707 707 <h5><?php _e( 'Manually Upgrade My WordPress Theme', 'buddypress' ) ?>'</h5> 708 <img src="<?php echo plugins_url( '/b uddypress/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" /> 709 709 </th> 710 710 <td> 711 711 <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> … … 723 723 <tr> 724 724 <th> 725 725 <h5><?php _e( 'Find a BuddyPress Theme', 'buddypress' ) ?></h5> 726 <img src="<?php echo plugins_url( '/b uddypress/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" /> 727 727 </th> 728 728 <td> 729 729 <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> … … 1278 1278 1279 1279 function bp_core_add_admin_menu_styles() { 1280 1280 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 ) ) ); 1282 1282 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 ) ) ); 1284 1284 1285 1285 wp_enqueue_script( 'thickbox' ); 1286 1286 wp_enqueue_style( 'thickbox' ); 1287 1287 ?> 1288 1288 <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; } 1290 1290 ul#adminmenu li.toplevel_page_bp-wizard:hover .wp-menu-image a { background-position: -1px 0; } 1291 1291 ul#adminmenu li.toplevel_page_bp-wizard .wp-menu-image a img { display: none; } 1292 1292 </style> -
bp-loader.php
11 11 12 12 define( 'BP_VERSION', '1.3-bleeding' ); 13 13 define( 'BP_DB_VERSION', 1225 ); 14 define( 'BP_LOADER_FILE', __FILE__ ); 14 15 15 16 // Define on which blog ID BuddyPress should run 16 17 if ( !defined( 'BP_ROOT_BLOG' ) ) … … 21 22 * since an upgrade. If so, load the install/upgrade routine only. 22 23 */ 23 24 if ( 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' ); 25 26 26 27 /*** 27 28 * If the install or upgrade routine is completed and everything is up to date … … 32 33 * This file will load in each BuddyPress component based on which 33 34 * of the components have been activated on the "BuddyPress" admin menu. 34 35 */ 35 require_once( WP_PLUGIN_DIR . '/buddypress/bp-core.php' );36 require_once( plugin_dir_path( __FILE__ ) . 'bp-core.php' ); 36 37 $bp_deactivated = apply_filters( 'bp_deactivated_components', get_site_option( 'bp-deactivated-components' ) ); 37 38 38 39 do_action( 'bp_core_loaded' ); … … 151 152 152 153 do_action( 'bp_loader_activate' ); 153 154 } 154 register_activation_hook( 'buddypress/bp-loader.php', 'bp_loader_activate' );155 register_activation_hook( plugin_basename( __FILE__ ), 'bp_loader_activate' ); 155 156 156 157 /* Deactivation Function */ 157 158 function bp_loader_deactivate() { 158 159 do_action( 'bp_loader_deactivate' ); 159 160 } 160 register_deactivation_hook( 'buddypress/bp-loader.php', 'bp_loader_deactivate' );161 register_deactivation_hook( plugin_basename( __FILE__ ), 'bp_loader_deactivate' ); 161 162 162 163 ?> -
bp-forums/bp-forums-admin.php
85 85 default: 86 86 if ( !file_exists( BP_PLUGIN_DIR . '/bp-forums/bbpress/' ) ) { ?> 87 87 <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> 89 89 </div> 90 90 <?php } else { ?> 91 91 -
bp-core.php
5 5 * It is important to use plugins_url() core function to obtain 6 6 * the correct scheme used (http or https). 7 7 */ 8 define( 'BP_PLUGIN_DIR', WP_PLUGIN_DIR . '/buddypress');9 define( 'BP_PLUGIN_URL', plugins_url( $path = '/buddypress') );8 define( 'BP_PLUGIN_DIR', untrailingslashit( plugin_dir_path( __FILE__ ) ) ); 9 define( 'BP_PLUGIN_URL', untrailingslashit( plugin_dir_url ( __FILE__ ) ) ); 10 10 11 11 /* Load the WP abstraction file so BuddyPress can run on all WordPress setups. */ 12 12 require ( BP_PLUGIN_DIR . '/bp-core/bp-core-wpabstraction.php' ); … … 43 43 require ( BP_PLUGIN_DIR . '/bp-core/bp-core-adminbar.php' ); 44 44 45 45 /* Register BuddyPress themes contained within the bp-theme folder */ 46 register_theme_directory( WP_PLUGIN_DIR . '/buddypress/bp-themes' );46 register_theme_directory( BP_PLUGIN_DIR . '/bp-themes' ); 47 47 48 48 49 49 /* "And now for something completely different" .... */ … … 1921 1921 function bp_core_update_message() { 1922 1922 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>'; 1923 1923 } 1924 add_action( 'in_plugin_update_message- buddypress/bp-loader.php', 'bp_core_update_message' );1924 add_action( 'in_plugin_update_message-' . plugin_basename( BP_LOADER_FILE ), 'bp_core_update_message' ); 1925 1925 1926 1926 /** 1927 1927 * bp_core_activation_notice()