[mythtv] patch: movies, years/stars/ratings
Andy Davidoff
dert at pobox.com
Fri Mar 7 05:53:30 EST 2003
[ I'm including the earlier airdate/stars/ratings patch for completeness,
and because I added an index in the SQL script. ]
This patch makes the movie listings page look more like the listings page
and enables release-year, star ratings, and content ratings for programs
in both these listing pages.
The year information is now used in the movie listings to improve the
search of the IMDB. This should be copied to the "single" program view,
which I haven't touched.
It is no longer necessary to specify channels that may contain movies;
we use the content ratings and release-years to figure this out now.
Instead, it's useful to specify a list of channels which should not be
included in the movie listings (eg. Pay-Per-View). The syntax for this
is straightfoward; those in the US can use channel-number ranges.
I'm probably forgetting something. Oh well, feedback appreciated...
-------------- next part --------------
Index: MC/programs/mythfilldatabase/filldata.cpp
===================================================================
RCS file: /var/lib/cvs/MC/programs/mythfilldatabase/filldata.cpp,v
retrieving revision 1.43
diff -d -u -w -r1.43 filldata.cpp
--- MC/programs/mythfilldatabase/filldata.cpp 23 Feb 2003 15:13:34 -0000 1.43
+++ MC/programs/mythfilldatabase/filldata.cpp 3 Mar 2003 01:19:44 -0000
@@ -50,6 +50,12 @@
QString finetune;
};
+struct ProgRating
+{
+ QString system;
+ QString rating;
+};
+
class ProgInfo
{
public:
@@ -63,6 +69,9 @@
category = other.category;
start = other.start;
end = other.end;
+ airdate = other.airdate;
+ stars = other.stars;
+ ratings = other.ratings;
}
QString startts;
@@ -72,6 +81,9 @@
QString subtitle;
QString desc;
QString category;
+ QString airdate;
+ QString stars;
+ QValueList<ProgRating> ratings;
QDateTime start;
QDateTime end;
@@ -301,6 +313,50 @@
{
pginfo->category = getFirstText(info);
}
+ else if (info.tagName() == "date" && pginfo->airdate == "")
+ {
+ pginfo->airdate = getFirstText(info);
+
+ if (4 != pginfo->airdate.length())
+ pginfo->airdate = "";
+ }
+ else if (info.tagName() == "star-rating")
+ {
+ QDomNodeList values = info.elementsByTagName("value");
+ QDomElement item;
+ QString stars, num, den;
+ float avg = 0.0;
+ // not sure why the XML suggests multiple ratings,
+ // but the following will average them anyway.
+ for (unsigned int i = 0; i < values.length(); i++)
+ {
+ item = values.item(i).toElement();
+ if (item.isNull())
+ continue;
+ stars = getFirstText(item);
+ num = stars.section('/', 0, 0);
+ den = stars.section('/', 1, 1);
+ if (0.0 >= den.toFloat())
+ continue;
+ avg *= i/(i+1);
+ avg += (num.toFloat()/den.toFloat()) / (i+1);
+ }
+ pginfo->stars.setNum(avg);
+ }
+ else if (info.tagName() == "rating")
+ {
+ // again, the structure of ratings seems poorly represented
+ // in the XML. no idea what we'd do with multiple values.
+ QDomNodeList values = info.elementsByTagName("value");
+ QDomElement item = values.item(0).toElement();
+ if (item.isNull())
+ continue;
+ ProgRating rating;
+ rating.system = info.attribute("system", "");
+ rating.rating = getFirstText(item);
+ if ("" != rating.system)
+ pginfo->ratings.append(rating);
+ }
}
}
@@ -713,14 +769,19 @@
nextoffset = 10;
}
+ QSqlQuery query;
QString querystr;
+
querystr.sprintf("DELETE FROM program WHERE starttime >= "
"DATE_ADD(CURRENT_DATE, INTERVAL %d DAY) "
"AND starttime < DATE_ADD(CURRENT_DATE, INTERVAL "
"%d DAY) AND chanid = %d;", offset, nextoffset, chanid);
+ query.exec(querystr);
- QSqlQuery query;
-
+ querystr.sprintf("DELETE FROM programrating WHERE starttime >= "
+ "DATE_ADD(CURRENT_DATE, INTERVAL %d DAY) "
+ "AND starttime < DATE_ADD(CURRENT_DATE, INTERVAL "
+ "%d DAY) AND chanid = %d;", offset, nextoffset, chanid);
query.exec(querystr);
}
@@ -769,23 +830,45 @@
(*i).title.replace(QRegExp("\""), QString("\\\""));
(*i).subtitle.replace(QRegExp("\""), QString("\\\""));
(*i).desc.replace(QRegExp("\""), QString("\\\""));
+ if ("" == (*i).airdate)
+ (*i).airdate = "0";
+ if ("" == (*i).stars)
+ (*i).stars = "0";
querystr.sprintf("INSERT INTO program (chanid,starttime,endtime,"
- "title,subtitle,description,category) VALUES(%d,"
- " \"%s\", \"%s\", \"%s\", \"%s\", \"%s\","
- " \"%s\");",
+ "title,subtitle,description,category,airdate,stars) "
+ "VALUES(%d, \"%s\", \"%s\", \"%s\", \"%s\", \"%s\","
+ " \"%s\", \"%s\", \"%s\");",
chanid,
(*i).start.toString("yyyyMMddhhmmss").ascii(),
(*i).end.toString("yyyyMMddhhmmss").ascii(),
(*i).title.utf8().data(),
(*i).subtitle.utf8().data(),
(*i).desc.utf8().data(),
- (*i).category.utf8().data());
+ (*i).category.utf8().data(),
+ (*i).airdate.utf8().data(),
+ (*i).stars.utf8().data());
if (!query.exec(querystr.utf8().data()))
{
MythContext::DBError("program insert", query);
}
+
+ QValueList<ProgRating>::iterator j = (*i).ratings.begin();
+ for (; j != (*i).ratings.end(); j++)
+ {
+ querystr.sprintf("INSERT INTO programrating (chanid,starttime,"
+ "system,rating) VALUES (%d, \"%s\", \"%s\", \"%s\");",
+ chanid,
+ (*i).start.toString("yyyyMMddhhmmss").ascii(),
+ (*j).system.utf8().data(),
+ (*j).rating.utf8().data());
+
+ if (!query.exec(querystr.utf8().data()))
+ {
+ MythContext::DBError("programrating insert", query);
+ }
+ }
}
}
}
@@ -852,10 +935,15 @@
void clearOldDBEntries(void)
{
- QString querystr = "DELETE FROM program WHERE starttime <= "
- "DATE_SUB(CURRENT_DATE, INTERVAL 1 DAY);";
QSqlQuery query;
+ QString querystr;
+ querystr = "DELETE FROM program WHERE starttime <= "
+ "DATE_SUB(CURRENT_DATE, INTERVAL 1 DAY);";
+ query.exec(querystr);
+
+ querystr = "DELETE FROM programrating WHERE starttime <= "
+ "DATE_SUB(CURRENT_DATE, INTERVAL 1 DAY);";
query.exec(querystr);
}
-------------- next part --------------
drop table if exists programrating;
CREATE TABLE programrating (
chanid int(10) unsigned NOT NULL default '0',
starttime timestamp(14) NOT NULL,
system char(8) NOT NULL default '',
rating char(8) NOT NULL default '',
UNIQUE KEY chanid (chanid,starttime,system,rating)
);
alter table program add airdate year not null, add stars float unsigned not null;
alter table programrating add index (starttime, system);
-------------- next part --------------
Index: mythweb/classes.php
===================================================================
RCS file: /var/lib/cvs/mythweb/classes.php,v
retrieving revision 1.8
diff -d -u -w -r1.8 classes.php
--- mythweb/classes.php 6 Mar 2003 22:04:23 -0000 1.8
+++ mythweb/classes.php 7 Mar 2003 10:52:06 -0000
@@ -138,6 +138,19 @@
var $recordColour;
var $typeColour;
var $whenRecord;
+ var $airdate;
+ var $stars;
+ var $starstring;
+ var $rater;
+ var $rating;
+ var $icon;
+
+ function startTime()
+ {
+ return sprintf("%02d:%02d",
+ (int) substr($this->startts, 8, 2),
+ (int) substr($this->startts, 10, 2));
+ }
function willRecord()
{
@@ -168,12 +181,25 @@
function printYourself($width, $anOffset)
{
- print("<TD VALIGN=\"TOP\" WIDTH=\"17%\" COLSPAN=\"$width\" BGCOLOR=\"$this->typeColour\" STYLE=\"border:2px solid $this->recordColour; padding:4px;\">");
+ print("<TD VALIGN=\"TOP\" COLSPAN=\"$width\" BGCOLOR=\"$this->typeColour\" STYLE=\"border:2px solid $this->recordColour; padding:4px;\">");
print("<A STYLE=\"color:");
if ($this->typeColour == $GLOBALS['list_default_colour']) print($GLOBALS['text_dark']);
else print($GLOBALS['text_light']);
print("\" HREF=\"main.php?mode=single&channel=$this->chanid&starttime=$this->startts&endtime=$this->endts&refoffset=$anOffset\">$this->title");
if ($GLOBALS['includeSubTitle'] && strlen($this->subtitle) > 0) print(": $this->subtitle");
+
+ if ($this->airdate > 0 && ($GLOBALS['includeReleaseYear'] || ($GLOBALS['includeReleaseYearForMovies'] && $this->smellsLikeMovie())))
+ $parens = sprintf("%4d", $this->airdate);
+ if (strlen($this->rating) > 0 && ($GLOBALS['includeRatings'] || ($GLOBALS['includeRatingsForMovies'] && $this->smellsLikeMovie())))
+ {
+ if ($parens)
+ $parens .= ", ";
+ $parens .= "<i>$this->rating</i>";
+ }
+ if ($parens)
+ print " ($parens)";
+
+ if ($GLOBALS['includeStarRating'] && strlen($this->stars) > 0) print " $this->starstring";
if ($GLOBALS['includeDescription'] && strlen($this->description) > 0) print(" - $this->description");
if ($GLOBALS['includeProgramType'] && strlen($this->progType) > 0) print(" ($this->progType)");
print("</A>");
@@ -209,6 +235,33 @@
print("</TABLE>");
print("</TD>");
print("</TR>");
+ }
+
+ function smellsLikeMovie()
+ {
+ if ($this->rater == "MPAA"
+ || ($this->airdate && $this->stars > 0))
+ return TRUE;
+
+ if ($this->airdate
+ && $GLOBALS['includeMoviesMadeForTV']
+ && $this->duration > 70)
+ switch ($this->progType)
+ {
+ case "Drama":
+ case "Doc":
+ case "Mystery":
+ case "Musical":
+ case "Action":
+ case "Comedy":
+ case "War":
+ case "Romance":
+ case "Crime":
+ case "SciFi":
+ case "Horror":
+ return TRUE;
+ }
+ return FALSE;
}
}
Index: mythweb/functions.php
===================================================================
RCS file: /var/lib/cvs/mythweb/functions.php,v
retrieving revision 1.12
diff -d -u -w -r1.12 functions.php
--- mythweb/functions.php 7 Mar 2003 00:28:46 -0000 1.12
+++ mythweb/functions.php 7 Mar 2003 10:52:07 -0000
@@ -357,19 +357,21 @@
//
function setupPrograms ($channelarray, $timearray, $numbSlots)
{
+ $maxStars = $GLOBALS['maximumStarRating'];
+ $star = $GLOBALS['starRatingCharacter'];
+
for ($i = 0; $i < $numbSlots; $i += 1)
{
$channelindex = 0;
$mytime = $timearray[$i];
- $sqltime = $mytime->sqltime;
$query = "SELECT ".
- "sum(record.type = 4)>0 as 'type4', ".
- "sum(record.type = 3 and record.chanid = program.chanid)>0 as 'type3', ".
- "sum(record.type = 2 and record.chanid = program.chanid and ".
+ "sum(record.type = 4 and program.title = record.title)>0 as 'type4', ".
+ "sum(record.type = 3 and program.title = record.title and record.chanid = program.chanid)>0 as 'type3', ".
+ "sum(record.type = 2 and program.title = record.title and record.chanid = program.chanid and ".
" record.starttime = sec_to_time(time_to_sec(program.starttime)) and ".
" record.endtime = sec_to_time(time_to_sec(program.endtime)))>0 as 'type2', " .
- "sum(record.type = 1 and record.chanid = program.chanid and ".
+ "sum(record.type = 1 and program.title = record.title and record.chanid = program.chanid and ".
" record.starttime = sec_to_time(time_to_sec(program.starttime)) and ".
" record.startdate = from_days(to_days(program.starttime)))>0 as 'type1', ".
"channel.chanid, ".
@@ -380,10 +382,15 @@
"program.subtitle, ".
"program.description, ".
"program.category, ".
+ "program.airdate, ".
+ "program.stars, ".
+ "concat(repeat('$star', program.stars*$maxStars), if((program.stars*$maxStars*10) % 10, '½', '')) as starstring, ".
+ "ifnull(programrating.system, '') as rater, ".
+ "ifnull(programrating.rating, '') as rating, ".
"((UNIX_TIMESTAMP(program.endtime) - UNIX_TIMESTAMP(program.starttime)) / 60 ) as duration ".
- "FROM channel left join program using (chanid) left join record using (title) ".
- "WHERE program.starttime < " . $sqltime . " AND program.endtime > " . $sqltime." ".
- "GROUP BY program.chanid ORDER BY channel.channum + 0;";
+ "FROM channel left join program using (chanid) left join programrating using (chanid, starttime), record ".
+ "WHERE program.starttime < " . $mytime->sqltime . " AND program.endtime > " . $mytime->sqltime." ".
+ "GROUP BY program.chanid ORDER BY channel.channum + 0, programrating.system;";
$result = mysql_query($query) or die("Gadzooks! I can't open the program table.");
@@ -404,6 +411,11 @@
$myprog->progType = $line["category"];
$myprog->duration = $line["duration"];
$myprog->description = $line["description"];
+ $myprog->rater = $line["rater"];
+ $myprog->rating = $line["rating"];
+ $myprog->airdate = $line["airdate"];
+ $myprog->stars = $line["stars"];
+ $myprog->starstring = $line["starstring"];
$myprog->whenRecord += $line["type1"]<<1;
$myprog->whenRecord += $line["type2"]<<2;
@@ -420,23 +432,59 @@
return $programarray;
}
-// fetch all the listings for a certain day
-function fetchDaysListings($channelarray, $day)
+// fetch all the movie listings for N days in the future
+function fetchMovieListings($ppv_channels, $day)
{
- $i = 0;
- $channelindex = 0;
+ $maxStars = $GLOBALS['maximumStarRating'];
+ $star = $GLOBALS['starRatingCharacter'];
- while ($chanid = $channelarray[$channelindex])
+ foreach ($ppv_channels as $start => $stop)
{
- $theTime = parseTime($day);
-
- $to = date('YmdHis', mktime(23, 59, 59, $theTime['month'], $theTime['day'], $theTime['year']));
-
- $query = "SELECT channel.chanid, channel.channum, starttime, endtime, title, subtitle, description, category, ((UNIX_TIMESTAMP(endtime) - UNIX_TIMESTAMP(starttime)) / 60 ) as duration FROM program,channel WHERE program.chanid = channel.chanid AND program.chanid = $chanid AND ((UNIX_TIMESTAMP(endtime) - UNIX_TIMESTAMP(starttime)) / 60 ) > 70 AND starttime >= $day AND starttime <= $to ORDER BY starttime ASC;";
+ $ignore .= "AND ";
+ if ((int) $start && (int) $stop)
+ $ignore .= "channel.channum not between $start and $stop ";
+ else
+ $ignore .= "channel.channum not in (\"$start\", \"$stop\") ";
+ }
+ $query = "SELECT ".
+ "sum(record.type = 4)>0 as 'type4', ".
+ "sum(record.type = 3 and record.chanid = program.chanid)>0 as 'type3', ".
+ "sum(record.type = 2 and record.chanid = program.chanid and ".
+ " record.starttime = sec_to_time(time_to_sec(program.starttime)) and ".
+ " record.endtime = sec_to_time(time_to_sec(program.endtime)))>0 as 'type2', " .
+ "sum(record.type = 1 and record.chanid = program.chanid and ".
+ " record.starttime = sec_to_time(time_to_sec(program.starttime)) and ".
+ " record.startdate = from_days(to_days(program.starttime)))>0 as 'type1', ".
+ "channel.chanid, ".
+ "channel.channum, ".
+ "channel.callsign, ".
+ "channel.icon, ".
+ "program.starttime, ".
+ "program.starttime, ".
+ "program.endtime, ".
+ "program.title, ".
+ "program.subtitle, ".
+ "program.description, ".
+ "program.category, ".
+ "program.airdate, ".
+ "program.stars, ".
+ "concat(repeat('$star', program.stars*$maxStars), if((program.stars*$maxStars*10) % 10, '½', '')) as starstring, ".
+ "ifnull(programrating.system, '') as rater, ".
+ "ifnull(programrating.rating, '') as rating, ".
+ "((UNIX_TIMESTAMP(program.endtime) - UNIX_TIMESTAMP(program.starttime)) / 60) as duration ".
+ "FROM programrating left join program using (chanid, starttime) left join record using (title), channel ".
+ "WHERE programrating.starttime between if($day, date_add(curdate(), interval $day day), now()) ".
+ "and date_add(curdate(), interval $day+1 day) ".
+ "AND program.chanid = channel.chanid ".
+ "AND (UNIX_TIMESTAMP(program.endtime) - UNIX_TIMESTAMP(program.starttime)) / 60 > 70 ".
+ "AND program.stars > 0 AND program.airdate > 0 ".
+ $ignore.
+ "GROUP BY programrating.chanid, programrating.starttime ".
+ "ORDER BY programrating.starttime ASC, programrating.system ASC;";
$result = mysql_query($query) or die("Gadzooks! I can't open the program table.");
- while ($line = mysql_fetch_array($result, MYSQL_ASSOC))
+ for ($i = 0; $line = mysql_fetch_array($result, MYSQL_ASSOC); $i++)
{
$myprog = new ProgramInfo;
$myprog->title = $line["title"];
@@ -448,14 +496,23 @@
$myprog->progType = $line["category"];
$myprog->duration = $line["duration"];
$myprog->description = $line["description"];
+ $myprog->rater = $line["rater"];
+ $myprog->rating = $line["rating"];
+ $myprog->airdate = $line["airdate"];
+ $myprog->stars = $line["stars"];
+ $myprog->starstring = $line["starstring"];
+ $myprog->callsign = $line["callsign"];
+ $myprog->icon = $line["icon"];
+
+ $myprog->whenRecord += $line["type1"]<<1;
+ $myprog->whenRecord += $line["type2"]<<2;
+ $myprog->whenRecord += $line["type3"]<<3;
+ $myprog->whenRecord += $line["type4"]<<4;
$listingarray[$i] = $myprog;
- $i++;
}
mysql_free_result($result);
- $channelindex++;
- }
return $listingarray;
}
Index: mythweb/listings.php
===================================================================
RCS file: /var/lib/cvs/mythweb/listings.php,v
retrieving revision 1.13
diff -d -u -w -r1.13 listings.php
--- mythweb/listings.php 6 Mar 2003 22:04:23 -0000 1.13
+++ mythweb/listings.php 7 Mar 2003 10:52:08 -0000
@@ -71,7 +71,6 @@
//
$timearray = setupTimes($sqlstarttime, $timeSlots);
$channelarray = setupChannels();
-$recordArray = setupRecordings();
$programarray = setupPrograms($channelarray, $timearray, $timeSlots);
// Put out the date/time adjust fields
@@ -196,24 +195,18 @@
else break;
}
- if(smellsLikeMovie($proginfo->duration, $proginfo->progType))
- {
+
+ if($proginfo->smellsLikeMovie())
$finalColour = $movie_colour;
- }
else
- {
$finalColour = $colorArray[$proginfo->progType];
- }
if ($finalColour == "")
- {
$finalColour = $list_default_colour;
- }
- $proginfo->setColours($finalColour, $finalColour);
- $recordArrayIndex = 0;
+
if($proginfo->willRecord())
- {
$proginfo->setColours($list_reccolour, $finalColour);
- }
+ else
+ $proginfo->setColours($finalColour, $finalColour);
$proginfo->printYourself($cellwidth, $theOffset);
}
Index: mythweb/movies.php
===================================================================
RCS file: /var/lib/cvs/mythweb/movies.php,v
retrieving revision 1.1
diff -d -u -w -r1.1 movies.php
--- mythweb/movies.php 11 Dec 2002 21:17:30 -0000 1.1
+++ mythweb/movies.php 7 Mar 2003 10:52:08 -0000
@@ -14,62 +14,82 @@
// movies.php - give a general overview of the movies for the next
// specified number of days
-$sqlstarttime = date('YmdHis');
-$recordArray = setupRecordings();
-$alreadyprinted = FALSE;
-$daycount = 0;
+$maxCols = 5;
+$header = "
+ <tr bgcolor=\"$list_fg_colour\" cellpadding=1>
+ <td align=center bgcolor=\"$list_bg_colour\"> </td>
+ <td align=center>Time</td>
+ <td align=center>Title</td>
+ <td align=center>Description</td>
+ <td align=center>Details...</td>
+ </tr>
+";
-// loop for a certain number of days grabbing each channels listing for an entire day
-// this is the only way i can think of doing this without selecting a massive number
-// of programs at once
-while ($daycount < $movie_lookahead) {
- $listingarray = fetchDaysListings($movie_channels, $sqlstarttime);
+$table = "
+ <p>
+ <table width=\"100%\" border=0 cellpadding=2 cellspacing=1 bgcolor=\"$list_bg_colour\">
+";
- $index = 0;
- while ($proginfo = $listingarray[$index]) {
- if ($proginfo == null) continue;
+for ($daycount = 0; $daycount < $movie_lookahead; $daycount++)
+{
+ print "<a name=\"day$daycount\"><p><div align=center>Jump to day...";
+ for ($daynav = 0; $daynav < $movie_lookahead; $daynav++)
+ {
+ if ($daycount == $daynav)
+ continue;
+ printf(" <a href=\"#day%d\">%d</a>", $daynav, $daynav+1);
+ }
+ print "</div>";
+ print $table;
- $recording = FALSE;
+ $alreadyprinted = FALSE;
+ $listingarray = fetchMovieListings($ignore_movie_channels, $daycount);
- // see if a program is being recorded
- $recordArrayIndex = 0;
- while($aRecord = $recordArray[$recordArrayIndex]) {
- if($aRecord->chanid == $proginfo->chanid && $aRecord->starttime == $proginfo->startts) {
- $recording = TRUE;
- }
- $recordArrayIndex++;
- }
- if(isInAlwaysRecord($proginfo->title) || isInTimeslotRecord($proginfo->chanid, $proginfo->startts, $proginfo->endts, $proginfo->title))
+ for ($index = 0; $proginfo = $listingarray[$index]; $index++)
{
- $recording = TRUE;
- }
+ if (!$proginfo->smellsLikeMovie())
+ continue;
- // print it out if the program appears to be a movie
- if (smellsLikeMovie($proginfo->duration, $proginfo->progType)) {
- // only print the date if there is any movies on it, and make sure you dont print it multiple times
if (!$alreadyprinted) {
- printTheDate($sqlstarttime, 0, 0);
- print("<br>");
+ printf("<tr cellpadding=1><td></td><td align=center bgcolor=\"$list_fg_colour\" colspan=%d>", $maxCols-1);
+ printTheDate($proginfo->startts, 0, 0);
+ print "</td></tr>\n";
$alreadyprinted = TRUE;
- }
- if ($recording) {
- print " <font color=\"#ff0000\">[R]</font>";
- }
- print "<a href=\"main.php?mode=single&channel=$proginfo->chanid&starttime=$proginfo->startts\">$proginfo->title</a>";
- if ($proginfo->subtitle) {
- print ": $proginfo->subtitle";
- }
- print " - $proginfo->description";
- print(" (<a href=\"http://www.imdb.com/Find?select=Titles&for=" . urlencode($proginfo->title) . "\">IMDB</a>)<br>");
- }
- $index++;
+ print $header;
}
- print("<br>");
- $alreadyprinted = FALSE;
- $theTime = parseTime($sqlstarttime);
- $sqlstarttime = date('YmdHis', mktime(0, 0, 0, $theTime['month'], $theTime['day']+1, $theTime['year']));
- $daycount++;
+ print "<tr>";
+
+ $channel = $proginfo->chanstr." ".$proginfo->callsign;
+ if ($includeIcon && is_file($proginfo->icon))
+ $channel .= "<br><img src=\"$proginfo->icon\">";
+ printf("<td align=center><font size=\"-1\"><a style=\"color:$menu_fg_colour\" href=\"main.php?mode=bychannel&chanid=%s\">%s</a></font></td>",
+ $proginfo->chanid, $channel);
+
+ print "<td align=center bgcolor=\"$list_fg_colour\">".$proginfo->startTime()."</td>";
+
+ $bgcolour = $colorArray[$proginfo->progType];
+ if ("" == $bgcolour)
+ $bgcolour = $list_default_colour;
+
+ if ($proginfo->willRecord())
+ $fgcolour = $list_reccolour;
+ else
+ $fgcolour = $bgcolour;
+
+ $proginfo->setColours($fgcolour, $bgcolour);
+ $proginfo->printYourself(1, 0);
+
+ printf("<td bgcolor=\"%s\">%s</td>", $list_default_colour, $proginfo->description);
+
+ printf("<td bgcolor=\"%s\" align=center><a href=\"http://www.imdb.com/Tsearch?type=substring&tv=off&year=%d&sort=smart&title=%s\">IMDB</a></td>",
+ $list_default_colour,
+ $proginfo->airdate,
+ urlencode($proginfo->title));
+
+ print "</tr>\n";
+ }
+ print "</table>";
}
?>
Index: mythweb/settings.php
===================================================================
RCS file: /var/lib/cvs/mythweb/settings.php,v
retrieving revision 1.6
diff -d -u -w -r1.6 settings.php
--- mythweb/settings.php 11 Dec 2002 20:57:44 -0000 1.6
+++ mythweb/settings.php 7 Mar 2003 10:52:10 -0000
@@ -43,11 +43,22 @@
$movie_lookahead = 5; // on the movies overview page, the number of days to look ahead
- // channels to search for movies on the movie overview - im not quite happy with how the movies.php
- // functions but at the moment i cant really see any other feasible way, scanning all the channels you get a
- // lot of results which ends up being pretty unwieldy and you get a lot of results that aren't actually movies.
- // perhaps it would be better implemented to have a list of keywords to ignore when searching for movies?
- $movie_channels = array(1003, 1004, 1005, 1006, 1007, 1008, 1012, 1039, 1066);
+ $includeReleaseYear = FALSE; // show release year for all programs
+ $includeReleaseYearForMovies = TRUE;// show release year for movies
+ $includeRatings = FALSE; // show the content ratings for all programs
+ $includeRatingsForMovies = TRUE; // show the content ratings for movies
+ $includeStarRating = TRUE; // show the "star rating" for movies
+ $includeMoviesMadeForTV = FALSE; // movies made for TV are treated as such in listings
+ $maximumStarRating = 4; // maximum star rating for movies
+ $starRatingCharacter = '♦'; // the character(s) to represent stars with
+ // this is a list of channels to /ignore/ when searching for movies.
+ // it is best populated with pay-per-view channel numbers.
+ // if your channums start with letters, you'll have to list 'em like this
+ // "FOO1" => "BAR2",
+ // "ZIP3" => "ZAP4",
+ $ignore_movie_channels = array(
+ 401 => 432,
+ );
//
// Default Search
More information about the mythtv-dev
mailing list