示例#1
0
            _e('Delete Avatar', 'bp-magic');
            ?>
"><?php 
            _e('Delete My Avatar', 'bp-magic');
            ?>
</a></p>
			<?php 
        }
        ?>

		<?php 
    }
    ?>

		<?php 
    if ('crop-image' == bp_get_avatar_admin_step()) {
        ?>

			<h5><?php 
        _e('Crop Your New Avatar', 'bp-magic');
        ?>
</h5>

			<img src="<?php 
        bp_avatar_to_crop();
        ?>
" id="avatar-to-crop" class="avatar" alt="<?php 
        _e('Avatar to crop', 'bp-magic');
        ?>
" />
示例#2
0
/**
 * Checks whether Avatar UI should be loaded.
 *
 * @since  2.3.0
 *
 * @return bool True if Avatar UI should load, false otherwise.
 */
function bp_avatar_is_front_edit()
{
    $retval = false;
    // No need to carry on if the current WordPress version is not supported.
    if (!bp_attachments_is_wp_version_supported()) {
        return $retval;
    }
    if (bp_is_user_change_avatar() && 'crop-image' !== bp_get_avatar_admin_step()) {
        $retval = !bp_core_get_root_option('bp-disable-avatar-uploads');
    }
    if (bp_is_active('groups')) {
        // Group creation
        if (bp_is_group_create() && bp_is_group_creation_step('group-avatar') && 'crop-image' !== bp_get_avatar_admin_step()) {
            $retval = !bp_disable_group_avatar_uploads();
            // Group Manage
        } elseif (bp_is_group_admin_page() && bp_is_group_admin_screen('group-avatar') && 'crop-image' !== bp_get_avatar_admin_step()) {
            $retval = !bp_disable_group_avatar_uploads();
        }
    }
    /**
     * Use this filter if you need to :
     * - Load the avatar UI for a component that is !groups or !user (return true regarding your conditions)
     * - Completely disable the avatar UI introduced in 2.3 (eg: __return_false())
     *
     * @since  2.3.0
     *
     * @param bool whether to load the Avatar UI.
     */
    return apply_filters('bp_avatar_is_front_edit', $retval);
}
示例#3
0
    <?php 
echo sprintf(__('Select an image from your computer to upload or change your cover photo. 
                The image must be larger than %spx in width and %spx in height (%sx%s pixels) 
                to attain quality cover photo.', 'gears'), BCP_MAX_WIDTH, BCP_MAX_HEIGHT, BCP_MAX_WIDTH, BCP_MAX_HEIGHT);
?>
</p>
<p>
    <?php 
_e('Click below to select a JPG, GIF or PNG format photo from your computer and then click \'Upload Image\' to proceed.', 'gears');
?>
</p>
           
<form action="" method="post" id="avatar-upload-form" class="standard-form" enctype="multipart/form-data">

    <?php 
if ('upload-image' == bp_get_avatar_admin_step()) {
    ?>
        <?php 
    wp_nonce_field('bp_avatar_upload');
    ?>
        <p id="avatar-upload" class="break-row-top">
            <input class="break-row-bottom" type="file" name="file" id="file" />
            <input class="break-row-bottom" type="hidden" name="action" value="bp_avatar_upload" />
            <input class="break-row-bottom mg-top-35" type="submit" name="upload_cover_photo" 
                id="upload_cover_photo"  value="<?php 
    _e('Upload Image', 'gears');
    ?>
" />
        </p>
        <?php 
} else {
/**
 * Output the current avatar upload step.
 *
 * @since 1.1.0
 */
function bp_avatar_admin_step()
{
    echo bp_get_avatar_admin_step();
}
示例#5
0
 function crop_avatar()
 {
     global $bp;
     $step = bp_get_avatar_admin_step();
     if ('crop-image' == $step || !empty($bp->groups->current_create_step) && $bp->groups->current_create_step == 'group-avatar') {
         bp_core_add_jquery_cropper();
     }
 }