mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-06-05 15:09:37 +09:00
- fixed cover photo size;
This commit is contained in:
@@ -1671,6 +1671,9 @@ function um_get_cover_uri( $image, $attrs ) {
|
||||
$uri_common = false;
|
||||
$ext = '.' . pathinfo( $image, PATHINFO_EXTENSION );
|
||||
|
||||
$ratio = str_replace(':1','',UM()->options()->get( 'profile_cover_ratio' ) );
|
||||
$height = round( $attrs / $ratio );
|
||||
|
||||
if ( is_multisite() ) {
|
||||
//multisite fix for old customers
|
||||
$multisite_fix_dir = UM()->uploader()->get_upload_base_dir();
|
||||
@@ -1682,8 +1685,8 @@ function um_get_cover_uri( $image, $attrs ) {
|
||||
$uri_common = $multisite_fix_url . um_user( 'ID' ) . "/cover_photo{$ext}?" . current_time( 'timestamp' );
|
||||
}
|
||||
|
||||
if ( file_exists( $multisite_fix_dir . um_user( 'ID' ) . DIRECTORY_SEPARATOR . "cover_photo-{$attrs}x{$attrs}{$ext}" ) ) {
|
||||
$uri_common = $multisite_fix_url . um_user( 'ID' ) . "/cover_photo-{$attrs}x{$attrs}{$ext}?". current_time( 'timestamp' );
|
||||
if ( file_exists( $multisite_fix_dir . um_user( 'ID' ) . DIRECTORY_SEPARATOR . "cover_photo-{$attrs}x{$height}{$ext}" ) ) {
|
||||
$uri_common = $multisite_fix_url . um_user( 'ID' ) . "/cover_photo-{$attrs}x{$height}{$ext}?". current_time( 'timestamp' );
|
||||
} elseif ( file_exists( $multisite_fix_dir . um_user( 'ID' ) . DIRECTORY_SEPARATOR . "cover_photo-{$attrs}{$ext}" ) ) {
|
||||
$uri_common = $multisite_fix_url . um_user( 'ID' ) . "/cover_photo-{$attrs}{$ext}?" . current_time( 'timestamp' );
|
||||
}
|
||||
@@ -1693,8 +1696,8 @@ function um_get_cover_uri( $image, $attrs ) {
|
||||
$uri = UM()->uploader()->get_upload_base_url() . um_user( 'ID' ) . "/cover_photo{$ext}?" . current_time( 'timestamp' );
|
||||
}
|
||||
|
||||
if ( file_exists( UM()->uploader()->get_upload_base_dir() . um_user( 'ID' ) . DIRECTORY_SEPARATOR . "cover_photo-{$attrs}x{$attrs}{$ext}" ) ) {
|
||||
$uri = UM()->uploader()->get_upload_base_url() . um_user( 'ID' ) . "/cover_photo-{$attrs}x{$attrs}{$ext}?". current_time( 'timestamp' );
|
||||
if ( file_exists( UM()->uploader()->get_upload_base_dir() . um_user( 'ID' ) . DIRECTORY_SEPARATOR . "cover_photo-{$attrs}x{$height}{$ext}" ) ) {
|
||||
$uri = UM()->uploader()->get_upload_base_url() . um_user( 'ID' ) . "/cover_photo-{$attrs}x{$height}{$ext}?". current_time( 'timestamp' );
|
||||
} elseif ( file_exists( UM()->uploader()->get_upload_base_dir() . um_user( 'ID' ) . DIRECTORY_SEPARATOR . "cover_photo-{$attrs}{$ext}" ) ) {
|
||||
$uri = UM()->uploader()->get_upload_base_url() . um_user( 'ID' ) . "/cover_photo-{$attrs}{$ext}?" . current_time( 'timestamp' );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user