/** * edit post * @param $post_id post id * @param $topic_id topic id * @param $text new post text */ function editPost($post_id, $topic_id, $text) { $no_access = true; $fdb = new DbForum(); $f_type = $fdb->getForumTypeByPostId($post_id); if ($this->_checkUserPerm('', $f_type, 'edit')) { $no_access = false; } if ($no_access && $fdb->getPostUser((int) $post_id) == $this->_getLoginUserName()) { if ($this->_checkUserPerm('', 'own', 'edit')) { $no_access = false; } } if ($no_access) { return <<<EOF <html> <body> <script language="javascript" type="text/javascript"> \twindow.parent.document.f.accessDenied(); </script> </body> </html> EOF; } // edit post here prepare_to_db($text, 1); $fdb->editPost($post_id, $text); return <<<EOF <html> <body> <script language="javascript" type="text/javascript"> \twindow.parent.document.f.editSuccess({$topic_id}); </script> </body> </html> EOF; }