Ticket #2945: 2945.001.diff
File 2945.001.diff, 64.2 KB (added by , 15 years ago) |
---|
-
bp-friends.php
6 6 if ( !defined( 'BP_FRIENDS_SLUG' ) ) 7 7 define ( 'BP_FRIENDS_SLUG', 'friends' ); 8 8 9 require ( BP_PLUGIN_DIR . ' /bp-friends/bp-friends-classes.php' );10 require ( BP_PLUGIN_DIR . ' /bp-friends/bp-friends-templatetags.php' );9 require ( BP_PLUGIN_DIR . 'bp-friends/bp-friends-classes.php' ); 10 require ( BP_PLUGIN_DIR . 'bp-friends/bp-friends-templatetags.php' ); 11 11 12 12 function friends_setup_globals() { 13 13 global $bp; … … 340 340 bp_core_add_notification( $friendship->initiator_user_id, $friendship->friend_user_id, $bp->friends->id, 'friendship_request' ); 341 341 342 342 // 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' ); 344 344 friends_notification_new_request( $friendship->id, $friendship->initiator_user_id, $friendship->friend_user_id ); 345 345 346 346 do_action( 'friends_friendship_requested', $friendship->id, $friendship->initiator_user_id, $friendship->friend_user_id ); … … 411 411 ) ); 412 412 413 413 // 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' ); 415 415 friends_notification_accepted_request( $friendship->id, $friendship->initiator_user_id, $friendship->friend_user_id ); 416 416 417 417 do_action( 'friends_friendship_accepted', $friendship->id, $friendship->initiator_user_id, $friendship->friend_user_id ); … … 569 569 570 570 function friends_remove_data( $user_id ) { 571 571 global $bp; 572 572 573 573 BP_Friends_Friendship::delete_all_for_user($user_id); 574 574 575 575 /* Remove usermeta */ -
bp-activity.php
1 1 <?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' );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' ); 5 5 6 6 function bp_activity_setup_globals() { 7 7 global $bp, $current_blog; … … 508 508 * 509 509 * @package BuddyPress Activity 510 510 * @since 1.3 511 * 511 * 512 512 * @param $content The content of the activity, usually found in $activity->content 513 513 * @return array $usernames Array of the found usernames that match existing users 514 514 */ 515 515 function bp_activity_find_mentions( $content ) { 516 516 $pattern = '/[@]+([A-Za-z0-9-_\.]+)/'; 517 517 preg_match_all( $pattern, $content, $usernames ); 518 518 519 519 // Make sure there's only one instance of each username 520 520 if ( !$usernames = array_unique( $usernames[1] ) ) 521 521 return false; 522 522 523 523 return $usernames; 524 524 } 525 525 … … 530 530 * 531 531 * @package BuddyPress Activity 532 532 * @since 1.3 533 * 533 * 534 534 * @param $activity_id The unique id for the activity item 535 535 */ 536 536 function bp_activity_reduce_mention_count( $activity_id ) { 537 537 $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 ) ) ) { 540 540 include_once( ABSPATH . WPINC . '/registration.php' ); 541 542 foreach( (array)$usernames as $username ) { 541 542 foreach( (array)$usernames as $username ) { 543 543 if ( !$user_id = username_exists( $username ) ) 544 544 continue; 545 545 546 546 // Decrease the number of new @ mentions for the user 547 547 $new_mention_count = (int)get_user_meta( $user_id, 'bp_new_mention_count', true ); 548 548 update_user_meta( $user_id, 'bp_new_mention_count', $new_mention_count - 1 ); … … 577 577 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 ); 578 578 } else { 579 579 $user_fullname = bp_core_get_user_displayname( $poster_user_id ); 580 580 581 581 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 ); 582 582 } 583 583 break; … … 745 745 update_user_meta( $bp->loggedin_user->id, 'bp_latest_update', array( 'id' => $activity_id, 'content' => wp_filter_kses( $content ) ) ); 746 746 747 747 /* 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' ); 749 749 750 750 do_action( 'bp_activity_posted_update', $content, $user_id, $activity_id ); 751 751 … … 790 790 ) ); 791 791 792 792 /* 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' ); 794 794 bp_activity_new_comment_notification( $comment_id, $user_id, $params ); 795 795 796 796 /* Clear the comment cache for this activity */ … … 998 998 $new_width = $new_height * $ratio; 999 999 1000 1000 $image = '<img src="' . esc_attr( $src ) . '" width="' . $new_width . '" height="' . $new_height . '" alt="' . __( 'Thumbnail', 'buddypress' ) . '" class="align-left thumbnail" />'; 1001 1001 1002 1002 if ( !empty( $link ) ) { 1003 1003 $image = '<a href="' . $link . '">' . $image . '</a>'; 1004 1004 } … … 1223 1223 1224 1224 /** 1225 1225 * updates_register_activity_actions() 1226 * 1226 * 1227 1227 * Register the activity stream actions for updates 1228 * 1228 * 1229 1229 * @global array $bp 1230 1230 */ 1231 1231 function updates_register_activity_actions() { -
bp-xprofile/bp-xprofile-cssjs.php
1 1 <?php 2 2 function xprofile_add_admin_css() { 3 3 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' ); 5 5 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' ); 7 7 } 8 8 add_action( 'admin_menu', 'xprofile_add_admin_css' ); 9 9 … … 17 17 wp_enqueue_script( 'jquery-ui-sortable' ); 18 18 19 19 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' ) ); 21 21 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' ) ); 23 23 } 24 24 } 25 25 add_action( 'admin_menu', 'xprofile_add_admin_js', 1 ); -
bp-core/bp-core-widgets.php
17 17 18 18 if ( is_active_widget( false, false, $this->id_base ) ) { 19 19 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' ) ); 21 21 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' ) ); 23 23 } 24 24 } 25 25 … … 63 63 <span class="activity"> 64 64 <?php 65 65 if ( 'newest' == $instance['member_default'] ) 66 bp_member_registered(); 66 bp_member_registered(); 67 67 if ( 'active' == $instance['member_default'] ) 68 68 bp_member_last_active(); 69 69 if ( 'popular' == $instance['member_default'] ) … … 107 107 'member_default' => 'active' 108 108 ); 109 109 $instance = wp_parse_args( (array) $instance, $defaults ); 110 110 111 111 $title = strip_tags( $instance['title'] ); 112 112 $max_members = strip_tags( $instance['max_members'] ); 113 113 $member_default = strip_tags( $instance['member_default'] ); … … 116 116 <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> 117 117 118 118 <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 120 120 <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'); ?> 122 122 <select name="<?php echo $this->get_field_name( 'member_default' ) ?>"> 123 123 <option value="newest" <?php if ( $member_default == 'newest' ) : ?>selected="selected"<?php endif; ?>><?php _e( 'Newest', 'buddypress' ) ?></option> 124 124 <option value="active" <?php if ( $member_default == 'active' ) : ?>selected="selected"<?php endif; ?>><?php _e( 'Active', 'buddypress' ) ?></option> 125 125 <option value="popular" <?php if ( $member_default == 'popular' ) : ?>selected="selected"<?php endif; ?>><?php _e( 'Popular', 'buddypress' ) ?></option> 126 </select> 126 </select> 127 127 </label> 128 128 </p> 129 129 130 130 <?php 131 131 } 132 132 } … … 183 183 'max_members' => 15 184 184 ); 185 185 $instance = wp_parse_args( (array) $instance, $defaults ); 186 186 187 187 $title = strip_tags( $instance['title'] ); 188 188 $max_members = strip_tags( $instance['max_members'] ); 189 189 ?> … … 247 247 'max_members' => 15 248 248 ); 249 249 $instance = wp_parse_args( (array) $instance, $defaults ); 250 250 251 251 $title = strip_tags( $instance['title'] ); 252 252 $max_members = strip_tags( $instance['max_members'] ); 253 253 ?> … … 298 298 <?php if ( 'active' == $type ) : ?> 299 299 <div class="item-meta"><span class="activity"><?php bp_member_last_active() ?></span></div> 300 300 <?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> 302 302 <?php elseif ( bp_is_active( 'friends' ) ) : ?> 303 303 <div class="item-meta"><span class="activity"><?php bp_member_total_friend_count() ?></span></div> 304 304 <?php endif; ?> -
bp-core/admin/bp-core-upgrade.php
3 3 if ( !defined( 'BP_ROOT_BLOG' ) ) 4 4 define( 'BP_ROOT_BLOG', 1 ); 5 5 6 if ( !defined( 'BP_PLUGIN_DIR' ) ) 7 define( 'BP_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); 8 9 if ( !defined( 'BP_PLUGIN_URL' ) ) 10 define( 'BP_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); 11 6 12 require_once( dirname( dirname( __FILE__ ) ) . '/bp-core-wpabstraction.php' ); 7 13 8 register_theme_directory( WP_PLUGIN_DIR . '/buddypress/bp-themes' );14 register_theme_directory( BP_PLUGIN_DIR . 'bp-themes' ); 9 15 10 16 // Install site options on activation 11 17 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 ) ); 12 18 13 19 /** 14 20 * bp_core_activate_site_options() 15 21 * … … 55 61 if ( !$this->current_version = get_site_option( 'bp-db-version' ) ) 56 62 if ( $this->current_version = get_option( 'bp-db-version' ) ) 57 63 $this->is_network_activate = true; 58 64 59 65 $this->new_version = constant( 'BP_DB_VERSION' ); 60 66 $this->setup_type = ( empty( $this->current_version ) && !(int)get_site_option( 'bp-core-db-version' ) ) ? 'new' : 'upgrade'; 61 67 $this->current_step = $this->current_step(); … … 103 109 } 104 110 } else { 105 111 // Upgrade wizard steps 106 112 107 113 if ( $this->is_network_activate ) 108 114 $steps[] = __( 'Multisite Upgrade', 'buddypress' ); 109 115 110 116 if ( $this->current_version < $this->new_version ) 111 117 $steps[] = __( 'Database Upgrade', 'buddypress' ); 112 118 … … 242 248 </div> 243 249 <?php 244 250 } 245 251 246 252 function step_ms_upgrade() { 247 253 if ( !current_user_can( 'activate_plugins' ) ) 248 254 return false; … … 251 257 $blogs_slug = constant( 'BP_BLOGS_SLUG' ); 252 258 else 253 259 $blogs_slug = __( 'blogs', 'buddypress' ); 254 260 255 261 if ( !defined( 'BP_ENABLE_MULTIBLOG' ) && is_multisite() ) 256 262 $existing_pages = get_blog_option( BP_ROOT_BLOG, 'bp-pages' ); 257 263 else … … 261 267 <div class="prev-next submit clear"> 262 268 <p><input type="submit" value="<?php _e( 'Save & Next →', 'buddypress' ) ?>" name="submit" /></p> 263 269 </div> 264 270 265 271 <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 267 273 <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> 268 274 269 275 <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> … … 280 286 <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> 281 287 </td> 282 288 </tr> 283 289 284 290 </table> 285 291 286 292 <p><?php _e( 'Would you like to enable blog tracking, which tracks blog activity across your network?', 'buddypress' ); ?></p> 287 293 288 294 <div class="left-col"> 289 295 290 296 <div class="component"> 291 297 <h5><?php _e( "Blog Tracking", 'buddypress' ) ?></h5> 292 298 … … 295 301 <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 302 </div> 297 303 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" /> 299 305 <p><?php _e( "Track new blogs, new posts and new comments across your entire blog network.", 'buddypress' ) ?></p> 300 </div> 306 </div> 301 307 </div> 302 308 303 309 <div class="submit clear"> 304 310 <p><input type="submit" value="<?php _e( 'Save & Next →', 'buddypress' ) ?>" name="submit" /></p> 305 311 … … 307 313 <input type="hidden" name="step" value="<?php echo esc_attr( $this->current_step ) ?>" /> 308 314 <?php wp_nonce_field( 'bpwizard_ms_upgrade' ) ?> 309 315 </div> 310 316 311 317 <script type="text/javascript"> 312 318 jQuery('select').click( function() { 313 319 jQuery(this).parent().children('input').attr( 'checked', 'checked' ); … … 339 345 <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 346 </div> 341 347 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" /> 343 349 <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 350 </div> 345 351 … … 351 357 <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 358 </div> 353 359 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" /> 355 361 <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 362 </div> 357 363 … … 363 369 <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 370 </div> 365 371 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" /> 367 373 <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 374 </div> 369 375 … … 377 383 <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 384 </div> 379 385 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" /> 381 387 <p><?php _e( "Track new blogs, new posts and new comments across your entire blog network.", 'buddypress' ) ?></p> 382 388 </div> 383 389 <?php else: ?> … … 395 401 <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 402 </div> 397 403 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" /> 399 405 <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 406 </div> 401 407 … … 407 413 <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 414 </div> 409 415 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" /> 411 417 <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 418 </div> 413 419 … … 419 425 <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 426 </div> 421 427 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" /> 423 429 <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 430 </div> 425 431 … … 680 686 <tr> 681 687 <th> 682 688 <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" /> 684 690 </th> 685 691 <td> 686 692 <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 698 <tr> 693 699 <th> 694 700 <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" /> 696 702 </th> 697 703 <td> 698 704 <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 711 <tr> 706 712 <th> 707 713 <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" /> 709 715 </th> 710 716 <td> 711 717 <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 729 <tr> 724 730 <th> 725 731 <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" /> 727 733 </th> 728 734 <td> 729 735 <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> … … 837 843 // Make sure that the pages are created on the BP_ROOT_BLOG, no matter which Dashboard the setup is being run on 838 844 if ( $current_blog->blog_id != BP_ROOT_BLOG && !defined( 'BP_ENABLE_MULTIBLOG' ) ) 839 845 switch_to_blog( BP_ROOT_BLOG ); 840 846 841 847 $existing_pages = get_option( 'bp-pages' ); 842 848 843 849 $bp_pages = $this->setup_pages( (array)$_POST['bp_pages'] ); 844 850 845 851 $bp_pages = array_merge( (array)$existing_pages, (array)$bp_pages ); 846 852 847 853 update_option( 'bp-pages', $bp_pages ); 848 854 849 855 if ( $current_blog->blog_id != BP_ROOT_BLOG ) 850 856 restore_current_blog(); 851 857 852 858 unset( $disabled['bp-blogs.php'] ); 853 859 854 860 bp_core_install( $disabled ); 855 861 } 856 862 857 863 update_site_option( 'bp-deactivated-components', $disabled ); 858 864 859 865 return true; … … 1042 1048 1043 1049 return false; 1044 1050 } 1045 1051 1046 1052 function setup_pages( $pages ) { 1047 1053 foreach ( $pages as $key => $value ) { 1048 1054 if ( 'page' == $value ) { … … 1056 1062 $bp_pages[$key] = wp_insert_post( array( 'post_title' => ucwords( $value ), 'post_status' => 'publish', 'post_type' => 'page' ) ); 1057 1063 } 1058 1064 } 1059 1065 1060 1066 return $bp_pages; 1061 1067 } 1062 1068 … … 1276 1282 1277 1283 function bp_core_add_admin_menu_styles() { 1278 1284 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' ) ); 1280 1286 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' ) ); 1282 1288 1283 1289 wp_enqueue_script( 'thickbox' ); 1284 1290 wp_enqueue_style( 'thickbox' ); 1285 1291 ?> 1286 1292 <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; } 1288 1294 ul#adminmenu li.toplevel_page_bp-wizard:hover .wp-menu-image a { background-position: -1px 0; } 1289 1295 ul#adminmenu li.toplevel_page_bp-wizard .wp-menu-image a img { display: none; } 1290 1296 </style> -
bp-core/admin/bp-core-admin.php
179 179 180 180 <table class="form-table" style="width: 80%"> 181 181 <tbody> 182 <?php if ( file_exists( BP_PLUGIN_DIR . ' /bp-activity.php') ) : ?>182 <?php if ( file_exists( BP_PLUGIN_DIR . 'bp-activity.php') ) : ?> 183 183 <tr> 184 184 <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> 185 185 <td> … … 188 188 </td> 189 189 </tr> 190 190 <?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() ) : ?> 192 192 <tr> 193 193 <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> 194 194 <td> … … 199 199 <?php else: ?> 200 200 <input type="hidden" name="bp_components[bp-blogs.php]" value="0" /> 201 201 <?php endif; ?> 202 <?php if ( file_exists( BP_PLUGIN_DIR . ' /bp-forums.php') ) : ?>202 <?php if ( file_exists( BP_PLUGIN_DIR . 'bp-forums.php') ) : ?> 203 203 <tr> 204 204 <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> 205 205 <td> … … 208 208 </td> 209 209 </tr> 210 210 <?php endif; ?> 211 <?php if ( file_exists( BP_PLUGIN_DIR . ' /bp-friends.php') ) : ?>211 <?php if ( file_exists( BP_PLUGIN_DIR . 'bp-friends.php') ) : ?> 212 212 <tr> 213 213 <td><h3><?php _e( 'Friends', 'buddypress' ) ?></h3><p><?php _e( 'Allows the creation of friend connections between users.', 'buddypress' ) ?></p></td> 214 214 <td> … … 217 217 </td> 218 218 </tr> 219 219 <?php endif; ?> 220 <?php if ( file_exists( BP_PLUGIN_DIR . ' /bp-groups.php') ) : ?>220 <?php if ( file_exists( BP_PLUGIN_DIR . 'bp-groups.php') ) : ?> 221 221 <tr> 222 222 <td><h3><?php _e( 'Groups', 'buddypress' ) ?></h3><p><?php _e( 'Let users create, join and participate in groups.', 'buddypress' ) ?></p></td> 223 223 <td> … … 226 226 </td> 227 227 </tr> 228 228 <?php endif; ?> 229 <?php if ( file_exists( BP_PLUGIN_DIR . ' /bp-messages.php') ) : ?>229 <?php if ( file_exists( BP_PLUGIN_DIR . 'bp-messages.php') ) : ?> 230 230 <tr> 231 231 <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> 232 232 <td> … … 235 235 </td> 236 236 </tr> 237 237 <?php endif; ?> 238 <?php if ( file_exists( BP_PLUGIN_DIR . ' /bp-xprofile.php') ) : ?>238 <?php if ( file_exists( BP_PLUGIN_DIR . 'bp-xprofile.php') ) : ?> 239 239 <tr> 240 240 <td><h3><?php _e( 'Extended Profiles', 'buddypress' ) ?></h3><p><?php _e( 'Activates customizable profiles and avatars for site users.', 'buddypress' ) ?></p></td> 241 241 <td width="45%"> … … 262 262 263 263 function bp_core_add_admin_menu_styles() { 264 264 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' ) ); 266 266 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' ) ); 268 268 269 269 wp_enqueue_script( 'thickbox' ); 270 270 wp_enqueue_style( 'thickbox' ); -
bp-core/bp-core-cssjs.php
20 20 if ( file_exists( WP_CONTENT_DIR . '/themes/' . $stylesheet . '/_inc/css/adminbar.css' ) ) 21 21 wp_enqueue_style( 'bp-admin-bar', apply_filters( 'bp_core_admin_bar_css', WP_CONTENT_URL . '/themes/' . $stylesheet . '/_inc/css/adminbar.css' ) ); 22 22 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' ) ); 24 24 } 25 25 } 26 26 add_action( 'init', 'bp_core_add_admin_bar_css' ); … … 37 37 ?> 38 38 39 39 <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; } 41 41 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; } 42 42 ul#adminmenu li.toplevel_page_bp-general-settings .wp-menu-image a img { display: none; } 43 43 </style> … … 141 141 142 142 <style type="text/css"> 143 143 .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 ); } 145 145 .jcrop-vline { height: 100%; width: 1px !important; } 146 146 .jcrop-hline { width: 100%; height: 1px !important; } 147 147 .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
704 704 } 705 705 function bp_get_avatar_admin_step() { 706 706 global $bp; 707 707 708 708 if ( isset( $bp->avatar_admin->step ) ) 709 709 $step = $bp->avatar_admin->step; 710 710 else … … 718 718 } 719 719 function bp_get_avatar_to_crop() { 720 720 global $bp; 721 721 722 722 if ( isset( $bp->avatar_admin->image->url ) ) 723 723 $url = $bp->avatar_admin->image->url; 724 724 else … … 1023 1023 global $bp; 1024 1024 1025 1025 $options = array(); 1026 1026 1027 1027 if ( bp_is_active( 'xprofile' ) ) 1028 1028 $options['members'] = __( 'Members', 'buddypress' ); 1029 1029 … … 1255 1255 if ( empty( $bp->grav_default->user ) ) { 1256 1256 $default_grav = 'wavatar'; 1257 1257 } 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'; 1259 1259 } else { 1260 1260 $default_grav = $bp->grav_default->user; 1261 1261 } … … 1530 1530 $path = bp_core_get_site_path(); 1531 1531 else 1532 1532 $path = $current_blog->path; 1533 1533 1534 1534 if ( 'page' != get_option( 'show_on_front' ) || !$component || empty( $bp->pages->{$component} ) || $_SERVER['REQUEST_URI'] != $path ) 1535 1535 return false; 1536 1536 -
bp-core/bp-core-avatars.php
39 39 } 40 40 41 41 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' ); 43 43 44 44 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' ); 46 46 } 47 47 add_action( 'bp_loaded', 'bp_core_set_avatar_constants', 8 ); 48 48 … … 484 484 */ 485 485 function bp_core_fetch_avatar_filter( $avatar, $user, $size, $default, $alt ) { 486 486 global $pagenow; 487 487 488 488 // Do not filter if inside WordPress options page 489 489 if ( 'options-discussion.php' == $pagenow ) 490 490 return $avatar; 491 491 492 492 // If passed an object, assume $user->user_id 493 493 if ( is_object( $user ) ) 494 494 $id = $user->user_id; -
bp-loader.php
16 16 if ( !defined( 'BP_ROOT_BLOG' ) ) 17 17 define( 'BP_ROOT_BLOG', 1 ); 18 18 19 if ( !defined( 'BP_PLUGIN_BASENAME' ) ) 20 define( 'BP_PLUGIN_BASENAME', plugin_basename( __FILE__ ) ); 21 19 22 /*** 20 23 * Check if this is the first time BuddyPress has been loaded, or the first time 21 24 * since an upgrade. If so, load the install/upgrade routine only. 22 25 */ 23 26 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' );27 require_once( plugin_dir_path( __FILE__ ) . 'bp-core/admin/bp-core-upgrade.php' ); 25 28 26 29 /*** 27 30 * If the install or upgrade routine is completed and everything is up to date … … 32 35 * This file will load in each BuddyPress component based on which 33 36 * of the components have been activated on the "BuddyPress" admin menu. 34 37 */ 35 require_once( WP_PLUGIN_DIR . '/buddypress/bp-core.php' );38 require_once( BP_PLUGIN_DIR . 'bp-core.php' ); 36 39 $bp_deactivated = apply_filters( 'bp_deactivated_components', get_site_option( 'bp-deactivated-components' ) ); 37 40 38 41 do_action( 'bp_core_loaded' ); 39 42 40 43 /* 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' ); 43 46 44 47 /* 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' ); 47 50 48 51 /* 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' ); 51 54 52 55 /* 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' ); 55 58 56 59 /* 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' ); 59 62 60 63 /* 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' ); 63 66 64 67 /* 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' ); 67 70 68 71 add_action( 'plugins_loaded', 'bp_loaded', 20 ); 69 72 } … … 112 115 'registration', 113 116 'fileupload_maxk' 114 117 ) ); 115 118 116 119 // These options always come from the options table of BP_ROOT_BLOG 117 120 $root_blog_options = apply_filters( 'bp_core_root_blog_options', array( 118 121 'avatar_default' … … 124 127 $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}" ); 125 128 else 126 129 $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 128 131 $root_blog_meta_keys = "'" . implode( "','", (array)$root_blog_options ) ."'"; 129 132 130 133 $root_blog_meta_table = BP_ROOT_BLOG == 1 ? $wpdb->base_prefix . 'options' : $wpdb->base_prefix . BP_ROOT_BLOG . '_options'; 131 134 $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})" ) ); 132 135 … … 151 154 152 155 do_action( 'bp_loader_activate' ); 153 156 } 154 register_activation_hook( 'buddypress/bp-loader.php', 'bp_loader_activate' );157 register_activation_hook( BP_PLUGIN_BASENAME, 'bp_loader_activate' ); 155 158 156 159 /* Deactivation Function */ 157 160 function bp_loader_deactivate() { … … 170 173 171 174 do_action( 'bp_loader_deactivate' ); 172 175 } 173 register_deactivation_hook( 'buddypress/bp-loader.php', 'bp_loader_deactivate' );176 register_deactivation_hook( BP_PLUGIN_BASENAME, 'bp_loader_deactivate' ); 174 177 175 178 ?> 179 No newline at end of file -
bp-blogs.php
1 1 <?php 2 require ( BP_PLUGIN_DIR . ' /bp-blogs/bp-blogs-classes.php' );3 require ( BP_PLUGIN_DIR . ' /bp-blogs/bp-blogs-templatetags.php' );2 require ( BP_PLUGIN_DIR . 'bp-blogs/bp-blogs-classes.php' ); 3 require ( BP_PLUGIN_DIR . 'bp-blogs/bp-blogs-templatetags.php' ); 4 4 5 5 /* Include the sitewide blog posts widget if this is a multisite installation */ 6 6 if ( is_multisite() ) 7 require ( BP_PLUGIN_DIR . ' /bp-blogs/bp-blogs-widgets.php' );7 require ( BP_PLUGIN_DIR . 'bp-blogs/bp-blogs-widgets.php' ); 8 8 9 9 function bp_blogs_setup_globals() { 10 10 global $bp, $wpdb; … … 475 475 476 476 if ( empty( $role ) ) { 477 477 $key = $wpdb->get_blog_prefix( $id ). 'capabilities'; 478 478 479 479 $roles = get_user_meta( $user_id, $key, true ); 480 480 481 481 if ( is_array( $roles ) ) 482 482 $role = array_search( 1, $roles ); 483 483 else -
bp-messages.php
1 1 <?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' );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' ); 6 6 7 7 function messages_setup_globals() { 8 8 global $bp; … … 399 399 } 400 400 401 401 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' ); 403 403 404 404 // Send screen notifications to the recipients 405 405 foreach ( (array)$message->recipients as $recipient ) -
bp-forums.php
8 8 define( 'BP_FORUMS_SLUG', 'forums' ); 9 9 10 10 if ( !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' ); 12 12 13 require ( BP_PLUGIN_DIR . ' /bp-forums/bp-forums-templatetags.php' );14 require ( BP_PLUGIN_DIR . ' /bp-forums/bp-forums-filters.php' );13 require ( BP_PLUGIN_DIR . 'bp-forums/bp-forums-templatetags.php' ); 14 require ( BP_PLUGIN_DIR . 'bp-forums/bp-forums-filters.php' ); 15 15 16 16 function bp_forums_setup() { 17 17 global $bp; … … 19 19 /* For internal identification */ 20 20 $bp->forums->id = 'forums'; 21 21 22 $bp->forums->image_base = BP_PLUGIN_URL . ' /bp-forums/images';22 $bp->forums->image_base = BP_PLUGIN_URL . 'bp-forums/images'; 23 23 $bp->forums->slug = BP_FORUMS_SLUG; 24 24 25 25 if ( isset( $bp->site_options['bb-config-location'] ) ) … … 72 72 $error_message = __( 'Please provide a title for your forum topic.', 'buddypress' ); 73 73 else if ( empty( $_POST['topic_text'] ) ) 74 74 $error_message = __( 'Forum posts cannot be empty. Please enter some text.', 'buddypress' ); 75 75 76 76 if ( $error_message ) { 77 77 bp_core_add_message( $error_message, 'error' ); 78 78 $redirect = bp_get_group_permalink( $bp->groups->current_group ) . 'forum'; … … 85 85 $redirect = bp_get_group_permalink( $bp->groups->current_group ) . 'forum/topic/' . $topic->topic_slug . '/'; 86 86 } 87 87 } 88 88 89 89 bp_core_redirect( $redirect ); 90 90 91 91 } else { 92 92 bp_core_add_message( __( 'Please pick the group forum where you would like to post this topic.', 'buddypress' ), 'error' ); 93 93 } … … 107 107 if ( !is_super_admin() ) 108 108 return false; 109 109 110 require ( BP_PLUGIN_DIR . ' /bp-forums/bp-forums-admin.php' );110 require ( BP_PLUGIN_DIR . 'bp-forums/bp-forums-admin.php' ); 111 111 112 112 /* Add the administration tab under the "Site Admin" tab for site administrators */ 113 113 add_submenu_page( 'bp-general-settings', __( 'Forums Setup', 'buddypress' ), __( 'Forums Setup', 'buddypress' ), 'manage_options', 'bb-forums-setup', "bp_forums_bbpress_admin" ); -
bp-groups.php
1 1 <?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' );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' ); 6 6 7 7 function groups_setup_globals() { 8 8 global $bp, $wpdb; … … 486 486 $error_message = __( 'Please provide a title for your forum topic.', 'buddypress' ); 487 487 else if ( empty( $_POST['topic_text'] ) ) 488 488 $error_message = __( 'Forum posts cannot be empty. Please enter some text.', 'buddypress' ); 489 489 490 490 if ( isset( $error_message ) ) { 491 491 bp_core_add_message( $error_message, 'error' ); 492 492 $redirect = bp_get_group_permalink( $bp->groups->current_group ) . 'forum'; … … 499 499 $redirect = bp_get_group_permalink( $bp->groups->current_group ) . 'forum/topic/' . $topic->topic_slug . '/'; 500 500 } 501 501 } 502 502 503 503 bp_core_redirect( $redirect ); 504 504 505 505 } 506 506 507 507 do_action( 'groups_screen_group_forum', $topic_id, $forum_id ); … … 1030 1030 bp_core_add_message( __( 'Please fill in all of the required fields', 'buddypress' ), 'error' ); 1031 1031 bp_core_redirect( $bp->root_domain . '/' . $bp->groups->slug . '/create/step/' . $bp->groups->current_create_step . '/' ); 1032 1032 } 1033 1033 1034 1034 $new_group_id = isset( $bp->groups->new_group_id ) ? $bp->groups->new_group_id : 0; 1035 1035 1036 1036 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' ) ) ) { … … 1322 1322 1323 1323 function groups_update_last_activity( $group_id = false ) { 1324 1324 global $bp; 1325 1325 1326 1326 if ( !$group_id ) 1327 1327 $group_id = $bp->groups->current_group->id; 1328 1328 1329 1329 if ( !$group_id ) 1330 1330 return false; 1331 1331 1332 1332 groups_update_groupmeta( $group_id, 'last_activity', bp_core_current_time() ); 1333 1333 } 1334 1334 add_action( 'groups_joined_group', 'groups_update_last_activity' ); … … 1540 1540 return false; 1541 1541 1542 1542 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' ); 1544 1544 groups_notification_group_updated( $group->id ); 1545 1545 } 1546 1546 … … 1911 1911 ) ); 1912 1912 1913 1913 /* 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' ); 1915 1915 1916 1916 groups_update_groupmeta( $group_id, 'last_activity', bp_core_current_time() ); 1917 1917 do_action( 'bp_groups_posted_update', $content, $user_id, $group_id, $activity_id ); … … 2251 2251 function groups_send_invites( $user_id, $group_id ) { 2252 2252 global $bp; 2253 2253 2254 require_once ( BP_PLUGIN_DIR . ' /bp-groups/bp-groups-notifications.php' );2254 require_once ( BP_PLUGIN_DIR . 'bp-groups/bp-groups-notifications.php' ); 2255 2255 2256 2256 if ( !$user_id ) 2257 2257 $user_id = $bp->loggedin_user->id; … … 2377 2377 if ( $requesting_user->save() ) { 2378 2378 $admins = groups_get_group_admins( $group_id ); 2379 2379 2380 require_once ( BP_PLUGIN_DIR . ' /bp-groups/bp-groups-notifications.php' );2380 require_once ( BP_PLUGIN_DIR . 'bp-groups/bp-groups-notifications.php' ); 2381 2381 2382 2382 for ( $i = 0; $i < count( $admins ); $i++ ) { 2383 2383 // Saved okay, now send the email notification … … 2423 2423 ) ); 2424 2424 2425 2425 /* 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' ); 2427 2427 groups_notification_membership_request_completed( $membership->user_id, $membership->group_id, true ); 2428 2428 2429 2429 do_action( 'groups_membership_accepted', $membership->user_id, $membership->group_id ); … … 2436 2436 return false; 2437 2437 2438 2438 // 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' ); 2440 2440 groups_notification_membership_request_completed( $membership->user_id, $membership->group_id, false ); 2441 2441 2442 2442 do_action( 'groups_membership_rejected', $membership->user_id, $membership->group_id ); -
bp-messages/bp-messages-cssjs.php
8 8 add_action( 'wp_head', 'messages_autocomplete_init_jsblock' ); 9 9 10 10 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' ); 15 15 16 16 } 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' ); 21 21 } 22 22 } 23 23 } … … 28 28 29 29 if ( $bp->current_component == $bp->messages->slug && 'compose' == $bp->current_action ) { 30 30 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' ); 32 32 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' ); 34 34 35 35 wp_print_styles(); 36 36 } -
bp-forums/bp-forums-admin.php
83 83 break; 84 84 85 85 default: 86 if ( !file_exists( BP_PLUGIN_DIR . ' /bp-forums/bbpress/' ) ) { ?>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 … … 129 129 130 130 /* Create the bb-config.php file */ 131 131 $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', 133 133 ABSPATH . 'bb-config.php', 134 134 array( 135 135 "define( 'BBDB_NAME'," => array( "'bbpress'", "'" . DB_NAME . "'" ), … … 157 157 $file = substr( $file, 0, -2 ); 158 158 $file .= "\n" . '$bb->custom_user_table = \'' . $wpdb->users . '\';'; 159 159 $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/\';'; 161 161 $file .= "\n" . '$bb->name = \'' . get_blog_option( BP_ROOT_BLOG, 'name' ) . ' ' . __( 'Forums', 'buddypress' ) . '\';'; 162 162 163 163 if ( is_multisite() ) -
bp-forums/bp-forums-bbpress.php
11 11 if ( !bp_forums_is_installed_correctly() ) 12 12 return false; 13 13 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/' ); 17 17 define( 'BB_INC', 'bb-includes/' ); 18 18 19 19 require_once( BB_PATH . BB_INC . 'class.bb-query.php' ); -
readme.txt
45 45 46 46 == Installation == 47 47 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/".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 your plugins folder, which is usually "/wp-content/plugins/". 49 49 50 50 Activate BuddyPress in the "Plugins" admin panel using the "Activate" link. 51 51 -
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', plugin s_url( $path = '/buddypress') );8 define( 'BP_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); 9 define( 'BP_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); 10 10 11 11 /* Load the WP abstraction file so BuddyPress can run on all WordPress setups. */ 12 require ( BP_PLUGIN_DIR . ' /bp-core/bp-core-wpabstraction.php' );12 require ( BP_PLUGIN_DIR . 'bp-core/bp-core-wpabstraction.php' ); 13 13 14 14 /* 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' );15 if ( file_exists( WP_PLUGIN_DIR . 'bp-custom.php' ) ) 16 require( WP_PLUGIN_DIR . 'bp-custom.php' ); 17 17 18 18 /* Define the user and usermeta table names, useful if you are using custom or shared tables. */ 19 19 if ( !defined( 'CUSTOM_USER_TABLE' ) ) … … 27 27 define( 'BP_SEARCH_SLUG', 'search' ); 28 28 29 29 /* 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' );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' ); 40 40 41 41 /* If BP_DISABLE_ADMIN_BAR is defined, do not load the global admin bar. */ 42 42 if ( !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' ); 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" .... */ … … 290 290 if ( !is_super_admin() ) 291 291 return false; 292 292 293 require ( BP_PLUGIN_DIR . ' /bp-core/admin/bp-core-admin.php' );293 require ( BP_PLUGIN_DIR . 'bp-core/admin/bp-core-admin.php' ); 294 294 } 295 295 add_action( 'admin_menu', 'bp_core_admin_menu_init' ); 296 296 … … 1893 1893 $locale = apply_filters( 'buddypress_locale', get_locale() ); 1894 1894 $mofile = sprintf( 'buddypress-%s.mo', $locale ); 1895 1895 $mofile_global = WP_LANG_DIR . '/' . $mofile; 1896 $mofile_local = BP_PLUGIN_DIR . ' /bp-languages/' . $mofile;1896 $mofile_local = BP_PLUGIN_DIR . 'bp-languages/' . $mofile; 1897 1897 1898 1898 if ( file_exists( $mofile_global ) ) 1899 1899 return load_textdomain( 'buddypress', $mofile_global ); … … 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-' . BP_PLUGIN_BASENAME, 'bp_core_update_message' ); 1925 1925 1926 1926 /** 1927 1927 * bp_core_activation_notice() -
bp-xprofile.php
1 1 <?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' );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' ); 7 7 8 8 /** 9 9 * xprofile_setup_globals() … … 633 633 if ( is_array( $values ) ) { 634 634 $data = array(); 635 635 foreach( (array)$values as $value ) { 636 $data[] = apply_filters( 'xprofile_get_field_data', $value ); 636 $data[] = apply_filters( 'xprofile_get_field_data', $value ); 637 637 } 638 638 } else { 639 639 $data = apply_filters( 'xprofile_get_field_data', $values ); 640 640 } 641 641 642 642 return $data; 643 643 } 644 644 … … 927 927 928 928 if ( !$object_id ) 929 929 return false; 930 930 931 931 if ( !isset( $object_type ) ) 932 932 return false; 933 933 934 934 if ( !in_array( $object_type, array( 'group', 'field', 'data' ) ) ) 935 935 return false; 936 936 … … 961 961 962 962 if ( !$object_id ) 963 963 return false; 964 964 965 965 if ( !isset( $object_type ) ) 966 966 return false; 967 967 968 968 if ( !in_array( $object_type, array( 'group', 'field', 'data' ) ) ) 969 969 return false; 970 970 … … 1002 1002 1003 1003 if ( !$object_id ) 1004 1004 return false; 1005 1005 1006 1006 if ( !isset( $object_type ) ) 1007 1007 return false; 1008 1008 1009 1009 if ( !in_array( $object_type, array( 'group', 'field', 'data' ) ) ) 1010 1010 return false; 1011 1011 1012 1012 $meta_key = preg_replace( '|[^a-z0-9_]|i', '', $meta_key ); 1013 1013 1014 1014 if ( is_string( $meta_value ) ) … … 1018 1018 1019 1019 if ( empty( $meta_value ) ) 1020 1020 return bp_xprofile_delete_meta( $object_id, $object_type, $meta_key ); 1021 1021 1022 1022 $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 ) ); 1023 1023 1024 1024 if ( !$cur ) … … 1035 1035 } 1036 1036 1037 1037 function 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 ); 1039 1039 } 1040 1040 1041 1041 function 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 ); 1043 1043 } 1044 1044 1045 1045 function 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 ); 1047 1047 } 1048 1048 1049 1049 /******************************************************************************** -
bp-groups/bp-groups-widgets.php
15 15 16 16 if ( is_active_widget( false, false, $this->id_base ) ) { 17 17 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' ) ); 19 19 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' ) ); 21 21 } 22 22 } 23 23 24 24 function widget( $args, $instance ) { 25 25 global $bp; 26 26 27 27 $user_id = apply_filters( 'bp_group_widget_user_id', '0' ); 28 28 29 29 extract( $args ); … … 99 99 'title' => __( 'Groups', 'buddypress' ), 100 100 'max_members' => 5, 101 101 'group_default' => 'active' 102 ); 102 ); 103 103 $instance = wp_parse_args( (array) $instance, $defaults ); 104 104 105 105 $title = strip_tags( $instance['title'] ); 106 106 $max_groups = strip_tags( $instance['max_groups'] ); 107 107 $group_default = strip_tags( $instance['group_default'] ); 108 108 ?> 109 109 110 110 <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> 111 111 112 112 <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 114 114 <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'); ?> 116 116 <select name="<?php echo $this->get_field_name( 'group_default' ); ?>"> 117 117 <option value="newest" <?php if ( $group_default == 'newest' ) : ?>selected="selected"<?php endif; ?>><?php _e( 'Newest', 'buddypress' ) ?></option> 118 118 <option value="active" <?php if ( $group_default == 'active' ) : ?>selected="selected"<?php endif; ?>><?php _e( 'Active', 'buddypress' ) ?></option> 119 119 <option value="popular" <?php if ( $group_default == 'popular' ) : ?>selected="selected"<?php endif; ?>><?php _e( 'Popular', 'buddypress' ) ?></option> 120 </select> 120 </select> 121 121 </label> 122 122 </p> 123 123 <?php