Skip to:
Content

BuddyPress.org

Changeset 2386


Ignore:
Timestamp:
01/21/2010 09:41:15 AM (15 years ago)
Author:
apeatling
Message:

Fixes #1612

Location:
trunk/bp-themes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-themes/bp-default/members/single/profile/change-avatar.php

    r2184 r2386  
    33<?php do_action( 'bp_before_profile_avatar_upload_content' ) ?>
    44
    5 <p><?php _e( 'Your avatar 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>
     5<?php if ( !(int)get_site_option( 'bp-disable-avatar-uploads' ) ) : ?>
    66
    7 <form action="" method="post" id="avatar-upload-form" enctype="multipart/form-data">
     7    <p><?php _e( 'Your avatar 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>
    88
    9     <?php if ( 'upload-image' == bp_get_avatar_admin_step() ) : ?>
     9    <form action="" method="post" id="avatar-upload-form" enctype="multipart/form-data">
    1010
    11         <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>
     11        <?php if ( 'upload-image' == bp_get_avatar_admin_step() ) : ?>
    1212
    13         <p id="avatar-upload">
    14             <input type="file" name="file" id="file" />
    15             <input type="submit" name="upload" id="upload" value="<?php _e( 'Upload Image', 'buddypress' ) ?>" />
    16             <input type="hidden" name="action" id="action" value="bp_avatar_upload" />
    17         </p>
     13            <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>
    1814
    19         <?php if ( bp_get_user_has_avatar() ) : ?>
    20             <p><?php _e( "If you'd like to delete your current avatar but not upload a new one, please use the delete avatar button.", 'buddypress' ) ?></p>
    21             <p><a class="button edit" href="<?php bp_avatar_delete_link() ?>" title="<?php _e( 'Delete Avatar', 'buddypress' ) ?>"><?php _e( 'Delete My Avatar', 'buddypress' ) ?></a></p>
     15            <p id="avatar-upload">
     16                <input type="file" name="file" id="file" />
     17                <input type="submit" name="upload" id="upload" value="<?php _e( 'Upload Image', 'buddypress' ) ?>" />
     18                <input type="hidden" name="action" id="action" value="bp_avatar_upload" />
     19            </p>
     20
     21            <?php if ( bp_get_user_has_avatar() ) : ?>
     22                <p><?php _e( "If you'd like to delete your current avatar but not upload a new one, please use the delete avatar button.", 'buddypress' ) ?></p>
     23                <p><a class="button edit" href="<?php bp_avatar_delete_link() ?>" title="<?php _e( 'Delete Avatar', 'buddypress' ) ?>"><?php _e( 'Delete My Avatar', 'buddypress' ) ?></a></p>
     24            <?php endif; ?>
     25
     26            <?php wp_nonce_field( 'bp_avatar_upload' ) ?>
     27
    2228        <?php endif; ?>
    2329
    24         <?php wp_nonce_field( 'bp_avatar_upload' ) ?>
     30        <?php if ( 'crop-image' == bp_get_avatar_admin_step() ) : ?>
    2531
    26     <?php endif; ?>
     32            <h3><?php _e( 'Crop Your New Avatar', 'buddypress' ) ?></h3>
    2733
    28     <?php if ( 'crop-image' == bp_get_avatar_admin_step() ) : ?>
     34            <img src="<?php bp_avatar_to_crop() ?>" id="avatar-to-crop" class="avatar" alt="<?php _e( 'Avatar to crop', 'buddypress' ) ?>" />
    2935
    30         <h3><?php _e( 'Crop Your New Avatar', 'buddypress' ) ?></h3>
     36            <div id="avatar-crop-pane">
     37                <img src="<?php bp_avatar_to_crop() ?>" id="avatar-crop-preview" class="avatar" alt="<?php _e( 'Avatar preview', 'buddypress' ) ?>" />
     38            </div>
    3139
    32         <img src="<?php bp_avatar_to_crop() ?>" id="avatar-to-crop" class="avatar" alt="<?php _e( 'Avatar to crop', 'buddypress' ) ?>" />
     40            <input type="submit" name="avatar-crop-submit" id="avatar-crop-submit" value="<?php _e( 'Crop Image', 'buddypress' ) ?>" />
    3341
    34         <div id="avatar-crop-pane">
    35             <img src="<?php bp_avatar_to_crop() ?>" id="avatar-crop-preview" class="avatar" alt="<?php _e( 'Avatar preview', 'buddypress' ) ?>" />
    36         </div>
     42            <input type="hidden" name="image_src" id="image_src" value="<?php bp_avatar_to_crop_src() ?>" />
     43            <input type="hidden" id="x" name="x" />
     44            <input type="hidden" id="y" name="y" />
     45            <input type="hidden" id="w" name="w" />
     46            <input type="hidden" id="h" name="h" />
    3747
    38         <input type="submit" name="avatar-crop-submit" id="avatar-crop-submit" value="<?php _e( 'Crop Image', 'buddypress' ) ?>" />
     48            <?php wp_nonce_field( 'bp_avatar_cropstore' ) ?>
    3949
    40         <input type="hidden" name="image_src" id="image_src" value="<?php bp_avatar_to_crop_src() ?>" />
    41         <input type="hidden" id="x" name="x" />
    42         <input type="hidden" id="y" name="y" />
    43         <input type="hidden" id="w" name="w" />
    44         <input type="hidden" id="h" name="h" />
     50        <?php endif; ?>
    4551
    46         <?php wp_nonce_field( 'bp_avatar_cropstore' ) ?>
     52    </form>
    4753
    48     <?php endif; ?>
     54<?php else : ?>
    4955
    50 </form>
     56    <p><?php _e( 'Your avatar will be used on your profile and throughout the site. To change your avatar, 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>
     57
     58<?php endif; ?>
    5159
    5260<?php do_action( 'bp_after_profile_avatar_upload_content' ) ?>
  • trunk/bp-themes/bp-sn-parent/profile/change-avatar.php

    r2077 r2386  
    1313        <?php do_action( 'bp_before_profile_avatar_upload_content' ) ?>
    1414
    15         <p><?php _e( 'Your avatar 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>
     15        <?php if ( !(int)get_site_option( 'bp-disable-avatar-uploads' ) ) : ?>
    1616
    17         <form action="" method="post" id="avatar-upload-form" enctype="multipart/form-data">
     17            <p><?php _e( 'Your avatar 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>
    1818
    19             <?php if ( 'upload-image' == bp_get_avatar_admin_step() ) : ?>
     19            <form action="" method="post" id="avatar-upload-form" enctype="multipart/form-data">
    2020
    21                 <h3><?php _e( 'Your Current Avatar', 'buddypress' ) ?></h3>
     21                <?php if ( 'upload-image' == bp_get_avatar_admin_step() ) : ?>
    2222
    23                 <p id="current-avatar">
    24                     <?php bp_displayed_user_avatar( 'type=full') ?>
    25                     <?php bp_displayed_user_avatar( 'type=thumb' ) ?>
    26                 </p>
     23                    <h3><?php _e( 'Your Current Avatar', 'buddypress' ) ?></h3>
    2724
    28                 <?php if ( bp_get_user_has_avatar() ) : ?>
    29                     <div class="generic-button" id="delete-avatar-button">
    30                         <a class="edit" href="<?php bp_avatar_delete_link() ?>" title="<?php _e( 'Delete Avatar', 'buddypress' ) ?>"><?php _e( 'Delete Avatar', 'buddypress' ) ?></a>
    31                     </div>
     25                    <p id="current-avatar">
     26                        <?php bp_displayed_user_avatar( 'type=full') ?>
     27                        <?php bp_displayed_user_avatar( 'type=thumb' ) ?>
     28                    </p>
     29
     30                    <?php if ( bp_get_user_has_avatar() ) : ?>
     31                        <div class="generic-button" id="delete-avatar-button">
     32                            <a class="edit" href="<?php bp_avatar_delete_link() ?>" title="<?php _e( 'Delete Avatar', 'buddypress' ) ?>"><?php _e( 'Delete Avatar', 'buddypress' ) ?></a>
     33                        </div>
     34                    <?php endif; ?>
     35
     36                    <h3><?php _e( 'Upload a New Avatar', 'buddypress' ) ?></h3>
     37
     38                    <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>
     39
     40                    <p id="avatar-upload">
     41                        <input type="file" name="file" id="file" />
     42                        <input type="submit" name="upload" id="upload" value="<?php _e( 'Upload Image', 'buddypress' ) ?>" />
     43                        <input type="hidden" name="action" id="action" value="bp_avatar_upload" />
     44                    </p>
     45
     46                    <?php wp_nonce_field( 'bp_avatar_upload' ) ?>
     47
    3248                <?php endif; ?>
    3349
    34                 <h3><?php _e( 'Upload a New Avatar', 'buddypress' ) ?></h3>
     50                <?php if ( 'crop-image' == bp_get_avatar_admin_step() ) : ?>
    3551
    36                 <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>
     52                    <h3><?php _e( 'Crop Your New Avatar', 'buddypress' ) ?></h3>
    3753
    38                 <p id="avatar-upload">
    39                     <input type="file" name="file" id="file" />
    40                     <input type="submit" name="upload" id="upload" value="<?php _e( 'Upload Image', 'buddypress' ) ?>" />
    41                     <input type="hidden" name="action" id="action" value="bp_avatar_upload" />
    42                 </p>
     54                    <img src="<?php bp_avatar_to_crop() ?>" id="avatar-to-crop" class="avatar" alt="<?php _e( 'Avatar to crop', 'buddypress' ) ?>" />
    4355
    44                 <?php wp_nonce_field( 'bp_avatar_upload' ) ?>
     56                    <div id="avatar-crop-pane">
     57                        <img src="<?php bp_avatar_to_crop() ?>" id="avatar-crop-preview" class="avatar" alt="<?php _e( 'Avatar preview', 'buddypress' ) ?>" />
     58                    </div>
    4559
    46             <?php endif; ?>
     60                    <input type="submit" name="avatar-crop-submit" id="avatar-crop-submit" value="<?php _e( 'Crop Image', 'buddypress' ) ?>" />
    4761
    48             <?php if ( 'crop-image' == bp_get_avatar_admin_step() ) : ?>
     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" />
    4967
    50                 <h3><?php _e( 'Crop Your New Avatar', 'buddypress' ) ?></h3>
     68                    <?php wp_nonce_field( 'bp_avatar_cropstore' ) ?>
    5169
    52                 <img src="<?php bp_avatar_to_crop() ?>" id="avatar-to-crop" class="avatar" alt="<?php _e( 'Avatar to crop', 'buddypress' ) ?>" />
     70                <?php endif; ?>
    5371
    54                 <div id="avatar-crop-pane">
    55                     <img src="<?php bp_avatar_to_crop() ?>" id="avatar-crop-preview" class="avatar" alt="<?php _e( 'Avatar preview', 'buddypress' ) ?>" />
    56                 </div>
     72            </form>
    5773
    58                 <input type="submit" name="avatar-crop-submit" id="avatar-crop-submit" value="<?php _e( 'Crop Image', 'buddypress' ) ?>" />
     74        <?php else : ?>
    5975
    60                 <input type="hidden" name="image_src" id="image_src" value="<?php bp_avatar_to_crop_src() ?>" />
    61                 <input type="hidden" id="x" name="x" />
    62                 <input type="hidden" id="y" name="y" />
    63                 <input type="hidden" id="w" name="w" />
    64                 <input type="hidden" id="h" name="h" />
     76            <p><?php _e( 'Your avatar will be used on your profile and throughout the site. To change your avatar, 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>
    6577
    66                 <?php wp_nonce_field( 'bp_avatar_cropstore' ) ?>
    67 
    68             <?php endif; ?>
    69 
    70         </form>
     78        <?php endif; ?>
    7179
    7280        <?php do_action( 'bp_after_profile_avatar_upload_content' ) ?>
Note: See TracChangeset for help on using the changeset viewer.