Mailing List Archive

[Patch] A couple of tweaks to mythweb
OK, so while I'm waiting for my TV tuner card to arrive, I've been looking
into mythweb. Here are a couple of patches for your consideration:

1) Patch to listings.php - adds > move forward in time arrows to each row
of the listing, so it's easier to navigate from the middle of the listings.
Adds the time slot hours to the bottom of the listings as well as the top.
In an ideal world they would be in a fixed position on screen and not
scroll, but that would require frames.

2) Patch to settings.php and banner.php - there is now the option to display
UNIX fortune messages (I was getting tired of the same 3 quotes over and
over). The default behavior remains so there is no requirement to have
fortune installed on your system.

The two patches may are independent.

Regards,

Dan Schwarz

--- /usr/local/src/mythtv/mythweb/listings.php 2002-11-09
16:47:51.000000000 -0500
+++ listings.php 2002-11-11 12:01:54.000000000 -0500
@@ -185,9 +185,40 @@
$lasttitle = $proginfo->title;
$lastsubtitle = $proginfo->subtitle;
}
+//
+// Right arrow to go forward in time
+//
+print "<TD><A HREF=\"main.php?mode=listings&timeoffset=$futureOffset\"><IMG
SRC=\"images/right.gif\" BORDER=\"0\" ALT=\"right\"></A></TD>";
+
print "\t</tr>\n";
$channelindex += 1;
}
+
+//
+// Left arrow to go back in time
+// (if only it were that easy)
+//
+print("\t\t\t\t\t\t<TR>\n");
+$pastOffset = $theOffset - 1;
+$futureOffset = $theOffset + 1;
+print "\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t<A
HREF=\"main.php?mode=listings&timeoffset=$pastOffset\"><IMG
SRC=\"images/left.gif\" BORDER=\"0\"
ALT=\"left\"></A>\n\t\t\t\t\t\t\t</td>\n";
+
+//
+// The headings for the time columns
+//
+for ($timeslot = 0; $timeslot < $timeSlots; $timeslot += 1)
+{
+ $theTime = $timearray[$timeslot];
+ $theTime->setColour($list_fg_colour, $list_bg_colour);
+ $theTime->printYourself();
+}
+
+//
+// Right arrow to go forward in time
+//
+print "<TD><A HREF=\"main.php?mode=listings&timeoffset=$futureOffset\"><IMG
SRC=\"images/right.gif\" BORDER=\"0\" ALT=\"right\"></A></TD>";
+print "\t</tr>\n";
+
print "</TABLE></TD></TR></TABLE>\n";


--- /usr/local/src/mythtv/mythweb/settings.php 2002-09-12
12:47:46.000000000 -0400
+++ settings.php 2002-11-11 16:21:09.000000000 -0500
@@ -84,4 +84,14 @@
$colorArray["Cooking"] = "#309930";
$colorArray["How-to"] = "#CC9966";
$colorArray["Special"] = "#CCFF33";
+
+ //
+ // Fortune option
+ //
+
+ // uncomment the following line to enable UNIX fortunes in your
+ // mythweb banner. The path below is correct for Debian.
+
+ //$fortune_cmd = "/usr/games/fortune -s"
+
?>

--- /usr/local/src/mythtv/mythweb/banner.php 2002-09-27
16:06:20.000000000 -0400
+++ banner.php 2002-11-11 16:06:21.000000000 -0500
@@ -54,22 +54,40 @@
print("\t\t\t\t<TD ALIGN=\"RIGHT\">\n");

//
- // Work in a random quote (anybody got more of these?)
+ // Work in a random quote
//
-
- $aNumber = rand(1,3);
- switch($aNumber)
+
+ // see if we can use UNIX fortune
+ if(isset($fortune_cmd))
{
- case 1:
- printQuote("Basically, I want the mythical convergence box that's been
talked about for a few years now.", "- Isaac Richards", $main_fontface,
$main_fontsize, $main_fg_colour);
- break;
- case 2:
- printQuote("Anytime you skip a commercial ... you're actually stealing
the programming.", "- Jamie Kellner (CEO, Turner Broadcasting)",
$main_fontface, $main_fontsize, $main_fg_colour);
+ $fortune_lineone = `$fortune_cmd`;
+ $fortune_linetwo = "";
+ }
+ else
+ // choose one of the three original quotes
+ {
+
+ $aNumber = rand(1,3);
+ switch($aNumber)
+ {
+ case 1:
+ $fortune_lineone = "Basically, I want the mythical convergence box
that's been talked about for a few years now.";
+ $fortune_linetwo = "- Isaac Richards";
+ break;
+ case 2:
+ $fortune_lineone = "Anytime you skip a commercial ... you're actually
stealing the programming.";
+ $fortune_linetwo = "Jamie Kellner (CEO, Turner Broadcasting)";
break;
- case 3:
- printQuote("I say to you that the VCR is to the ... American public as
the Boston strangler is to the woman home alone.", "- Jack Valenti",
$main_fontface, $main_fontsize, $main_fg_colour);
+ case 3:
+ $fortune_lineone = "I say to you that the VCR is to the ... American
public as the Boston strangler is to the woman home alone.";
+ $fortune_linetwo = "- Jack Valenti";
break;
+ }
+
}
+
+ printQuote($fortune_lineone,$fortune_linetwo,$main_fontface,
$main_fontsize, $main_fg_colour);
+
print("<BR>");
//
// Add a search box.
Re: [Patch] A couple of tweaks to mythweb [ In reply to ]
Dan,

Thanks for the patches!!

I am trying to get mythWeb up to sync with MythTV (and add features) so that
by 0.8 everything will be working well. Real life has been amazingly hectic
lately, but I'm hoping to make some useful CVS commits over the next 2-3 days.

BR,

Thor



On Tuesday 12 November 2002 12:03 am, you wrote:
> OK, so while I'm waiting for my TV tuner card to arrive, I've been looking
> into mythweb. Here are a couple of patches for your consideration:
>
> 1) Patch to listings.php - adds > move forward in time arrows to each row
> of the listing, so it's easier to navigate from the middle of the listings.
> Adds the time slot hours to the bottom of the listings as well as the top.
> In an ideal world they would be in a fixed position on screen and not
> scroll, but that would require frames.
>
> 2) Patch to settings.php and banner.php - there is now the option to
> display UNIX fortune messages (I was getting tired of the same 3 quotes
> over and over). The default behavior remains so there is no requirement to
> have fortune installed on your system.
>
> The two patches may are independent.
>
> Regards,
>
> Dan Schwarz
>

--
----------------------------------------------------------------
Thor Sigvaldason <thor@sigvaldason.com>
For my PGP/GnuPG public key, send an e-mail to thorskey@sigvaldason.com
----------------------------------------------------------------