public function view($id = null) { if (empty($id)) { redirect('charts'); } else { if (Ranked_file::count(array('conditions' => array('id = ?', $id))) == 0) { redirect('charts'); } else { error_reporting(E_ALL ^ E_DEPRECATED ^ E_NOTICE ^ E_WARNING); $file = Ranked_file::find($id); $pack = Pack::find($file->pack_id); $this->data['user_scores'] = User_score::get_scores_for_chart($id); $this->data['pack'] = $pack; $this->data['subtitle'] = $file->title; $this->_process_everything($file->raw_file, $file->rate); } } }