Ticket #2741: nomorepictures.patch
File nomorepictures.patch, 6.0 KB (added by , 14 years ago) |
---|
-
bp-themes/bp-default/registration/activate.php
1 <?php /* This template is only used on multisite installations */ ?>2 3 1 <?php get_header(); ?> 4 2 5 3 <div id="content"> … … 9 7 10 8 <div class="page" id="activate-page"> 11 9 12 <?php do_action( 'template_notices' ) ?>13 14 10 <?php if ( bp_account_was_activated() ) : ?> 15 11 16 12 <h2 class="widgettitle"><?php _e( 'Account Activated', 'buddypress' ) ?></h2> -
bp-themes/bp-default/registration/register.php
228 228 <p><?php _e( 'You have successfully created your account! Please log in using the username and password you have just created.', 'buddypress' ) ?></p> 229 229 <?php endif; ?> 230 230 231 <?php if ( bp_is_active( 'xprofile' ) && !(int)bp_get_option( 'bp-disable-avatar-uploads' ) ) : ?>232 233 <?php if ( 'upload-image' == bp_get_avatar_admin_step() ) : ?>234 235 <h4><?php _e( 'Your Current Avatar', 'buddypress' ) ?></h4>236 <p><?php _e( "We've fetched an avatar for your new account. If you'd like to change this, why not upload a new one?", 'buddypress' ) ?></p>237 238 <div id="signup-avatar">239 <?php bp_signup_avatar() ?>240 </div>241 242 <p>243 <input type="file" name="file" id="file" />244 <input type="submit" name="upload" id="upload" value="<?php _e( 'Upload Image', 'buddypress' ) ?>" />245 <input type="hidden" name="action" id="action" value="bp_avatar_upload" />246 <input type="hidden" name="signup_email" id="signup_email" value="<?php bp_signup_email_value() ?>" />247 <input type="hidden" name="signup_username" id="signup_username" value="<?php bp_signup_username_value() ?>" />248 </p>249 250 <?php wp_nonce_field( 'bp_avatar_upload' ) ?>251 252 <?php endif; ?>253 254 <?php if ( 'crop-image' == bp_get_avatar_admin_step() ) : ?>255 256 <h3><?php _e( 'Crop Your New Avatar', 'buddypress' ) ?></h3>257 258 <img src="<?php bp_avatar_to_crop() ?>" id="avatar-to-crop" class="avatar" alt="<?php _e( 'Avatar to crop', 'buddypress' ) ?>" />259 260 <div id="avatar-crop-pane">261 <img src="<?php bp_avatar_to_crop() ?>" id="avatar-crop-preview" class="avatar" alt="<?php _e( 'Avatar preview', 'buddypress' ) ?>" />262 </div>263 264 <input type="submit" name="avatar-crop-submit" id="avatar-crop-submit" value="<?php _e( 'Crop Image', 'buddypress' ) ?>" />265 266 <input type="hidden" name="signup_email" id="signup_email" value="<?php bp_signup_email_value() ?>" />267 <input type="hidden" name="signup_username" id="signup_username" value="<?php bp_signup_username_value() ?>" />268 <input type="hidden" name="signup_avatar_dir" id="signup_avatar_dir" value="<?php bp_signup_avatar_dir_value() ?>" />269 270 <input type="hidden" name="image_src" id="image_src" value="<?php bp_avatar_to_crop_src() ?>" />271 <input type="hidden" id="x" name="x" />272 <input type="hidden" id="y" name="y" />273 <input type="hidden" id="w" name="w" />274 <input type="hidden" id="h" name="h" />275 276 <?php wp_nonce_field( 'bp_avatar_cropstore' ) ?>277 278 <?php endif; ?>279 280 <?php endif; ?>281 282 231 <?php endif; // completed-confirmation signup step ?> 283 232 284 233 <?php do_action( 'bp_custom_signup_steps' ) ?> -
bp-core/bp-core-signup.php
154 154 155 155 } 156 156 157 $bp->avatar_admin->step = 'upload-image';158 159 /* If user has uploaded a new avatar */160 if ( !empty( $_FILES ) ) {161 162 /* Check the nonce */163 check_admin_referer( 'bp_avatar_upload' );164 165 $bp->signup->step = 'completed-confirmation';166 167 if ( is_multisite() ) {168 /* Get the activation key */169 if ( !$bp->signup->key = $wpdb->get_var( $wpdb->prepare( "SELECT activation_key FROM {$wpdb->signups} WHERE user_login = %s AND user_email = %s", $_POST[ 'signup_username' ], $_POST[ 'signup_email' ] ) ) ) {170 bp_core_add_message( __( 'There was a problem uploading your avatar, please try uploading it again', 'buddypress' ) );171 } else {172 /* Hash the key to create the upload folder (added security so people don't sniff the activation key) */173 $bp->signup->avatar_dir = wp_hash( $bp->signup->key );174 }175 } else {176 $user_id = bp_core_get_userid( $_POST['signup_username'] );177 $bp->signup->avatar_dir = wp_hash( $user_id );178 }179 180 /* Pass the file to the avatar upload handler */181 if ( bp_core_avatar_handle_upload( $_FILES, 'bp_core_signup_avatar_upload_dir' ) ) {182 $bp->avatar_admin->step = 'crop-image';183 184 /* Make sure we include the jQuery jCrop file for image cropping */185 add_action( 'wp_print_scripts', 'bp_core_add_jquery_cropper' );186 }187 }188 189 /* If the image cropping is done, crop the image and save a full/thumb version */190 if ( isset( $_POST['avatar-crop-submit'] ) ) {191 192 /* Check the nonce */193 check_admin_referer( 'bp_avatar_cropstore' );194 195 /* Reset the avatar step so we can show the upload form again if needed */196 $bp->signup->step = 'completed-confirmation';197 $bp->avatar_admin->step = 'upload-image';198 199 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'] ) ) )200 bp_core_add_message( __( 'There was a problem cropping your avatar, please try uploading it again', 'buddypress' ), 'error' );201 else202 bp_core_add_message( __( 'Your new avatar was uploaded successfully', 'buddypress' ) );203 }204 157 bp_core_load_template( apply_filters( 'bp_core_template_register', 'registration/register' ) ); 205 158 } 206 159 add_action( 'wp', 'bp_core_screen_signup', 3 );