{if MODULE_USER_COVER_PHOTO && $user->userID == $__wcf->user->userID}
{if $__wcf->getSession()->getPermission('user.profile.coverPhoto.canUploadCoverPhoto')}
<div id="userProfileCoverPhotoUpload" class="jsStaticDialogContent" data-title="{lang}wcf.user.coverPhoto.upload{/lang}">
- {lang}wcf.user.coverPhoto.description{/lang}
-
{if $__wcf->user->disableCoverPhoto}
<p class="error">{lang}wcf.user.coverPhoto.error.disabled{/lang}</p>
{else}
{* placeholder for the upload button *}
<div id="coverPhotoUploadButtonContainer"></div>
+ <small>{lang}wcf.user.coverPhoto.upload.description{/lang}</small>
{/if}
</div>
<script data-relocate="true">
*/
protected $userID;
- const MAX_HEIGHT = 400;
- const MAX_WIDTH = 1600;
+ const MAX_HEIGHT = 800;
+ const MAX_WIDTH = 2000;
const MIN_HEIGHT = 200;
- const MIN_WIDTH = 800;
+ const MIN_WIDTH = 500;
/**
* UserCoverPhoto constructor.
public function getFilename() {
return substr($this->coverPhotoHash, 0, 2) . '/' . $this->userID . '-' . $this->coverPhotoHash . '.' . $this->coverPhotoExtension;
}
+
+ /**
+ * Returns the minimum and maximum dimensions for cover photos.
+ *
+ * @return array
+ */
+ public static function getCoverPhotoDimensions() {
+ return [
+ 'max' => [
+ 'height' => self::MAX_HEIGHT,
+ 'width' => self::MAX_WIDTH
+ ],
+ 'min' => [
+ 'height' => self::MIN_HEIGHT,
+ 'width' => self::MIN_WIDTH
+ ]
+ ];
+ }
}
namespace wcf\page;
use wcf\data\object\type\ObjectType;
use wcf\data\object\type\ObjectTypeCache;
+use wcf\data\user\cover\photo\UserCoverPhoto;
use wcf\data\user\follow\UserFollowerList;
use wcf\data\user\follow\UserFollowingList;
use wcf\data\user\group\UserGroup;
'followingCount' => $this->followingList->countObjects(),
'visitors' => $this->visitorList !== null ? $this->visitorList->getObjects() : [],
'visitorCount' => $this->visitorList !== null ? $this->visitorList->countObjects() : 0,
- 'isAccessible' => UserGroup::isAccessibleGroup($this->user->getGroupIDs())
+ 'isAccessible' => UserGroup::isAccessibleGroup($this->user->getGroupIDs()),
+ 'coverPhotoDimensions' => UserCoverPhoto::getCoverPhotoDimensions()
]);
}
<item name="wcf.user.coverPhoto.delete.confirmMessage"><![CDATA[{if LANGUAGE_USE_INFORMAL_VARIANT}Willst du dein{else}Wollen Sie Ihr{/if} Profilbild wirklich löschen? Nach dem Löschen wird wieder das Standard-Bild angezeigt.]]></item>
<item name="wcf.user.coverPhoto.edit"><![CDATA[Profilbild bearbeiten]]></item>
<item name="wcf.user.coverPhoto.upload"><![CDATA[Profilbild hochladen]]></item>
+ <item name="wcf.user.coverPhoto.upload.description"><![CDATA[Minimale Bildgröße: {$coverPhotoDimensions.min.width}×{$coverPhotoDimensions.min.height} Pixel<br>Maximale Bildgröße: {$coverPhotoDimensions.max.width}×{$coverPhotoDimensions.max.height} Pixel<br>Erlaubte Dateiendungen: gif, jpg, jpeg, png<br>Maximale Dateigröße: {$__wcf->session->getPermission('user.profile.coverPhoto.maxSize')|filesize}]]></item>
<item name="wcf.user.coverPhoto.upload.error.badImage"><![CDATA[{if LANGUAGE_USE_INFORMAL_VARIANT}Du hast{else}Sie haben{/if} kein gültiges Bild hochgeladen.]]></item>
<item name="wcf.user.coverPhoto.upload.error.invalidExtension"><![CDATA[Die Datei hat eine ungültige Dateiendung.]]></item>
<item name="wcf.user.coverPhoto.upload.error.maxHeight"><![CDATA[Das Bild ist zu hoch.]]></item>
<item name="wcf.user.coverPhoto.delete.confirmMessage"><![CDATA[Do you really want to delete your cover photo? This will replace your current photo with the default image.]]></item>
<item name="wcf.user.coverPhoto.edit"><![CDATA[Edit Cover Photo]]></item>
<item name="wcf.user.coverPhoto.upload"><![CDATA[Upload Cover Photo]]></item>
+ <item name="wcf.user.coverPhoto.upload.description"><![CDATA[Minimum Image Size: {$coverPhotoDimensions.min.width}×{$coverPhotoDimensions.min.height} pixels<br>Maximum Image Size: {$coverPhotoDimensions.max.width}×{$coverPhotoDimensions.max.height} pixels<br>Allowed File Extensions: gif, jpg, jpeg, png<br>Maximum Filesize: {$__wcf->session->getPermission('user.profile.coverPhoto.maxSize')|filesize}]]></item>
<item name="wcf.user.coverPhoto.upload.error.badImage"><![CDATA[The uploaded file is not an image.]]></item>
<item name="wcf.user.coverPhoto.upload.error.invalidExtension"><![CDATA[The file has an invalid extension.]]></item>
<item name="wcf.user.coverPhoto.upload.error.maxHeight"><![CDATA[The image is too tall.]]></item>