-
diff --git a/classes/Cache.php b/classes/Cache.php
index 123ac5be..84812449 100644
a
|
b
|
class Cache { |
13 | 13 | public static function &get($key = null) { |
14 | 14 | $data = &Cache::$Instance->get($key); |
15 | 15 | if (!$data) |
16 | | return null; |
| 16 | $data = null; |
17 | 17 | return $data; |
18 | 18 | |
19 | 19 | } |
-
diff --git a/classes/Cache/Null.php b/classes/Cache/Null.php
index 83e0fe02..dc3c9479 100644
a
|
b
|
|
2 | 2 | |
3 | 3 | class Cache_Null implements Cache_Engine { |
4 | 4 | public function &get($key = null) { |
| 5 | $ret = null; |
5 | 6 | if (is_array($key)) { |
6 | 7 | $ret = array(); |
7 | 8 | foreach ($key as $k => $v) |
8 | 9 | $ret[$k] = &self::get($v); |
9 | | return $ret; |
10 | 10 | } |
11 | | return null; |
| 11 | return $ret; |
12 | 12 | } |
13 | 13 | |
14 | 14 | public function set($object, $data, $lifeLength) { |
-
diff --git a/classes/Modules.php b/classes/Modules.php
index a3ff620b..9badc7db 100644
a
|
b
|
class Modules implements Cache_Enabled { |
48 | 48 | |
49 | 49 | public static function getModule($module) { |
50 | 50 | self::load(); |
51 | | return self::$Modules[$module]; |
| 51 | return (isset(self::$Modules[$module])) ? self::$Modules[$module] : null; |
52 | 52 | } |
53 | 53 | |
54 | 54 | public static function getModuleProperty($module, $key) { |
-
diff --git a/classes/Translate.php b/classes/Translate.php
index 4bf038dd..97e766a3 100644
a
|
b
|
class Translate extends MythBase { |
95 | 95 | } |
96 | 96 | } |
97 | 97 | // Pull in the translated string (or default to $str if the translated string is '') |
98 | | if ($this->translations[$str]) |
| 98 | if (isset($this->translations[$str]) && $this->translations[$str]) |
99 | 99 | $str = $this->translations[$str]; |
100 | 100 | |
101 | 101 | // Nothing extra to print |
… |
… |
class Translate extends MythBase { |
134 | 134 | if (!isset($args)) |
135 | 135 | $args = array(t($int)); |
136 | 136 | // Return the appropriate translated string |
137 | | if ($a[$int-1]) |
| 137 | if (isset($a[$int-1])) |
138 | 138 | return $this->string($a[$int-1], $args); |
139 | 139 | return $this->string($a[count($a)-1], $args); |
140 | 140 | } |
… |
… |
class Translate extends MythBase { |
265 | 265 | **/ |
266 | 266 | private static function get_browser_lang() { |
267 | 267 | // default to "everything is acceptable", as RFC2616 specifies |
268 | | $alparts = explode(',', $_SERVER["HTTP_ACCEPT_LANGUAGE"] ? $_SERVER["HTTP_ACCEPT_LANGUAGE"] : '*'); |
269 | | $acparts = explode(',', $_SERVER["HTTP_ACCEPT_CHARSET"] ? $_SERVER["HTTP_ACCEPT_CHARSET"] : '*'); |
| 268 | $alparts = explode(',', isset($_SERVER["HTTP_ACCEPT_LANGUAGE"]) ? $_SERVER["HTTP_ACCEPT_LANGUAGE"] : '*'); |
| 269 | $acparts = explode(',', isset($_SERVER["HTTP_ACCEPT_CHARSET"]) ? $_SERVER["HTTP_ACCEPT_CHARSET"] : '*'); |
270 | 270 | // Parse the contents of the Accept-Language header. |
271 | 271 | $alscores = array(); |
272 | 272 | foreach($alparts as $part) { |
… |
… |
class Translate extends MythBase { |
300 | 300 | $acscores[strtoupper($part)]=1; |
301 | 301 | } |
302 | 302 | if ($acscores['ISO-8859-1'] == 2) |
303 | | $acscores['ISO-8859-1'] = $acscores['*'] ? $acscores['*'] : 1; |
| 303 | $acscores['ISO-8859-1'] = isset($acscores['*']) ? $acscores['*'] : 1; |
304 | 304 | /* |
305 | 305 | * Loop through the available languages/encodings, and pick the one |
306 | 306 | * with the highest score, excluding the ones with a charset the user |
… |
… |
class Translate extends MythBase { |
318 | 318 | continue; |
319 | 319 | $tmp = @explode('.', str_replace('_', '-', $encoding)); |
320 | 320 | $allang = strtolower($tmp[0]); |
321 | | $cs = strtoupper($tmp[1]); |
| 321 | $cs = isset($tmp[1]) ? strtoupper($tmp[1]) : ''; |
322 | 322 | $noct = explode('-', $allang); |
323 | 323 | $testvals = array( |
324 | | array($alscores[$allang], $acscores[$cs]), |
325 | | array($alscores[$noct[0]], $acscores[$cs]), |
326 | | array($alscores[$allang], $acscores['*']), |
327 | | array($alscores[$noct[0]], $acscores['*']), |
328 | | array($alscores['*'], $acscores[$cs]), |
329 | | array($alscores['*'], $acscores['*']) |
| 324 | array(isset($alscores[$allang]) ? $alscores[$allang] : 0, isset($acscores[$cs]) ? $acscores[$cs] : 0), |
| 325 | array(isset($alscores[$noct[0]]) ? $alscores[$noct[0]] : 0, isset($acscores[$cs]) ? $acscores[$cs] : 0), |
| 326 | array(isset($alscores[$allang]) ? $alscores[$allang] : 0, isset($acscores['*']) ? $acscores['*'] : 0), |
| 327 | array(isset($alscores[$noct[0]]) ? $alscores[$noct[0]] : 0, isset($acscores['*']) ? $acscores['*'] : 0), |
| 328 | array(isset($alscores['*']) ? $alscores['*'] : 0, isset($acscores[$cs]) ? $acscores[$cs] : 0), |
| 329 | array(isset($alscores['*']) ? $alscores['*'] : 0, isset($acscores['*']) ? $acscores['*'] : 0) |
330 | 330 | ); |
331 | 331 | // Scan through the possible test-match values until we find a valid set |
332 | 332 | foreach($testvals as $tval) { |
-
diff --git a/includes/class_autoload.php b/includes/class_autoload.php
index 83e3296b..05533383 100644
a
|
b
|
|
18 | 18 | include_once "classes/$className.php"; |
19 | 19 | elseif (file_exists(modules_path.'/'.module."/classes/$className.php")) |
20 | 20 | include_once modules_path.'/'.module."/classes/$className.php"; |
21 | | elseif (file_exists(modules_path.'/'.$Path[1]."/classes/$className.php")) |
| 21 | elseif (!empty($Path[1]) && file_exists(modules_path.'/'.$Path[1]."/classes/$className.php")) |
22 | 22 | include_once modules_path.'/'.$Path[1]."/classes/$className.php"; |
23 | 23 | elseif (file_exists(modules_path.'/'.$Path[0]."/classes/$className.php")) |
24 | 24 | include_once modules_path.'/'.$Path[0]."/classes/$className.php"; |
-
diff --git a/includes/config.php b/includes/config.php
index 470e0528..0fae634d 100644
a
|
b
|
|
39 | 39 | $_SESSION['guide_favonly'] = false; |
40 | 40 | |
41 | 41 | // The size of timeslots, in seconds (1800 = 30 minutes) |
42 | | if ($_SESSION['timeslot_size'] < 300) { |
| 42 | if (!isset($_SESSION['timeslot_size']) || $_SESSION['timeslot_size'] < 300) { |
43 | 43 | switch (tmpl) { |
44 | 44 | case 'wap': $_SESSION['timeslot_size'] = 900; break; |
45 | 45 | default: $_SESSION['timeslot_size'] = 300; break; |
… |
… |
|
48 | 48 | define('timeslot_size', $_SESSION['timeslot_size']); |
49 | 49 | |
50 | 50 | // The number of time slots to display in the channel listing |
51 | | if ($_SESSION['num_time_slots'] < 3) { |
| 51 | if (!isset($_SESSION['num_time_slots']) || $_SESSION['num_time_slots'] < 3) { |
52 | 52 | switch (tmpl) { |
53 | 53 | case 'wap': $_SESSION['num_time_slots'] = 12; break; |
54 | 54 | default: $_SESSION['num_time_slots'] = 36; break; |
… |
… |
|
57 | 57 | define('num_time_slots', $_SESSION['num_time_slots']); |
58 | 58 | |
59 | 59 | // How many timeslots to block together in headers and listing "now" rounds |
60 | | if ($_SESSION['timeslot_blocks'] < 1) |
| 60 | if (!isset($_SESSION['timeslot_blocks']) || $_SESSION['timeslot_blocks'] < 1) |
61 | 61 | $_SESSION['timeslot_blocks'] = 3; |
62 | 62 | define('timeslot_blocks', $_SESSION['timeslot_blocks']); |
63 | 63 | |
64 | 64 | // How many channels to skip between re-showing the timeslot bar |
65 | | if ($_SESSION['timeslotbar_skip'] < 5) |
| 65 | if (!isset($_SESSION['timeslotbar_skip']) || $_SESSION['timeslotbar_skip'] < 5) |
66 | 66 | $_SESSION['timeslotbar_skip'] = 20; |
67 | 67 | define('timeslotbar_skip', $_SESSION['timeslotbar_skip']); |
68 | 68 | |
69 | 69 | // maximum star rating for movies |
70 | | if ($_SESSION['max_stars'] < 3) |
| 70 | if (!isset($_SESSION['max_stars']) || $_SESSION['max_stars'] < 3) |
71 | 71 | $_SESSION['max_stars'] = 4; |
72 | 72 | define('max_stars', $_SESSION['max_stars']); |
73 | 73 | |
… |
… |
if (!isset($_SESSION['show_video_covers'])) |
99 | 99 | $_SESSION['show_video_covers'] = 1; |
100 | 100 | |
101 | 101 | // Screens |
102 | | if (!is_array($_SESSION['settings']['screens']['tv']['upcoming recordings'])) |
| 102 | if (!isset($_SESSION['settings']['screens']['tv']['upcoming recordings']) || !is_array($_SESSION['settings']['screens']['tv']['upcoming recordings'])) |
103 | 103 | $_SESSION['settings']['screens']['tv']['upcoming recordings'] = array('title' => 'on', 'channel' => 'on', 'record date' => 'on', 'length' => 'on'); |
-
diff --git a/includes/css.php b/includes/css.php
index c8f921bd..519369f2 100644
a
|
b
|
|
24 | 24 | // Recording classes? |
25 | 25 | $css_class[] = recstatus_class($item); |
26 | 26 | // Category type? |
27 | | if ($item->category_type && !preg_match('/unknown/i', $item->category_type)) |
| 27 | if (isset($item->category_type) && !preg_match('/unknown/i', $item->category_type)) |
28 | 28 | $css_class[] = 'type_'.preg_replace("/[^a-zA-Z0-9\-_]+/", '_', $item->category_type); |
29 | 29 | // Category cache |
30 | 30 | $category = strtolower($item->category); // user lowercase to avoid a little overhead later |
31 | 31 | static $cache = array(); |
32 | | if ($cache[$category]) |
| 32 | if (isset($cache[$category])) |
33 | 33 | $css_class[] = $cache[$category]; |
34 | 34 | // Scan the $Categories hash for any matches |
35 | 35 | else { |
… |
… |
|
50 | 50 | } |
51 | 51 | } |
52 | 52 | // No category found? |
53 | | if (!$cache[$category]) |
| 53 | if (!isset($cache[$category])) |
54 | 54 | $css_class[] = $cache[$category] = 'cat_Unknown'; |
55 | 55 | // Return |
56 | 56 | return preg_replace('/ +/', ' ', implode(' ', $css_class)); |
… |
… |
|
61 | 61 | * status. |
62 | 62 | **/ |
63 | 63 | function recstatus_class(&$item) { |
64 | | if ($item->recstatus && !strcasecmp(get_class($item), 'program')) { |
| 64 | if (isset($item->recstatus) && !strcasecmp(get_class($item), 'program')) { |
65 | 65 | switch ($item->recstatus) { |
66 | 66 | case 'ForceRecord': |
67 | 67 | return 'record_override_record'; |
-
diff --git a/includes/errordisplay.php b/includes/errordisplay.php
index 6c071400..4c379a63 100644
a
|
b
|
|
53 | 53 | function display_errors($leading='<p align="center">', $trailing = '</p>') { |
54 | 54 | global $Errors, $Warnings; |
55 | 55 | // Errors or warnings from a previous page? |
56 | | if (is_array($_SESSION['WARNINGS']) && count($_SESSION['WARNINGS'])) { |
| 56 | if (isset($_SESSION['WARNINGS']) && is_array($_SESSION['WARNINGS']) && count($_SESSION['WARNINGS'])) { |
57 | 57 | foreach ($_SESSION['WARNINGS'] as $warning) { |
58 | 58 | $Warnings[] = $warning; |
59 | 59 | } |
-
diff --git a/includes/errors.php b/includes/errors.php
index 9f160523..52e20ee0 100644
a
|
b
|
|
175 | 178 | array_shift($backtrace); |
176 | 179 | foreach ($backtrace as $layer) { |
177 | 180 | foreach (array('file', 'line', 'class', 'function', 'type', 'args') as $key) { |
178 | | $val = $layer[$key]; |
| 181 | $val = (isset($layer[$key])) ? $layer[$key] : ''; |
179 | 182 | $bt .= str_repeat(' ', max(8-strlen($key), 0)). "$key: "; |
180 | 183 | if (is_array($val) || is_object($val)) |
181 | 184 | $bt .= print_r($val, true); |
-
diff --git a/includes/lockdown.php b/includes/lockdown.php
index fe367944..265c5502 100644
a
|
b
|
|
11 | 11 | * |
12 | 12 | **/ |
13 | 13 | |
14 | | if ($_SERVER['MYTHWEB_LOCKDOWN_DISABLE'] != true) { |
| 14 | if (!isset($_SERVER['MYTHWEB_LOCKDOWN_DISABLE']) || $_SERVER['MYTHWEB_LOCKDOWN_DISABLE'] != true) { |
15 | 15 | if ( stristr('bot', $_SERVER['HTTP_USER_AGENT']) !== false |
16 | 16 | || stristr('spider', $_SERVER['HTTP_USER_AGENT']) !== false |
17 | 17 | || stristr('crawler', $_SERVER['HTTP_USER_AGENT']) !== false |
… |
… |
|
22 | 22 | touch('lockdown'); |
23 | 23 | } |
24 | 24 | |
25 | | if ( $_SERVER['MYTHWEB_LOCKDOWN_DISABLE'] != true && file_exists('lockdown')) |
| 25 | if ((!isset($_SERVER['MYTHWEB_LOCKDOWN_DISABLE']) || $_SERVER['MYTHWEB_LOCKDOWN_DISABLE'] != true) && file_exists('lockdown')) |
26 | 26 | tailored_error('lockdown'); |
-
diff --git a/includes/skin.php b/includes/skin.php
index 4afdae0f..eac5b2b5 100644
a
|
b
|
|
17 | 17 | */ |
18 | 18 | |
19 | 19 | // Figure out the template |
20 | | $tmpl = $_SESSION['tmpl']; |
| 20 | $tmpl = (isset($_SESSION['tmpl'])) ? $_SESSION['tmpl'] : ''; |
21 | 21 | |
22 | 22 | if (isset($_REQUEST['RESET_TMPL'])) |
23 | 23 | $tmpl = _or($_REQUEST['RESET_TMPL'], 'default'); |
… |
… |
|
32 | 32 | $tmpl = 'default'; |
33 | 33 | |
34 | 34 | // Figure out the skin |
35 | | $skin = $_SESSION['skin']; |
| 35 | $skin = (isset($_SESSION['skin'])) ? $_SESSION['skin'] : ''; |
36 | 36 | |
37 | 37 | if (isset($_REQUEST['RESET_SKIN'])) |
38 | 38 | $skin = _or($_REQUEST['RESET_SKIN'], 'default'); |
-
diff --git a/includes/sorting.php b/includes/sorting.php
index e307525b..c85958ca 100644
a
|
b
|
|
43 | 43 | if (!$session) |
44 | 44 | $session = $GLOBALS['last_sort_session']; |
45 | 45 | // Make sure this is an array |
46 | | if (!is_array($_SESSION[$session])) |
| 46 | if (!isset($_SESSION[$session]) || !is_array($_SESSION[$session])) |
47 | 47 | $_SESSION[$session] = array(); |
48 | 48 | // Make sure the field is lower case |
49 | 49 | $field = strtolower($field); |
… |
… |
|
70 | 70 | function sort_programs(&$programs, $session) { |
71 | 71 | $GLOBALS['last_sort_session'] = $session; |
72 | 72 | // First, check for a sort variable passed in by the user |
73 | | isset($_GET['reverse']) or $_GET['reverse'] = $_POST['reverse']; |
74 | | isset($_GET['sortby']) or $_GET['sortby'] = $_POST['sortby']; |
| 73 | isset($_GET['reverse']) or $_GET['reverse'] = isset($_POST['reverse']) ? $_POST['reverse'] : ''; |
| 74 | isset($_GET['sortby']) or $_GET['sortby'] = isset($_POST['sortby']) ? $_POST['sortby'] : ''; |
75 | 75 | // Now we build an array the user's sort preferences |
76 | | if (!is_array($_SESSION[$session]) || !count($_SESSION[$session])) |
| 76 | if (!isset($_SESSION[$session]) || !is_array($_SESSION[$session]) || !count($_SESSION[$session])) |
77 | 77 | $_SESSION[$session] = array(array('field' => 'airdate', |
78 | 78 | 'reverse' => false), |
79 | 79 | array('field' => 'title', |
-
diff --git a/includes/utils.php b/includes/utils.php
index 4e30d010..b1a638cf 100644
a
|
b
|
|
234 | 234 | **/ |
235 | 235 | function video_url($show, $ext = false) { |
236 | 236 | // URL override? |
237 | | if (!$ext && $_SESSION['file_url_override']) |
| 237 | if (!$ext && !empty($_SESSION['file_url_override'])) |
238 | 238 | return 'file://'.$_SESSION['file_url_override'].str_replace('%2F', '/', rawurlencode(basename($show->filename))); |
239 | 239 | // Which protocol should we use for downloads? |
240 | 240 | |
-
diff --git a/modules/_shared/tmpl/_errors/unknown_module.php b/modules/_shared/tmpl/_errors/unknown_module.php
index cc8b2826..c393aed5 100644
a
|
b
|
|
23 | 23 | |
24 | 24 | <h2>An unknown module was specified</h2> |
25 | 25 | |
| 26 | <?php if (isset($Path[0])) { ?> |
26 | 27 | <p> |
27 | 28 | <?php echo $Path[0] ?> |
28 | 29 | </p> |
| 30 | <?php } ?> |
29 | 31 | |
30 | 32 | </div> |
31 | 33 | |
-
diff --git a/modules/_shared/tmpl/default/header.php b/modules/_shared/tmpl/default/header.php
index 9360baf7..538b7faf 100644
a
|
b
|
EOF; |
143 | 143 | <?php |
144 | 144 | if (Modules::getModule('tv')) { |
145 | 145 | ?> |
146 | | <a id="tv_link"<?php if ($Path[0] == 'tv') echo ' class="current_section"' ?> href="tv" onmouseover="return help_text('<?php echo str_replace("'", "\\'", t('TV functions, including recorded programs.')) ?>')" onmouseout="return help_text()"> |
| 146 | <a id="tv_link"<?php if (!empty($Path[0]) && $Path[0] == 'tv') echo ' class="current_section"' ?> href="tv" onmouseover="return help_text('<?php echo str_replace("'", "\\'", t('TV functions, including recorded programs.')) ?>')" onmouseout="return help_text()"> |
147 | 147 | <img src="<?php echo skin_url ?>img/tv.png" class="alpha_png" alt="MythTV"> |
148 | 148 | <span style="display: none;"><?php echo t('Television'); ?></span> |
149 | 149 | </a> |
… |
… |
EOF; |
151 | 151 | } |
152 | 152 | if (Modules::getModule('music')) { |
153 | 153 | ?> |
154 | | <a id="music_link"<?php if ($Path[0] == 'music') echo ' class="current_section"' ?> href="music" onmouseover="return help_text('<?php echo str_replace("'", "\\'", t('MythMusic on the web.')) ?>')" onmouseout="return help_text()"> |
| 154 | <a id="music_link"<?php if (!empty($Path[0]) && $Path[0] == 'music') echo ' class="current_section"' ?> href="music" onmouseover="return help_text('<?php echo str_replace("'", "\\'", t('MythMusic on the web.')) ?>')" onmouseout="return help_text()"> |
155 | 155 | <img src="<?php echo skin_url ?>img/music.png" class="alpha_png" alt="MythMusic"> |
156 | 156 | <span style="display: none;"><?php echo t('Music'); ?></span> |
157 | 157 | </a> |
… |
… |
EOF; |
159 | 159 | } |
160 | 160 | if (Modules::getModule('video')) { |
161 | 161 | ?> |
162 | | <a id="video_link"<?php if ($Path[0] == 'video') echo ' class="current_section"' ?> href="video" onmouseover="return help_text('<?php echo str_replace("'", "\\'", t('MythVideo on the web.')) ?>')" onmouseout="return help_text()"> |
| 162 | <a id="video_link"<?php if (!empty($Path[0]) && $Path[0] == 'video') echo ' class="current_section"' ?> href="video" onmouseover="return help_text('<?php echo str_replace("'", "\\'", t('MythVideo on the web.')) ?>')" onmouseout="return help_text()"> |
163 | 163 | <img src="<?php echo skin_url ?>img/video.png" class="alpha_png" alt="MythVideo"> |
164 | 164 | <span style="display: none;"><?php echo t('Videos'); ?></span> |
165 | 165 | </a> |
… |
… |
EOF; |
167 | 167 | } |
168 | 168 | if (Modules::getModule('weather')) { |
169 | 169 | ?> |
170 | | <a id="weather_link"<?php if ($Path[0] == 'weather') echo ' class="current_section"' ?> href="weather" onmouseover="return help_text('<?php echo str_replace("'", "\\'", t('MythWeb Weather.')) ?>')" onmouseout="return help_text()"> |
| 170 | <a id="weather_link"<?php if (!empty($Path[0]) && $Path[0] == 'weather') echo ' class="current_section"' ?> href="weather" onmouseover="return help_text('<?php echo str_replace("'", "\\'", t('MythWeb Weather.')) ?>')" onmouseout="return help_text()"> |
171 | 171 | <img src="<?php echo skin_url ?>img/weather.png" class="alpha_png" alt="MythWeather"> |
172 | 172 | <span style="display: none;"><?php echo t('Weather'); ?></span> |
173 | 173 | </a> |
174 | 174 | <?php |
175 | 175 | } |
176 | 176 | ?> |
177 | | <a id="settings_link"<?php if ($Path[0] == 'settings') echo ' class="current_section"' ?> href="settings" onmouseover="return help_text('<?php echo str_replace("'", "\\'", t('Edit MythWeb and some MythTV settings.')) ?>')" onmouseout="return help_text()"> |
| 177 | <a id="settings_link"<?php if (!empty($Path[0]) && $Path[0] == 'settings') echo ' class="current_section"' ?> href="settings" onmouseover="return help_text('<?php echo str_replace("'", "\\'", t('Edit MythWeb and some MythTV settings.')) ?>')" onmouseout="return help_text()"> |
178 | 178 | <img src="<?php echo skin_url ?>img/settings.png" class="alpha_png" alt="<?php echo t('Settings') ?>"> |
179 | 179 | <span style="display: none;"><?php echo t('Settings'); ?></span> |
180 | 180 | </a> |
… |
… |
EOF; |
194 | 194 | <form action="tv/search" method="get"> |
195 | 195 | <div id="simple_search"> |
196 | 196 | <input type="hidden" name="type" value="q"> |
197 | | <input id="search_text" type="text" name="s" size="15" value="<?php echo html_entities($_SESSION['search']['s']) ?>"> |
| 197 | <input id="search_text" type="text" name="s" size="15" value="<?php echo html_entities(isset($_SESSION['search']['s']) ? $_SESSION['search']['s'] : '') ?>"> |
198 | 198 | <input id="search_submit" type="submit" class="submit" name="search" value="<?php echo t('Search') ?>"> |
199 | 199 | (<a href="tv/search"><?php echo t('Advanced') ?></a>) |
200 | 200 | </div> |
… |
… |
EOF; |
212 | 212 | <tr> |
213 | 213 | <td><div id="command_choices"> |
214 | 214 | <a href="" <?php |
215 | | echo show_popup('category_legend',$legend) |
| 215 | echo show_popup('category_legend', (isset($legend)) ? $legend : '') |
216 | 216 | ?>>MythTV:</a> |
217 | 217 | <?php if (Modules::getModule('tv')) { ?> |
218 | 218 | <a href="tv/list"><?php echo t('Listings') ?></a> |
-
diff --git a/modules/_shared/tmpl/default/welcome.php b/modules/_shared/tmpl/default/welcome.php
index 6d59072f..fb841285 100644
a
|
b
|
|
49 | 49 | // Print out the list of modules |
50 | 50 | foreach (Modules::getModules() as $id => $module) { |
51 | 51 | // Hidden module? |
52 | | if ($module['hidden']) |
| 52 | if (isset($module['hidden'])) |
53 | 53 | continue; |
54 | 54 | // Show this module |
55 | 55 | echo ' <li id="module_', $id, '"'; |
… |
… |
|
69 | 69 | // each module. |
70 | 70 | foreach (Modules::getModules() as $id => $module) { |
71 | 71 | // Hidden module? |
72 | | if ($module['hidden']) |
| 72 | if (isset($module['hidden'])) |
73 | 73 | continue; |
74 | 74 | require "modules/$id/tmpl/".tmpl.'/welcome.php'; |
75 | 75 | } |
-
diff --git a/modules/backend_log/handler.php b/modules/backend_log/handler.php
index e03b695d..0b2a4664 100644
a
|
b
|
|
10 | 10 | **/ |
11 | 11 | |
12 | 12 | // Where to start searching from |
13 | | $_GET['start'] = intVal($_GET['start']); |
| 13 | $_GET['start'] = isset($_GET['start']) ? intVal($_GET['start']) : 0; |
14 | 14 | if ($_GET['start'] < 1) |
15 | 15 | $_GET['start'] = 0; |
16 | 16 | |
17 | 17 | // How many entries to show? |
18 | | $_GET['show'] = intVal($_GET['show']); |
| 18 | $_GET['show'] = isset($_GET['show']) ? intVal($_GET['show']) : 0; |
19 | 19 | if ($_GET['show'] < 1) |
20 | 20 | $_GET['show'] = 100; |
21 | 21 | |
-
diff --git a/modules/backend_log/tmpl/default/backend_log.php b/modules/backend_log/tmpl/default/backend_log.php
index c1bf2385..8582fefd 100644
a
|
b
|
|
23 | 23 | <tr class="header"> |
24 | 24 | <th>row</th> |
25 | 25 | <?php |
26 | | foreach (array_keys($Logs[0]) as $key) |
27 | | echo "<th>$key</th>\n"; |
| 26 | if (!empty($Logs)) { |
| 27 | foreach (array_keys($Logs[0]) as $key) |
| 28 | echo "<th>$key</th>\n"; |
| 29 | } |
28 | 30 | ?> |
29 | 31 | </tr> |
30 | 32 | </thead> |
-
diff --git a/modules/database/set_settings.php b/modules/database/set_settings.php
index 2eccb0e8..b30543bc 100644
a
|
b
|
|
9 | 9 | |
10 | 10 | $tables = $db->query('SHOW TABLES'); |
11 | 11 | while ($table = $tables->fetch_col()) { |
12 | | if ($_REQUEST['action'] == t('Optimize Tables')) { |
| 12 | if (isset($_REQUEST['action']) && $_REQUEST['action'] == t('Optimize Tables')) { |
13 | 13 | $db->query("OPTIMIZE TABLE $table"); |
14 | 14 | $db->query("ANALYZE TABLE $table"); |
15 | 15 | } |
16 | 16 | |
17 | | if ($_REQUEST['action'] == t('Repair Tables')) |
| 17 | if (isset($_REQUEST['action']) && $_REQUEST['action'] == t('Repair Tables')) |
18 | 18 | $db->query("REPAIR TABLE $table"); |
19 | 19 | |
20 | | if ($_REQUEST['action'] != t('Extended Check')) |
| 20 | if (isset($_REQUEST['action']) && $_REQUEST['action'] != t('Extended Check')) |
21 | 21 | $Tables[$table]['check'] = $db->query_assoc("CHECK TABLE $table"); |
22 | 22 | else |
23 | 23 | $Tables[$table]['check'] = $db->query_assoc("CHECK TABLE $table EXTENDED"); |
-
diff --git a/modules/music/handler.php b/modules/music/handler.php
index 516609e5..6f05264f 100644
a
|
b
|
|
10 | 10 | **/ |
11 | 11 | |
12 | 12 | // Raw passthrough? |
13 | | if (substr($Path[1], -3) == '.js') { |
| 13 | if (!empty($Path[1]) && substr($Path[1], -3) == '.js') { |
14 | 14 | readfile('modules/music/'.$Path[1]); |
15 | 15 | exit; |
16 | 16 | } |
17 | 17 | |
18 | 18 | // Load the modules we'll need |
19 | | if (in_array($Path[1], array('mp3act_js.js.php', 'mp3act_hidden.php'))) { |
| 19 | if (!empty($Path[1]) && in_array($Path[1], array('mp3act_js.js.php', 'mp3act_hidden.php'))) { |
20 | 20 | require_once 'modules/music/'.$Path[1]; |
21 | 21 | exit; |
22 | 22 | } |
23 | 23 | |
24 | 24 | // Streaming handler will exit on its own |
25 | | if ($Path[1] == 'stream') { |
| 25 | if (!empty($Path[1]) && $Path[1] == 'stream') { |
26 | 26 | require_once 'modules/music/stream.php'; |
27 | 27 | } |
28 | 28 | |
-
diff --git a/modules/music/mp3act_functions.php b/modules/music/mp3act_functions.php
index f0e9f37b..96766b70 100644
a
|
b
|
function playlistInfo() |
1225 | 1225 | } |
1226 | 1226 | else |
1227 | 1227 | { |
1228 | | if (1 == $pl['count']) |
| 1228 | if (isset($pl['count']) && 1 == $pl['count']) |
1229 | 1229 | $info .= sprintf(t('%s Song (%s)'), $pl['songcount'], $pl['length']); |
1230 | 1230 | else |
1231 | 1231 | $info .= sprintf(t('%s Songs (%s)'), $pl['songcount'], $pl['length']); |
… |
… |
function getPlaylistM3u($id, $quality, $depth = 0) |
1595 | 1595 | $query = 'SELECT ms.song_id, artist_name, ms.name, (ms.length/1000) AS length '. |
1596 | 1596 | 'FROM music_songs AS ms '. |
1597 | 1597 | 'LEFT JOIN music_artists AS mt ON ms.artist_id=mt.artist_id '. |
1598 | | 'WHERE ms.song_id IN ('.$db->escape($pl['playlist_songs']).')'; |
| 1598 | 'WHERE ms.song_id IN (' . preg_replace('/[^0-9,]/', '', $pl['playlist_songs']) . ')'; |
1599 | 1599 | |
1600 | 1600 | $song_info = array(); |
1601 | 1601 | $sh = $db->query($query); |
… |
… |
function getPlaylistM3u($id, $quality, $depth = 0) |
1611 | 1611 | $songs = explode(',', $pl['playlist_songs']); |
1612 | 1612 | foreach ($songs as $song_id) |
1613 | 1613 | { |
1614 | | if ($song_id > 0) |
| 1614 | if ($song_id > 0 && isset($song_info[$song_id])) |
1615 | 1615 | { |
1616 | 1616 | $row = $song_info[$song_id]; |
1617 | 1617 | $tmp .= '#EXTINF:'.intval($row['length']).','.utf8_decode($row['artist_name']).' - '.utf8_decode($row['name'])."\n"; |
… |
… |
function play($type, $id, $quality = 'high') |
1672 | 1672 | if($tmp == '') |
1673 | 1673 | return ''; |
1674 | 1674 | |
1675 | | session_cache_limiter('nocache'); |
1676 | 1675 | header('Content-Type: audio/mpegurl;'); |
1677 | 1676 | header('Content-Disposition: inline; filename="playlist.m3u"'); |
1678 | | header('Expires: 0'); |
1679 | | header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); |
1680 | | header('Pragma: nocache'); |
| 1677 | header('Expires: Thu, 19 Nov 1981 08:52:00 GMT'); |
| 1678 | header('Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0'); |
| 1679 | header('Pragma: no-cache'); |
1681 | 1680 | |
1682 | 1681 | return "#EXTM3U\n".$tmp; |
1683 | 1682 | } |
-
diff --git a/modules/music/mp3act_hidden.php b/modules/music/mp3act_hidden.php
index 3664ba57..f85d8e35 100644
a
|
b
|
|
3 | 3 | require_once('modules/music/mp3act_functions.php'); |
4 | 4 | |
5 | 5 | // Play the Music |
6 | | if ('' != $_GET['id']) |
7 | | echo play($_GET['type'], $_GET['id'], $_GET['quality']); |
8 | | |
| 6 | if (isset($_GET['id']) && '' != $_GET['id']) |
| 7 | echo play( |
| 8 | isset($_GET['type']) ? $_GET['type'] : null, |
| 9 | isset($_GET['id']) ? $_GET['id'] : null, |
| 10 | isset($_GET['quality']) ? $_GET['quality'] : null |
| 11 | ); |
| 12 | else { |
| 13 | echo "Missing ID"; |
| 14 | exit; |
| 15 | } |
-
diff --git a/modules/music/mp3act_main.php b/modules/music/mp3act_main.php
index 1b4b0a2e..b7cee1f8 100644
a
|
b
|
|
29 | 29 | |
30 | 30 | <script type="text/javascript"> |
31 | 31 | var page = 'search'; |
32 | | var mode = '<?php echo $_SESSION['sess_playmode']; ?>'; |
| 32 | var mode = '<?php echo (isset($_SESSION['sess_playmode'])) ? $_SESSION['sess_playmode'] : ''; ?>'; |
33 | 33 | var bc_parenttype = ''; |
34 | 34 | var bc_parentitem = ''; |
35 | 35 | var bc_childtype = ''; |
-
diff --git a/modules/music/stream.php b/modules/music/stream.php
index 88b38fc2..30f5e1b4 100644
a
|
b
|
|
15 | 15 | set_time_limit(0); |
16 | 16 | |
17 | 17 | // Album art? |
18 | | if ($_GET['a']) { |
| 18 | if (isset($_GET['a'])) { |
19 | 19 | list($path, $fname) = $db->query_row('SELECT md.path, ma.filename |
20 | 20 | FROM music_albumart AS ma |
21 | 21 | LEFT JOIN music_directories AS md |
… |
… |
|
29 | 29 | } |
30 | 30 | |
31 | 31 | // Music? |
32 | | elseif ($_GET['i']) { |
| 32 | elseif (isset($_GET['i'])) { |
33 | 33 | // Load some info about the song |
34 | 34 | list($path, $fname) = $db->query_row('SELECT md.path, ms.filename |
35 | 35 | FROM music_songs AS ms |
-
diff --git a/modules/mythtv/set_keys.php b/modules/mythtv/set_keys.php
index 9889d890..2171a2b6 100644
a
|
b
|
|
28 | 28 | $sh->finish(); |
29 | 29 | |
30 | 30 | // Make sure we have a valid host selected |
31 | | if (!isset($Settings_Hosts[$_SESSION['settings']['host']])) |
32 | | $_SESSION['settings']['host'] = reset(array_keys($Settings_Hosts)); |
| 31 | if (!isset($_SESSION['settings']['host']) || !isset($Settings_Hosts[$_SESSION['settings']['host']])) |
| 32 | { |
| 33 | $hosts = array_keys($Settings_Hosts); |
| 34 | $_SESSION['settings']['host'] = reset($hosts); |
| 35 | } |
33 | 36 | // Save? |
34 | | elseif ($_POST['save'] && $_POST['host']) { |
| 37 | elseif (isset($_POST['save']) && isset($_POST['host'])) { |
35 | 38 | foreach ($_POST['jump'] as $dest => $key_list) { |
36 | 39 | $db->query('UPDATE jumppoints |
37 | 40 | SET keylist=? |
-
diff --git a/modules/mythtv/set_settings.php b/modules/mythtv/set_settings.php
index 8ae4cfdc..9fa9066f 100644
a
|
b
|
|
20 | 20 | $sh->finish(); |
21 | 21 | |
22 | 22 | // Make sure we have a valid host selected |
23 | | if (!isset($Settings_Hosts[$_SESSION['settings']['host']])) |
24 | | $_SESSION['settings']['host'] = reset(array_keys($Settings_Hosts)); |
| 23 | if (!isset($_SESSION['settings']['host']) || !isset($Settings_Hosts[$_SESSION['settings']['host']])) { |
| 24 | $hosts = array_keys($Settings_Hosts); |
| 25 | $_SESSION['settings']['host'] = reset($hosts); |
| 26 | } |
25 | 27 | // Save? |
26 | | elseif ($_POST['save'] && isset($_POST['host'])) { |
| 28 | elseif (isset($_POST['save']) && isset($_POST['host'])) { |
27 | 29 | foreach ($_POST['settings'] as $value => $data) { |
28 | 30 | setting($value, _or($_POST['host'], null), $data); |
29 | 31 | } |
-
diff --git a/modules/mythtv/tmpl/default/set_settings.php b/modules/mythtv/tmpl/default/set_settings.php
index 409f0078..135a2970 100644
a
|
b
|
|
10 | 10 | **/ |
11 | 11 | ?> |
12 | 12 | <form class="form" method="post" action="<?php echo form_action ?>"> |
13 | | <input type="hidden" name="host" value="<?php echo html_entities($_SESSION['settings']['host']) ?>" /> |
| 13 | <input type="hidden" name="host" value="<?php echo html_entities(isset($_SESSION['settings']['host']) ? $_SESSION['settings']['host'] : '') ?>" /> |
14 | 14 | |
15 | 15 | <table border="0" cellpadding="4" cellspacing="2" class="list small" align="center"> |
16 | 16 | <tr class="menu" align="center"> |
-
diff --git a/modules/mythweb/set_defaults.php b/modules/mythweb/set_defaults.php
index 3c14431b..e2118f70 100644
a
|
b
|
|
10 | 10 | **/ |
11 | 11 | |
12 | 12 | // Save? |
13 | | if ($_POST['save']) { |
| 13 | if (isset($_POST['save'])) { |
14 | 14 | // Some global mythweb settings |
15 | 15 | $_SESSION['prefer_channum'] = setting('WebPrefer_Channum', null, $_POST['prefer_channum'] ? 1 : 0); |
16 | 16 | $_SESSION['show_popup_info'] = $_POST['show_popup_info'] ? 1 : 0; |
… |
… |
|
21 | 21 | $_SESSION['cache_engine'] = $_POST['cache_engine']; |
22 | 22 | } |
23 | 23 | |
24 | | if ($_POST['set_current_session_as_default']) |
| 24 | if (isset($_POST['set_current_session_as_default'])) |
25 | 25 | sess_write('default', session_encode()); |
26 | | elseif ($_POST['clear_current_default_session']) |
| 26 | elseif (isset($_POST['clear_current_default_session'])) |
27 | 27 | sess_destroy('default'); |
28 | 28 | |
29 | 29 | // These settings are limited to MythWeb itself |
-
diff --git a/modules/mythweb/set_flvplayer.php b/modules/mythweb/set_flvplayer.php
index 5f2cc905..875d5bd0 100644
a
|
b
|
|
10 | 10 | **/ |
11 | 11 | |
12 | 12 | // Save? |
13 | | if ($_POST['save']) { |
| 13 | if (isset($_POST['save'])) { |
14 | 14 | // Validaton |
15 | 15 | if ($_POST['width'] < 1) |
16 | 16 | $_POST['width'] = 320; |
-
diff --git a/modules/mythweb/set_recommend.php b/modules/mythweb/set_recommend.php
index 14c693f3..2015de99 100644
a
|
b
|
|
10 | 10 | **/ |
11 | 11 | |
12 | 12 | // Save? |
13 | | if ($_POST['save']) { |
| 13 | if (isset($_POST['save'])) { |
14 | 14 | setting('recommend_enabled', null, isset($_POST['recommend_enabled']) ? $_POST['recommend_enabled'] : 0); |
15 | 15 | setting('recommend_server', null, $_POST['recommend_server']); |
16 | 16 | setting('recommend_key', null, $_POST['recommend_key']); |
-
diff --git a/modules/mythweb/set_session.php b/modules/mythweb/set_session.php
index b649c4ff..7d39bd70 100644
a
|
b
|
|
10 | 10 | **/ |
11 | 11 | |
12 | 12 | // Save? |
13 | | if ($_POST['save']) { |
| 13 | if (isset($_POST['save'])) { |
14 | 14 | // Save the template |
15 | 15 | if (isset($_POST['tmpl'])) |
16 | 16 | $_SESSION['tmpl'] = $_POST['tmpl']; |
-
diff --git a/modules/settings/handler.php b/modules/settings/handler.php
index 3eae7f03..9ca763fb 100644
a
|
b
|
|
15 | 15 | } |
16 | 16 | |
17 | 17 | // Restore the last used path? |
18 | | if (empty($Path[1]) && is_array($_SESSION['settings']['last'])) |
| 18 | if (empty($Path[1]) && isset($_SESSION['settings']['last']) && is_array($_SESSION['settings']['last'])) |
19 | 19 | array_splice($Path, 1, count($Path), $_SESSION['settings']['last']); |
20 | 20 | |
21 | 21 | // Empty or unknown module? |
… |
… |
|
77 | 77 | .'<select name="settings_host" onchange="$(\'host_form\').submit()">'; |
78 | 78 | foreach ($Settings_Hosts as $host => $name) { |
79 | 79 | $s .= '<option value="'.html_entities($host).'"'; |
80 | | if ($host == $_SESSION['settings']['host']) |
| 80 | if (isset($_SESSION['settings']['host']) && $host == $_SESSION['settings']['host']) |
81 | 81 | $s .= ' SELECTED'; |
82 | 82 | $s .= '>'.html_entities($name).'</option>'; |
83 | 83 | } |
-
diff --git a/modules/status/handler.php b/modules/status/handler.php
index 0ad2852b..f45cf354 100644
a
|
b
|
|
15 | 15 | $statusport = setting('BackendStatusPort', '%'); |
16 | 16 | |
17 | 17 | // XML mode? |
18 | | $xml_param = ($Path[1] == 'xml') ? '/xml' : '/GetStatusHTML'; |
| 18 | $xml_param = (!empty($Path[1]) && $Path[1] == 'xml') ? '/xml' : '/GetStatusHTML'; |
19 | 19 | |
20 | 20 | // Make sure the content is interpreted as UTF-8 |
21 | 21 | header('Content-Type: text/html; charset=UTF-8'); |
-
diff --git a/modules/stream/set_protocol.php b/modules/stream/set_protocol.php
index 6c5882b6..fd4ddd69 100644
a
|
b
|
|
10 | 10 | **/ |
11 | 11 | |
12 | 12 | // Save? |
13 | | if ($_POST['save']) { |
| 13 | if (isset($_POST['save'])) { |
14 | 14 | // Save the protocol choice |
15 | 15 | $_SESSION['stream']['force_http'] = $_REQUEST['force_http'] ? true : false; |
16 | 16 | $_SESSION['stream']['include_user_and_password'] = $_REQUEST['include_user_and_password'] ? true : false;; |
-
diff --git a/modules/stream/tmpl/default/set_protocol.php b/modules/stream/tmpl/default/set_protocol.php
index 0db69c7f..61c87de2 100644
a
|
b
|
|
19 | 19 | <table border="0" cellspacing="0" cellpadding="0"> |
20 | 20 | <tr class="x-sep"> |
21 | 21 | <th><label for="force_http"><?php echo t('Force HTTP for streams') ?>:</label></th> |
22 | | <td><input type="checkbox" id="force_http" name="force_http" value="1"<?php if ($_SESSION['stream']['force_http']) echo ' CHECKED' ?>></td> |
| 22 | <td><input type="checkbox" id="force_http" name="force_http" value="1"<?php if (isset($_SESSION['stream']['force_http'])) echo ' CHECKED' ?>></td> |
23 | 23 | </tr><tr class="x-sep"> |
24 | 24 | <th><label for="force_http_port"><?php echo t('Force HTTP/HTTPS port for streams'); ?>:</label></th> |
25 | | <td><input type="text" id="force_http_port" name="force_http_port" value="<?php echo $_SESSION['stream']['force_http_port'] ?>"></td> |
| 25 | <td><input type="text" id="force_http_port" name="force_http_port" value="<?php echo (isset($_SESSION['stream']['force_http_port'])) ? $_SESSION['stream']['force_http_port'] : '' ?>"></td> |
26 | 26 | </tr><tr> |
27 | 27 | <th><label for="include_user_and_password"><?php echo t('Embed HTTP basic auth user name/password into stream urls') ?>:</label></th> |
28 | | <td><input type="checkbox" id="include_user_and_password" name="include_user_and_password" value="1"<?php if ($_SESSION['stream']['include_user_and_password']) echo ' CHECKED' ?>></td> |
| 28 | <td><input type="checkbox" id="include_user_and_password" name="include_user_and_password" value="1"<?php if (isset($_SESSION['stream']['include_user_and_password'])) echo ' CHECKED' ?>></td> |
29 | 29 | </tr><tr class="x-sep"> |
30 | 30 | <td align="center"><input type="reset" class="submit" value="<?php echo t('Reset') ?>"></td> |
31 | 31 | <td align="center"><input type="submit" class="submit" name="save" value="<?php echo t('Save') ?>"></td> |
-
diff --git a/modules/tv/classes/Program.php b/modules/tv/classes/Program.php
index 1de5c777..a7c3f011 100644
a
|
b
|
class Program extends MythBase { |
72 | 72 | public $recording = false; |
73 | 73 | public $starstring; |
74 | 74 | public $url; |
| 75 | public $previouslyshown = 0; |
| 76 | public $recstatus = 0; |
| 77 | public $syndicatedepisodenumber = ''; |
| 78 | public $inputid = 0; |
| 79 | public $recendts = 0; |
| 80 | public $rectype = 0; |
75 | 81 | // recent/pending jobqueue entries |
76 | 82 | public $jobs = array(); |
77 | 83 | // Jobs this program can be assigned to |
… |
… |
class Program extends MythBase { |
180 | 186 | $this->colorcode = $data['colorcode']; |
181 | 187 | $this->syndicatedepisodenumber = $data['syndicatedepisodenumber']; |
182 | 188 | $this->title_pronounce = $data['title_pronounce']; |
183 | | $this->recstatus = $data['recstatus']; |
184 | | $this->recordedid = $data['recordedid']; |
| 189 | $this->recstatus = isset($data['recstatus']) ? $data['recstatus'] : 0; |
| 190 | $this->recordedid = isset($data['recordedid']) ? $data['recordedid'] : 0; |
185 | 191 | |
186 | 192 | // These db fields should really get renamed... |
187 | 193 | $this->audioproperties = $data['stereo']; |
… |
… |
class Program extends MythBase { |
229 | 235 | $this->recordedid); |
230 | 236 | } |
231 | 237 | // Turn recstatus into a word |
232 | | if (isset($this->recstatus) && $GLOBALS['RecStatus_Types'][$this->recstatus]) { |
| 238 | if (isset($this->recstatus) && isset($GLOBALS['RecStatus_Types'][$this->recstatus])) { |
233 | 239 | $this->recstatus_orig = $this->recstatus; |
234 | 240 | $this->recstatus = $GLOBALS['RecStatus_Types'][$this->recstatus]; |
235 | 241 | $this->conflicting = ($this->recstatus == 'Conflict'); # conflicts with another scheduled recording? |
… |
… |
class Program extends MythBase { |
261 | 267 | |
262 | 268 | public function merge($prog) { |
263 | 269 | foreach (get_object_vars($prog) as $name => $value) { |
264 | | if ($value && !$this->$name) { |
| 270 | if ($value && !isset($this->$name)) { |
265 | 271 | $this->$name = $value; |
266 | 272 | } |
267 | 273 | } |
… |
… |
class Program extends MythBase { |
712 | 718 | * |
713 | 719 | * @return array sorted list of category_type fields from the program table |
714 | 720 | **/ |
715 | | public function category_types() { |
| 721 | public static function category_types() { |
716 | 722 | static $cache = array(); |
717 | 723 | if (empty($cache)) { |
718 | 724 | global $db; |
… |
… |
class Program extends MythBase { |
728 | 734 | * |
729 | 735 | * @return array sorted list of category fields from the program table |
730 | 736 | **/ |
731 | | public function categories() { |
| 737 | public static function categories() { |
732 | 738 | static $cache = array(); |
733 | 739 | if (empty($cache)) { |
734 | 740 | global $db; |
-
diff --git a/modules/tv/classes/Schedule.php b/modules/tv/classes/Schedule.php
index e71feadd..5200e354 100644
a
|
b
|
class Schedule extends MythBase { |
103 | 103 | public static function findAll($sort = true) { |
104 | 104 | global $db; |
105 | 105 | $orderby = ''; |
106 | | if ($sort && is_array($_SESSION['schedules_sortby']) && count($_SESSION['schedules_sortby'])) { |
| 106 | if ($sort && isset($_SESSION['schedules_sortby']) && is_array($_SESSION['schedules_sortby']) && count($_SESSION['schedules_sortby'])) { |
107 | 107 | $orderby = 'ORDER BY '; |
108 | 108 | foreach ($_SESSION['schedules_sortby'] AS $key => $sort) { |
109 | 109 | if ($key > 0) |
… |
… |
class Schedule extends MythBase { |
223 | 223 | $this->will_record = ($this->type && $this->type != rectype_dontrec) ? true : false; |
224 | 224 | |
225 | 225 | // Turn type into a word |
226 | | $this->texttype = $GLOBALS['RecTypes'][$this->type]; |
| 226 | $this->texttype = (isset($GLOBALS['RecTypes'][$this->type])) ? $GLOBALS['RecTypes'][$this->type] : ''; |
227 | 227 | |
228 | 228 | // Do we have a chanid? Load some info about it |
229 | 229 | if ($this->chanid > 0 && !isset($this->channel)) |
-
diff --git a/modules/tv/detail.php b/modules/tv/detail.php
index 7ce8c6d1..132297f8 100644
a
|
b
|
|
17 | 17 | } |
18 | 18 | |
19 | 19 | // Use the new directory structure? |
20 | | if (!$_REQUEST['chanid'] && !$_REQUEST['starttime']) { |
21 | | $_REQUEST['chanid'] = $Path[2]; |
22 | | $_REQUEST['starttime'] = $Path[3]; |
23 | | $_REQUEST['manualid'] = $Path[4]; |
| 20 | if (!isset($_REQUEST['chanid']) && !isset($_REQUEST['starttime'])) { |
| 21 | $_REQUEST['chanid'] = !empty($Path[2]) ? $Path[2] : ''; |
| 22 | $_REQUEST['starttime'] = !empty($Path[3]) ? $Path[3] : ''; |
| 23 | $_REQUEST['manualid'] = !empty($Path[4]) ? $Path[4] : ''; |
24 | 24 | } |
25 | 25 | // Just in case |
26 | 26 | $_GET['chanid'] = intVal($_REQUEST['chanid']); |
… |
… |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | // Auto-expire -- only available for javascript templates |
48 | | if (isset($_REQUEST['toggle_autoexpire']) && $_GET['chanid'] && $_GET['starttime']) { |
| 48 | if (isset($_REQUEST['toggle_autoexpire']) && isset($_GET['chanid']) && isset($_GET['starttime'])) { |
49 | 49 | $sh = $db->query('UPDATE recorded |
50 | 50 | SET autoexpire = ? |
51 | 51 | WHERE chanid = ? AND starttime = FROM_UNIXTIME(?)', |
… |
… |
|
87 | 87 | // Get the schedule for this recording, if one exists |
88 | 88 | if ($program->recordid) |
89 | 89 | $schedule =& Schedule::find($program->recordid); |
90 | | elseif ($_GET['recordid']) |
| 90 | elseif (isset($_GET['recordid'])) |
91 | 91 | $schedule =& Schedule::find($_GET['recordid']); |
92 | 92 | else |
93 | 93 | $schedule = new Schedule(NULL); |
… |
… |
|
100 | 100 | |
101 | 101 | // Make sure this is a valid program. If not, forward the user back to the listings page |
102 | 102 | if (!strlen($program->starttime) && !$schedule->recordid) { |
103 | | if ($_GET['recordid']) { |
| 103 | if (isset($_GET['recordid'])) { |
104 | 104 | add_warning(t('Unknown Recording Schedule.')); |
105 | 105 | header('Location: '.root_url.'tv/schedules'); |
106 | 106 | } |
… |
… |
|
132 | 132 | } |
133 | 133 | |
134 | 134 | // Queue a job? |
135 | | if ($program && $program->filename && $_REQUEST['job']) { |
| 135 | if ($program && $program->filename && isset($_REQUEST['job'])) { |
136 | 136 | $host = ""; |
137 | 137 | if (setting("JobsRunOnRecordHost")){ |
138 | 138 | $host = $program->hostname; |
… |
… |
|
255 | 255 | redirect_browser(root.'tv/detail?recordid='.$schedule->recordid); |
256 | 256 | redirect_browser(root_url.'tv/detail/'.$program->chanid.'/'.$program->starttime); |
257 | 257 | } |
258 | | elseif ($_REQUEST['forget_old']) { |
| 258 | elseif (isset($_REQUEST['forget_old'])) { |
259 | 259 | $program->rec_forget_old(); |
260 | 260 | // Redirect back to the page again, but without the query string, so reloads are cleaner |
261 | 261 | redirect_browser(root_url.'tv/detail/'.$program->chanid.'/'.$program->starttime); |
-
diff --git a/modules/tv/handler.php b/modules/tv/handler.php
index 7158f7d5..99a5aeaa 100644
a
|
b
|
|
23 | 23 | // Call the opensearch module early, before loading all kinds of stuff it |
24 | 24 | // doesn't need. Plus, it's not "enabled" like other modules, so we skip that |
25 | 25 | // check, too. |
26 | | if ($Path[1] == 'opensearch') |
| 26 | if (!empty($Path[1]) && $Path[1] == 'opensearch') |
27 | 27 | require_once 'modules/tv/opensearch.php'; |
28 | 28 | |
29 | | if ($Path[1] == 'get_pixmap') |
| 29 | if (!empty($Path[1]) && $Path[1] == 'get_pixmap') |
30 | 30 | require_once 'modules/tv/get_pixmap.php'; |
31 | 31 | |
32 | 32 | /** |
… |
… |
|
57 | 57 | require_once 'includes/recording_schedules.php'; |
58 | 58 | |
59 | 59 | // Restore the last used path? |
60 | | if (empty($Path[1]) && is_array($_SESSION['tv']['last'])) |
| 60 | if (empty($Path[1]) && isset($_SESSION['tv']['last']) && is_array($_SESSION['tv']['last'])) |
61 | 61 | array_splice($Path, 1, count($Path), $_SESSION['tv']['last']); |
62 | 62 | |
63 | 63 | // Flash player? |
64 | | if (preg_match('/\.swf/', $Path[1])) { |
| 64 | if (!empty($Path[1]) && preg_match('/\.swf/', $Path[1])) { |
65 | 65 | header('Content-Type: application/x-shockwave-flash'); |
66 | 66 | readfile('modules/tv/'.$Path[1]); |
67 | 67 | exit; |
68 | 68 | } |
69 | 69 | |
70 | 70 | // Unknown section? Use the default |
71 | | if (!file_exists('modules/tv/'.$Path[1].'.php')) |
| 71 | if (empty($Path[1]) || !file_exists('modules/tv/'.$Path[1].'.php')) |
72 | 72 | $Path[1] = 'list'; |
73 | 73 | |
74 | 74 | // Keep track of this path for the next visit |
-
diff --git a/modules/tv/includes/programs.php b/modules/tv/includes/programs.php
index 917bb573..8034e103 100644
a
|
b
|
|
63 | 63 | **/ |
64 | 64 | function &load_one_program($start_time, $chanid, $manualid) { |
65 | 65 | if ($manualid) |
66 | | $program =& load_all_program_data($start_time, $start_time, $chanid, true, 'program.manualid='.intval($manualid)); |
| 66 | $program = load_all_program_data($start_time, $start_time, $chanid, true, 'program.manualid='.intval($manualid)); |
67 | 67 | else |
68 | | $program =& load_all_program_data($start_time, $start_time, $chanid, true); |
| 68 | $program = load_all_program_data($start_time, $start_time, $chanid, true); |
69 | 69 | if (!is_object($program) || strcasecmp(get_class($program), 'program')) |
70 | | return NULL; |
| 70 | $program = null; |
71 | 71 | return $program; |
72 | 72 | } |
73 | 73 | |
… |
… |
|
155 | 155 | // No results |
156 | 156 | if ($sh->num_rows() < 1) { |
157 | 157 | $sh->finish(); |
158 | | return array(); |
| 158 | $return_val = array(); |
| 159 | return $return_val; |
159 | 160 | } |
160 | 161 | // Build two separate queries for optimized selecting of recstatus |
161 | 162 | $sh2 = $db->prepare('SELECT recstatus |
… |
… |
|
180 | 181 | if (!$data['chanid']) |
181 | 182 | continue; |
182 | 183 | // This program has already been loaded, and is attached to a recording schedule |
183 | | if (!empty($data['title']) && $scheduledRecordings[$data['callsign']][$data['starttime_unix']][0]->title == $data['title']) { |
| 184 | if (!empty($data['title']) && isset($scheduledRecordings[$data['callsign']][$data['starttime_unix']][0]->title) && $scheduledRecordings[$data['callsign']][$data['starttime_unix']][0]->title == $data['title']) { |
184 | 185 | $program =& $scheduledRecordings[$data['callsign']][$data['starttime_unix']][0]; |
185 | 186 | // merge in data fetched from DB |
186 | 187 | $program->merge(new Program($data)); |
-
diff --git a/modules/tv/list.php b/modules/tv/list.php
index cb2df804..e7c1bd61 100644
a
|
b
|
|
13 | 13 | **/ |
14 | 14 | |
15 | 15 | // Were we passed a timestamp? This is going to be the most common occurrence |
16 | | if ($_REQUEST['time']) |
| 16 | if (isset($_REQUEST['time'])) |
17 | 17 | $list_starttime = intVal($_REQUEST['time']); |
18 | 18 | elseif(isset($_REQUEST['daytime'])) |
19 | 19 | $list_starttime = unixtime(sprintf('%08d%04d00', $_REQUEST['date'], $_REQUEST['daytime'])); |
… |
… |
|
39 | 39 | $_SESSION['list_time'] = $list_starttime; |
40 | 40 | |
41 | 41 | // Are we an ajax request? |
42 | | if ($_REQUEST['ajax']) |
| 42 | if (isset($_REQUEST['ajax'])) |
43 | 43 | require_once tmpl_dir.'list_data.php'; |
44 | 44 | else |
45 | 45 | require_once tmpl_dir.'list.php'; |
-
diff --git a/modules/tv/lookup_metadata.php b/modules/tv/lookup_metadata.php
index 092cb283..d3611854 100644
a
|
b
|
|
14 | 14 | |
15 | 15 | $url = "Video/LookupVideo"; |
16 | 16 | $args = array( |
17 | | 'Title' => $_REQUEST['title'], |
18 | | 'Subtitle' => $_REQUEST['subtitle'], |
19 | | 'Inetref' => $_REQUEST['inetref'], |
20 | | 'Season' => $_REQUEST['season'], |
21 | | 'Episode' => $_REQUEST['episode'], |
22 | | 'GrabberType' => $_REQUEST['grabbertype'], |
23 | | 'AllowGeneric' => $_REQUEST['allowgeneric']); |
| 17 | 'Title' => isset($_REQUEST['title']) ? $_REQUEST['title'] : '', |
| 18 | 'Subtitle' => isset($_REQUEST['subtitle']) ? $_REQUEST['subtitle'] : '', |
| 19 | 'Inetref' => isset($_REQUEST['inetref']) ? $_REQUEST['inetref'] : '', |
| 20 | 'Season' => isset($_REQUEST['season']) ? $_REQUEST['season'] : '', |
| 21 | 'Episode' => isset($_REQUEST['episode']) ? $_REQUEST['episode'] : '', |
| 22 | 'GrabberType' => isset($_REQUEST['grabbertype']) ? $_REQUEST['grabbertype'] : '', |
| 23 | 'AllowGeneric' => isset($_REQUEST['allowgeneric']) ? $_REQUEST['allowgeneric'] : '' |
| 24 | ); |
24 | 25 | |
25 | 26 | echo MythBackend::find()->httpRequestAsJson($url, $args); |
-
diff --git a/modules/tv/recorded.php b/modules/tv/recorded.php
index d374c034..35b1973f 100644
a
|
b
|
|
13 | 13 | require_once 'includes/sorting.php'; |
14 | 14 | |
15 | 15 | // Delete or undelete a program? |
16 | | if ($_REQUEST['delete'] || $_REQUEST['undelete']) { |
| 16 | if (isset($_REQUEST['delete']) || isset($_REQUEST['undelete'])) { |
17 | 17 | if ($_REQUEST['delete']) |
18 | 18 | $backendstr = 'DELETE_RECORDING'; |
19 | 19 | else |
… |
… |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | // Queries for a specific program title |
57 | | isset($_REQUEST['title']) or $_REQUEST['title'] = isset($_REQUEST['refresh']) ? '' : $_SESSION['recorded_title']; |
58 | | isset($_REQUEST['recgroup']) or $_REQUEST['recgroup'] = isset($_REQUEST['refresh']) ? '' : $_SESSION['recorded_recgroup']; |
| 57 | isset($_REQUEST['title']) or $_REQUEST['title'] = isset($_REQUEST['refresh']) ? '' : (isset($_SESSION['recorded_title']) ? $_SESSION['recorded_title'] : null); |
| 58 | isset($_REQUEST['recgroup']) or $_REQUEST['recgroup'] = isset($_REQUEST['refresh']) ? '' : (isset($_SESSION['recorded_recgroup']) ? $_SESSION['recorded_recgroup'] : null); |
59 | 59 | |
60 | 60 | // Parse the program list |
61 | 61 | $warning = NULL; |
… |
… |
|
85 | 85 | } |
86 | 86 | // keep track of their names and how many episodes we have recorded |
87 | 87 | $Total_Programs++; |
| 88 | if (!isset($Groups[$record[30]])) |
| 89 | $Groups[$record[30]] = 0; |
88 | 90 | $Groups[$record[30]]++; |
89 | 91 | // Hide LiveTV and Deleted recordings from the title list |
90 | | if (($_REQUEST['recgroup'] && $_REQUEST['recgroup'] == $record[30]) || (!$_REQUEST['recgroup'] && $record[30] != 'LiveTV' && $record[30] != 'Deleted')) |
| 92 | if ((isset($_REQUEST['recgroup']) && $_REQUEST['recgroup'] == $record[30]) || (!isset($_REQUEST['recgroup']) && $record[30] != 'LiveTV' && $record[30] != 'Deleted')) |
| 93 | { |
| 94 | if (!isset($Program_Titles[$record[0]])) |
| 95 | $Program_Titles[$record[0]] = 0; |
91 | 96 | $Program_Titles[$record[0]]++; |
| 97 | } |
92 | 98 | // Skip files with no chanid |
93 | | if (!$record[8]) |
| 99 | if (!isset($record[8]) || !$record[8]) |
94 | 100 | continue; |
95 | 101 | // Skip programs the user doesn't want to look at |
96 | | if ($_REQUEST['title'] && $_REQUEST['title'] != $record[0]) |
| 102 | if (isset($_REQUEST['title']) && $_REQUEST['title'] != $record[0]) |
97 | 103 | continue; |
98 | | if ($_REQUEST['recgroup'] && $_REQUEST['recgroup'] != $record[30]) |
| 104 | if (isset($_REQUEST['recgroup']) && $_REQUEST['recgroup'] != $record[30]) |
99 | 105 | continue; |
100 | 106 | // Hide LiveTV recordings from the default view |
101 | 107 | if (empty($_REQUEST['recgroup']) && ($record[30] == 'LiveTV' || $record[30] == 'Deleted')) |
102 | 108 | continue; |
103 | 109 | // Make sure that everything we're dealing with is an array |
104 | | if (!is_array($Programs[$record[0]])) |
| 110 | if (!isset($Programs[$record[0]]) || !is_array($Programs[$record[0]])) |
105 | 111 | $Programs[$record[0]] = array(); |
106 | 112 | // Assign a reference to this show to the various arrays |
107 | 113 | $Programs[$record[0]][] = $record; |
… |
… |
|
164 | 170 | $_SESSION['recorded_recgroup'] = $_REQUEST['recgroup']; |
165 | 171 | |
166 | 172 | // The default sorting choice isn't so good for recorded programs, so we'll set our own default |
167 | | if (!is_array($_SESSION['recorded_sortby']) || !count($_SESSION['recorded_sortby'])) |
| 173 | if (!isset($_SESSION['recorded_sortby']) || !is_array($_SESSION['recorded_sortby']) || !count($_SESSION['recorded_sortby'])) |
168 | 174 | $_SESSION['recorded_sortby'] = array(array('field' => 'airdate', |
169 | 175 | 'reverse' => true), |
170 | 176 | array('field' => 'title', |
-
diff --git a/modules/tv/schedules.php b/modules/tv/schedules.php
index 8ef2ad00..d5454654 100644
a
|
b
|
|
10 | 10 | **/ |
11 | 11 | |
12 | 12 | // Scheduling a manual recording gets its own page |
13 | | if ($Path[2] == 'manual' || $Path[2] == 'custom') { |
| 13 | if (!empty($Path[2]) && ($Path[2] == 'manual' || $Path[2] == 'custom')) { |
14 | 14 | require_once 'modules/tv/schedules_'.$Path[2].'.php'; |
15 | 15 | exit; |
16 | 16 | } |
-
diff --git a/modules/tv/schedules_custom.php b/modules/tv/schedules_custom.php
index 23f2bcac..1c955a77 100644
a
|
b
|
|
11 | 11 | **/ |
12 | 12 | |
13 | 13 | // Path-based |
14 | | if ($Path[3]) |
| 14 | if (!empty($Path[3])) |
15 | 15 | $_GET['recordid'] = $Path[3]; |
16 | 16 | |
17 | 17 | // Load an existing schedule? |
18 | | if ($_GET['recordid']) { |
19 | | $schedule =& Schedule::find($_GET['recordid']); |
| 18 | if (isset($_GET['recordid'])) { |
| 19 | $schedule = Schedule::find($_GET['recordid']); |
20 | 20 | // Not a custom search schedule |
21 | 21 | if (empty($schedule->search) || $schedule->search == searchtype_manual) |
22 | 22 | redirect_browser(root_url.'tv/schedules'); |
-
diff --git a/modules/tv/schedules_manual.php b/modules/tv/schedules_manual.php
index b97f2354..e64884a7 100644
a
|
b
|
|
9 | 9 | **/ |
10 | 10 | |
11 | 11 | // Path-based |
12 | | if ($Path[3]) |
| 12 | if (!empty($Path[3])) |
13 | 13 | $_GET['recordid'] = $Path[3]; |
14 | 14 | |
15 | 15 | // Load an existing schedule? |
16 | | if ($_GET['recordid']) { |
17 | | $schedule =& Schedule::find($_GET['recordid']); |
| 16 | if (!empty($_GET['recordid'])) { |
| 17 | $schedule = Schedule::find($_GET['recordid']); |
18 | 18 | // Not a manual schedule |
19 | 19 | if (empty($schedule->search) || $schedule->search != searchtype_manual) |
20 | 20 | redirect_browser(root_url.'tv/schedules'); |
-
diff --git a/modules/tv/search.php b/modules/tv/search.php
index 64dbc19b..0871dc42 100644
a
|
b
|
|
29 | 29 | } |
30 | 30 | |
31 | 31 | // Sorting should re-trigger the search |
32 | | if ($_REQUEST['sortby']) |
| 32 | if (isset($_REQUEST['sortby'])) |
33 | 33 | $_REQUEST['search'] = true; |
34 | 34 | |
35 | 35 | // Pull in updates |
… |
… |
|
60 | 60 | } |
61 | 61 | |
62 | 62 | // Session defaults |
63 | | if (!is_array($_SESSION['search']['ctype']) || empty($_SESSION['search']['ctype'])) |
| 63 | if (empty($_SESSION['search']['ctype']) || !is_array($_SESSION['search']['ctype'])) |
64 | 64 | $_SESSION['search']['ctype'] = Program::category_types(); |
65 | 65 | |
66 | | if (!is_array($_SESSION['search']['categories']) || empty($_SESSION['search']['categories'])) |
| 66 | if (empty($_SESSION['search']['categories']) || !is_array($_SESSION['search']['categories'])) |
67 | 67 | $_SESSION['search']['categories'] = array(); |
68 | 68 | |
69 | 69 | if (!isset($_SESSION['search']['stars_gt']) || !isset($_SESSION['search']['stars_lt'])) { |
… |
… |
|
76 | 76 | if (!isset($_SESSION['search']['endtime'])) { |
77 | 77 | $_SESSION['search']['endtime'] = '+ 2 weeks'; |
78 | 78 | } |
79 | | if (!is_array($_SESSION['search']['as']) || empty($_SESSION['search']['as'])) { |
80 | | if (!is_string($_SESSION['search']['as'])) |
| 79 | if (empty($_SESSION['search']['as']) || !is_array($_SESSION['search']['as'])) { |
| 80 | if (!isset($_SESSION['search']['as']) || !is_string($_SESSION['search']['as'])) |
81 | 81 | $_SESSION['search']['as'] = ''; |
82 | 82 | $_SESSION['search']['as'] = array($_SESSION['search']['as']); |
83 | 83 | } |
84 | | if (!is_array($_SESSION['search']['af'])) { |
85 | | if (gettype($_SESSION['search']['af']) == 'string') |
| 84 | if (!isset($_SESSION['search']['af']) || !is_array($_SESSION['search']['af'])) { |
| 85 | if (isset($_SESSION['search']['af']) && is_string($_SESSION['search']['af'])) |
86 | 86 | $_SESSION['search']['af'] = array(array($_SESSION['search']['af'])); |
87 | 87 | else |
88 | 88 | $_SESSION['search']['af'] = array(array('title')); |
89 | 89 | } |
90 | | if (!is_array($_SESSION['search']['aj'])) { |
91 | | if (gettype($_SESSION['search']['aj']) == 'string') |
| 90 | if (!isset($_SESSION['search']['aj']) || !is_array($_SESSION['search']['aj'])) { |
| 91 | if (isset($_SESSION['search']['aj']) && is_string($_SESSION['search']['aj'])) |
92 | 92 | $_SESSION['search']['aj'] = array($_SESSION['search']['aj']); |
93 | 93 | else |
94 | 94 | $_SESSION['search']['aj'] = array('AND'); |
… |
… |
|
307 | 307 | } |
308 | 308 | |
309 | 309 | // HDTV only? |
310 | | if ($_SESSION['search']['hd']) |
| 310 | if (isset($_SESSION['search']['hd'])) |
311 | 311 | $extra_query[] = 'program.hdtv & 1'; |
312 | | if ($_SESSION['search']['generic']) |
| 312 | if (isset($_SESSION['search']['generic'])) |
313 | 313 | $extra_query[] = 'program.generic = 0'; |
314 | 314 | // Commercial-free channels only? |
315 | | if ($_SESSION['search']['commfree']) |
| 315 | if (isset($_SESSION['search']['commfree'])) |
316 | 316 | $extra_query[] = 'channel.commmethod=-2'; |
317 | 317 | |
318 | 318 | // Finish the query and add any extra parameters |
319 | | if ($query) |
| 319 | if (!empty($query)) |
320 | 320 | $query = "($query)"; |
321 | 321 | if (count($extra_query) > 0) { |
322 | | if ($query) |
| 322 | if (!empty($query)) |
323 | 323 | $query .= ' AND '; |
324 | 324 | $query .= '('.implode(' AND ', $extra_query).')'; |
325 | 325 | } |
… |
… |
|
328 | 328 | if (!empty($query)) |
329 | 329 | $tmpdate = strtotime($_SESSION['search']['starttime']); |
330 | 330 | if ($tmpdate == false) { |
331 | | $Results =& load_all_program_data(time(), strtotime('+1 month'), NULL, false, $query, $_SESSION['search']['distinctTitle']); |
| 331 | $Results = load_all_program_data(time(), strtotime('+1 month'), NULL, false, $query, isset($_SESSION['search']['distinctTitle']) ? $_SESSION['search']['distinctTitle'] : null); |
332 | 332 | } else { |
333 | | $Results =& load_all_program_data($tmpdate, strtotime('+1 month'), NULL, false, $query, $_SESSION['search']['distinctTitle']); |
| 333 | $Results = load_all_program_data($tmpdate, strtotime('+1 month'), NULL, false, $query, isset($_SESSION['search']['distinctTitle']) ? $_SESSION['search']['distinctTitle'] : null); |
334 | 334 | } |
335 | 335 | |
336 | 336 | } |
337 | 337 | |
338 | 338 | // Only show unwatched shows? |
339 | | if ($_SESSION['search']['unwatched'] && count($Results)) { |
| 339 | if (isset($_SESSION['search']['unwatched']) && count($Results)) { |
340 | 340 | foreach ($Results as $key => $show) { |
341 | 341 | switch($show->recstatus) { |
342 | 342 | case 'PreviousRecording': |
… |
… |
|
350 | 350 | } |
351 | 351 | |
352 | 352 | // Ignore will record shows? |
353 | | if ($_SESSION['search']['scheduled'] && count($Results)) { |
| 353 | if (isset($_SESSION['search']['scheduled']) && count($Results)) { |
354 | 354 | foreach ($Results as $key => $show) { |
355 | 355 | switch($show->recstatus) { |
356 | 356 | case 'WillRecord': |
… |
… |
|
376 | 376 | foreach ($Results as $key => $show) { |
377 | 377 | $tkey = md5($show->channel->channum.':'.$show->channel->callsign.':'.$show->title.':'.$show->subtitle.':'.$show->description); |
378 | 378 | $skey = $show->channel->name.$show->starttime.$tkey; |
379 | | if($seen[$skey]){ |
| 379 | if (isset($seen[$skey])) { |
380 | 380 | unset($Results[$key]); |
381 | 381 | continue; |
382 | 382 | }else{ |
-
diff --git a/modules/tv/set_channels.php b/modules/tv/set_channels.php
index 9534b21a..6f37c4ea 100644
a
|
b
|
|
10 | 10 | **/ |
11 | 11 | |
12 | 12 | // Save? |
13 | | if ($_POST['save']) { |
| 13 | if (isset($_POST['save'])) { |
14 | 14 | // Parse the post variables and save each group of channel info |
15 | 15 | foreach ($_POST['channel'] as $chanid => $data) { |
16 | 16 | |
… |
… |
|
67 | 67 | } |
68 | 68 | |
69 | 69 | // Sortby |
70 | | if ($_GET['sortby']) |
| 70 | if (isset($_GET['sortby'])) |
71 | 71 | $_SESSION['tv']['set']['chan_sort'] = $_GET['sortby']; |
72 | | switch ($_SESSION['tv']['set']['chan_sort']) { |
| 72 | |
| 73 | $chan_sort = (isset($_SESSION['tv']['set']['chan_sort'])) ? $_SESSION['tv']['set']['chan_sort'] : ''; |
| 74 | switch ($chan_sort) { |
73 | 75 | case 'callsign': |
74 | 76 | case 'name': |
75 | 77 | $sortby = $_SESSION['tv']['set']['chan_sort']; |
-
diff --git a/modules/tv/set_playgroup.php b/modules/tv/set_playgroup.php
index 67f45393..36c61a79 100644
a
|
b
|
|
17 | 17 | require_once 'modules/tv/classes/Schedule.php'; |
18 | 18 | |
19 | 19 | // Save changes |
20 | | if ($_REQUEST['save'] && $_REQUEST['old_name']) { |
| 20 | if (isset($_REQUEST['save']) && isset($_REQUEST['old_name'])) { |
21 | 21 | if ($_REQUEST['old_name'] == 'Default') |
22 | 22 | $_REQUEST['name'] = 'Default'; |
23 | 23 | else |
… |
… |
|
50 | 50 | } |
51 | 51 | } |
52 | 52 | // Delete group |
53 | | elseif ($_REQUEST['delete']) { |
| 53 | elseif (isset($_REQUEST['delete'])) { |
54 | 54 | if ($_REQUEST['old_name'] != 'Default') { |
55 | 55 | $db->query('DELETE FROM playgroup WHERE name = ?', |
56 | 56 | $_REQUEST['old_name']); |
… |
… |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | // Load a playgroup to edit |
61 | | if ($_REQUEST['new_group']) { |
| 61 | if (isset($_REQUEST['new_group'])) { |
62 | 62 | $group = $db->query_assoc('SELECT * FROM playgroup WHERE name = "Default"'); |
63 | 63 | $group['name'] = 'NEW GROUP'; |
64 | 64 | } |
65 | 65 | else { |
66 | | $group = $db->query_assoc('SELECT * FROM playgroup WHERE name = ?', |
67 | | $_REQUEST['playgroup']); |
| 66 | if (isset($_REQUEST['playgroup'])) { |
| 67 | $group = $db->query_assoc('SELECT * FROM playgroup WHERE name = ?', |
| 68 | $_REQUEST['playgroup']); |
| 69 | } |
68 | 70 | if (empty($group)) { |
69 | 71 | $_REQUEST['playgroup'] = 'Default'; |
70 | 72 | $group = $db->query_assoc('SELECT * FROM playgroup WHERE name = ?', |
-
diff --git a/modules/tv/set_screens.php b/modules/tv/set_screens.php
index a488bb2b..10c3397b 100644
a
|
b
|
|
13 | 13 | ); |
14 | 14 | |
15 | 15 | // Save? |
16 | | if ($_POST['save']) { |
| 16 | if (isset($_POST['save'])) { |
17 | 17 | foreach(array_keys($Screens) as $key) |
18 | 18 | $_SESSION['settings']['screens']['tv'][$key] = $_POST[str_replace(' ', '_', $key)]; |
19 | 19 | } |
-
diff --git a/modules/tv/set_session.php b/modules/tv/set_session.php
index 214e9676..8581e933 100644
a
|
b
|
|
10 | 10 | **/ |
11 | 11 | |
12 | 12 | // Save? |
13 | | if ($_POST['save']) { |
| 13 | if (isset($_POST['save'])) { |
14 | 14 | // Save the date formats |
15 | 15 | if (isset($_POST['date_statusbar'])) $_SESSION['date_statusbar'] = $_POST['date_statusbar']; |
16 | 16 | if (isset($_POST['date_scheduled'])) $_SESSION['date_scheduled'] = $_POST['date_scheduled']; |
-
diff --git a/modules/tv/tmpl/default/_advanced_options.php b/modules/tv/tmpl/default/_advanced_options.php
index 4547acd8..ea20a880 100644
a
|
b
|
|
256 | 256 | <h3><?php echo t('Advanced Options') ?>:</h3> |
257 | 257 | (<?php |
258 | 258 | echo '<a onclick="toggle_advanced(false); return false;" id="hide_advanced"'; |
259 | | if (!$_SESSION['tv']['show_advanced_schedule']) |
| 259 | if (empty($_SESSION['tv']['show_advanced_schedule'])) |
260 | 260 | echo ' style="display: none"'; |
261 | 261 | echo '>', t('Hide'), '</a>', |
262 | 262 | '<a onclick="toggle_advanced(true)" id="show_advanced"'; |
263 | | if ($_SESSION['tv']['show_advanced_schedule']) |
| 263 | if (!empty($_SESSION['tv']['show_advanced_schedule'])) |
264 | 264 | echo ' style="display: none"'; |
265 | 265 | echo '>', t('Display'), '</a>'; |
266 | 266 | ?>) |
267 | 267 | |
268 | 268 | <div id="schedule_advanced_off"<?php |
269 | | if ($_SESSION['tv']['show_advanced_schedule']) echo ' style="display: none"' |
| 269 | if (!empty($_SESSION['tv']['show_advanced_schedule'])) echo ' style="display: none"' |
270 | 270 | ?>> |
271 | 271 | <?php echo t('info: hidden advanced schedule') ?> |
272 | 272 | </div> |
273 | 273 | |
274 | 274 | <dl class="clearfix" id="schedule_advanced"<?php |
275 | | if (!$_SESSION['tv']['show_advanced_schedule']) echo ' style="display: none"' |
| 275 | if (empty($_SESSION['tv']['show_advanced_schedule'])) echo ' style="display: none"' |
276 | 276 | ?>> |
277 | 277 | <dt><?php echo t('Recording Profile') ?>:</dt> |
278 | 278 | <dd><?php profile_select($schedule->profile) ?></dd> |
-
diff --git a/modules/tv/tmpl/default/detail.php b/modules/tv/tmpl/default/detail.php
index 05bad9be..830af1ad 100644
a
|
b
|
|
451 | 451 | echo '<a onclick="javascript:confirm_delete(false)"', |
452 | 452 | ' title="',html_entities(t('Delete $1', |
453 | 453 | $program->title |
454 | | .($show->subtitle |
| 454 | .(isset($show->subtitle) |
455 | 455 | ? ': '.$show->subtitle |
456 | 456 | : '') |
457 | 457 | )).'">', |
… |
… |
|
459 | 459 | '<a onclick="javascript:confirm_delete(true)"', |
460 | 460 | ' title="',html_entities(t('Delete and rerecord $1', |
461 | 461 | $program->title |
462 | | .($show->subtitle |
| 462 | .(isset($show->subtitle) |
463 | 463 | ? ': '.$show->subtitle |
464 | 464 | : '') |
465 | 465 | )).'">', |
… |
… |
|
525 | 525 | <a href="http://www.tv.com/search.php?type=11&stype=all&qs=<?php echo urlencode($schedule->title) ?>"><?php echo t('Search $1', 'TV.com') ?></a> |
526 | 526 | <a href="http://www.google.com/search?q=<?php echo urlencode($schedule->title) ?>"><?php echo t('Search $1', 'Google') ?></a> |
527 | 527 | <a href="<?php echo root_url ?>tv/search/<?php echo str_replace('%2F', '/', rawurlencode('^'.$schedule->title.'$')) ?>?field=title"><?php |
528 | | if ($_GET['recordid']) |
| 528 | if (isset($_GET['recordid'])) |
529 | 529 | echo t('Find showings of this program'); |
530 | 530 | else |
531 | 531 | echo t('Find other showings of this program'); |
532 | 532 | ?></a> |
533 | 533 | <?php } |
534 | | if ($_GET['recordid']) { |
| 534 | if (isset($_GET['recordid'])) { |
535 | 535 | echo '<a href="', root_url, 'tv/schedules">', |
536 | 536 | t('Back to the recording schedules'), |
537 | 537 | '</a>'; |
… |
… |
|
842 | 842 | } |
843 | 843 | echo ' </ul>'; |
844 | 844 | } |
845 | | if (is_array($program->jobs['queue']) && count($program->jobs['queue'])) { |
| 845 | if (isset($program->jobs['queue']) && is_array($program->jobs['queue']) && count($program->jobs['queue'])) { |
846 | 846 | echo t('Queued jobs'), ':', |
847 | 847 | ' <ul class="-queued">'; |
848 | 848 | foreach ($program->jobs['queue'] as $job) { |
-
diff --git a/modules/tv/tmpl/default/list_data.php b/modules/tv/tmpl/default/list_data.php
index 525337b4..ae7cebb5 100644
a
|
b
|
|
54 | 54 | continue; |
55 | 55 | |
56 | 56 | // Skip already-displayed channels |
57 | | if ($displayed_channels[$channel->channum][$channel->callsign]) |
| 57 | if (isset($displayed_channels[$channel->channum][$channel->callsign])) |
58 | 58 | continue; |
59 | 59 | $displayed_channels[$channel->channum][$channel->callsign] = 1; |
60 | 60 | |
-
diff --git a/modules/tv/tmpl/default/recorded.php b/modules/tv/tmpl/default/recorded.php
index 8502305b..36c3d201 100644
a
|
b
|
|
48 | 48 | <option value=""><?php echo t('All groups') ?></option><?php |
49 | 49 | foreach($Groups as $recgroup => $count) { |
50 | 50 | echo '<option id="Group '.htmlspecialchars($recgroup).'" value="'.htmlspecialchars($recgroup).'"'; |
51 | | if ($_REQUEST['recgroup'] == $recgroup) |
| 51 | if (isset($_REQUEST['recgroup']) && $_REQUEST['recgroup'] == $recgroup) |
52 | 52 | echo ' SELECTED'; |
53 | 53 | echo '>'.html_entities($recgroup) |
54 | 54 | .' ('.tn('$1 recording', '$1 recordings', $count) |
… |
… |
|
65 | 65 | <?php |
66 | 66 | foreach($Program_Titles as $title => $count) { |
67 | 67 | echo '<option id="Title '.htmlspecialchars($title).'" value="'.htmlspecialchars($title).'"'; |
68 | | if ($_REQUEST['title'] == $title) |
| 68 | if (isset($_REQUEST['title']) && $_REQUEST['title'] == $title) |
69 | 69 | echo ' SELECTED'; |
70 | 70 | echo '>'.html_entities($title) |
71 | 71 | .($count > 1 ? ' ('.tn('$1 episode', '$1 episodes', $count).')' : "") |
… |
… |
|
101 | 101 | $prev_group = ''; |
102 | 102 | $cur_group = ''; |
103 | 103 | |
104 | | $offset = $_REQUEST['offset']; |
| 104 | $offset = isset($_REQUEST['offset']) ? $_REQUEST['offset'] : 0; |
105 | 105 | $rows = $offset; |
106 | 106 | |
107 | 107 | foreach ($All_Shows as $show) { |
… |
… |
EOM; |
176 | 176 | <td class="x-originalairdate"><?php echo $show->airdate ?></td> |
177 | 177 | <td class="x-airdate"><?php echo strftime($_SESSION['date_recorded'], $show->starttime) ?></td><?php |
178 | 178 | if ($_SESSION["show_channel_icons"] == true && !empty($show->channel->icon)) { |
179 | | ?><td class="x-chanicon" rowspan="2"><a href="<?php echo root_url ?>tv/channel/<?php echo $show->channel->chanid, '/', $list_starttime ?>" |
| 179 | ?><td class="x-chanicon" rowspan="2"><a href="<?php echo root_url ?>tv/channel/<?php echo $show->channel->chanid, '/', ((isset($list_starttime)) ? $list_starttime : '') ?>" |
180 | 180 | title="<?php echo t('Details for: $1', html_entities($show->channel->name)) ?>"> |
181 | 181 | <img class="channelicon" src="<?php echo $show->channel->icon ?>"></a></td><?php |
182 | 182 | } else { ?> |
… |
… |
EOM; |
252 | 252 | </tr><?php |
253 | 253 | $prev_group = $cur_group; |
254 | 254 | // Keep track of how many shows are visible in each section |
| 255 | if (!isset($row_count[$section])) |
| 256 | $row_count[$section] = 0; |
255 | 257 | $row_count[$section]++; |
256 | 258 | // Keep track of which shows are in which section |
257 | 259 | $row_section[$row] = $section; |
-
diff --git a/modules/tv/tmpl/default/search.php b/modules/tv/tmpl/default/search.php
index eaa06b4b..e9f14c31 100644
a
|
b
|
|
55 | 55 | <td class="x-timeopts"><p style="margin-top: 0"> |
56 | 56 | <p> |
57 | 57 | <input type="checkbox" name="hd" id="hd" value="1"<?php |
58 | | if ($_SESSION['search']['hd']) echo ' CHECKED' ?>> |
| 58 | if (isset($_SESSION['search']['hd'])) echo ' CHECKED' ?>> |
59 | 59 | <label for="hd"><?php echo t('Only match HD programs') ?></label> |
60 | 60 | <br> |
61 | 61 | <input type="checkbox" name="commfree" id="commfree" value="1"<?php |
62 | | if ($_SESSION['search']['commfree']) echo ' CHECKED' ?>> |
| 62 | if (isset($_SESSION['search']['commfree'])) echo ' CHECKED' ?>> |
63 | 63 | <label for="commfree"><?php echo t('Only match commercial-free channels') ?></label> |
64 | 64 | <br> |
65 | 65 | <input type="checkbox" name="unwatched" id="unwatched" value="1"<?php |
66 | | if ($_SESSION['search']['unwatched']) echo ' CHECKED' ?>> |
| 66 | if (isset($_SESSION['search']['unwatched'])) echo ' CHECKED' ?>> |
67 | 67 | <label for="unwatched"><?php echo t('Only match non-recorded shows') ?></label> |
68 | 68 | <br> |
69 | 69 | <input type="checkbox" name="scheduled" id="scheduled" value="1"<?php |
70 | | if ($_SESSION['search']['scheduled']) echo ' CHECKED' ?>> |
| 70 | if (isset($_SESSION['search']['scheduled'])) echo ' CHECKED' ?>> |
71 | 71 | <label for="scheduled"><?php echo t('Ignore scheduled shows') ?></label> |
72 | 72 | <br> |
73 | 73 | <input type="checkbox" name="generic" id="generic" value="1"<?php |
74 | | if ($_SESSION['search']['generic']) echo ' CHECKED' ?>> |
| 74 | if (isset($_SESSION['search']['generic'])) echo ' CHECKED' ?>> |
75 | 75 | <label for="generic"><?php echo t('Ignore generic shows') ?></label> |
76 | 76 | <br> |
77 | 77 | <input type="checkbox" name="distinctTitle" id="distinctTitle" value="1"<?php |
78 | | if ($_SESSION['search']['distinctTitle']) echo ' CHECKED' ?>> |
| 78 | if (isset($_SESSION['search']['distinctTitle'])) echo ' CHECKED' ?>> |
79 | 79 | <label for="distinctTitle"><?php echo t('Only show distinct shows') ?></label> |
80 | 80 | </p> |
81 | 81 | <p> |
… |
… |
|
86 | 86 | </p> |
87 | 87 | <p> |
88 | 88 | <?php echo t('Originally aired between'); ?>:<br> |
89 | | <input type="text" size="12" name="airdate_start" style="text-align: center" value="<?php echo html_entities($_SESSION['search']['airdate_start']) ?>"> |
| 89 | <input type="text" size="12" name="airdate_start" style="text-align: center" value="<?php echo html_entities(isset($_SESSION['search']['airdate_start']) ? $_SESSION['search']['airdate_start'] : '') ?>"> |
90 | 90 | <?php echo t('and'); ?> |
91 | | <input type="text" size="12" name="airdate_end" style="text-align: center" value="<?php echo html_entities($_SESSION['search']['airdate_end']) ?>"> |
| 91 | <input type="text" size="12" name="airdate_end" style="text-align: center" value="<?php echo html_entities(isset($_SESSION['search']['airdate_end']) ? $_SESSION['search']['airdate_end'] : '') ?>"> |
92 | 92 | </p> |
93 | 93 | </td> |
94 | 94 | <td class="x-progtype"> |
… |
… |
|
108 | 108 | <?php |
109 | 109 | |
110 | 110 | // Print the results list if a search was performed |
111 | | if ($_REQUEST['search']) { |
| 111 | if (isset($_REQUEST['search'])) { |
112 | 112 | // Print the search name |
113 | 113 | echo '<p id="x_search_name">', |
114 | 114 | ($_SESSION['search']['type'] == 'a' |
… |
… |
|
197 | 197 | <td class="x-airdate"><?php |
198 | 198 | echo '<a href="'.root_url.'tv/detail/'.$show->chanid.'/'.$show->starttime.'">'. |
199 | 199 | strftime($_SESSION['date_search'], $show->starttime) . '</a>'; |
200 | | if ($show->extra_showings) |
| 200 | if (isset($show->extra_showings) && is_array($show->extra_showings)) |
201 | 201 | foreach ($show->extra_showings as $pair) { |
202 | 202 | list($chanid, $showtime) = $pair; |
203 | 203 | echo '<br><a href="', root_url, 'tv/detail/', $chanid, '/', $showtime, '" class="italic">', |
-
diff --git a/modules/tv/tmpl/default/set_screens.php b/modules/tv/tmpl/default/set_screens.php
index 75b9deb5..9ed0f9b4 100644
a
|
b
|
|
19 | 19 | <?php |
20 | 20 | foreach($options as $option) { |
21 | 21 | echo '<input type="checkbox" name="'.$screen.'['.$option.']" id="'.$screen.'['.$option.']" '; |
22 | | if ($_SESSION['settings']['screens']['tv'][$screen][$option] == 'on') |
| 22 | if (isset($_SESSION['settings']['screens']['tv'][$screen][$option])) |
23 | 23 | echo 'checked'; |
24 | 24 | echo '> <label for="'.$screen.'['.$option.']">'.t(ucwords($option)).'</label><br />'; |
25 | 25 | } |
-
diff --git a/modules/tv/tmpl/default/set_session.php b/modules/tv/tmpl/default/set_session.php
index 9e0a810e..894d9237 100644
a
|
b
|
|
20 | 20 | <td><input class="radio" type="checkbox" title="Show recording thumbnails." id="recorded_pixmaps" name="recorded_pixmaps"<?php if ($_SESSION['recorded_pixmaps']) echo ' CHECKED' ?>></td> |
21 | 21 | </tr><tr> |
22 | 22 | <th><?php echo t('Download URL override') ?></label>:</th> |
23 | | <td>file://<input type="text" id="file_url_override" name="file_url_override" value="<?php echo html_entities(trim($_SESSION['file_url_override'])) ?>" title="Instead of streaming downloaded recordings, load from a local file:// path instead."></td> |
| 23 | <td>file://<input type="text" id="file_url_override" name="file_url_override" value="<?php echo html_entities(trim((isset($_SESSION['file_url_override'])) ? $_SESSION['file_url_override'] : '')) ?>" title="Instead of streaming downloaded recordings, load from a local file:// path instead."></td> |
24 | 24 | </tr><tr> |
25 | 25 | <th><?php echo t('Page recorded programs') ?></label>:</th> |
26 | 26 | <td><select name="recorded_paging"> |
-
diff --git a/modules/tv/tmpl/default/upcoming.php b/modules/tv/tmpl/default/upcoming.php
index 93dc841a..4db284ea 100644
a
|
b
|
|
20 | 20 | |
21 | 21 | /** @todo FIXME: pull this out of the theme page! */ |
22 | 22 | // Which field are we grouping by? |
23 | | $group_field = $_SESSION['scheduled_sortby'][0]['field']; |
24 | | if (empty($group_field)) |
25 | | $group_field = 'recdate'; |
26 | | elseif (!in_array($group_field, array('title', 'channum', 'airdate', 'recdate'))) |
| 23 | $group_field = (!empty($_SESSION['scheduled_sortby'][0]['field'])) ? $_SESSION['scheduled_sortby'][0]['field'] : 'recdate'; |
| 24 | if (!in_array($group_field, array('title', 'channum', 'airdate', 'recdate'))) |
27 | 25 | $group_field = ''; |
28 | 26 | |
29 | 27 | ?> |
… |
… |
|
118 | 116 | <?php |
119 | 117 | foreach($Program_Titles as $title => $count) { |
120 | 118 | echo '<option id="Title '.htmlspecialchars($title).'" value="'.htmlspecialchars($title).'"'; |
121 | | if ($_SESSION['scheduled_recordings']['disp_title'] == $title) |
| 119 | if (isset($_SESSION['scheduled_recordings']['disp_title']) && $_SESSION['scheduled_recordings']['disp_title'] == $title) |
122 | 120 | echo ' SELECTED'; |
123 | 121 | echo '>'.html_entities($title) |
124 | 122 | .($count > 1 ? ' ('.tn('$1 episode', '$1 episodes', $count).')' : "") |
… |
… |
|
137 | 135 | <tr class="menu"> |
138 | 136 | <?php if ($group_field != '') echo "<td class=\"list\"> </td>\n" ?> |
139 | 137 | <th class="x-status"><?php echo t('Status') ?></th> |
140 | | <?php if ($_SESSION['settings']['screens']['tv']['upcoming recordings']['title'] == 'on') { ?> |
| 138 | <?php if (isset($_SESSION['settings']['screens']['tv']['upcoming recordings']['title'])) { ?> |
141 | 139 | <th class="x-title"><?php echo get_sort_link('title', t('Title')) ?></th> |
142 | | <?php } if ($_SESSION['settings']['screens']['tv']['upcoming recordings']['original airdate'] == 'on') { ?> |
| 140 | <?php } if (isset($_SESSION['settings']['screens']['tv']['upcoming recordings']['original airdate'])) { ?> |
143 | 141 | <th class="x-originalairdate"><?php echo get_sort_link('originalairdate', t('Original Airdate')) ?></th> |
144 | | <?php } if ($_SESSION['settings']['screens']['tv']['upcoming recordings']['episode number'] == 'on') { ?> |
| 142 | <?php } if (isset($_SESSION['settings']['screens']['tv']['upcoming recordings']['episode number'])) { ?> |
145 | 143 | <th class="x-episodenumber"><?php echo get_sort_link('episodenumber', t('Episode Number')) ?></th> |
146 | | <?php } if ($_SESSION['settings']['screens']['tv']['upcoming recordings']['channel'] == 'on') { ?> |
| 144 | <?php } if (isset($_SESSION['settings']['screens']['tv']['upcoming recordings']['channel'])) { ?> |
147 | 145 | <th class="x-channum"><?php echo get_sort_link('channum', t('Channel')) ?></th> |
148 | | <?php } if ($_SESSION['settings']['screens']['tv']['upcoming recordings']['recording group'] == 'on') { ?> |
| 146 | <?php } if (isset($_SESSION['settings']['screens']['tv']['upcoming recordings']['recording group'])) { ?> |
149 | 147 | <th class="x-recgroup"><?php echo get_sort_link('recgroup', t('Recording Group')) ?></th> |
150 | | <?php } if ($_SESSION['settings']['screens']['tv']['upcoming recordings']['airdate'] == 'on') { ?> |
| 148 | <?php } if (isset($_SESSION['settings']['screens']['tv']['upcoming recordings']['airdate'])) { ?> |
151 | 149 | <th class="x-airdate"><?php echo get_sort_link('airdate', t('Airdate')) ?></th> |
152 | | <?php } if ($_SESSION['settings']['screens']['tv']['upcoming recordings']['record date'] == 'on') { ?> |
| 150 | <?php } if (isset($_SESSION['settings']['screens']['tv']['upcoming recordings']['record date'])) { ?> |
153 | 151 | <th class="x-recdate"><?php echo get_sort_link('recdate', t('Record Date')) ?></th> |
154 | | <?php } if ($_SESSION['settings']['screens']['tv']['upcoming recordings']['length'] == 'on') { ?> |
| 152 | <?php } if (isset($_SESSION['settings']['screens']['tv']['upcoming recordings']['length'])) { ?> |
155 | 153 | <th class="x-length"><?php echo get_sort_link('length', t('Record Length')) ?></th> |
156 | 154 | <?php } ?> |
157 | 155 | </tr><?php |
… |
… |
|
353 | 351 | <?php if (!empty($group_field)) echo " <td class=\"list\"> </td>\n" ?> |
354 | 352 | <td class="x-status rec_class <?php echo $rec_class ?>"><?php echo $rec_char ?></td> |
355 | 353 | <?php |
356 | | if ($_SESSION['settings']['screens']['tv']['upcoming recordings']['title'] == 'on') { |
| 354 | if (isset($_SESSION['settings']['screens']['tv']['upcoming recordings']['title'])) { |
357 | 355 | ?> |
358 | 356 | <td class="x-title <?php echo $show->css_class ?>"><?php |
359 | 357 | if ($show->hdtv) |
… |
… |
|
388 | 386 | </td> |
389 | 387 | <?php |
390 | 388 | } |
391 | | if ($_SESSION['settings']['screens']['tv']['upcoming recordings']['original airdate'] == 'on') { |
| 389 | if (isset($_SESSION['settings']['screens']['tv']['upcoming recordings']['original airdate'])) { |
392 | 390 | ?> |
393 | 391 | <td class="x-originalairdate"><?php echo $show->airdate ?></td> |
394 | 392 | <?php |
395 | 393 | } |
396 | | if ($_SESSION['settings']['screens']['tv']['upcoming recordings']['episode number'] == 'on') { |
| 394 | if (isset($_SESSION['settings']['screens']['tv']['upcoming recordings']['episode number'])) { |
397 | 395 | ?> |
398 | 396 | <td class="x-episodenumber"><?php echo $show->syndicatedepisodenumber ?></td> |
399 | 397 | <?php |
400 | 398 | } |
401 | | if ($_SESSION['settings']['screens']['tv']['upcoming recordings']['channel'] == 'on') { |
| 399 | if (isset($_SESSION['settings']['screens']['tv']['upcoming recordings']['channel'])) { |
402 | 400 | ?> |
403 | 401 | <td class="x-channum"><?php echo $show->channum, ' - ', $show->channame ?></td> |
404 | 402 | <?php |
405 | 403 | } |
406 | | if ($_SESSION['settings']['screens']['tv']['upcoming recordings']['recording group'] == 'on') { |
| 404 | if (isset($_SESSION['settings']['screens']['tv']['upcoming recordings']['recording group'])) { |
407 | 405 | ?> |
408 | 406 | <td class="x-recgroup"><?php echo $show->recgroup ?></td> |
409 | 407 | <?php |
410 | 408 | } |
411 | | if ($_SESSION['settings']['screens']['tv']['upcoming recordings']['airdate'] == 'on') { |
| 409 | if (isset($_SESSION['settings']['screens']['tv']['upcoming recordings']['airdate'])) { |
412 | 410 | ?> |
413 | 411 | <td class="x-airdate" nowrap><?php echo strftime($_SESSION['date_scheduled'], $show->starttime) ?></td> |
414 | 412 | <?php |
415 | 413 | } |
416 | | if ($_SESSION['settings']['screens']['tv']['upcoming recordings']['record date'] == 'on') { |
| 414 | if (isset($_SESSION['settings']['screens']['tv']['upcoming recordings']['record date'])) { |
417 | 415 | ?> |
418 | 416 | <td class="x-recdate" nowrap><?php echo strftime($_SESSION['date_scheduled'], $show->recstartts) ?></td> |
419 | 417 | <?php |
420 | 418 | } |
421 | | if ($_SESSION['settings']['screens']['tv']['upcoming recordings']['length'] == 'on') { |
| 419 | if (isset($_SESSION['settings']['screens']['tv']['upcoming recordings']['length'])) { |
422 | 420 | ?> |
423 | 421 | <td class="x-length"><?php echo nice_length($show->length) ?></td> |
424 | 422 | <?php |
… |
… |
|
451 | 449 | $ical_href .='skip_duplicates&'; |
452 | 450 | if (!$_SESSION['scheduled_recordings']['disp_deactivated']) |
453 | 451 | $ical_href .='skip_deactivated&'; |
454 | | if ($_SESSION['scheduled_recordings']['disp_recgroup']) |
| 452 | if (isset($_SESSION['scheduled_recordings']['disp_recgroup'])) |
455 | 453 | $ical_href .= 'recgroup='.urlencode($_SESSION['scheduled_recordings']['disp_recgroup']).'&'; |
456 | | if ($_SESSION['scheduled_recordings']['disp_title']) |
| 454 | if (isset($_SESSION['scheduled_recordings']['disp_title'])) |
457 | 455 | $ical_href .= 'title='.urlencode($_SESSION['scheduled_recordings']['disp_title']).'&'; |
458 | 456 | echo '<div id="feed_buttons"><a href="'.$ical_href.'"><img src="'.skin_url.'/img/iCal2.0.png"></a></div>'; |
459 | 457 | |
-
diff --git a/modules/tv/upcoming.php b/modules/tv/upcoming.php
index 269f9ef1..54fbd80f 100644
a
|
b
|
|
13 | 13 | require_once 'includes/sorting.php'; |
14 | 14 | |
15 | 15 | // Use the new directory structure? |
16 | | if (!$_REQUEST['chanid'] && !$_REQUEST['starttime']) { |
17 | | $_REQUEST['chanid'] = $Path[2]; |
18 | | $_REQUEST['starttime'] = $Path[3]; |
19 | | $_REQUEST['manualid'] = $Path[4]; |
| 16 | if (!isset($_REQUEST['chanid']) && !isset($_REQUEST['starttime'])) { |
| 17 | $_REQUEST['chanid'] = !empty($Path[2]) ? $Path[2] : ''; |
| 18 | $_REQUEST['starttime'] = !empty($Path[3]) ? $Path[3] : ''; |
| 19 | $_REQUEST['manualid'] = !empty($Path[4]) ? $Path[4] : ''; |
20 | 20 | } |
21 | 21 | // Just in case |
22 | 22 | $_GET['chanid'] = intVal($_REQUEST['chanid']); |
… |
… |
|
29 | 29 | |
30 | 30 | if (is_object($program)) { |
31 | 31 | // Forget all knowledge of old recordings |
32 | | if ($_REQUEST['forget_old']) |
| 32 | if (!empty($_REQUEST['forget_old'])) |
33 | 33 | $program->rec_forget_old(); |
34 | 34 | // Fake an old recording so that this show won't record again |
35 | | elseif ($_REQUEST['never_record']) |
| 35 | elseif (!empty($_REQUEST['never_record'])) |
36 | 36 | $program->rec_never_record(); |
37 | 37 | // Revert to default recording rules |
38 | | elseif ($_REQUEST['default']) |
| 38 | elseif (!empty($_REQUEST['default'])) |
39 | 39 | $program->rec_default(); |
40 | 40 | // Suppress something that shouldn't be recorded |
41 | | elseif ($_REQUEST['dontrec']) |
| 41 | elseif (!empty($_REQUEST['dontrec'])) |
42 | 42 | $program->rec_override(rectype_dontrec); |
43 | 43 | // Record a show that wouldn't otherwise record (various reasons, read below) |
44 | | elseif ($_REQUEST['record']) |
| 44 | elseif (!empty($_REQUEST['record'])) |
45 | 45 | $program->rec_override(rectype_override); |
46 | | elseif ($_REQUEST['activate']) |
| 46 | elseif (!empty($_REQUEST['activate'])) |
47 | 47 | $program->activate(); |
48 | 48 | } |
49 | 49 | else { |
50 | | if ($_REQUEST['dontrec']) |
| 50 | if (!empty($_REQUEST['dontrec'])) |
51 | 51 | $schedule =& Schedule::find($_GET['chanid'], $_GET['starttime'])->save(rectype_dontrec); |
52 | 52 | else |
53 | 53 | add_warning('Unknown program.'); |
… |
… |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | // Ignore certain shows? |
61 | | if ($_POST['change_display']) { |
62 | | $_SESSION['scheduled_recordings']['disp_scheduled'] = $_POST['disp_scheduled'] ? true : false; |
63 | | $_SESSION['scheduled_recordings']['disp_duplicates'] = $_POST['disp_duplicates'] ? true : false; |
64 | | $_SESSION['scheduled_recordings']['disp_deactivated'] = $_POST['disp_deactivated'] ? true : false; |
65 | | $_SESSION['scheduled_recordings']['disp_conflicts'] = $_POST['disp_conflicts'] ? true : false; |
66 | | $_SESSION['scheduled_recordings']['disp_recgroup'] = $_POST['disp_recgroup']; |
67 | | $_SESSION['scheduled_recordings']['disp_title'] = $_POST['disp_title']; |
| 61 | if (isset($_POST['change_display'])) { |
| 62 | $_SESSION['scheduled_recordings']['disp_scheduled'] = isset($_POST['disp_scheduled']) ? true : false; |
| 63 | $_SESSION['scheduled_recordings']['disp_duplicates'] = isset($_POST['disp_duplicates']) ? true : false; |
| 64 | $_SESSION['scheduled_recordings']['disp_deactivated'] = isset($_POST['disp_deactivated']) ? true : false; |
| 65 | $_SESSION['scheduled_recordings']['disp_conflicts'] = isset($_POST['disp_conflicts']) ? true : false; |
| 66 | $_SESSION['scheduled_recordings']['disp_recgroup'] = isset($_POST['disp_recgroup']) ? $_POST['disp_recgroup'] : null; |
| 67 | $_SESSION['scheduled_recordings']['disp_title'] = isset($_POST['disp_title']) ? $_POST['disp_title'] : null; |
68 | 68 | } |
69 | 69 | |
70 | 70 | // Defaults |
71 | | if (!is_array($_SESSION['scheduled_recordings']) |
| 71 | if (!isset($_SESSION['scheduled_recordings']) || !is_array($_SESSION['scheduled_recordings']) |
72 | 72 | || !($_SESSION['scheduled_recordings']['disp_scheduled'] |
73 | 73 | || $_SESSION['scheduled_recordings']['disp_duplicates'] |
74 | 74 | || $_SESSION['scheduled_recordings']['disp_deactivated'] |
… |
… |
|
93 | 93 | foreach ($shows as $starttime => $show_group) { |
94 | 94 | // Parse each show group |
95 | 95 | foreach ($show_group as $key => &$show) { |
| 96 | if (!isset($Groups[$show->recgroup])) |
| 97 | $Groups[$show->recgroup] = 0; |
96 | 98 | $Groups[$show->recgroup]++; |
97 | 99 | // Skip things we've already recorded (or missed) |
98 | 100 | if ($starttime <= time() && $show->recstatus != 'Recording') |
… |
… |
|
100 | 102 | // Make sure this is a valid show (ie. skip in-progress recordings and other junk) |
101 | 103 | if (!$callsign || $show->length < 1) |
102 | 104 | continue; |
| 105 | if (!isset($Program_Titles[$show->title])) |
| 106 | $Program_Titles[$show->title] = 0; |
103 | 107 | $Program_Titles[$show->title]++; |
104 | 108 | // Skip scheduled shows? |
105 | 109 | if (in_array($show->recstatus, array('WillRecord', 'ForceRecord'))) { |
106 | | if (!$_SESSION['scheduled_recordings']['disp_scheduled'] || $_GET['skip_scheduled']) |
| 110 | if (!$_SESSION['scheduled_recordings']['disp_scheduled'] || isset($_GET['skip_scheduled'])) |
107 | 111 | continue; |
108 | 112 | } |
109 | 113 | // Skip conflicting shows? |
110 | 114 | elseif (in_array($show->recstatus, array('Conflict', 'Overlap'))) { |
111 | | if (!$_SESSION['scheduled_recordings']['disp_conflicts'] || $_GET['skip_conflicts']) |
| 115 | if (!$_SESSION['scheduled_recordings']['disp_conflicts'] || isset($_GET['skip_conflicts'])) |
112 | 116 | continue; |
113 | 117 | } |
114 | 118 | // Skip duplicate or ignored shows? |
115 | 119 | elseif (in_array($show->recstatus, array('NeverRecord', 'PreviousRecording', 'CurrentRecording'))) { |
116 | | if (!$_SESSION['scheduled_recordings']['disp_duplicates'] || $_GET['skip_duplicates']) |
| 120 | if (!$_SESSION['scheduled_recordings']['disp_duplicates'] || isset($_GET['skip_duplicates'])) |
117 | 121 | continue; |
118 | 122 | } |
119 | 123 | // Skip deactivated shows? |
120 | 124 | elseif ($show->recstatus != 'Recording') { |
121 | | if (!$_SESSION['scheduled_recordings']['disp_deactivated'] || $_GET['skip_deactivated']) |
| 125 | if (!$_SESSION['scheduled_recordings']['disp_deactivated'] || isset($_GET['skip_deactivated'])) |
122 | 126 | continue; |
123 | 127 | } |
124 | 128 | // Show specific recgroup only |
125 | | if (($_SESSION['scheduled_recordings']['disp_recgroup'] && $show->recgroup != $_SESSION['scheduled_recordings']['disp_recgroup']) |
126 | | || ($_GET['recgroup'] && $show->recgroup != $_GET['recgroup'])) |
| 129 | if ((!empty($_SESSION['scheduled_recordings']['disp_recgroup']) && $show->recgroup != $_SESSION['scheduled_recordings']['disp_recgroup']) |
| 130 | || (isset($_GET['recgroup']) && $show->recgroup != $_GET['recgroup'])) |
127 | 131 | continue; |
128 | 132 | // Show specific title only |
129 | | if (($_SESSION['scheduled_recordings']['disp_title'] && $show->title != $_SESSION['scheduled_recordings']['disp_title']) |
130 | | || ($_GET['title'] && $show->title != $_GET['title'])) |
| 133 | if ((!empty($_SESSION['scheduled_recordings']['disp_title']) && $show->title != $_SESSION['scheduled_recordings']['disp_title']) |
| 134 | || (isset($_GET['title']) && $show->title != $_GET['title'])) |
131 | 135 | continue; |
132 | 136 | // Assign a reference to this show to the various arrays |
133 | 137 | $all_shows[] =& $show; |
-
diff --git a/modules/video/set_settings.php b/modules/video/set_settings.php
index b54900ed..3621b7ec 100644
a
|
b
|
|
19 | 19 | $sh->finish(); |
20 | 20 | |
21 | 21 | // Make sure we have a valid host selected |
22 | | if (!isset($Settings_Hosts[$_SESSION['settings']['host']])) |
23 | | $_SESSION['settings']['host'] = reset(array_keys($Settings_Hosts)); |
| 22 | if (!isset($_SESSION['settings']['host']) || !isset($Settings_Hosts[$_SESSION['settings']['host']])) { |
| 23 | $hosts = array_keys($Settings_Hosts); |
| 24 | $_SESSION['settings']['host'] = reset($hosts); |
| 25 | } |
24 | 26 | |
25 | 27 | // Make sure the session host gets updated to the posted one. |
26 | 28 | if (isset($_POST['host'])) |
27 | 29 | $_SESSION['settings']['host'] = $_POST['host']; |
28 | 30 | |
29 | | if ($_POST['save']) { |
| 31 | if (isset($_POST['save'])) { |
30 | 32 | setting('web_video_imdb_path', $_SESSION['settings']['host'], $_POST['web_video_imdb_path']); |
31 | 33 | setting('web_video_imdb_type', $_SESSION['settings']['host'], $_POST['web_video_imdb_type']); |
32 | 34 | setting('VideoAggressivePC', $_SESSION['settings']['host'], $_POST['VideoAggressivePC']); |