public function index() { if ($this->uri->segment(3)) { redirect('market'); } if ($this->session->userdata('logged_in')) { define('INGAME', TRUE); define('AJAX', TRUE); $this->output->enable_profiler($this->config->item('debug')); $this->lang->load('market'); $this->lang->load('ingame'); $user = $this->user->data($this->session->userdata('user_id')); $country = $this->user->data($user->country, 'countries'); date_default_timezone_set($user->timezone); $panel['avatar'] = avatar($user, $this->lang->lang()); $panel['user'] = $user; $panel['exp_prcnt'] = exp_percent($user); $panel['l18n'] = l18n($this->lang->lang()); $panel['currency'] = $country->currency; $script['img'] = loading(lang('overal.loading')); $head['panel'] = $this->load->view('panel', $panel, TRUE); $head['help'] = lang('ingame.help'); $head['menu'] = $this->load->view('menu_ingame', '', TRUE); $head['script'] = $this->load->view('market/market_ajax', $script, TRUE); $data['head'] = $this->load->view('head', $head, TRUE); $data['footer'] = $this->load->view('footer', '', TRUE); $data['is_society'] = $this->user->has_company(); $this->load->view('market/market', $data); } else { log_message('error', 'User with IP ' . $this->input->ip_address() . ' has tried to enter /market without loggin in.'); redirect('/'); } }
public function index() { if ($this->uri->segment(2)) { redirect('/'); } if ($this->session->userdata('logged_in')) { define('INGAME', TRUE); $this->output->enable_profiler($this->config->item('debug')); $this->lang->load('ingame'); $user = $this->user->data($this->session->userdata('user_id')); $country = $this->user->data($user->country, 'countries'); date_default_timezone_set($user->timezone); $panel['avatar'] = avatar($user, $this->lang->lang()); $panel['user'] = $user; $panel['exp_prcnt'] = exp_percent($user); $panel['l18n'] = l18n($this->lang->lang()); $panel['currency'] = $country->currency; $head['help'] = lang('ingame.help'); $head['menu'] = $this->load->view('menu_ingame', '', TRUE); $head['panel'] = $this->load->view('panel', $panel, TRUE); $data['user'] = $user; $data['head'] = $this->load->view('head', $head, TRUE); $data['footer'] = $this->load->view('footer', '', TRUE); $data['country'] = $country; $this->load->view('ingame', $data); } else { $this->output->enable_profiler($this->config->item('debug')); $this->lang->load('login'); $head['menu'] = $this->load->view('menu_outgame', '', TRUE); $data['head'] = $this->load->view('head', $head, TRUE); $data['footer'] = $this->load->view('footer', '', TRUE); $this->load->view('login', $data); } }