/** * Search for shows */ function search_shows() { global $apikey, $w, $query; $url = "http://api.trakt.tv/search/shows.json/{$apikey}?query={$query}"; $w->write($url, 'debug.txt'); $shows = $w->request($url); $shows = json_decode($shows); if (is_valid($shows)) { print_shows($shows); if (count($w->results()) == 0) { $w->result('info', '', 'No results', 'Please widen your search.', 'icons/info.png', 'no'); } } }
echo " selected"; } echo ">" . date("D m/d/y", $time) . "</option>"; } ?> </select><br /> <input type="submit" class="submit" value="<?php echo t('Jump'); ?> "><br /><br /> </center> </form> </p> <?php // Print the shows for today print_shows(); // Print the main page footer require_once 'modules/_shared/tmpl/' . tmpl . '/footer.php'; function print_shows() { global $this_channel; // No search was performed, just return if (!is_array($this_channel->programs)) { return; } // Display the results $row = 0; foreach ($this_channel->programs as $show) { if (strlen($show->title) <= 0 && strlen($show->subtitle) <= 0) { continue; }