4 require_once
'Modules/Forum/classes/class.ilObjForumAccess.php';
5 require_once
'Modules/Forum/classes/class.ilForumAuthorInformationCache.php';
96 if($this->authorEntity instanceof
ilObjUser && $this->authorEntity->
getId())
115 $this->author->setId(0);
116 $this->author->setPref(
'public_profile',
'n');
117 $this->author->setGender(
'');
140 protected function isCurrentUserSessionLoggedIn()
147 return $ilUser->getId() != ANONYMOUS_USER_ID;
157 if($with_profile_link && $this->publicProfileLinkAttributes)
161 foreach($this->publicProfileLinkAttributes as $attr => $value)
163 $link .=
' ' . $attr .
'="' . $value .
'"';
172 if($with_profile_link && $this->publicProfileLinkAttributes)
175 $linked_login .=
'</a>';
178 $this->linked_public_name = $link;
179 $this->linked_short_name = $linked_login;
185 protected function init()
192 include_once
'Modules/Forum/classes/class.ilObjForumAccess.php';
199 ($this->isCurrentUserSessionLoggedIn() && $this->
getAuthor()->getPref(
'public_profile') ==
'y' || $this->
getAuthor()->getPref(
'public_profile') ==
'g')
203 $this->authorName = $this->
getAuthor()->getPublicName();
204 $this->authorShortName = $this->
getAuthor()->getLogin();
206 if($this->
getAuthor()->getPref(
'public_upload') ==
'y')
208 $this->profilePicture = $this->
getAuthor()->getPersonalPicturePath(
'xsmall');
215 if($this->
getAuthor()->getPref(
'public_gender') !=
'y')
225 $this->authorShortName = $this->authorName = $this->
getAuthor()->getLogin();
230 else if(strlen($this->importName))
233 $this->authorShortName = $this->authorName = $this->importName ?
234 $this->importName .
' (' . $lng->txt(
'imported') .
')' :
235 $lng->txt(
'unknown');
239 else if(strlen($this->pseudonym))
242 $this->authorShortName = $this->authorName = $this->pseudonym .
' (' . $lng->txt(
'frm_pseudonym') .
')';
243 $this->is_pseudonym =
true;
250 $this->authorShortName = $this->authorName = $lng->txt(
'forums_anonymous');
278 if(!$without_short_name)
284 return trim(preg_replace(
'/\(?'.$this->
getAuthorShortName().
'\)?/',
'', $this->authorName));