public static function findFrontends() { $frontends = Cache::get('MythFrontends[Frontends]'); if (!is_array($frontends) || count($frontends) == 0) { global $db; $frontends = array(); $frontends_sh = $db->query('SELECT DISTINCT settings.hostname FROM settings WHERE settings.hostname IS NOT NULL AND settings.value = "NetworkControlEnabled" AND settings.data = 1'); while ($host = $frontends_sh->fetch_col()) { $frontend =& MythFrontend::find($host); if ($frontend->query_location() != 'OFFLINE') { $frontends[$host] = $frontend; } } Cache::set('MythFrontends[Frontends]', $frontends); } return $frontends; }
<?php /** * * @license GPL * * @package MythWeb * **/ $chanid = $_REQUEST['chanid']; $starttime = $_REQUEST['starttime']; if ($_REQUEST['host']) { $host = $_REQUEST['host']; $frontends = MythFrontend::findFrontends(); $frontends[$host]->play_program($chanid, $starttime); header('Location: ' . root_url . 'tv/detail/' . urlencode($chanid) . '/' . urlencode($starttime)); exit; } $Page_Previous_Location = root_url . 'tv/detail/' . urlencode($chanid) . '/' . urlencode($starttime); $Page_Previous_Location_Name = 'Details'; $Page_Title_Short = 'Pick Frontend'; // Display the page require_once tmpl_dir . 'play_program_on_frontend.php';