1<?php 2/** 3 * Search 4 * 5 * @license GPL 6 * 7 * @package MythWeb 8 * 9 **/ 10 11// Print the main page header 12 $page_title = 'MythWeb - '.t('Search'); 13 require_once 'modules/_shared/tmpl/'.tmpl.'/header.php'; 14 15// Search, but nothing found - notify the user 16 global $Results; 17 if (!is_array($Results) || !count($Results)) { 18 echo '<p class="huge" align="center">No matches found</p>'; 19 return; 20 } 21// Get the url search string so we don't have to recreate it for each sort type 22 $search_str = '&s='.urlencode($_GET['s']); 23 $fields = array(); 24 if (preg_match('/\btitle/i', $_REQUEST['field'])) $fields[] = 'title'; 25 if (stristr($_REQUEST['field'], 'subtitle')) $fields[] = 'subtitle'; 26 if (stristr($_REQUEST['field'], 'desc')) $fields[] = 'description'; 27 if (stristr($_REQUEST['field'], 'cat')) $fields[] = 'category'; 28 if ($fields) 29 $search_str .= '&fields='.implode(',', $fields); 30// Display the results 31 32 $row = 0; 33 foreach ($Results as $show) { 34// Print the content 35 echo $show->channel->name.'<br />'; 36 echo '<a href="'.root_url.'tv/detail/'.$show->chanid.'/'.$show->starttime.'"><b>'.$show->title.'</b></a><br />'; 37 if(strlen($show->subtitle)) 38 echo $show->subtitle.'<br />'; 39// echo $show->description.'<br />'; 40 echo strftime($_SESSION['date_search'], $show->starttime).'<br />'; 41 echo nice_length($show->length).'<br /><br />'; 42 43 $row++; 44 } 45 require_once 'modules/_shared/tmpl/'.tmpl.'/footer.php'; 46