107 $this->globalUser = $DIC->user();
108 $this->globalLng = $DIC->language();
125 if (is_numeric($this->display_id) && $this->display_id > 0) {
128 if (!$this->author) {
134 if (!$this->author) {
136 $this->author->setId(0);
137 $this->author->setPref(
'public_profile',
'n');
138 $this->author->setGender(
'');
163 return !$this->globalUser->isAnonymous();
173 if ($with_profile_link && $this->public_profile_link_attributes) {
176 foreach ($this->public_profile_link_attributes as $attr => $value) {
177 $link .=
' ' . $attr .
'="' . $value .
'"';
186 if ($with_profile_link && $this->public_profile_link_attributes) {
188 $linked_login .=
'</a>';
191 $this->linked_public_name = $link;
192 $this->linked_short_name = $linked_login;
210 && $this->
getAuthor()->getPref(
'public_profile') ==
'y')
211 || $this->
getAuthor()->getPref(
'public_profile') ==
'g')
214 $this->author_name = $this->
getAuthor()->getPublicName();
215 $this->author_short_name = $this->
getAuthor()->getLogin();
217 if ($this->
getAuthor()->getPref(
'public_upload') ==
'y') {
220 $this->profilePicture = $this->getAvatarImageSource(
226 if ($this->
getAuthor()->getPref(
'public_gender') !=
'y') {
233 $this->author_short_name = $this->author_name = $this->
getAuthor()->getLogin();
235 $this->profilePicture = $this->getAvatarImageSource($this->author_short_name, $this->
getAuthor()->getId());
240 $this->author_short_name = $this->author_name = $translationLanguage->txt(
'deleted');
241 $this->is_deleted =
true;
242 $this->suffix = $translationLanguage->txt(
'deleted');
244 $this->profilePicture = $this->getAvatarImageSource($this->author_short_name);
245 } elseif (strlen($this->import_name)) {
247 $this->author_short_name = $this->author_name = $this->import_name .
' (' . $translationLanguage->txt(
'imported') .
')';
248 $this->suffix = $translationLanguage->txt(
'imported');
250 $this->profilePicture = $this->getAvatarImageSource($this->author_short_name);
251 } elseif (strlen($this->alias)) {
253 $this->author_short_name = $this->author_name = $this->alias .
' (' . $translationLanguage->txt(
'frm_pseudonym') .
')';
254 $this->suffix = $translationLanguage->txt(
'frm_pseudonym');
256 $this->profilePicture = $this->getAvatarImageSource($this->author_short_name);
259 $this->author_short_name = $this->author_name = $translationLanguage->txt(
'forums_anonymous');
261 $this->profilePicture = $this->getAvatarImageSource($this->author_short_name);
283 protected function getAvatarImageSource(
$name, $usrId = ANONYMOUS_USER_ID)
292 $avatar = $DIC[
"user.avatar.factory"]->avatar(
'xsmall');
293 $avatar->setUsrId($usrId);
296 return $avatar->getUrl();
321 if (!$without_short_name) {
324 return trim(preg_replace(
'/\(' . preg_quote($this->
getAuthorShortName()) .
'\)/',
'', $this->author_name));
357 return strlen($this->suffix);
static getCachedUserInstance($usr_id)
static subStr($a_str, $a_start, $a_length=null)
static hasHTML()
Has HTML output.
getPersonalPicturePath($a_size="small", $a_force_pic=false)
Get path to personal picture.