<definitionname>com.woltlab.wcf.boxController</definitionname>
<classname>wcf\system\box\UserTrophyListBoxController</classname>
</type>
+ <type>
+ <name>com.woltlab.wcf.profileCommentList</name>
+ <definitionname>com.woltlab.wcf.boxController</definitionname>
+ <classname>wcf\system\box\ProfileCommentListBoxController</classname>
+ </type>
<!-- /box controllers -->
<!-- simple acl -->
--- /dev/null
+<?php
+declare(strict_types=1);
+namespace wcf\data\user\profile\comment;
+use wcf\data\comment\Comment;
+use wcf\data\comment\ViewableComment;
+use wcf\system\cache\runtime\UserProfileRuntimeCache;
+use wcf\system\WCF;
+
+/**
+ * Represents a viewable user profile comment.
+ *
+ * @author Alexander Ebert
+ * @copyright 2001-2018 WoltLab GmbH
+ * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @package WoltLabSuite\Core\Data\Comment
+ *
+ * @method Comment getDecoratedObject()
+ * @mixin Comment
+ */
+class ViewableUserProfileComment extends ViewableComment {
+ /**
+ * @inheritDoc
+ */
+ public function __get($name) {
+ if ($name === 'title') {
+ return WCF::getLanguage()->getDynamicVariable('wcf.user.profile.title', ['user' => UserProfileRuntimeCache::getInstance()->getObject($this->objectID)]);
+ }
+
+ return parent::__get($name);
+ }
+}
--- /dev/null
+<?php
+declare(strict_types=1);
+namespace wcf\system\box;
+use wcf\data\comment\ViewableCommentList;
+use wcf\data\user\profile\comment\ViewableUserProfileComment;
+use wcf\data\user\User;
+use wcf\data\user\UserProfile;
+use wcf\system\user\UserProfileHandler;
+use wcf\system\WCF;
+
+/**
+ * Box controller implementation for a list of comments on user profiles.
+ *
+ * @author Alexander Ebert
+ * @copyright 2001-2018 WoltLab GmbH
+ * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @package WoltLabSuite\Core\System\Box
+ */
+class ProfileCommentListBoxController extends AbstractCommentListBoxController {
+ /**
+ * @inheritDoc
+ */
+ protected $objectTypeName = 'com.woltlab.wcf.user.profileComment';
+
+ /**
+ * @inheritDoc
+ */
+ protected function applyObjectTypeFilters(ViewableCommentList $commentList) {
+ $commentList->decoratorClassName = ViewableUserProfileComment::class;
+
+ if (WCF::getSession()->getPermission('user.profile.canViewUserProfile')) {
+ $optionID = User::getUserOptionID('canViewProfile');
+ $commentList->sqlJoins .= ' INNER JOIN wcf' . WCF_N . '_user_option_value user_option_value ON (user_option_value.userID = comment.objectID)';
+
+ if (WCF::getUser()->userID) {
+ $followers = UserProfileHandler::getInstance()->getFollowers();
+ if (empty($followers)) {
+ $commentList->getConditionBuilder()->add("(
+ user_option_value.userOption{$optionID} IN (?)
+ OR user_option_value.userID = ?
+ )", [
+ [
+ UserProfile::ACCESS_EVERYONE,
+ UserProfile::ACCESS_REGISTERED
+ ],
+ WCF::getUser()->userID
+ ]);
+ }
+ else {
+ $commentList->getConditionBuilder()->add("(
+ user_option_value.userOption{$optionID} IN (?)
+ OR (
+ user_option_value.userOption{$optionID} = ?
+ AND comment.objectID IN (?)
+ )
+ OR user_option_value.userID = ?
+ )", [
+ [
+ UserProfile::ACCESS_EVERYONE,
+ UserProfile::ACCESS_REGISTERED
+ ],
+ UserProfile::ACCESS_FOLLOWING,
+ $followers,
+ WCF::getUser()->userID
+ ]);
+ }
+ }
+ else {
+ $commentList->getConditionBuilder()->add("user_option_value.userOption{$optionID} = ?", [UserProfile::ACCESS_EVERYONE]);
+ }
+ }
+ else {
+ $commentList->getConditionBuilder()->add('0 = 1');
+ }
+ }
+}
<item name="wcf.acp.box.boxController.com.woltlab.wcf.followingsOnline"><![CDATA[Benutzer online, denen der aktive Nutzer folgt]]></item>
<item name="wcf.acp.box.boxController.com.woltlab.wcf.pageCommentList"><![CDATA[Seiten-Kommentare]]></item>
<item name="wcf.acp.box.boxController.com.woltlab.wcf.paidSubscriptions"><![CDATA[Bezahlte Mitgliedschaften]]></item>
+ <item name="wcf.acp.box.boxController.com.woltlab.wcf.profileCommentList"><![CDATA[Profil-Kommentare]]></item>
<item name="wcf.acp.box.boxController.com.woltlab.wcf.recentActivityList"><![CDATA[Letzte Aktivitäten]]></item>
<item name="wcf.acp.box.boxController.com.woltlab.wcf.registerButton"><![CDATA[Registrierungs-Button]]></item>
<item name="wcf.acp.box.boxController.com.woltlab.wcf.signedInAs"><![CDATA[Angemeldet als]]></item>
<item name="wcf.user.profile.user"><![CDATA[Benutzer]]></item>
<item name="wcf.user.profile.management"><![CDATA[Verwaltung]]></item>
<item name="wcf.user.profile.customization"><![CDATA[Anpassung]]></item>
+ <item name="wcf.user.profile.title"><![CDATA[Benutzerprofil von {$user->username}]]></item>
</category>
<category name="wcf.user.objectWatch">
<item name="wcf.acp.box.boxController.com.woltlab.wcf.followingsOnline"><![CDATA[Users Online Followed by Active User]]></item>
<item name="wcf.acp.box.boxController.com.woltlab.wcf.pageCommentList"><![CDATA[Page Comments]]></item>
<item name="wcf.acp.box.boxController.com.woltlab.wcf.paidSubscriptions"><![CDATA[Paid Subscriptions]]></item>
+ <item name="wcf.acp.box.boxController.com.woltlab.wcf.profileCommentList"><![CDATA[Profile Comments]]></item>
<item name="wcf.acp.box.boxController.com.woltlab.wcf.recentActivityList"><![CDATA[Recent Activity]]></item>
<item name="wcf.acp.box.boxController.com.woltlab.wcf.registerButton"><![CDATA[Register Button]]></item>
<item name="wcf.acp.box.boxController.com.woltlab.wcf.signedInAs"><![CDATA[Signed In As]]></item>
<item name="wcf.user.profile.user"><![CDATA[User]]></item>
<item name="wcf.user.profile.management"><![CDATA[Management]]></item>
<item name="wcf.user.profile.customization"><![CDATA[Customization]]></item>
+ <item name="wcf.user.profile.title"><![CDATA[User profile of {$user->username}]]></item>
</category>
<category name="wcf.user.objectWatch">