I'm having some problems applying the patch?

$ patch -p0 < ./engines/videodb-tvcom_engine.patch
can't find file to patch at input line 5
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git a/engines/engines.php b/engines/engines.php
|index 36e4eda..b02c3ab 100644
|--- a/engines/engines.php
|+++ b/engines/engines.php
--------------------------
File to patch: engines/engines.php
patching file engines/engines.php
Reversed (or previously applied) patch detected!  Assume -R? [n]
Apply anyway? [n]
Skipping patch.
1 out of 1 hunk ignored -- saving rejects to file engines/engines.php.rej
patching file b/engines/tvcom.php
The next patch would delete the file a/engines/tvtome.php,
which does not exist!  Assume -R? [n]

Michael Kollmann wrote:
Hi,

these changes should be sufficient for most needs.

I can send this patch split into two incremental patches to better show 
individual changes to tvtome.php if there's any need for that.

Mike
  

diff --git a/engines/engines.php b/engines/engines.php index 36e4eda..b02c3ab 100644 --- a/engines/engines.php +++ b/engines/engines.php @@ -30,7 +30,7 @@ function engineGetEngine($id) { // engine prefixed (imdb:081547) if (preg_match('/^(\w+):/', $id, $match)) $engine = $match[1]; - elseif (preg_match('/^\d+-\d+$/', $id)) $engine = 'tvtome'; + elseif (preg_match('/^\d+-\d+$/', $id)) $engine = 'tvcom'; elseif (preg_match('/^DP[0-9]/', $id)) $engine = 'dvdpalace'; // German Movie Database elseif (preg_match('/^[0-9A-Z]{10,}$/', $id)) { diff --git a/engines/tvcom.php b/engines/tvcom.php new file mode 100644 index 0000000..33be42e --- /dev/null +++ b/engines/tvcom.php @@ -0,0 +1,265 @@ +<?php +/** + * TV.com Parser + * + * Parses data from the TV Tome Movie Database + * + * @package Engines + * @author Andreas Goetz <cpuidle@gmx.de> + * @link http://www.tv.com TV Tome + * @version $Id: tvtome.php,v 1.11 2005/09/07 16:39:11 andig2 Exp $ + */ + +$GLOBALS['tvcomServer'] = 'http://www.tv.com'; +$GLOBALS['tvcomIdPrefix'] = 'tvcom:'; + +/** + * Get meta information about the engine + * + * @todo Include image search capabilities etc in meta information + */ +function tvcomMeta() +{ + return array('name' => 'TV.com', 'stable' => 1); +} + +/** + * Get search Url for a TV.com movie + * + * @param string The search string + * @return string The search URL (GET) + */ +function tvcomSearchUrl($title) +{ + global $tvcomServer; + + preg_replace ('|\ |', '+', $title); + return $tvcomServer.'/search.php?qs='.urlencode($title).'&stype=all'; +} + +/** + * Get search Url to visit external site + * + * @todo Have to store episode url, probably. + * + * @param string $id The movie's external id + * @return string The visit URL + */ +function tvcomContentUrl($id) +{ + global $tvcomServer; + + // split into show and episode + list($showid, $episodeid) = explode('-', $id); + return $tvcomServer.'/show/'.$showid.'/episode/'.$episodeid.'/summary.html'; +} + +/** + * Search a Movie + * + * Searches for a given title on tv.com and returns + * results as associative array + * + * @param string The search string + * @return array Associative array with id and title + */ +function tvcomSearch($title) +{ + global $tvcomServer; + global $CLIENTERROR; + global $cache; + + // search for series + $resp = httpClient(tvcomSearchUrl($title), $cache); + if (!$resp['success']) $CLIENTERROR .= $resp['error']."\n"; + + // take the first match + if (preg_match('|Show:.*?<a[^>]*href="(http.*?/summary.html)[^>]*>(.*?)</a>|s', $resp['data'], $series)) + { + $showurl = $series[1]; + $showtitle = $series[2]; + $resp = httpClient($showurl, $cache); + if (!$resp['success']) $CLIENTERROR .= $resp['error']."\n"; + } + + // get show tag and id + if (preg_match('|/([^/]+)/show/(\d+)/|i', $showurl, $series)) + { +// $showtag = $series[1]; + $showid = $series[2]; + } + + // look for episode listing + if (preg_match('|<a href="(http.*?/show/\d+/episode_listings.html)[^>]*>.*?Episodes|', $resp['data'], $series)) + { + // TODO: field to enter season (and/or get and strip from title) + $listurl = $series[1]."?season=0"; + $resp = httpClient($listurl, $cache); + if (!$resp['success']) $CLIENTERROR .= $resp['error']."\n"; + } + + if (preg_match_all('|<td class="f-bold">\s*<a href=".*?/episode/(\d+)/[^>]*>(.*?)</a>|i', $resp['data'], $data, PREG_SET_ORDER)) + { + foreach ($data as $row) + { + $info['id'] = $showid.'-'.$row[1]; // season id - episode id + $info['showid'] = $showid; // currently not used + $info['episodeid'] = $row[3]; // currently not used + $info['title'] = $showtitle; + $info['subtitle'] = $row[2]; + $ary[] = $info; + } + } + + return $ary; +} + +/** + * Fetches the data for a given TV Tome id + * + * @param int TV Tome id (show-episode) + * @return array Result data + */ +function tvcomData($id) +{ + global $CLIENTERROR; + global $cache; + + $data= array(); //result + $ary = array(); //temp + + // fetch mainpage + $resp = httpClient(tvcomContentUrl($id), $cache); + if (!$resp['success']) $CLIENTERROR .= $resp['error']."\n"; + + // strip it a little + preg_match('|<span class="f-bold">Score:</span>(.*?)<div class="ta-c f-bold">|si', $resp[data], $ary); + $body = $ary[1]; + + // Year + preg_match('|First Aired:.*\ (\d{4})\ |i', $body, $ary); + $data['year'] = trim($ary[1]); + + // Director + preg_match('|Director:\s*</td>\s*<td>\s*<a href="[^>]*>([^<]*)</a>|si', $body, $ary); + $data['director'] = preg_replace('/\.*$/','',trim($ary[1])); + + // Plot + preg_match('|<div id="main-col">\s*<div>\s*([^<]*)|si', $body, $ary); + trim($ary); + if (empty($ary)) { + preg_match('|<div id="main-col">\s*<div>([^<]*)<div class="ta-r mt-10 f-bold">|si', $body, $ary); + } + $data['plot'] = trim($ary[1]); + +/* + // TODO: update to new layout + // expose this to append the notes to the plot + if (preg_match('/Notes<\/strong>.*?<tr><td>\s+(.+?)\s+<\/td><\/tr>/is', $resp['data'], $ary)) + { + $data['plot'] .= "\n<b>Note:</b>\n".'<ul>'.trim(preg_replace('/\s{2,}/s', ' ', $ary[1])).'</ul>'; + } +*/ + + // Cast + $cast = ''; + if (preg_match('|<td class[^<]*Star:[^<]*</td>(.*?)</td>|si', $body, $ary)) + { + preg_match_all('|<a href="http.*?/person/.*?/summary.html">(.*?)</a>\s*\(([^,)(]+)\)?|si',$ary[0],$stars,PREG_SET_ORDER); + foreach($stars as $s){ + $cast .= trim($s[1]) . "::"; + $cast .= trim($s[2]); + $cast .= "::\n"; + } + } + + if (preg_match('|<td class[^<]*Recurring Role:[^<]*</td>(.*?)</td>|si', $body, $ary)) + { + preg_match_all('|<a href="http.*?/person/.*?/summary.html">(.*?)</a>\s*\(([^,)(]+)\)?|si',$ary[0],$stars,PREG_SET_ORDER); + foreach($stars as $s){ + $cast .= trim($s[1]) . "::"; + $cast .= trim($s[2]); + $cast .= "::\n"; + } + } + + if (preg_match('|<td class[^<]*Guest Star:[^<]*</td>(.*?)</td>|si', $body, $ary)) + { + preg_match_all('|<a href="http.*?/person/.*?/summary.html">(.*?)</a>\s*\(([^,)(]+)\)?|si',$ary[0],$stars,PREG_SET_ORDER); + foreach($stars as $s){ + $cast .= trim($s[1]) . "::"; + $cast .= trim($s[2]); + $cast .= "::\n"; + } + } + + $data['cast'] = trim($cast); + + // Rating + preg_match('|<span[^>]*>(\d[^<]*)|si', $body, $ary); + $data['rating'] = trim($ary[1]); + + // Episode number (currently not used) + preg_match('|Episode Number: (\d+)|i', $body, $ary); + $data['episode'] = $ary[1]; + + // Season number (currently not used) + preg_match('|Season Num: (\d+)|i', $body, $ary); + $data['season'] = $ary[1]; + +/* + // Production code (currently not used) + preg_match('|Prod Code: ([^<]+)|i', $body, $ary); + $data['prodno'] = $ary[1]; +*/ + +/* + More data from IMDB currently not retrievable via tvtome: + + //Cover URL + preg_match('/<IMG.*?alt="cover".*?(http:\/\/.+?\.(jpe?g|gif))/i',$resp['data'],$ary); + $data['coverurl'] = trim($ary[1]); + + //MPAA Rating + preg_match('/<A HREF="\/mpaa">MPAA<\/A>: ?<\/B>(.+?)<br>/i',$resp['data'],$ary); + $data['mpaa'] = trim($ary[1]); + + //Runtime + preg_match('/Runtime:?<\/B>:?.*?([0-9,]+).*?<\/TD>/si',$resp['data'],$ary); + $data['runtime'] = preg_replace('/,/', '', trim($ary[1])); + + //Countries + preg_match_all('/<A HREF="\/Sections\/Countries\/.+?\/">(.+?)<\/A>/i',$resp['data'],$ary,PREG_PATTERN_ORDER); + $data['country'] = trim(join(' ',$ary[1])); + + //Genres (as Array) + preg_match_all('/<A HREF="\/Sections\/Genres\/.+?\/">(.+?)<\/A>/i',$resp['data'],$ary,PREG_PATTERN_ORDER); + foreach($ary[1] as $genre) { + $data['genres'][] = trim($genre); + } + + //fetch credits + $resp = httpClient($tvcomServer.'/title/tt'.$id.'/fullcredits', true); + if(!$resp['success']) $CLIENTERROR .= $resp['error']."\n"; + $resp['data'] = preg_replace('/.*?Cast<\/B><\/A>(.*?)<\/TABLE>/is', '$1', $resp['data']); +*/ + + return $data; +} + +/** + * Parses Actor-Details + * + * Find image and detail URL for actor, not sure if this can be made + * a one-step process? + * + * @param string $name Name of the Actor + * @return array array with Actor-URL and Thumbnail + */ +function tvcomActor($name, $actorid) +{ + global $tvcomServer; + return array(); +} + +?> diff --git a/engines/tvtome.php b/engines/tvtome.php deleted file mode 100644 index ed51bda..0000000 --- a/engines/tvtome.php +++ /dev/null @@ -1,223 +0,0 @@ -<?php -/** - * TVTOME Parser - * - * Parses data from the TV Tome Movie Database - * - * @package Engines - * @author Andreas Goetz <cpuidle@gmx.de> - * @link http://www.tvtome.com TV Tome - * @version $Id: tvtome.php,v 1.11 2005/09/07 16:39:11 andig2 Exp $ - */ - -$GLOBALS['tvtomeServer'] = 'http://www.tvtome.com'; - -/** - * Get meta information about the engine - * - * @todo Include image search capabilities etc in meta information - */ -function tvtomeMeta() -{ - return array('name' => 'TV Tome', 'stable' => 1, 'php' => '9.9'); -} - -/** - * Get search Url for a TV Tome movie - * - * @param string The search string - * @return string The search URL (GET) - */ -function tvtomeSearchUrl($title) -{ - global $tvtomeServer; - return $tvtomeServer.'/tvtome/servlet/Search?searchType=all&searchString='.urlencode($title); -} - -/** - * Get search Url to visit external site - * - * @param string $id The movie's external id - * @return string The visit URL - */ -function tvtomeContentUrl($id) -{ - global $tvtomeServer; - - // split into show and episode - list($showid, $episodeid) = explode('-', $id); - return $tvtomeServer.'/tvtome/servlet/GuidePageServlet/showid-'.$showid.'/epid-'.$episodeid.'/'; -} - -/** - * Search a Movie - * - * Searches for a given title on tvtome and returns - * results as associative array - * - * @param string The search string - * @return array Associative array with id and title - */ -function tvtomeSearch($title) -{ - global $tvtomeServer; - global $CLIENTERROR; - global $cache; - - // search for series - $resp = httpClient(tvtomeSearchUrl($title), $cache); - if (!$resp['success']) $CLIENTERROR .= $resp['error']."\n"; - - // direct match? - if ($resp['redirect']) { - $url = $resp['redirect']; - } else { - // take the first match - if (preg_match('/Show search for:.*?<a href="(.*?)">/s', $resp['data'], $series)) - { - $url = $tvtomeServer.$series[1]; - $resp = httpClient($tvtomeServer.$series[1], $cache); - if (!$resp['success']) $CLIENTERROR .= $resp['error']."\n"; - } - } - - // look for episode guide - if (preg_match('/<a href="(.*?)" class="sidenav">.*?Episode List/', $resp['data'], $series)) - { - $resp = httpClient($url.$series[1], $cache); - if (!$resp['success']) $CLIENTERROR .= $resp['error']."\n"; - } - - if (preg_match_all('/<td nowrap valign=top class="small">\s*(.*?)<\/td>.*?<a href=".*?showid-(\d+)\/epid-(\d+).*?">(.*?)<\/a>/i', $resp['data'], $data, PREG_SET_ORDER)) - { - foreach ($data as $row) - { - $info['id'] = $row[2].'-'.$row[3]; // season id - episode id - $info['showid'] = $row[2]; // currently not used - $info['episodeid'] = $row[3]; // currently not used - $info['title'] = $row[4]; // dup - $info['subtitle'] = $row[4]; // dup - $ary[] = $info; - } - } - - return $ary; -} - -/** - * Fetches the data for a given TV Tome id - * - * @param int TV Tome id (show-episode) - * @return array Result data - */ -function tvtomeData($id) -{ - global $CLIENTERROR; - global $cache; - - $data= array(); //result - $ary = array(); //temp - - // fetch mainpage - $resp = httpClient(tvtomeContentUrl($id), $cache); - if (!$resp['success']) $CLIENTERROR .= $resp['error']."\n"; - - // Titles - preg_match('/<h1>(.*?)<\/h1>/i', $resp['data'], $ary); - list($t,$s) = split(" - ",trim($ary[1]),2); - $data['title'] = trim($t); - $data['subtitle'] = trim($s); - - // Year - preg_match('/<td class="row1">First Aired<\/td><td class="row1">.*?(\d{4})<\/td>/i', $resp['data'], $ary); - $data['year'] = trim($ary[1]); - - // Director - preg_match('/<td class="row2">Director<\/td><td class="row2"><a href=".+?">(.+?)<\/a>/i', $resp['data'], $ary); - $data['director'] = trim($ary[1]); - - // Plot - preg_match('/Synopsis<\/strong>.*?<tr><td>\s+(.+?)\s+<\/td><\/tr>/is', $resp['data'], $ary); - $plot = preg_replace('/\s{2,}/s', ' ', $ary[1]); - $plot = preg_replace('#<(br|p)\s*/?>#i', "\n", $plot); - $data['plot'] = trim($plot); - -/* - // expose this to append the notes to the plot - if (preg_match('/Notes<\/strong>.*?<tr><td>\s+(.+?)\s+<\/td><\/tr>/is', $resp['data'], $ary)) - { - $data['plot'] .= "\n<b>Note:</b>\n".'<ul>'.trim(preg_replace('/\s{2,}/s', ' ', $ary[1])).'</ul>'; - } -*/ - - // Cast - if (preg_match('/<b>Guest Stars:<\/b>(.+?)<\/td>/is', $resp['data'], $m)) - { - preg_match_all('/<a href="\/tvtome\/servlet\/PersonDetail\/personid-\d+">(.+?)<\/a>\s+\((.+?)\)/si', $m[1], $ary, PREG_PATTERN_ORDER); - $count = 0; - while (isset($ary[1][$count])) - { - $actor = trim(strip_tags($ary[1][$count])); - $role = trim(strip_tags($ary[2][$count])); - $role = preg_replace('/as\s+/', '', $role); // avoid leading as... - if (ereg('\(uncredited$', $role)) $role .= ')'; // fix trailing ) - $cast .= "$actor::$role\n"; # ::$actorid - $count++; - } - $data['cast'] = trim($cast); - } - - // Rating - preg_match('/Avg. Rating:<\/td><td>(\d\.\d)\d*<\/td>/i', $resp['data'], $ary); - $data['rating'] = trim($ary[1]); - -/* - More data from IMDB currently not retrievable via tvtome: - - //Cover URL - preg_match('/<IMG.*?alt="cover".*?(http:\/\/.+?\.(jpe?g|gif))/i',$resp['data'],$ary); - $data['coverurl'] = trim($ary[1]); - - //MPAA Rating - preg_match('/<A HREF="\/mpaa">MPAA<\/A>: ?<\/B>(.+?)<br>/i',$resp['data'],$ary); - $data['mpaa'] = trim($ary[1]); - - //Runtime - preg_match('/Runtime:?<\/B>:?.*?([0-9,]+).*?<\/TD>/si',$resp['data'],$ary); - $data['runtime'] = preg_replace('/,/', '', trim($ary[1])); - - //Countries - preg_match_all('/<A HREF="\/Sections\/Countries\/.+?\/">(.+?)<\/A>/i',$resp['data'],$ary,PREG_PATTERN_ORDER); - $data['country'] = trim(join(' ',$ary[1])); - - //Genres (as Array) - preg_match_all('/<A HREF="\/Sections\/Genres\/.+?\/">(.+?)<\/A>/i',$resp['data'],$ary,PREG_PATTERN_ORDER); - foreach($ary[1] as $genre) { - $data['genres'][] = trim($genre); - } - - //fetch credits - $resp = httpClient($tvtomeServer.'/title/tt'.$id.'/fullcredits', true); - if(!$resp['success']) $CLIENTERROR .= $resp['error']."\n"; - $resp['data'] = preg_replace('/.*?Cast<\/B><\/A>(.*?)<\/TABLE>/is', '$1', $resp['data']); -*/ - - return $data; -} - -/** - * Parses Actor-Details - * - * Find image and detail URL for actor, not sure if this can be made - * a one-step process? - * - * @param string $name Name of the Actor - * @return array array with Actor-URL and Thumbnail - */ -function tvtomeActor($name, $actorid) -{ - global $tvtomeServer; - return array(); -} - -?> \ No newline at end of file diff --git a/javascript/search.js b/javascript/search.js index c881e0c..3d7051b 100644 --- a/javascript/search.js +++ b/javascript/search.js @@ -67,9 +67,9 @@ function submitSearch() document.searchFilmweb.submit(); break; - case "tvtome": - document.searchTvtome.forTvtome.value = unQuote(document.search.q.value); - document.searchTvtome.submit(); + case "tvcom": + document.searchTvcom.forTvcom.value = unQuote(document.search.q.value); + document.searchTvcom.submit(); break; case "amazon": diff --git a/lookup.php b/lookup.php index a5c6992..d7f9f7e 100644 --- a/lookup.php +++ b/lookup.php @@ -83,7 +83,7 @@ switch ($engine) break; default: - // tvtome, amazon, google + // tvcom, amazon, google if (!empty($find)) { $matches = engineSearch($find, $engine); diff --git a/templates/DownLord/lookup.tpl b/templates/DownLord/lookup.tpl index a94558d..fb64563 100644 --- a/templates/DownLord/lookup.tpl +++ b/templates/DownLord/lookup.tpl @@ -81,7 +81,7 @@ <ul> {foreach item=match from=$imdbresults} <li> - <a class="list_title" href="javascript:void(returnData('{$match.id}','{$match.title|escape:"javascript"}','{$match.subtitle|escape:"javascript"}', '{$engine}'));" title="add ID and close Window">{$match.title}</a> + <a class="list_title" href="javascript:void(returnData('{$match.id}','{$match.title|escape:"javascript"}','{$match.subtitle|escape:"javascript"}', '{$engine}'));" title="add ID and close Window">{$match.title}{if $match.subtitle} - {$match.subtitle}{/if}</a> {if $match.details or $match.imgsmall} <br/> <font size="-2"> diff --git a/templates/advanced/lookup.tpl b/templates/advanced/lookup.tpl index a2ae8ae..423419c 100644 --- a/templates/advanced/lookup.tpl +++ b/templates/advanced/lookup.tpl @@ -62,7 +62,7 @@ <ul> {foreach item=match from=$imdbresults} <li> - <a href="javascript:void(returnDataMine('{$match.id}','{$match.title|escape:"javascript"}','{$match.subtitle|escape:"javascript"}', '{$engine}'));" title="add ID and close Window">{$match.title}</a> + <a href="javascript:void(returnDataMine('{$match.id}','{$match.title|escape:"javascript"}','{$match.subtitle|escape:"javascript"}', '{$engine}'));" title="add ID and close Window">{$match.title}{if $match.subtitle} - {$match.subtitle}{/if}</a> {if $match.details or $match.imgsmall} <br/> <font size="-2"> {if $match.imgsmall}<img src="{$match.imgsmall}" align="left" width="25" height="35" />{/if} diff --git a/templates/default/lookup.tpl b/templates/default/lookup.tpl index 34a1bfd..9a92aa2 100644 --- a/templates/default/lookup.tpl +++ b/templates/default/lookup.tpl @@ -71,7 +71,7 @@ <ul> {foreach item=match from=$imdbresults} <li> - <a href="javascript:void(returnData('{$match.id}','{$match.title|escape:"javascript"}','{$match.subtitle|escape:"javascript"}', '{$engine}'));" title="add ID and close Window">{$match.title}</a> + <a href="javascript:void(returnData('{$match.id}','{$match.title|escape:"javascript"}','{$match.subtitle|escape:"javascript"}', '{$engine}'));" title="add ID and close Window">{$match.title}{if $match.subtitle} - {$match.subtitle}{/if}</a> {if $match.details or $match.imgsmall} <br/> <font size="-2"> diff --git a/templates/elegant/lookup.tpl b/templates/elegant/lookup.tpl index 1317a65..aa5eef7 100644 --- a/templates/elegant/lookup.tpl +++ b/templates/elegant/lookup.tpl @@ -68,7 +68,7 @@ <ul> {foreach item=match from=$imdbresults} <li> - <a href="javascript:void(returnData('{$match.id}','{$match.title|escape:"javascript"}','{$match.subtitle|escape:"javascript"}', '{$engine}')); opener.xmlrequest();" title="add ID and close Window">{$match.title}</a> + <a href="javascript:void(returnData('{$match.id}','{$match.title|escape:"javascript"}','{$match.subtitle|escape:"javascript"}', '{$engine}')); opener.xmlrequest();" title="add ID and close Window">{$match.title}{if $match.subtitle} - {$match.subtitle}{/if}</a> {if $match.details or $match.imgsmall} <br/> <font size="-2"> diff --git a/templates/jeckyll/lookup.tpl b/templates/jeckyll/lookup.tpl index f678789..2ae1322 100755 --- a/templates/jeckyll/lookup.tpl +++ b/templates/jeckyll/lookup.tpl @@ -7,7 +7,7 @@ <table width="95%" cellpadding="0" cellspacing="2"> <tr valign="bottom"> {foreach item=tab from=$engines} - <td><div class="divbutton"><a href="{$tab.url}" style="text-decoration: none;">{if $tab.CLASS == 'tabActive'}� {/if}{$tab.name}</a></div></td> + <td><div class="divbutton"><a href="{$tab.url}" style="text-decoration: none;">{if $tab.CLASS == 'tabActive'} {/if}{$tab.name}</a></div></td> {/foreach} </tr> </table> @@ -83,7 +83,7 @@ {foreach item=match from=$imdbresults} <li> <a href="javascript:void(returnData('{$match.id}','{$match.title|escape:"javascript"}','{$match.subtitle|escape:"javascript"}', '{$engine}'));" title="add ID and close Window"> - {$match.title} + {$match.title}{if $match.subtitle} - {$match.subtitle}{/if} </a> {if $match.details or $match.imgsmall} <br/> diff --git a/templates/modern/lookup.tpl b/templates/modern/lookup.tpl index bc2bd14..5f0d078 100644 --- a/templates/modern/lookup.tpl +++ b/templates/modern/lookup.tpl @@ -68,7 +68,7 @@ <ul> {foreach item=match from=$imdbresults} <li> - <a href="javascript:void(returnData('{$match.id}','{$match.title|escape:"javascript"}','{$match.subtitle|escape:"javascript"}', '{$engine}'));" title="add ID and close Window">{$match.title}</a> + <a href="javascript:void(returnData('{$match.id}','{$match.title|escape:"javascript"}','{$match.subtitle|escape:"javascript"}', '{$engine}'));" title="add ID and close Window">{$match.title}{if $match.subtitle} - {$match.subtitle}{/if}</a> {if $match.details or $match.imgsmall} <br/> <font size="-2"> diff --git a/templates/modern/searchengines.tpl b/templates/modern/searchengines.tpl index 598f115..0725aea 100644 --- a/templates/modern/searchengines.tpl +++ b/templates/modern/searchengines.tpl @@ -10,12 +10,12 @@ <input type="hidden" name="select" value="All" /> </form> -{if $engine.tvtome} -{assign var="link" value="http://www.tvtome.com/tvtome/servlet/Search"} -<form action="trace.php" id="searchTvtome" name="searchTvtome" method="get" {if !$config.imdbBrowser}target="_blank"{/if}> +{if $engine.tvcom} +{assign var="link" value="http://www.tv.com/search.php"} +<form action="trace.php" id="searchTvcom" name="searchTvcom" method="get" {if !$config.imdbBrowser}target="_blank"{/if}> {if $config.imdbBrowser}<input type="hidden" name="videodburl" value="{$link}"/>{/if} - <input type="hidden" name="searchString" id="forTvtome" value=""/> - <input type="hidden" name="searchType" value="all" /> + <input type="hidden" name="qs" id="forTvcom" value=""/> + <input type="hidden" name="stype" value="all"/> </form> {/if} diff --git a/templates/modern/searchradios.tpl b/templates/modern/searchradios.tpl index 8fdd4d0..ba2c94a 100644 --- a/templates/modern/searchradios.tpl +++ b/templates/modern/searchradios.tpl @@ -4,8 +4,8 @@ *} <label for="engine0"><input type="radio" name="engine" id="engine0" value="videodb" checked="checked" />videoDB</label> -{if $engine.tvtome} -<label for="engine1"><input type="radio" name="engine" id="engine1" value="tvtome" />TV Tome</label>{/if} +{if $engine.tvcom} +<label for="engine1"><input type="radio" name="engine" id="engine1" value="tvcom" />TV.com</label>{/if} {if $engine.amazon || $engine.amazoncom || $engine.amazonxml} <label for="engine2"><input type="radio" name="engine" id="engine2" value="amazon" />Amazon</label>{/if} <label for="engine3"><input type="radio" name="engine" id="engine3" value="imdb" />IMDB</label> diff --git a/trace.php b/trace.php index 719d172..d6ec4d5 100644 --- a/trace.php +++ b/trace.php @@ -99,7 +99,7 @@ function array_delete($a, $i, $count = 1) return $result; } -function tvtomeId($url) +function tvcomId($url) { if (preg_match('/showid-(\d+)\/epid-(\d+)\/?$/', $url, $m)) $id = $m[1].'-'.$m[2]; else $id = false; @@ -156,10 +156,10 @@ function _replace_enclosed_tag_traced($matches) '<img src="'.img('add.gif').'" valign="absmiddle" border="0" alt="Add Movie"/></a>'; } } - elseif (eregi('tvtome', $uri['host'])) + elseif (eregi('tv', $uri['host'])) { - // tvtome - if (false !== ($id = tvtomeId($url))) + // tvcom + if (false !== ($id = tvcomId($url))) { if (!ereg(' Episode', $title)) // don't match on previous/next $append .= ' <a href="edit.php?save=1&amp;lookup=1&amp;imdbID='.$id. @@ -223,7 +223,7 @@ function imdb_replace_title_callback($matches) return $result; } -function tvtome_replace_title_callback($matches) +function tvcom_replace_title_callback($matches) { global $page, $uri; @@ -231,7 +231,7 @@ function tvtome_replace_title_callback($matches) $title = html_entity_decode(strip_tags($matches[3])); # fix names like &#34;ER&#34; $subtitle = html_entity_decode(strip_tags($matches[4])); - if (false !== ($id = tvtomeId($uri['path']))) { + if (false !== ($id = tvcomId($uri['path']))) { $result .= ' <a href="edit.php?save=1&amp;lookup=1&amp;imdbID='.$id. '&amp;title='.urlencode($title).'&amp;subtitle='.urlencode($subtitle).'">'. '<img src="'.img('add.gif').'" valign="absmiddle" border="0" alt="Add Movie"/></a>'; @@ -281,8 +281,8 @@ function fixup_HTML($html) // title if (eregi('imdb', $uri['host'])) { $html = preg_replace_callback("/(<strong\s+class=\"title\">)(.*?)(<small>.*?<\/strong>)/si", 'imdb_replace_title_callback', $html); - } elseif (eregi('tvtome', $uri['host'])) { - $html = preg_replace_callback('/((<h1>)(.+?) - (.+?))(<\/h1>)/i', 'tvtome_replace_title_callback', $html); + } elseif (eregi('tv', $uri['host'])) { + $html = preg_replace_callback('/((<h1>)(.+?) - (.+?))(<\/h1>)/i', 'tvcom_replace_title_callback', $html); } /* // strip flash @@ -293,7 +293,7 @@ function fixup_HTML($html) $html = preg_replace('/<!-- AD BOX begins .*? AD BOX ends -->/is', '', $html); $html = preg_replace('#<CENTER><script src="http://\w+.amazon.com.*?</CENTER>#mis', '', $html); $html = preg_replace('#<!-- ---- IMDB.*?Advertising.com---------- -->#mis', '', $html); - // tvtome + // tvcom $html = preg_replace('/<!-- BEGIN RICH-MEDIA BURST! CODE .*? END BURST CODE -->/is', '', $html); $html = preg_replace('/<!-- FASTCLICK.COM .*?!-- FASTCLICK.COM .*? -->/is', '', $html); */

------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

_______________________________________________ videodb-devel mailing list videodb-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/videodb-devel