Skip to content

Commit 825bbca

Browse files
committed
Fixes #6783, this adds in the ability to override canned searches via the new configuration directory, and adds in a default one for the aussies out there
git-svn-id: http://svn.mythtv.org/svn/trunk@21090 7dbf422c-18fa-0310-86e9-fd20926502f2
1 parent 2c6b070 commit 825bbca

File tree

3 files changed

+31
-1
lines changed

3 files changed

+31
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?php
2+
/**
3+
* This file is used to create canned searches for your local setup. They are
4+
* defined in this separate file so that are not overwritten when you next
5+
* upgrade mythweb. Just use the php square bracket syntax to append to the
6+
* Canned_Searches array. See the examples included in this file. The
7+
* canned search names (array keys) are not subject to translate as it's
8+
* intented for local use and not global distribution.
9+
* Remove the .default extension to activate
10+
*
11+
* @url $URL: http://svn.mythtv.org/svn/branches/release-0-21-fixes/mythplugins/mythweb/modules/tv/canned_searches.conf.php $
12+
* @date $Date: 2007-12-31 21:38:38 +0100 (Mo, 31. Dez 2007) $
13+
* @version $Revision: 15274 $
14+
* @author $Author: xris $
15+
* @license GPL
16+
*
17+
* @package MythWeb
18+
*
19+
/**/
20+
21+
$Canned_Searches['Movies on Aussie TV (non HD)'] = '( program.category_type like "%movie%" OR program.title like "%movie%" ) AND timediff(program.endtime, program.starttime) > "01:10:00" and callsign not like "%HD%"';
22+
23+
$Canned_Searches['Movies on Aussie TV (HD)'] = '( program.category_type like "%movie%" OR program.title like "%movie%" ) AND timediff(program.endtime, program.starttime) > "01:10:00" and callsign like "%HD%';
24+
25+
?>

modules/tv/search.php

+3
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,9 @@
265265
$search_name = $search_name[1];
266266
// Load the canned searches
267267
require_once 'modules/tv/canned_searches.conf.php';
268+
// Load the local canned searches (if it exists)
269+
if (file_exists('configuration/canned_searches.conf.php'))
270+
include 'configuration/canned_searches.conf.php';
268271
// Find the query
269272
if (empty($Canned_Searches[$search_name]))
270273
add_warning("Unknown canned query: $search_name");

modules/tv/searches.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,12 @@
1515

1616
// Load the canned searches
1717
require_once 'modules/tv/canned_searches.conf.php';
18+
// Load the local canned searches (if it exists)
19+
if (file_exists('configuration/canned_searches.conf.php'))
20+
include 'configuration/canned_searches.conf.php';
1821

1922
// Load the class for this page
2023
require_once tmpl_dir.'searches.php';
2124

2225
// Exit
2326
exit;
24-

0 commit comments

Comments
 (0)