From 8b2e8e5d6b263b82b5182c2631b9609efb5b3674 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Tue, 19 Mar 2019 13:45:44 +0100 Subject: [PATCH] Use of the shared default cover photo --- com.woltlab.wcf/templates/articleListItems.tpl | 2 +- .../files/lib/data/style/Style.class.php | 17 +++++++++++++++++ .../cover/photo/DefaultUserCoverPhoto.class.php | 5 ++--- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/com.woltlab.wcf/templates/articleListItems.tpl b/com.woltlab.wcf/templates/articleListItems.tpl index 803b37661f..695ca9630b 100644 --- a/com.woltlab.wcf/templates/articleListItems.tpl +++ b/com.woltlab.wcf/templates/articleListItems.tpl @@ -2,7 +2,7 @@ {foreach from=$objects item='article'}
-
+
{hascontent}
{content} diff --git a/wcfsetup/install/files/lib/data/style/Style.class.php b/wcfsetup/install/files/lib/data/style/Style.class.php index 472ef6ca2d..d17c7a97f1 100644 --- a/wcfsetup/install/files/lib/data/style/Style.class.php +++ b/wcfsetup/install/files/lib/data/style/Style.class.php @@ -217,6 +217,7 @@ class Style extends DatabaseObject { * Returns the cover photo filename. * * @return string + * @since 3.1 */ public function getCoverPhoto() { if ($this->coverPhotoExtension) { @@ -226,6 +227,22 @@ class Style extends DatabaseObject { return 'default.jpg'; } + /** + * @return string + * @since 5.2 + */ + public function getCoverPhotoLocation() { + return WCF_DIR . 'images/coverPhotos/' . $this->getCoverPhoto(); + } + + /** + * @return string + * @since 5.2 + */ + public function getCoverPhotoUrl() { + return WCF::getPath() . 'images/coverPhotos/' . $this->getCoverPhoto(); + } + /** * Returns the path to a favicon-related file. * diff --git a/wcfsetup/install/files/lib/data/user/cover/photo/DefaultUserCoverPhoto.class.php b/wcfsetup/install/files/lib/data/user/cover/photo/DefaultUserCoverPhoto.class.php index ffa5852e87..ec314e11e4 100644 --- a/wcfsetup/install/files/lib/data/user/cover/photo/DefaultUserCoverPhoto.class.php +++ b/wcfsetup/install/files/lib/data/user/cover/photo/DefaultUserCoverPhoto.class.php @@ -1,7 +1,6 @@ getFilename(); + return StyleHandler::getInstance()->getStyle()->getCoverPhotoLocation(); } /** * @inheritDoc */ public function getURL() { - return WCF::getPath() . 'images/coverPhotos/' . $this->getFilename(); + return StyleHandler::getInstance()->getStyle()->getCoverPhotoUrl(); } /** -- 2.20.1