{foreach from=$commentList item=comment}
<li class="comment jsComment" data-comment-id="{@$comment->commentID}" data-object-type="com.woltlab.wcf.comment" data-like-liked="{if $likeData[comment][$comment->commentID]|isset}{@$likeData[comment][$comment->commentID]->liked}{/if}" data-like-likes="{if $likeData[comment][$comment->commentID]|isset}{@$likeData[comment][$comment->commentID]->likes}{else}0{/if}" data-like-dislikes="{if $likeData[comment][$comment->commentID]|isset}{@$likeData[comment][$comment->commentID]->dislikes}{else}0{/if}" data-like-users='{if $likeData[comment][$comment->commentID]|isset}{ {implode from=$likeData[comment][$comment->commentID]->getUsers() item=likeUser}"{@$likeUser->userID}": { "username": "{$likeUser->username|encodeJSON}" }{/implode} }{else}{ }{/if}' data-can-edit="{if $comment->isEditable()}true{else}false{/if}" data-can-delete="{if $comment->isDeletable()}true{else}false{/if}" data-responses="{@$comment->responses}" data-last-response-time="{@$comment->getLastResponseTime()}" data-user-id="{@$comment->userID}">
<div class="box32">
- <a href="{link controller='User' object=$comment->getUserProfile()}{/link}" title="{$comment->getUserProfile()->username}" class="framed">
- {@$comment->getUserProfile()->getAvatar()->getImageTag(32)}
- </a>
+ {if $comment->userID}
+ <a href="{link controller='User' object=$comment->getUserProfile()}{/link}" title="{$comment->getUserProfile()->username}" class="framed">
+ {@$comment->getUserProfile()->getAvatar()->getImageTag(32)}
+ </a>
+ {else}
+ <span class="framed">{@$comment->getUserProfile()->getAvatar()->getImageTag(32)}</span>
+ {/if}
<div>
<div class="commentContent">
<div class="containerHeadline">
- <h3><a href="{link controller='User' object=$comment->getUserProfile()}{/link}" class="userLink" data-user-id="{@$comment->userID}">{$comment->username}</a><small> - {@$comment->time|time}</small></h3>
+ <h3>
+ {if $comment->userID}
+ <a href="{link controller='User' object=$comment->getUserProfile()}{/link}" class="userLink" data-user-id="{@$comment->userID}">{$comment->username}</a>
+ {else}
+ {$comment->username}
+ {/if}
+
+ <small> - {@$comment->time|time}</small>
+ </h3>
</div>
<p class="userMessage">{@$comment->getFormattedMessage()}</p>
{foreach from=$responseList item=response}
<li class="commentResponse jsCommentResponse" data-response-id="{@$response->responseID}" data-object-type="com.woltlab.wcf.comment.response" data-like-liked="{if $likeData[response][$response->responseID]|isset}{@$likeData[response][$response->responseID]->liked}{/if}" data-like-likes="{if $likeData[response][$response->responseID]|isset}{@$likeData[response][$response->responseID]->likes}{else}0{/if}" data-like-dislikes="{if $likeData[response][$response->responseID]|isset}{@$likeData[response][$response->responseID]->dislikes}{else}0{/if}" data-like-users='{if $likeData[response][$response->responseID]|isset}{ {implode from=$likeData[response][$response->responseID]->getUsers() item=likeUser}"{@$likeUser->userID}": { "username": "{$likeUser->username|encodeJSON}" }{/implode} }{else}{ }{/if}' data-can-edit="{if $response->isEditable()}true{else}false{/if}" data-can-delete="{if $response->isDeletable()}true{else}false{/if}" data-user-id="{@$response->userID}">
<div class="box32">
- <a href="{link controller='User' object=$response->getUserProfile()}{/link}" title="{$response->getUserProfile()->username}" class="framed">
- {if $response->getUserProfile()->getAvatar()}
+ {if $response->userID}
+ <a href="{link controller='User' object=$response->getUserProfile()}{/link}" title="{$response->getUserProfile()->username}" class="framed">
{@$response->getUserProfile()->getAvatar()->getImageTag(32)}
- {/if}
- </a>
+ </a>
+ {else}
+ <span class="framed">{@$response->getUserProfile()->getAvatar()->getImageTag(32)}</span>
+ {/if}
<div class="commentContent commentResponseContent">
<div class="containerHeadline">
- <h3><a href="{link controller='User' object=$response->getUserProfile()}{/link}" class="userLink" data-user-id="{@$response->userID}">{$response->username}</a><small> - {@$response->time|time}</small></h3>
+ <h3>
+ {if $response->userID}
+ <a href="{link controller='User' object=$response->getUserProfile()}{/link}" class="userLink" data-user-id="{@$response->userID}">{$response->username}</a>
+ {else}
+ {$response->username}
+ {/if}
+
+ <small> - {@$response->time|time}</small>
+ </h3>
</div>
<p class="userMessage">{@$response->getFormattedMessage()}</p>
<?php
namespace wcf\data\comment;
use wcf\data\comment\response\StructuredCommentResponse;
+use wcf\data\user\User;
use wcf\data\user\UserProfile;
use wcf\data\DatabaseObjectDecorator;
* @return wcf\data\user\UserProfile
*/
public function getUserProfile() {
+ if ($this->userProfile === null) {
+ $this->userProfile = new UserProfile(new User(null, $this->data));
+ }
+
return $this->userProfile;
}
<?php
namespace wcf\data\comment\response;
+use wcf\data\user\User;
use wcf\data\user\UserProfile;
use wcf\data\DatabaseObjectDecorator;
* @return wcf\data\user\UserProfile
*/
public function getUserProfile() {
+ if ($this->userProfile === null) {
+ $this->userProfile = new UserProfile(new User(null, $this->data));
+ }
+
return $this->userProfile;
}