Пример #1
0
 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;
 }
Пример #2
0
 protected function get_data()
 {
     $data = parent::get_data();
     $this->game['booster'] = Database::join('set', 's.id = gs.id_set')->order('gs.order', 'asc')->get_table('game_set', 's.name, s.id, gs.state', 'gs.id_game = ?', $this->game['id']);
     foreach ($this->game['booster'] as &$booster) {
         $booster['name'] = str_replace("'", ''', $booster['name']);
     }
     if (empty($this->game['start']) || $this->game['start'] == '0000-00-00 00:00:00') {
         $this->game['start'] = 0;
     } else {
         $this->game['start'] = strtotime($this->game['start']);
     }
     $data['game'] = $this->game;
     return $data;
 }
Пример #3
0
 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;
 }