Changeset 2075
- Timestamp:
- 11/02/2009 06:26:55 PM (16 years ago)
- Location:
- branches/1.1
- Files:
-
- 9 edited
-
bp-activity/bp-activity-templatetags.php (modified) (1 diff)
-
bp-core/bp-core-avatars.php (modified) (2 diffs)
-
bp-core/bp-core-signup.php (modified) (2 diffs)
-
bp-core/bp-core-templatetags.php (modified) (1 diff)
-
bp-core/deprecated/bp-core-deprecated.php (modified) (1 diff)
-
bp-groups.php (modified) (3 diffs)
-
bp-xprofile/bp-xprofile-admin.php (modified) (2 diffs)
-
bp-xprofile/bp-xprofile-classes.php (modified) (6 diffs)
-
bp-xprofile/bp-xprofile-templatetags.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/1.1/bp-activity/bp-activity-templatetags.php
r2052 r2075 238 238 $object = apply_filters( 'bp_get_activity_avatar_object_' . $activities_template->activity->component_name, $object ); 239 239 240 return apply_filters( 'bp_get_ group_avatar', bp_core_fetch_avatar( array( 'item_id' => $item_id, 'object' => $object, 'type' => $type, 'alt' => $alt, 'class' => $class, 'width' => $width, 'height' => $height ) ) );240 return apply_filters( 'bp_get_activity_avatar', bp_core_fetch_avatar( array( 'item_id' => $item_id, 'object' => $object, 'type' => $type, 'alt' => $alt, 'class' => $class, 'width' => $width, 'height' => $height ) ) ); 241 241 } 242 242 -
branches/1.1/bp-core/bp-core-avatars.php
r2025 r2075 93 93 $avatar_folder_url = apply_filters( 'bp_core_avatar_folder_url', get_blog_option( BP_ROOT_BLOG, 'siteurl' ) . '/' . basename( WP_CONTENT_DIR ) . '/blogs.dir/' . BP_ROOT_BLOG . '/files/' . $avatar_dir . '/' . $item_id, $item_id, $object, $avatar_dir ); 94 94 $avatar_folder_dir = apply_filters( 'bp_core_avatar_folder_dir', WP_CONTENT_DIR . '/blogs.dir/' . BP_ROOT_BLOG . '/files/' . $avatar_dir . '/' . $item_id, $item_id, $object, $avatar_dir ); 95 95 96 /**** 97 * Look for uploaded avatar first. Use it if it exists. 98 * Set the file names to search for, to select the full size 99 * or thumbnail image. 100 */ 101 $avatar_name = ( 'full' == $type ) ? '-bpfull' : '-bpthumb'; 102 $legacy_user_avatar_name = ( 'full' == $type ) ? '-avatar2' : '-avatar1'; 103 $legacy_group_avatar_name = ( 'full' == $type ) ? '-groupavatar-full' : '-groupavatar-thumb'; 104 105 if ( file_exists( $avatar_folder_dir ) ) { 106 if ( $av_dir = opendir( $avatar_folder_dir ) ) { 107 while ( false !== ( $avatar_file = readdir($av_dir) ) ) { 108 if ( preg_match( "/{$avatar_name}/", $avatar_file ) || preg_match( "/{$legacy_user_avatar_name}/", $avatar_file ) || preg_match( "/{$legacy_group_avatar_name}/", $avatar_file ) ) 109 $avatar_url = $avatar_folder_url . '/' . $avatar_file; 110 } 111 } 112 closedir($av_dir); 113 114 if ( $avatar_url ) 115 return apply_filters( 'bp_core_fetch_avatar', "<img src='{$avatar_url}' alt='{$alt}' id='{$css_id}' class='{$class}'{$html_width}{$html_height} />", $params ); 116 } 117 96 118 /* If no avatars have been uploaded for this item, display a gravatar */ 97 if ( !file_exists( $avatar_ folder_dir) && !$no_grav ) {119 if ( !file_exists( $avatar_url ) && !$no_grav ) { 98 120 99 121 if ( empty( $bp->grav_default->{$object} ) ) … … 120 142 return apply_filters( 'bp_core_fetch_avatar', "<img src='{$gravatar}' alt='{$alt}' id='{$css_id}' class='{$class}'{$html_width}{$html_height} />", $params ); 121 143 122 } else if ( !file_exists( $avatar_folder_dir ) && $no_grav ) 123 return false; 124 125 /* Set the file names to search for to select the full size or thumbnail image. */ 126 $avatar_name = ( 'full' == $type ) ? '-bpfull' : '-bpthumb'; 127 $legacy_user_avatar_name = ( 'full' == $type ) ? '-avatar2' : '-avatar1'; 128 $legacy_group_avatar_name = ( 'full' == $type ) ? '-groupavatar-full' : '-groupavatar-thumb'; 129 130 if ( $av_dir = opendir( $avatar_folder_dir ) ) { 131 while ( false !== ( $avatar_file = readdir($av_dir) ) ) { 132 if ( preg_match( "/{$avatar_name}/", $avatar_file ) || preg_match( "/{$legacy_user_avatar_name}/", $avatar_file ) || preg_match( "/{$legacy_group_avatar_name}/", $avatar_file ) ) 133 $avatar_url = $avatar_folder_url . '/' . $avatar_file; 134 } 135 } 136 closedir($av_dir); 137 138 return apply_filters( 'bp_core_fetch_avatar', "<img src='{$avatar_url}' alt='{$alt}' id='{$css_id}' class='{$class}'{$html_width}{$html_height} />", $params ); 144 } else if ( !file_exists( $avatar_url ) && $no_grav ) 145 return false; 146 139 147 } 140 148 -
branches/1.1/bp-core/bp-core-signup.php
r2045 r2075 173 173 174 174 if ( !bp_core_avatar_handle_crop( array( 'original_file' => $_POST['image_src'], 'crop_x' => $_POST['x'], 'crop_y' => $_POST['y'], 'crop_w' => $_POST['w'], 'crop_h' => $_POST['h'] ) ) ) 175 bp_core_add_message( __( 'There was a problem cropping your avatar, please try uploading it again', 'buddypress' ) );175 bp_core_add_message( __( 'There was a problem cropping your avatar, please try uploading it again', 'buddypress' ), 'error' ); 176 176 else 177 177 bp_core_add_message( __( 'Your new avatar was uploaded successfully', 'buddypress' ) ); … … 209 209 return false; 210 210 211 if ( '' != locate_template( array( 'registration/register.php' ), false ) || '' != locate_template( array( 'register.php' ), false ) )212 die;211 if ( locate_template( array( 'registration/register.php' ), false ) || locate_template( array( 'register.php' ), false ) ) 212 wp_redirect( bp_root_domain() . BP_REGISTER_SLUG ); 213 213 } 214 214 add_action( 'signup_header', 'bp_core_wpsignup_redirect' ); 215 216 217 218 219 215 ?> -
branches/1.1/bp-core/bp-core-templatetags.php
r2007 r2075 1467 1467 } 1468 1468 1469 function bp_is_group_single() { 1470 global $bp; 1471 1472 if ( BP_GROUPS_SLUG == $bp->current_component && $bp->is_single_item ) 1473 return true; 1474 1475 return false; 1476 } 1477 1469 1478 function bp_is_user_blogs() { 1470 1479 global $bp; -
branches/1.1/bp-core/deprecated/bp-core-deprecated.php
r2032 r2075 750 750 751 751 /*** 752 * In older versions of BuddyPress, BuddyPress templates were in a sep erate theme.752 * In older versions of BuddyPress, BuddyPress templates were in a separate theme. 753 753 * The child theme setup makes upgrades and extending themes much easier, so the 754 754 * old method was deprecated. -
branches/1.1/bp-groups.php
r2032 r2075 545 545 } 546 546 547 /* Group avatar is handled sep erately */547 /* Group avatar is handled separately */ 548 548 if ( 'group-avatar' == $bp->groups->current_create_step && isset( $_POST['upload'] ) ) { 549 549 if ( !empty( $_FILES ) && isset( $_POST['upload'] ) ) { … … 1154 1154 if ( 'demote' == $bp->action_variables[1] && is_numeric( $bp->action_variables[2] ) ) { 1155 1155 $user_id = $bp->action_variables[2]; 1156 1157 /* Check if the user is the group admin first. */ 1158 if ( groups_is_user_admin( $bp->loggedin_user->id, $bp->groups->current_group->id ) ) { 1159 bp_core_add_message( __('As the only group administrator, you cannot demote yourself.', 'buddypress'), 'error' ); 1160 bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group ) ); 1161 } 1156 1162 1157 1163 /* Check the nonce first. */ … … 1174 1180 $user_id = $bp->action_variables[2]; 1175 1181 1182 /* Check if the user is the group admin first. */ 1183 if ( groups_is_user_admin( $bp->loggedin_user->id, $bp->groups->current_group->id ) ) { 1184 bp_core_add_message( __('As the only group administrator, you cannot ban yourself.', 'buddypress'), 'error' ); 1185 bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group ) ); 1186 } 1187 1176 1188 /* Check the nonce first. */ 1177 1189 if ( !check_admin_referer( 'groups_ban_member' ) ) -
branches/1.1/bp-xprofile/bp-xprofile-admin.php
r1969 r2075 90 90 <tr id="field_<?php echo attribute_escape( $field->id ); ?>" class="sortable<?php if ( $class ) { echo ' ' . $class; } ?>"> 91 91 <td width="10"><img src="<?php echo BP_PLUGIN_URL ?>/bp-xprofile/admin/images/move.gif" alt="<?php _e( 'Drag', 'buddypress' ) ?>" /></td> 92 <td><span title="<?php echo $field->desc ; ?>"><?php echo attribute_escape( $field->name ); ?> <?php if(!$field->can_delete) { ?> <?php _e( '(Core Field)', 'buddypress' ) ?><?php } ?></span></td>92 <td><span title="<?php echo $field->description; ?>"><?php echo attribute_escape( $field->name ); ?> <?php if(!$field->can_delete) { ?> <?php _e( '(Core Field)', 'buddypress' ) ?><?php } ?></span></td> 93 93 <td><?php echo attribute_escape( $field->type ); ?></td> 94 94 <td style="text-align:center;"><?php if ( $field->is_required ) { echo '<img src="' . BP_PLUGIN_URL . '/bp-xprofile/admin/images/tick.gif" alt="' . __( 'Yes', 'buddypress' ) . '" />'; } else { ?>--<?php } ?></td> … … 217 217 if ( BP_XProfile_Field::admin_validate() ) { 218 218 $field->name = wp_filter_kses( $_POST['title'] ); 219 $field->desc = wp_filter_kses( $_POST['description'] );219 $field->description = wp_filter_kses( $_POST['description'] ); 220 220 $field->is_required = wp_filter_kses( $_POST['required'] ); 221 221 $field->type = wp_filter_kses( $_POST['fieldtype'] ); -
branches/1.1/bp-xprofile/bp-xprofile-classes.php
r2025 r2075 182 182 var $type; 183 183 var $name; 184 var $desc ;184 var $description; 185 185 var $is_required; 186 186 var $can_delete; … … 215 215 $this->type = $field->type; 216 216 $this->name = stripslashes($field->name); 217 $this->desc = stripslashes($field->description);217 $this->description = stripslashes($field->description); 218 218 $this->is_required = $field->is_required; 219 219 $this->can_delete = $field->can_delete; … … 257 257 $this->type = apply_filters( 'xprofile_field_type_before_save', $this->type, $this->id ); 258 258 $this->name = apply_filters( 'xprofile_field_name_before_save', $this->name, $this->id ); 259 $this->desc = apply_filters( 'xprofile_field_description_before_save', $this->desc, $this->id );259 $this->description = apply_filters( 'xprofile_field_description_before_save', $this->description, $this->id ); 260 260 $this->is_required = apply_filters( 'xprofile_field_is_required_before_save', $this->is_required, $this->id ); 261 261 $this->order_by = apply_filters( 'xprofile_field_order_by_before_save', $this->order_by, $this->id ); … … 265 265 266 266 if ( $this->id != null ) 267 $sql = $wpdb->prepare("UPDATE {$bp->profile->table_name_fields} SET group_id = %d, parent_id = 0, type = %s, name = %s, description = %s, is_required = %d, order_by = %s, field_order = %d WHERE id = %d", $this->group_id, $this->type, $this->name, $this->desc , $this->is_required, $this->order_by, $this->field_order, $this->id);267 $sql = $wpdb->prepare("UPDATE {$bp->profile->table_name_fields} SET group_id = %d, parent_id = 0, type = %s, name = %s, description = %s, is_required = %d, order_by = %s, field_order = %d WHERE id = %d", $this->group_id, $this->type, $this->name, $this->description, $this->is_required, $this->order_by, $this->field_order, $this->id); 268 268 else 269 $sql = $wpdb->prepare("INSERT INTO {$bp->profile->table_name_fields} (group_id, parent_id, type, name, description, is_required, order_by, field_order ) VALUES (%d, 0, %s, %s, %s, %d, %s, %d )", $this->group_id, $this->type, $this->name, $this->desc , $this->is_required, $this->order_by, $this->field_order );269 $sql = $wpdb->prepare("INSERT INTO {$bp->profile->table_name_fields} (group_id, parent_id, type, name, description, is_required, order_by, field_order ) VALUES (%d, 0, %s, %s, %s, %d, %s, %d )", $this->group_id, $this->type, $this->name, $this->description, $this->is_required, $this->order_by, $this->field_order ); 270 270 271 271 // Check for null so field options can be changed without changing any other part of the field. … … 520 520 521 521 $this->name = $_POST['title']; 522 $this->desc = $_POST['description'];522 $this->description = $_POST['description']; 523 523 $this->is_required = $_POST['required']; 524 524 $this->type = $_POST['fieldtype']; … … 555 555 <h3><label for="description"><?php _e("Field Description", 'buddypress') ?></label></h3> 556 556 <div id="titlewrap"> 557 <textarea name="description" id="description" rows="8" cols="60"><?php echo htmlspecialchars( $this->desc ); ?></textarea>557 <textarea name="description" id="description" rows="8" cols="60"><?php echo htmlspecialchars( $this->description ); ?></textarea> 558 558 </div> 559 559 </div> -
branches/1.1/bp-xprofile/bp-xprofile-templatetags.php
r2056 r2075 369 369 global $field; 370 370 371 return apply_filters( 'bp_get_the_profile_field_description', $field->desc );371 return apply_filters( 'bp_get_the_profile_field_description', $field->description ); 372 372 } 373 373
Note: See TracChangeset
for help on using the changeset viewer.