/bp-templates/bp-legacy/buddypress/members/single/profile/change-avatar.php

  1. <?php 
  2. /** 
  3. * BuddyPress - Members Profile Change Avatar 
  4. * 
  5. * @package BuddyPress 
  6. * @subpackage bp-legacy 
  7. */ 
  8.  
  9. ?> 
  10.  
  11. <h2><?php _e( 'Change Profile Photo', 'buddypress' ); ?></h2> 
  12.  
  13. <?php 
  14.  
  15. /** 
  16. * Fires before the display of profile avatar upload content. 
  17. * 
  18. * @since 1.1.0 
  19. */ 
  20. do_action( 'bp_before_profile_avatar_upload_content' ); ?> 
  21.  
  22. <?php if ( !(int)bp_get_option( 'bp-disable-avatar-uploads' ) ) : ?> 
  23.  
  24. <p><?php _e( 'Your profile photo will be used on your profile and throughout the site. If there is a <a href="http://gravatar.com">Gravatar</a> associated with your account email we will use that, or you can upload an image from your computer.', 'buddypress' ); ?></p> 
  25.  
  26. <form action="" method="post" id="avatar-upload-form" class="standard-form" enctype="multipart/form-data"> 
  27.  
  28. <?php if ( 'upload-image' == bp_get_avatar_admin_step() ) : ?> 
  29.  
  30. <?php wp_nonce_field( 'bp_avatar_upload' ); ?> 
  31. <p><?php _e( 'Click below to select a JPG, GIF or PNG format photo from your computer and then click \'Upload Image\' to proceed.', 'buddypress' ); ?></p> 
  32.  
  33. <p id="avatar-upload"> 
  34. <label for="file" class="bp-screen-reader-text"><?php 
  35. /** translators: accessibility text */ 
  36. _e( 'Select an image', 'buddypress' ); 
  37. ?></label> 
  38. <input type="file" name="file" id="file" /> 
  39. <input type="submit" name="upload" id="upload" value="<?php esc_attr_e( 'Upload Image', 'buddypress' ); ?>" /> 
  40. <input type="hidden" name="action" id="action" value="bp_avatar_upload" /> 
  41. </p> 
  42.  
  43. <?php if ( bp_get_user_has_avatar() ) : ?> 
  44. <p><?php _e( "If you'd like to delete your current profile photo but not upload a new one, please use the delete profile photo button.", 'buddypress' ); ?></p> 
  45. <p><a class="button edit" href="<?php bp_avatar_delete_link(); ?>"><?php _e( 'Delete My Profile Photo', 'buddypress' ); ?></a></p> 
  46. <?php endif; ?> 
  47.  
  48. <?php endif; ?> 
  49.  
  50. <?php if ( 'crop-image' == bp_get_avatar_admin_step() ) : ?> 
  51.  
  52. <h5><?php _e( 'Crop Your New Profile Photo', 'buddypress' ); ?></h5> 
  53.  
  54. <img src="<?php bp_avatar_to_crop(); ?>" id="avatar-to-crop" class="avatar" alt="<?php esc_attr_e( 'Profile photo to crop', 'buddypress' ); ?>" /> 
  55.  
  56. <div id="avatar-crop-pane"> 
  57. <img src="<?php bp_avatar_to_crop(); ?>" id="avatar-crop-preview" class="avatar" alt="<?php esc_attr_e( 'Profile photo preview', 'buddypress' ); ?>" /> 
  58. </div> 
  59.  
  60. <input type="submit" name="avatar-crop-submit" id="avatar-crop-submit" value="<?php esc_attr_e( 'Crop Image', 'buddypress' ); ?>" /> 
  61.  
  62. <input type="hidden" name="image_src" id="image_src" value="<?php bp_avatar_to_crop_src(); ?>" /> 
  63. <input type="hidden" id="x" name="x" /> 
  64. <input type="hidden" id="y" name="y" /> 
  65. <input type="hidden" id="w" name="w" /> 
  66. <input type="hidden" id="h" name="h" /> 
  67.  
  68. <?php wp_nonce_field( 'bp_avatar_cropstore' ); ?> 
  69.  
  70. <?php endif; ?> 
  71.  
  72. </form> 
  73.  
  74. <?php 
  75. /** 
  76. * Load the Avatar UI templates 
  77. * 
  78. * @since 2.3.0 
  79. */ 
  80. bp_avatar_get_templates(); ?> 
  81.  
  82. <?php else : ?> 
  83.  
  84. <p><?php _e( 'Your profile photo will be used on your profile and throughout the site. To change your profile photo, please create an account with <a href="http://gravatar.com">Gravatar</a> using the same email address as you used to register with this site.', 'buddypress' ); ?></p> 
  85.  
  86. <?php endif; ?> 
  87.  
  88. <?php 
  89.  
  90. /** 
  91. * Fires after the display of profile avatar upload content. 
  92. * 
  93. * @since 1.1.0 
  94. */ 
  95. do_action( 'bp_after_profile_avatar_upload_content' ); ?> 
.