/** * Render the mChat archive * * @return \Symfony\Component\HttpFoundation\Response */ public function page_archive() { if (!$this->auth->acl_get('u_mchat_view') || !$this->auth->acl_get('u_mchat_archive')) { throw new \phpbb\exception\http_exception(403, 'MCHAT_NOACCESS_ARCHIVE'); } $this->functions_mchat->mchat_prune(); $this->template->assign_var('MCHAT_ARCHIVE_PAGE', true); $this->render_page('archive'); // Add to navlinks $this->template->assign_block_vars_array('navlinks', array(array('FORUM_NAME' => $this->user->lang('MCHAT_TITLE'), 'U_VIEW_FORUM' => $this->helper->route('dmzx_mchat_controller')), array('FORUM_NAME' => $this->user->lang('MCHAT_ARCHIVE'), 'U_VIEW_FORUM' => $this->helper->route('dmzx_mchat_page_controller', array('page' => 'archive'))))); return $this->helper->render('mchat_body.html', $this->user->lang('MCHAT_ARCHIVE_PAGE')); }
public function add_memberlist_info($event) { $user_id = (int) $event['member']['user_id']; $user = array(); // Warnings list $this->user->add_lang_ext('rxu/AdvancedWarnings', 'warnings'); $sql = 'SELECT w.warning_id, w.post_id, w.warning_time, w.warning_end, w.warning_type, w.warning_status, l.user_id, l.log_data, l.reportee_id, u.username, u.user_colour FROM ' . WARNINGS_TABLE . ' w, ' . LOG_TABLE . ' l, ' . USERS_TABLE . " u \n\t\t\t\tWHERE w.user_id = {$user_id} \n\t\t\t\t\tAND l.log_id = w.log_id\n\t\t\t\t\tAND u.user_id = l.user_id\n\t\t\t\t\t\tORDER BY w.warning_status DESC, w.warning_id DESC"; $result = $this->db->sql_query($sql); $warning = array(); while ($row = $this->db->sql_fetchrow($result)) { if (!$this->auth->acl_get('m_warn') && !$row['warning_status']) { continue; } $warning = unserialize($row['log_data']); $user[] = array('U_EDIT' => $this->auth->acl_get('m_warn') ? append_sid("{$this->phpbb_root_path}mcp.{$this->php_ext}", 'i=\\rxu\\AdvancedWarnings\\mcp\\warnings_module&mode=' . ($row['post_id'] ? 'warn_post&p=' . $row['post_id'] : 'warn_user') . '&u=' . $user_id . '&warn_id=' . $row['warning_id']) : '', 'USERNAME_FULL' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']), 'USERNAME_COLOUR' => $row['user_colour'] ? '#' . $row['user_colour'] : '', 'WARNING_TIME' => $row['warning_end'] ? $this->user->format_date($row['warning_end']) : $this->user->lang['PERMANENT'], 'WARNING' => $warning[0], 'WARNINGS' => $this->user->format_date($row['warning_time']), 'WARNING_STATUS' => $row['warning_status'] && $this->auth->acl_get('m_warn') ? true : false, 'WARNING_TYPE' => $row['warning_type'] == self::BAN ? $this->user->lang['BAN'] : $this->user->lang['WARNING'], 'U_WARNING_POST_URL' => $row['post_id'] ? append_sid("{$this->phpbb_root_path}viewtopic.{$this->php_ext}", 'p=' . $row['post_id'] . '#p' . $row['post_id']) : ''); } $this->db->sql_freeresult($result); $this->template->assign_block_vars_array('user', $user); // Check warning permissions $event['warn_user_enabled'] = $this->auth->acl_get('m_warn'); }