<?php
namespace wcf\system\user\notification\event;
-use wcf\data\user\User;
use wcf\system\comment\CommentDataHandler;
use wcf\system\request\LinkHandler;
use wcf\system\WCF;
<?php
namespace wcf\system\user\notification\event;
-use wcf\data\user\User;
+use wcf\system\comment\CommentDataHandler;
use wcf\system\request\LinkHandler;
-use wcf\system\user\notification\event\AbstractUserNotificationEvent;
use wcf\system\WCF;
/**
* @subpackage system.user.notification.event
* @category Community Framework
*/
-class UserProfileCommentResponseLikeUserNotificationEvent extends AbstractUserNotificationEvent {
+class UserProfileCommentResponseLikeUserNotificationEvent extends AbstractSharedUserNotificationEvent {
/**
* @see \wcf\system\user\notification\event\AbstractUserNotificationEvent::$stackable
*/
protected $stackable = true;
+ /**
+ * @see \wcf\system\user\notification\event\AbstractUserNotificationEvent::prepare()
+ */
+ protected function prepare() {
+ CommentDataHandler::getInstance()->cacheUserID($this->additionalData['objectID']);
+ CommentDataHandler::getInstance()->cacheUserID($this->additionalData['commentUserID']);
+ }
+
/**
* @see \wcf\system\user\notification\event\IUserNotificationEvent::getTitle()
*/
$count = count($authors);
$commentUser = $owner = null;
if ($this->additionalData['objectID'] != WCF::getUser()->userID) {
- $owner = new User($this->additionalData['objectID']);
+ $owner = CommentDataHandler::getInstance()->getUser($this->additionalData['objectID']);
}
if ($this->additionalData['commentUserID'] != WCF::getUser()->userID) {
- $commentUser = new User($this->additionalData['commentUserID']);
+ $commentUser = CommentDataHandler::getInstance()->getUser($this->additionalData['commentUserID']);
}
if ($count > 1) {
*/
protected function prepare() {
CommentDataHandler::getInstance()->cacheCommentID($this->userNotificationObject->commentID);
+ CommentDataHandler::getInstance()->cacheUserID($this->additionalData['userID']);
}
/**
* @see \wcf\system\user\notification\event\IUserNotificationEvent::getMessage()
*/
public function getMessage() {
- // @todo: use cache or a single query to retrieve required data
- $comment = new Comment($this->userNotificationObject->commentID);
+ $comment = CommentDataHandler::getInstance()->getComment($this->userNotificationObject->commentID);
if ($comment->userID) {
- $commentAuthor = new User($comment->userID);
+ $commentAuthor = CommentDataHandler::getInstance()->getUser($comment->userID);
}
else {
$commentAuthor = new User(null, array(
* @see \wcf\system\user\notification\event\IUserNotificationEvent::getMessage()
*/
public function getMessage() {
- // @todo: use cache or a single query to retrieve required data
$comment = CommentDataHandler::getInstance()->getComment($this->userNotificationObject->commentID);
$owner = CommentDataHandler::getInstance()->getUser($comment->objectID);
if ($comment->userID) {
* @see \wcf\system\user\notification\event\IUserNotificationEvent::getLink()
*/
public function getLink() {
- // @todo: use cache or a single query to retrieve required data
$comment = CommentDataHandler::getInstance()->getComment($this->userNotificationObject->commentID);
$user = CommentDataHandler::getInstance()->getUser($comment->objectID);
<item name="wcf.user.notification.commentResponse.title"><![CDATA[Neue Antwort (Pinnwand)]]></item>
<item name="wcf.user.notification.commentResponse.title.stacked"><![CDATA[{#$timesTriggered} neue Antworten (Pinnwand)]]></item>
<item name="wcf.user.notification.commentResponse.message"><![CDATA[Hat eine Antwort zu Ihrem Kommentar an der Pinnwand von {$owner->username} verfasst.]]></item>
- <item name="wcf.user.notification.commentResponse.message.stacked"><![CDATA[{if $count < 4}{@$authors[0]->getAnchorTag()}{if $count == 2} und {else}, {/if}{@$authors[1]->getAnchorTag()}{if $count == 3} und {@$authors[2]->getAnchorTag()}{/if}{else}{@$authors[0]->getAnchorTag()} und {#$count} weitere{/if} haben auf Ihren Kommentar an der <a href="{link controller='User' object=$owner}#wall{/link}">Pinnwand von {$owner->username}</a> geantwortet.]]></item>
+ <item name="wcf.user.notification.commentResponse.message.stacked"><![CDATA[{if $count < 4}{@$authors[0]->getAnchorTag()}{if $count == 2} und {else}, {/if}{@$authors[1]->getAnchorTag()}{if $count == 3} und {@$authors[2]->getAnchorTag()}{/if}{else}{@$authors[0]->getAnchorTag()} und {#$count} weitere{/if} haben auf Ihren Kommentar an {if $owner->userID == $__wcf->getUser()->userID}<a href="{link controller='User' object=$owner}#wall{/link}">Ihrer Pinnwand</a>{else}der <a href="{link controller='User' object=$owner}#wall{/link}">Pinnwand von {$owner->username}</a>{/if} geantwortet.]]></item>
<item name="wcf.user.notification.commentResponse.like.title"><![CDATA[Gefällt die Antwort auf einen Kommentar (Pinnwand)]]></item>
<item name="wcf.user.notification.commentResponse.like.title.stacked"><![CDATA[{#$count} Benutzern gefällt Ihre Antwort auf einen Kommentar (Pinnwand)]]></item>
<item name="wcf.user.notification.commentResponse.like.message"><![CDATA[Gefällt Ihre Antwort auf einen Kommentar an {if $owner === null}Ihrer Pinnwand{else}der Pinnwand von {$owner->username}{/if}.]]></item>
<item name="wcf.user.notification.com.woltlab.wcf.user.profileComment.notification.comment"><![CDATA[Neuer Kommentar an Ihrer Pinnwand]]></item>
<item name="wcf.user.notification.com.woltlab.wcf.user.profileComment.response.notification.commentResponse"><![CDATA[Neue Antwort auf einen Kommentar an Ihrer Pinnwand]]></item>
<item name="wcf.user.notification.com.woltlab.wcf.user.profileComment.response.notification.commentResponseOwner"><![CDATA[Neue Antwort auf einen Kommentar von Ihnen]]></item>
+ <item name="wcf.user.notification.com.woltlab.wcf.user.profileComment.like.notification.like"><![CDATA[Jemand gefällt Ihr Kommentar]]></item>
+ <item name="wcf.user.notification.com.woltlab.wcf.user.profileComment.response.like.notification.like"><![CDATA[Jemand gefällt Ihre Antwort auf einen Kommentar]]></item>
</category>
<category name="wcf.user.profile">
<item name="wcf.user.notification.commentResponse.title"><![CDATA[New Reply (Wall)]]></item>
<item name="wcf.user.notification.commentResponse.title.stacked"><![CDATA[{#$timesTriggered} new replies (Wall)]]></item>
<item name="wcf.user.notification.commentResponse.message"><![CDATA[Wrote a reply to your comment on {$owner->username}’s wall.]]></item>
- <item name="wcf.user.notification.commentResponse.message.stacked"><![CDATA[{if $count < 4}{@$authors[0]->getAnchorTag()}{if $count == 2} and {else}, {/if}{@$authors[1]->getAnchorTag()}{if $count == 3} and {@$authors[2]->getAnchorTag()}{/if}{else}{@$authors[0]->getAnchorTag()} and {#$count} others{/if} replied to your comment on <a href="{link controller='User' object=$owner}#wall{/link}">{$owner->username}’s wall</a>.]]></item>
+ <item name="wcf.user.notification.commentResponse.message.stacked"><![CDATA[{if $count < 4}{@$authors[0]->getAnchorTag()}{if $count == 2} and {else}, {/if}{@$authors[1]->getAnchorTag()}{if $count == 3} and {@$authors[2]->getAnchorTag()}{/if}{else}{@$authors[0]->getAnchorTag()} and {#$count} others{/if} replied to your comment on <a href="{link controller='User' object=$owner}#wall{/link}">{if $owner->userID == $__wcf->getUser()->userID}your{else}{$owner->username}’s{/if} wall</a>.]]></item>
<item name="wcf.user.notification.commentResponse.like.title"><![CDATA[Likes your reply to a comment (Wall)]]></item>
<item name="wcf.user.notification.commentResponse.like.title.stacked"><![CDATA[{#$count} users like your reply to a comment (Wall)]]></item>
<item name="wcf.user.notification.commentResponse.like.message"><![CDATA[Likes your reply to a comment on {if $owner === null}your wall{else}{$owner->username}’s wall{/if}.]]></item>
<item name="wcf.user.notification.com.woltlab.wcf.user.profileComment.notification.comment"><![CDATA[New comment on your wall]]></item>
<item name="wcf.user.notification.com.woltlab.wcf.user.profileComment.response.notification.commentResponse"><![CDATA[New reply to a comment on your wall]]></item>
<item name="wcf.user.notification.com.woltlab.wcf.user.profileComment.response.notification.commentResponseOwner"><![CDATA[New reply to one of your comments]]></item>
+ <item name="wcf.user.notification.com.woltlab.wcf.user.profileComment.like.notification.like"><![CDATA[Your comment was liked]]></item>
+ <item name="wcf.user.notification.com.woltlab.wcf.user.profileComment.response.like.notification.like"><![CDATA[Reply to your comment was liked]]></item>
</category>
<category name="wcf.user.profile">