protected function get_data() { $data = parent::get_data(); $data['sets'] = Database::order('order', 'asc')->get_table('set'); if (empty($data['sets'])) { $data['sets'] = Grabber::get_set_list(); } return $data; }
public function __construct($url) { parent::__construct($url); if (empty($_GET['id']) || !is_numeric($_GET['id'])) { $this->redirect_location = '/admin/'; $this->create_redirect(); } else { $this->id = (int) $_GET['id']; } }
protected function get_data() { $data = parent::get_data(); $data['note'] = Database::order('n.time')->join('note', 'u.id = n.id_user')->get_full_table('user', 'n.id_game = ?', $this->game); foreach ($data['note'] as &$note) { $note['text'] = nl2br($note['text']); $md5 = md5($note['login']); $parts = array(hexdec($md5[0] . $md5[1]), hexdec($md5[2] . $md5[3]), hexdec($md5[4] . $md5[5])); foreach ($parts as &$part) { $part = dechex(ceil($part / 2)); if (strlen($part) == 1) { $part = '0' . $part; } } $note['color'] = implode($parts); } return $data; }
protected function get_list($type) { $data = parent::get_list($type); if ($type == 'js') { switch ($this->game['type']) { case 1: $type = 'draft'; break; case 2: $type = 'sealed'; break; case 3: $type = 'masters'; break; default: $type = 'draft'; } $data['game'] = $type; $data['gametime'] = filemtime(JS . SL . 'game' . SL . $type . '.js'); } return $data; }
protected function get_user() { return parent::get_user() == false; }