/** * Assign details for the source post. */ public function assign_source_object_details() { users_overlord::load_users(array($this->post->post_user_id, $this->post->post_edit_user, $this->post->post_delete_user)); users_overlord::assign_details($this->post->post_user_id, 'POSTER_', true); $this->load_contrib_object(); $action_param = array('hash' => generate_link_hash('attention_action')); phpbb::$template->assign_vars(array('OBJECT_TYPE' => $this->get_lang_string('object'), 'PARENT' => $this->contrib->contrib_name, 'U_PARENT' => $this->contrib->get_url(), 'POST_SUBJECT' => censor_text($this->post->post_subject), 'POST_DATE' => phpbb::$user->format_date($this->post->post_time), 'POST_TEXT' => $this->post->generate_text_for_display(), 'EDITED_MESSAGE' => $this->post->post_edited ? sprintf(phpbb::$user->lang['EDITED_MESSAGE'], users_overlord::get_user($this->post->post_edit_user, '_full'), phpbb::$user->format_date($this->post->post_edited)) : '', 'DELETED_MESSAGE' => $this->post->post_deleted != 0 ? sprintf(phpbb::$user->lang['DELETED_MESSAGE'], users_overlord::get_user($this->post->post_delete_user, '_full'), phpbb::$user->format_date($this->post->post_deleted), $this->post->get_url('undelete')) : '', 'POST_EDIT_REASON' => censor_text($this->post->post_edit_reason), 'U_APPROVE' => !$this->post->post_approved ? $this->get_report_url('approve', $action_param) : false, 'U_DISAPPROVE' => !$this->post->post_approved ? $this->get_report_url('disapprove', $action_param) : false, 'U_VIEW' => $this->post->get_url(), 'U_EDIT' => $this->post->get_url('edit'), 'SECTION_NAME' => '<a href="' . $this->post->get_url() . '">' . censor_text($this->post->post_subject) . '</a> - ' . phpbb::$user->lang['ATTENTION'], 'S_UNAPPROVED' => !$this->post->post_approved)); }
/** * Output a basic preview */ public function preview() { // Setup the attachments! $this->setup_attachments(); // Use the info from the post object instead of request_data $for_edit = $this->post_object->generate_text_for_edit(); $message = $this->post_object->generate_text_for_display(); if ($this->auth['attachments']) { $parsed_attachments = $this->uploader->get_operator()->parse_attachments($message, 'common/attachment.html', $this->uploader->get_request_comments()); foreach ($parsed_attachments as $attachment) { $this->template->assign_block_vars('preview_attachment', array('DISPLAY_ATTACHMENT' => $attachment)); } } $this->template->assign_vars(array('PREVIEW_SUBJECT' => isset($for_edit['subject']) ? censor_text($for_edit['subject']) : '', 'PREVIEW_MESSAGE' => $message, 'S_DISPLAY_PREVIEW' => true)); }
/** * Output a basic preview */ public function preview() { // Setup the attachments! $this->setup_attachments(); $for_edit = $this->post_object->generate_text_for_edit(); // Use the info from the post object instead of request_data // This seems unneccessary, it works as expected without running generate_text_for_storage first. //$request_data = $this->request_data(); //$this->post_object->generate_text_for_storage($request_data['bbcode_enabled'], $request_data['magic_url_enabled'], $request_data['smilies_enabled']); $message = $this->post_object->generate_text_for_display(); if ($this->attachments) { $parsed_attachments = $this->attachments->parse_attachments($message, 'common/attachment.html', true); } phpbb::$template->assign_vars(array('PREVIEW_SUBJECT' => isset($for_edit['subject']) ? censor_text($for_edit['subject']) : '', 'PREVIEW_MESSAGE' => $message, 'S_DISPLAY_PREVIEW' => true)); if ($this->attachments) { foreach ($parsed_attachments as $attachment) { phpbb::$template->assign_block_vars('preview_attachment', array('DISPLAY_ATTACHMENT' => $attachment)); } } }
/** * Assign details for the source contribution. */ public function assign_source_object_details() { users_overlord::load_users(array($this->contrib->contrib_user_id)); users_overlord::assign_details($this->contrib->contrib_user_id, 'POSTER_', true); phpbb::$template->assign_vars(array('OBJECT_TYPE' => $this->get_lang_string('object'), 'POST_SUBJECT' => censor_text($this->contrib->contrib_name), 'POST_DATE' => phpbb::$user->format_date($this->contrib->contrib_last_update), 'POST_TEXT' => $this->contrib->generate_text_for_display(), 'U_VIEW' => $this->contrib->get_url(), 'U_EDIT' => $this->contrib->get_url('manage'), 'SECTION_NAME' => '<a href="' . $this->contrib->get_url() . '">' . censor_text($this->contrib->contrib_name) . '</a> - ' . phpbb::$user->lang['ATTENTION'])); }