// remove (#1 - xxxx/xxxx) at the beginnning of the name if (substr($title, 0, 2) == "(#") { while (substr($title, 0, 1) != ")") { $title = substr($title, 1); } $title = substr($title, 1); } if (isset($_GET["sc_genre"]) && strlen(trim($_GET["sc_genre"])) > 1) { $genre = $_GET["sc_genre"]; } if (isset($_GET["sc_name"]) && strlen(trim($_GET["sc_name"])) > 1) { $title = $_GET["sc_name"]; } $title = trim($title); $genre = trim($genre); add_station($title, $url, $genre); } // delete station if (isset($_GET["del_item_id"])) { $id = $_GET["del_item_id"]; delete_station($id); header("Location:app.php#page2"); } // play folder if (isset($_GET["play_folder"])) { $folder = base64_decode($_GET["play_folder"]); generate_playlist($folder); $_GET["play_local"] = "playlist.m3u"; $_GET["play_local_rel"] = 1; } ?>
<?php include_once 'common.php'; if ($_SERVER['REQUEST_METHOD'] == 'POST') { if (isset($_POST['_action'])) { unset($_POST['_action']); $res = del_station($_POST); } else { $_POST['active'] = 1; $res = add_station($_POST); } $dir = dirname($_SERVER['REQUEST_URI']); if (!empty($dir) && strlen($dir) > 2) { $dir .= '/'; } else { $dir = 'http://indycast.net/'; } header('Location: /admin.php'); exit(0); } $station = false; if (!empty($_GET['id'])) { $station = get_station(['id' => $_GET['id']]); } if (!$station) { $station = []; echo '<title>new station | indycast</title>'; } else { echo '<title>' . $station['callsign'] . ' modify | indycast</title>'; } ?>