Example #1
0
 public static function fromRow($row, Forum $forum = null)
 {
     global $user, $userManager, $db;
     $topic = new self(!is_null($forum) ? $forum : $row->forum_id, $row->user_id, $row->topic_title, $row->id);
     $topic->setImportant($row->topic_important == '1');
     $topic->setClosed($row->topic_closed == '1');
     // if user is logged in, use new entry-icons
     if ($userManager->loggedIn()) {
         $available = max($row->mark_time, $user->getRegisterDate()) < $topic->getLastPost()->getDate() ? true : false;
         $topic->setNewEntriesAvailable($available);
     }
     return $topic;
 }