function &message_init_posting_from_post_data(&$_posting = NULL) { if (!$_posting) { $_posting = new Posting(); } $_posting->set_id($_POST['msg_id']); $_posting->set_username($_POST['username']); $_posting->set_subject($_POST['subject']); $_posting->set_body($_POST['body']); return $_posting; }
function _posting_read() { $posting = $this->forumdb->get_posting_from_id($_GET['msg_id']); $this->_add_posting_breadcrumbs($posting); /* Plugin hook: on_message_read_print * Called before the HTML for the posting is produced. * Args: posting: The posting that is about to be shown. */ $this->eventbus->emit('on_message_read_print', $this->api, $posting); // Hide subject and body if the message is locked. if ($posting) { // bypassed in threadview or listview, if permitted if (!$this->current_group->permissions['bypass']) { $posting->apply_block(); } } else { $posting = new Posting(); $posting->set_subject(_('No Such Message')); $posting->set_body(_('A message with the given ID does not exist.')); } $view = $this->_get_current_view(); $view->show_posting($posting); }