/**
  * @see Page::readData()
  */
 public function readData()
 {
     parent::readData();
     // Lade Content
     $uwp = new UserWantedPosterData($this->userID);
     $this->uwpData = $uwp->readEntry();
     // Wandle BBCode um und newlines
     if (isset($this->uwpData['text'])) {
         $bbcode = new MessageParser();
         $this->uwpData['text'] = $bbcode->parse($this->uwpData['text'], $this->uwpData['enableSmilies'], $this->uwpData['enableHtml'], $this->uwpData['enableBBCodes']);
     }
 }
 /**
  * @see Page::readData()
  */
 public function readData()
 {
     parent::readData();
     // Löschen
     if (isset($_REQUEST['action'])) {
         if ($_REQUEST['action'] == 'delete' && !empty($_REQUEST['id'])) {
             if ($this->user->userID != WCF::getUser()->userID && !WCF::getUser()->getPermission('mod.guestbook.canDeleteEntrys')) {
                 require_once WCF_DIR . 'lib/system/exception/PermissionDeniedException.class.php';
                 throw new PermissionDeniedException();
             } else {
                 $userGB = new UserGuestbookData($this->userID);
                 $userGB->deleteEntry($_REQUEST['id']);
             }
         } else {
             if ($_REQUEST['action'] == 'deleteComment' && !empty($_REQUEST['id'])) {
                 if ($this->user->userID != WCF::getUser()->userID || !WCF::getUser()->getPermission('user.guestbook.canComment')) {
                     require_once WCF_DIR . 'lib/system/exception/PermissionDeniedException.class.php';
                     throw new PermissionDeniedException();
                 } else {
                     $userGB = new UserGuestbookData($this->userID);
                     $userGB->deleteComment($_REQUEST['id']);
                 }
             } else {
                 if (($_REQUEST['action'] == 'lock' || $_REQUEST['action'] == 'unlock') && !empty($_REQUEST['userID'])) {
                     if (!WCF::getUser()->getPermission('mod.guestbook.canLock')) {
                         require_once WCF_DIR . 'lib/system/exception/PermissionDeniedException.class.php';
                         throw new PermissionDeniedException();
                     } else {
                         $userGB = new UserGuestbookData($this->userID);
                         $userGB->lockEntry($_REQUEST['userID'], $_REQUEST['action']);
                     }
                 }
             }
         }
     }
     // Statistiken
     if ($this->user->userID && WCF::getUser()->userID && (empty($this->pageNo) || $this->pageNo < 2)) {
         if ($this->user->userID != WCF::getUser()->userID) {
             UserGuestbookData::updateStatsVisitor(WCF::getUser()->userID);
         } else {
             UserGuestbookData::updateStatsUser();
         }
     }
     $stats = UserGuestbookData::getStats();
     $this->cntEntries = $stats['entries'];
     $this->cntViews = $stats['views'];
     $this->lastVisitor = $stats['lastVisitor'];
     $this->visitorLastVisit = $stats['visitorLastVisit'];
     // Lade Gästebuchdaten
     $userGB = new UserGuestbookData($this->userID);
     $this->gbData = $userGB->getEntries($this->pageNo, $this->itemsPerPage);
     // Wandle BBCode um und newlines
     $bbcode = new MessageParser();
     foreach ($this->gbData as $p => $v) {
         $this->gbData[$p]['text'] = $bbcode->parse($v['text'], $v['enableSmilies'], $v['enableHtml'], $v['enableBBCodes']);
         if (!empty($v['comment'])) {
             $this->gbData[$p]['comment'] = $bbcode->parse($v['comment'], $v['enableSmilies'], $v['enableHtml'], $v['enableBBCodes']);
         }
         // permissions
         $editTime = intval(WCF::getUser()->getPermission('user.guestbook.canEditOwnEntries'));
         if (WCF::getUser()->getPermission('mod.guestbook.canDeleteEntrys') || $v['userID'] == WCF::getUser()->userID) {
             $this->gbData[$p]['permDelete'] = true;
         } else {
             $this->gbData[$p]['permDelete'] = false;
         }
         if (WCF::getUser()->getPermission('mod.guestbook.canEditAll') || WCF::getUser()->getPermission('user.guestbook.canEditOwnGuestbook') && $v['userID'] == WCF::getUser()->userID || $editTime != 0 && $v['fromUserID'] == WCF::getUser()->userID && ($editTime == -1 || $v['entryTime'] > TIME_NOW - $editTime)) {
             $this->gbData[$p]['permEdit'] = true;
         } else {
             $this->gbData[$p]['permEdit'] = false;
         }
         if (WCF::getUser()->getPermission('user.guestbook.canComment') && $v['userID'] == WCF::getUser()->userID) {
             $this->gbData[$p]['permComment'] = true;
         } else {
             $this->gbData[$p]['permComment'] = false;
         }
     }
 }