Changeset 6022
- Timestamp:
- 05/11/2012 05:38:50 PM (13 years ago)
- Location:
- trunk/bp-core
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-core/bp-core-admin.php
r5999 r6022 174 174 add_action( 'admin_notices', array( $this, 'admin_notices' ) ); 175 175 add_action( 'network_admin_notices', array( $this, 'admin_notices' ) ); 176 176 177 177 // Enqueue all admin JS and CSS 178 178 add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) ); … … 237 237 // Not in maintenance mode 238 238 } else { 239 239 240 240 // Bail if user cannot moderate 241 241 if ( ! bp_current_user_can( 'manage_options' ) ) … … 349 349 // Allow subscriptions setting 350 350 add_settings_field( '_bp_group_creation', __( 'Group Creation', 'buddypress' ), 'bp_admin_setting_callback_group_creation', 'buddypress', 'bp_groups' ); 351 register_setting ( 'buddypress', '_bp_group_creation', 'intval' ); 351 register_setting ( 'buddypress', '_bp_group_creation', 'intval' ); 352 352 } 353 353 … … 540 540 * 541 541 * @global string $pagenow 542 * @return If no notice is needed 542 * @return If no notice is needed 543 543 */ 544 544 public function admin_notices() { -
trunk/bp-core/bp-core-avatars.php
r5956 r6022 15 15 function bp_core_set_avatar_constants() { 16 16 global $bp; 17 17 18 18 if ( !defined( 'BP_AVATAR_THUMB_WIDTH' ) ) 19 19 define( 'BP_AVATAR_THUMB_WIDTH', 50 ); … … 113 113 114 114 /** Set item_id ***********************************************************/ 115 115 116 116 if ( empty( $item_id ) ) { 117 117 … … 130 130 131 131 break; 132 132 133 133 case 'user' : 134 134 default : … … 145 145 146 146 $class = apply_filters( 'bp_core_avatar_class', $class, $item_id, $object, $params ); 147 147 148 148 /** Set avatar_dir ********************************************************/ 149 149 … … 164 164 165 165 break; 166 166 167 167 case 'user' : 168 168 default : … … 181 181 182 182 if ( false !== strpos( $alt, '%s' ) || false !== strpos( $alt, '%1$s' ) ) { 183 183 184 184 // Get item name for alt/title tags 185 185 $item_name = ''; … … 194 194 $item_name = bp_get_group_name( groups_get_group( array( 'group_id' => $item_id ) ) ); 195 195 break; 196 196 197 197 case 'user' : 198 198 default : … … 207 207 /** Sanity Checks *********************************************************/ 208 208 209 // Get a fallback for the 'alt' parameter 209 // Get a fallback for the 'alt' parameter 210 210 if ( empty( $alt ) ) 211 211 $alt = __( 'Avatar Image', 'buddypress' ); … … 727 727 function bp_core_avatar_upload_path() { 728 728 global $bp; 729 729 730 730 // See if the value has already been calculated and stashed in the $bp global 731 731 if ( isset( $bp->avatar->upload_path ) ) { … … 740 740 switch_to_blog( bp_get_root_blog_id() ); 741 741 } 742 742 743 743 // Get upload directory information from current site 744 744 $upload_dir = wp_upload_dir(); 745 745 746 746 // Directory does not exist and cannot be created 747 747 if ( !empty( $upload_dir['error'] ) ) { 748 748 $basedir = ''; 749 749 750 750 } else { 751 751 $basedir = $upload_dir['basedir']; 752 752 } 753 753 754 754 // Will bail if not switched 755 755 restore_current_blog(); 756 756 } 757 757 758 758 // Stash in $bp for later use 759 759 $bp->avatar->upload_path = $basedir; 760 760 } 761 761 762 762 return apply_filters( 'bp_core_avatar_upload_path', $basedir ); 763 763 } … … 773 773 function bp_core_avatar_url() { 774 774 global $bp; 775 775 776 776 // See if the value has already been calculated and stashed in the $bp global 777 777 if ( isset( $bp->avatar->url ) ) { … … 785 785 // Get upload directory information from current site 786 786 $upload_dir = wp_upload_dir(); 787 787 788 788 // Directory does not exist and cannot be created 789 789 if ( !empty( $upload_dir['error'] ) ) { 790 790 $baseurl = ''; 791 791 792 792 } else { 793 793 $baseurl = $upload_dir['baseurl']; … … 841 841 function bp_core_avatar_dimension( $type = 'thumb', $h_or_w = 'height' ) { 842 842 global $bp; 843 843 844 844 $dim = isset( $bp->avatar->{$type}->{$h_or_w} ) ? (int) $bp->avatar->{$type}->{$h_or_w} : false; 845 845 846 846 return apply_filters( 'bp_core_avatar_dimension', $dim, $type, $h_or_w ); 847 847 } … … 905 905 function bp_core_avatar_original_max_width() { 906 906 global $bp; 907 907 908 908 return apply_filters( 'bp_core_avatar_original_max_width', (int) $bp->avatar->original_max_width ); 909 909 } … … 919 919 function bp_core_avatar_original_max_filesize() { 920 920 global $bp; 921 921 922 922 return apply_filters( 'bp_core_avatar_original_max_filesize', (int) $bp->avatar->original_max_filesize ); 923 923 } … … 933 933 function bp_core_avatar_default() { 934 934 global $bp; 935 935 936 936 return apply_filters( 'bp_core_avatar_default', $bp->avatar->full->default ); 937 937 } … … 947 947 function bp_core_avatar_default_thumb() { 948 948 global $bp; 949 949 950 950 return apply_filters( 'bp_core_avatar_thumb', $bp->avatar->thumb->default ); 951 951 } -
trunk/bp-core/bp-core-classes.php
r6015 r6022 275 275 $uids = $wpdb->escape( $include ); 276 276 } 277 277 278 278 if ( !empty( $uids ) ) { 279 279 $sql['where_users'] = "AND u.ID IN ({$uids})"; … … 282 282 $friend_ids = friends_get_friend_user_ids( $user_id ); 283 283 $friend_ids = $wpdb->escape( implode( ',', (array) $friend_ids ) ); 284 284 285 285 if ( !empty( $friend_ids ) ) { 286 286 $sql['where_friends'] = "AND u.ID IN ({$friend_ids})"; 287 287 288 288 // User has no friends, return false since there will be no users to fetch. 289 289 } else { -
trunk/bp-core/bp-core-filters.php
r5927 r6022 22 22 function bp_core_exclude_pages( $pages ) { 23 23 global $bp; 24 24 25 25 if ( bp_is_root_blog() ) { 26 26 if ( !empty( $bp->pages->activate ) ) 27 27 $pages[] = $bp->pages->activate->id; 28 28 29 29 if ( !empty( $bp->pages->register ) ) 30 30 $pages[] = $bp->pages->register->id; 31 31 32 32 if ( !empty( $bp->pages->forums ) && ( !bp_is_active( 'forums' ) || ( bp_is_active( 'forums' ) && bp_forums_has_directory() && !bp_forums_is_installed_correctly() ) ) ) 33 33 $pages[] = $bp->pages->forums->id; … … 279 279 // Get the component's ID to try and get it's name 280 280 $component_id = $component_name = bp_current_component(); 281 281 282 282 // Use the actual component name 283 283 if ( !empty( $bp->{$component_id}->name ) ) { 284 284 $component_name = $bp->{$component_id}->name; 285 285 286 286 // Fall back on the component ID (probably same as current_component) 287 287 } elseif ( !empty( $bp->{$component_id}->id ) ) { -
trunk/bp-core/bp-core-functions.php
r6015 r6022 77 77 if ( !empty( $bp->db_version_raw ) ) 78 78 $retval = $bp->db_version_raw; 79 79 80 80 return $retval; 81 81 } … … 481 481 if ( !is_user_logged_in() ) 482 482 return false; 483 483 484 484 $user_id = bp_loggedin_user_id(); 485 485 … … 950 950 * A utility for parsing individual function arguments into an array. 951 951 * 952 * The purpose of this function is to help with backward compatibility in cases where 952 * The purpose of this function is to help with backward compatibility in cases where 953 953 * 954 954 * function foo( $bar = 1, $baz = false, $barry = array(), $blip = false ) { // ... -
trunk/bp-core/bp-core-loader.php
r5721 r6022 37 37 * This involves figuring out the currently required, active, deactive, 38 38 * and optional components. 39 * 40 * @since BuddyPress (1.5) 41 * 42 * @global BuddyPress $bp 39 * 40 * @since BuddyPress (1.5) 41 * 42 * @global BuddyPress $bp 43 43 */ 44 44 private function bootstrap() { … … 134 134 * @since BuddyPress (1.5) 135 135 * 136 * @global BuddyPress $bp 136 * @global BuddyPress $bp 137 137 */ 138 138 function setup_globals() { … … 241 241 * @since BuddyPress (1.6) 242 242 * 243 * @global BuddyPress $bp 243 * @global BuddyPress $bp 244 244 */ 245 245 function bp_setup_core() { -
trunk/bp-core/bp-core-options.php
r5976 r6022 83 83 // Users from all sites can post 84 84 '_bp_enable_akismet' => true, 85 85 86 86 /** BuddyBar **********************************************************/ 87 87 … … 125 125 * 126 126 * @since BuddyPress (1.6) 127 * 127 * 128 128 * @uses bp_get_default_options() To get default options 129 129 * @uses delete_option() Removes default options … … 251 251 * When switching from single to multisite we need to copy blog options to 252 252 * site options. 253 * 253 * 254 254 * This function is no longer used 255 255 * … … 322 322 $root_blog_options_meta = array_merge( $root_blog_options_meta, $network_options_meta ); 323 323 } 324 324 325 325 // Missing some options, so do some one-time fixing 326 326 if ( empty( $root_blog_options_meta ) || ( count( $root_blog_options_meta ) < count( $root_blog_option_keys ) ) ) { … … 358 358 $root_blog_options_meta[$old_meta_key] = $old_meta_value; 359 359 } 360 360 361 361 $root_blog_options_meta = array_merge( $root_blog_options_meta, $existing_options ); 362 362 unset( $existing_options ); -
trunk/bp-core/bp-core-widgets.php
r5930 r6022 36 36 37 37 echo $before_widget; 38 38 39 39 $title = $instance['link_title'] ? '<a href="' . trailingslashit( bp_get_root_domain() . '/' . bp_get_members_root_slug() ) . '">' . $instance['title'] . '</a>' : $instance['title']; 40 40 41 41 echo $before_title 42 42 . $title … … 98 98 function update( $new_instance, $old_instance ) { 99 99 $instance = $old_instance; 100 100 101 101 $instance['title'] = strip_tags( $new_instance['title'] ); 102 102 $instance['max_members'] = strip_tags( $new_instance['max_members'] ); … … 123 123 124 124 <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> 125 125 126 126 <p><label for="<?php echo $this->get_field_name('link_title') ?>"><input type="checkbox" name="<?php echo $this->get_field_name('link_title') ?>" value="1" <?php checked( $link_title ) ?> /> <?php _e( 'Link widget title to Members directory', 'buddypress' ) ?></label></p> 127 127
Note: See TracChangeset
for help on using the changeset viewer.