/** * @see Action::execute() */ public function execute() { parent::execute(); // add edit note $postData = array(); if (!$this->board->getPermission('canHideEditNote') && (WCF::getUser()->userID != $this->post->userID || $this->post->time <= TIME_NOW - POST_EDIT_HIDE_EDIT_NOTE_PERIOD * 60)) { $postData['editor'] = WCF::getUser()->username; $postData['editorID'] = WCF::getUser()->userID; $postData['lastEditTime'] = TIME_NOW; $postData['editCount'] = $this->post->editCount + 1; $postData['editReason'] = ''; } // update message $this->post->updateMessage($this->text, $postData); if ($this->thread->firstPostID == $this->post->postID) { // update first post preview $this->post->updateFirstPostPreview($this->post->threadID, $this->post->postID, $this->text, array('enableSmilies' => $this->post->enableSmilies, 'enableHtml' => $this->post->enableHtml, 'enableBBCodes' => $this->post->enableBBCodes)); } $this->executed(); // get new formatted message and return it $postList = new PostList(); $postList->sqlConditions = 'post.postID = ' . $this->postID; $postList->readPosts(); $post = reset($postList->posts); HeaderUtil::sendHeaders(); echo $post->getFormattedMessage(); }
/** * @see Page::show() */ public function show() { $this->loadAvailableLanguages(); // get max text length $this->maxTextLength = WCF::getUser()->getPermission('user.board.maxPostLength'); if (MODULE_POLL != 1 || !$this->board->getPermission('canStartPoll')) { $this->showPoll = false; } if (MODULE_ATTACHMENT != 1 || !$this->board->getPermission('canUploadAttachment')) { $this->showAttachments = false; } // get attachments editor if ($this->attachmentListEditor == null) { $this->attachmentListEditor = new MessageAttachmentListEditor(array(), 'post', PACKAGE_ID, WCF::getUser()->getPermission('user.board.maxAttachmentSize'), WCF::getUser()->getPermission('user.board.allowedAttachmentExtensions'), WCF::getUser()->getPermission('user.board.maxAttachmentCount')); } // get poll editor if ($this->pollEditor == null) { $this->pollEditor = new PollEditor(0, 0, 'post', WCF::getUser()->getPermission('user.board.canStartPublicPoll')); } // show form parent::show(); }