00001 <?php
00032 function __construct($channel_data) {
00033 $this->chanid = $channel_data['chanid'];
00034 $this->channum = $channel_data['channum'];
00035 $this->sourceid = $channel_data['sourceid'];
00036 $this->callsign = $channel_data['callsign'];
00037 $this->name = $channel_data['name'];
00038 $this->finetune = $channel_data['finetune'];
00039 $this->videofilters = $channel_data['videofilters'];
00040 $this->xmltvid = $channel_data['xmltvid'];
00041 $this->contrast = $channel_data['contrast'];
00042 $this->brightness = $channel_data['brightness'];
00043 $this->colour = $channel_data['colour'];
00044 $this->visible = $channel_data['visible'];
00045 $this->icon = 'data/tv_icons/'.basename($channel_data['icon']);
00046
00047 if ($channel_data['icon'] && !file_exists($this->icon)) {
00048
00049 if (file_exists($channel_data['icon']))
00050 copy($channel_data['icon'], $this->icon);
00051
00052 else {
00053
00054 $host = $GLOBALS['Master_Host'];
00055 $port = _or(get_backend_setting('BackendStatusPort', $GLOBALS['Master_Host']),
00056 get_backend_setting('BackendStatusPort'));
00057
00058 $data = @file_get_contents("http://$host:$port/Myth/GetChannelIcon"
00059 .'?ChanId='.$this->chanid
00060 );
00061 if ($data) {
00062 $iconfile = fopen($this->icon, 'wb');
00063 fwrite($iconfile, $data);
00064 fclose($iconfile);
00065 }
00066 unset($data);
00067 }
00068 }
00069
00070
00071 if (is_file($this->icon))
00072 $this->icon = root . $this->icon;
00073 else
00074 $this->icon = null;
00075 }
00076
00087