Пример #1
0
 function __construct()
 {
     parent::__construct();
     $this->mTimenow = time() * 1000;
     if (!$this->input['debug']) {
         header('Content-Type: application/vnd.apple.mpegurl');
     }
     $channel_stream = $this->input['channel_stream'];
     if ($channel_stream) {
         $tmp = explode('_', $channel_stream);
         $this->input['channel'] = $tmp[0];
         $this->input['stream'] = $tmp[1];
     }
     $channel_id = addslashes($this->input['channel']);
     if (!@(include CACHE_DIR . 'channel/' . $channel_id . '.php')) {
         $this->db = hg_ConnectDB();
         include_once CUR_CONF_PATH . 'lib/channel.class.php';
         $mChannel = new channel();
         $mChannel->cache_channel($channel_id);
         @(include CACHE_DIR . 'channel/' . $channel_id . '.php');
     }
     if (!$channel_info['channel']) {
         $this->errorOutput('NO_CHANNEL_NAME');
     }
     if (!$channel_info['channel']['status']) {
         $this->errorOutput('CHANNEL_STOP');
     }
     $this->mChannelinfo = $channel_info;
     if ($this->input['stream']) {
         if (!array_key_exists($this->input['stream'], $this->mChannelinfo['stream'])) {
             $this->errorOutput('NO_STREAM_NAME');
         }
     }
 }
Пример #2
0
 public function get_shield_zone()
 {
     $channel_id = $this->input['channel_code'];
     $dates = $this->input['dates'];
     if (!$dates) {
         $dates = date('Y-m-d');
     }
     if (!@(include CACHE_DIR . 'channel/' . $channel_id . '.php')) {
         $this->db = hg_ConnectDB();
         include_once CUR_CONF_PATH . 'lib/channel.class.php';
         $mChannel = new channel();
         $mChannel->cache_channel($channel_id);
         @(include CACHE_DIR . 'channel/' . $channel_id . '.php');
     }
     if (!$channel_info['channel']) {
         $this->errorOutput('NO_CHANNEL_NAME');
     }
     if (!$channel_info['channel']['status']) {
         $this->errorOutput('CHANNEL_STOP');
     }
     $program_shield_dir = $this->settings['program_shield_dir'] ? $this->settings['program_shield_dir'] : 'program_shield';
     $dir = $dates;
     $cache_file = CACHE_DIR . $program_shield_dir . '/' . $dir . '/' . $channel_info['channel']['code'] . '.php';
     if (!@(include $cache_file)) {
         $this->db = hg_ConnectDB();
         include_once CUR_CONF_PATH . 'lib/program_shield.class.php';
         $mProgramShield = new programShield();
         $mProgramShield->cache_program_shield($channel_info['channel']['id'], $dates, $channel_info['channel']['code']);
         include $cache_file;
     }
     if (!$program_shield_zone) {
         $program_shield_zone = array();
     }
     foreach ($program_shield_zone as $v) {
         $this->addItem($v);
     }
     $this->output();
 }