<?php /** * Created by PhpStorm. * User: Colin * Date: 2016-02-12 * Time: 9:19 PM */ require_once "includes/config.php"; include_once "includes/page_header.php"; require_once "includes/functions.php"; $movie_array = get_movies(); $show_array = get_shows(); $movie_array = array_filter($movie_array, function ($k) { if (strpos($k, $_GET["q"]) != false) { return true; } else { return false; } }); $show_array = array_filter($show_array, function ($k) { if (strpos($k, $_GET["q"]) != false) { return true; } else { return false; } }); echo "<H1>Results</H1>"; if (sizeof($movie_array) > 0) { echo "<H2>Matching Movies:</H2>"; foreach ($movie_array as $movie) {
<?php /** * Created by PhpStorm. * User: Colin * Date: 2016-02-11 * Time: 7:53 PM * * builds the list of TV Shows */ require_once "functions.php"; if (isset($_GET['show']) && !empty($_GET['show'])) { $episodes = get_media(urldecode($_GET['show']), '.mp4'); echo sizeof($episodes) . " episodes<br/>"; foreach ($episodes as $episode) { echo '<a href="watch.php?vid=', urlencode($episode), '">' . strip_path($episode) . '</a><br/>'; } } else { $shows = get_shows(); echo sizeof($shows) . " shows<br/>"; foreach ($shows as $show) { print_show($show); } }