<?php
namespace wcf\data\like;
use wcf\data\object\type\ObjectTypeCache;
+use wcf\data\user\User;
use wcf\data\user\UserProfile;
use wcf\system\like\IViewableLikeProvider;
$userIDs = array();
$likeGroups = array();
foreach ($this->objects as &$like) {
- $userIDs[] = $like->objectUserID;
+ $userIDs[] = $like->userID;
$like = new ViewableLike($like);
if (!isset($likeGroups[$like->objectTypeID])) {
$users = UserProfile::getUserProfiles($userIDs);
foreach ($this->objects as $like) {
- $like->setUserProfile($users[$like->objectUserID]);
+ $like->setUserProfile($users[$like->userID]);
}
}
if (isset($comments[$like->objectID])) {
$comment = $comments[$like->objectID];
- if (isset($users[$comment->objectID]) && isset($users[$comment->userID]) && !$users[$comment->objectID]->isProtected()) {
+ if (isset($users[$comment->objectID]) && !$users[$comment->objectID]->isProtected()) {
$like->setIsAccessible();
// short output
$text = WCF::getLanguage()->getDynamicVariable('wcf.like.title.com.woltlab.wcf.user.profileComment', array(
- 'commentAuthor' => $users[$comment->userID],
+ 'commentAuthor' => $comment->userID ? $users[$comment->userID] : null,
'user' => $users[$comment->objectID],
'like' => $like
));
$response = $responses[$like->objectID];
$comment = $comments[$response->commentID];
- if (isset($users[$comment->objectID]) && isset($users[$comment->userID]) && isset($users[$response->userID]) && !$users[$comment->objectID]->isProtected()) {
+ if (isset($users[$comment->objectID]) && !$users[$comment->objectID]->isProtected()) {
$like->setIsAccessible();
// short output
$text = WCF::getLanguage()->getDynamicVariable('wcf.like.title.com.woltlab.wcf.user.profileComment.response', array(
- 'responseAuthor' => $users[$response->userID],
- 'commentAuthor' => $users[$comment->userID],
+ 'responseAuthor' => $comment->userID ? $users[$response->userID] : null,
+ 'commentAuthor' => $comment->userID ? $users[$comment->userID] : null,
'user' => $users[$comment->objectID],
'like' => $like
));
<item name="wcf.like.objectType.com.woltlab.wcf.comment.response"><![CDATA[Kommentar-Antwort]]></item>
<item name="wcf.like.likes.more"><![CDATA[Weitere Likes]]></item>
<item name="wcf.like.likes.noMoreEntries"><![CDATA[Keine weiteren Likes]]></item>
- <item name="wcf.like.title.com.woltlab.wcf.user.profileComment"><![CDATA[Mag den Kommentar von <a href="{link controller='User' object=$commentAuthor}{/link}">{$commentAuthor->username}</a> an der <a href="{link controller='User' object=$user}{/link}#wall">Pinnwand von {$user->username}</a>{if $like->isDislike()} nicht{/if}.]]></item>
- <item name="wcf.like.title.com.woltlab.wcf.user.profileComment.response"><![CDATA[Mag die Antwort von <a href="{link controller='User' object=$responseAuthor}{/link}">{$responseAuthor->username}</a> zum Kommentar von <a href="{link controller='User' object=$commentAuthor}{/link}">{$commentAuthor->username}</a> an der <a href="{link controller='User' object=$user}{/link}#wall">Pinnwand von {$user->username}</a>{if $like->isDislike()} nicht{/if}.]]></item>
+ <item name="wcf.like.title.com.woltlab.wcf.user.profileComment"><![CDATA[Mag den Kommentar {if $commentAuthor}<a href="{link controller='User' object=$commentAuthor}{/link}">von {$commentAuthor->username}</a>{else}eines Gasts{/if} an der <a href="{link controller='User' object=$user}{/link}#wall">Pinnwand von {$user->username}</a>{if $like->isDislike()} nicht{/if}.]]></item>
+ <item name="wcf.like.title.com.woltlab.wcf.user.profileComment.response"><![CDATA[Mag die Antwort {if $responseAuthor}<a href="{link controller='User' object=$responseAuthor}{/link}">von {$responseAuthor->username}</a>{else}eines Gasts{/if} zum Kommentar {if $commentAuthor}von <a href="{link controller='User' object=$commentAuthor}{/link}">{$commentAuthor->username}</a> an der <a href="{link controller='User' object=$user}{/link}#wall">Pinnwand von {$user->username}</a>{else}eines Gasts{/if}{if $like->isDislike()} nicht{/if}.]]></item>
</category>
<category name="wcf.message">
<item name="wcf.like.objectType.com.woltlab.wcf.comment.response"><![CDATA[Comment Reply]]></item>
<item name="wcf.like.likes.more"><![CDATA[TODO: Weitere Likes]]></item>
<item name="wcf.like.likes.noMoreEntries"><![CDATA[TODO: Keine weiteren Likes]]></item>
- <item name="wcf.like.title.com.woltlab.wcf.user.profileComment"><![CDATA[TODO: Mag den Kommentar von <a href="{link controller='User' object=$commentAuthor}{/link}">{$commentAuthor->username}</a> an der <a href="{link controller='User' object=$user}{/link}#wall">Pinnwand von {$user->username}</a>{if $like->isDislike()} nicht{/if}.]]></item>
- <item name="wcf.like.title.com.woltlab.wcf.user.profileComment.response"><![CDATA[TODO: Mag die Antwort von <a href="{link controller='User' object=$responseAuthor}{/link}">{$responseAuthor->username}</a> zum Kommentar von <a href="{link controller='User' object=$commentAuthor}{/link}">{$commentAuthor->username}</a> an der <a href="{link controller='User' object=$user}{/link}#wall">Pinnwand von {$user->username}</a>{if $like->isDislike()} nicht{/if}.]]></item>
+ <item name="wcf.like.title.com.woltlab.wcf.user.profileComment"><![CDATA[TODO: Mag den Kommentar {if $commentAuthor}<a href="{link controller='User' object=$commentAuthor}{/link}">von {$commentAuthor->username}</a>{else}eines Gasts{/if} an der <a href="{link controller='User' object=$user}{/link}#wall">Pinnwand von {$user->username}</a>{if $like->isDislike()} nicht{/if}.]]></item>
+ <item name="wcf.like.title.com.woltlab.wcf.user.profileComment.response"><![CDATA[TOOD: Mag die Antwort {if $responseAuthor}<a href="{link controller='User' object=$responseAuthor}{/link}">von {$responseAuthor->username}</a>{else}eines Gasts{/if} zum Kommentar {if $commentAuthor}von <a href="{link controller='User' object=$commentAuthor}{/link}">{$commentAuthor->username}</a> an der <a href="{link controller='User' object=$user}{/link}#wall">Pinnwand von {$user->username}</a>{else}eines Gasts{/if}{if $like->isDislike()} nicht{/if}.]]></item>
</category>
<category name="wcf.message">