require 'config.php';
function printShow($show) {
global $TV_PATH;
global $EXISTS_FILES;
global $CONTENT_FILES;
# Construct our show path and make sure it's reasonable
$path = $TV_PATH . '/' . $show;
if (!is_dir($path)) {
die('Unknown show: ' . htmlspecialchars($show));
}
# Check the flags
$flags = readFlags($path);
# Check the seasons
$seasons = findSeasons($path);
# Header
echo '
' . htmlspecialchars($show) . '
';
echo '';
}
# Print a DL of all shows and note the available and monitored seasons
function printAllShows() {
global $TV_PATH;
global $MEDIA_PATH;
$shows = allShows($TV_PATH);
echo "\n";
foreach ($shows as $show => $seasons) {
echo '- ' . htmlspecialchars($show) . "
\n";
foreach ($seasons as $season => $monitored) {
echo '- Season ' . htmlspecialchars($season);
if ($monitored) {
echo ' (monitored)';
}
echo "
\n";
}
}
echo "
\n";
}
?>