From patchwork Fri Apr 28 17:55:57 2006 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Joachim Banzhaf (compuserve)" X-Patchwork-Id: 12281 Received: from smtp.compuserve.de ([62.52.27.101] helo=lnxc-641.srv.mediaways.net) by www.linuxtv.org with smtp (Exim 4.50) id 1FZXCD-0004dm-T2 for vdr@linuxtv.org; Fri, 28 Apr 2006 19:56:02 +0200 Received: (qmail 13395 invoked by uid 501); 28 Apr 2006 17:56:01 -0000 X-Authenticated-Sender: joachimbanzhaf Received: from mf62c.m.pppool.de (mf62c.m.pppool.de [89.49.246.44]) by compuserve.de ([10.228.3.105]) with ESMTP via TCP; 28 Apr 2006 17:55:59 -0000 From: "Joachim Banzhaf (compuserve)" To: vdr@linuxtv.org Subject: Re: [vdr] New short summary view for vdradmin-am-3.4.4 Date: Fri, 28 Apr 2006 19:55:57 +0200 User-Agent: KMail/1.8.2 References: <200604281316.44351.joachimbanzhaf@compuserve.de> In-Reply-To: <200604281316.44351.joachimbanzhaf@compuserve.de> MIME-Version: 1.0 Message-Id: <200604281955.58130.joachimbanzhaf@compuserve.de> X-BeenThere: vdr@linuxtv.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: VDR Mailing List List-Id: VDR Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Apr 2006 17:56:02 -0000 Status: O X-Status: X-Keywords: X-UID: 9122 Am Freitag, 28. April 2006 13:16 schrieb Joachim Banzhaf (compuserve): > Hi list, > > I implemented an extension for vdradmin-am-3.4.4 and posted it on > > http://www.vdr-portal.de/board/thread.php?postid=458137#post458137 > > It just occured to me, that not everyone likes reading german portals (I > prefer international ML's too :-)). > > So here it comes again: > > actually I have two patches: now there are three. apply this one to a clean vdradmin-am-3.4.4/ with patch -p1 The first line of the summary list should include heading infos like title, > show, station, ... and not be just empty. Just a matter of time, i guess. done. > I didn't manage to display the percentage for current shows in a graphical > manner. I thought it would be quite obvious to use something like this: > > cellpadding="0"> > > > >
> > and it works standalone (see test.html.gz or test.png) but not in > vdradmin-am. I suspect css is in my way, but my knowledge on this is not > enough to solve it. I gave up on background color and use images now. Put the images in the template/default/bilder directory. The other items are still open... Joachim Banzhaf Dateien vdradmin-am-3.4.4.orig/template/default/bilder/elapsed.gif und vdradmin-am-3.4.4/template/default/bilder/elapsed.gif sind verschieden. Dateien vdradmin-am-3.4.4.orig/template/default/bilder/remaining.gif und vdradmin-am-3.4.4/template/default/bilder/remaining.gif sind verschieden. diff -Nur -x '*.orig' -x '*~' -x '*.patch' -x '*.at' -x '*.done' -x '*.conf' -x '*.pid' vdradmin-am-3.4.4.orig/template/default/navigation.html vdradmin-am-3.4.4/template/default/navigation.html --- vdradmin-am-3.4.4.orig/template/default/navigation.html 2006-03-11 06:41:12.000000000 +0100 +++ vdradmin-am-3.4.4/template/default/navigation.html 2006-04-27 18:24:44.000000000 +0200 @@ -31,6 +31,10 @@
+
+
diff -Nur -x '*.orig' -x '*~' -x '*.patch' -x '*.at' -x '*.done' -x '*.conf' -x '*.pid' vdradmin-am-3.4.4.orig/template/default/prog_summary2.html vdradmin-am-3.4.4/template/default/prog_summary2.html --- vdradmin-am-3.4.4.orig/template/default/prog_summary2.html 1970-01-01 01:00:00.000000000 +0100 +++ vdradmin-am-3.4.4/template/default/prog_summary2.html 2006-04-28 18:34:19.000000000 +0200 @@ -0,0 +1,116 @@ + + + + + + + VDRAdmin-AM - <%! What's On Now? !%> + + + + + + + + +
+ + + + + + + +
+

+
+ <%! What's on: !%> <%! now !%> | + <%! next !%> |<%! at: !%>  + +  <%! o'clock !%> +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Uhrzeit

Sendung

Sender

Steuerung

+
+ - +
+ + + + + + + +
  
+
+ +   +
+
+
+

+ + + + + + + +

+ + + +   + +
+
+ +

+
+ + <%! TV select !%> + <%! Search for other show times !%> + <%! Record !%> + +
+
+ + diff -Nur -x '*.orig' -x '*~' -x '*.patch' -x '*.at' -x '*.done' -x '*.conf' -x '*.pid' vdradmin-am-3.4.4.orig/template/default/prog_summary.html vdradmin-am-3.4.4/template/default/prog_summary.html --- vdradmin-am-3.4.4.orig/template/default/prog_summary.html 2006-02-27 12:44:36.000000000 +0100 +++ vdradmin-am-3.4.4/template/default/prog_summary.html 2006-04-27 18:24:44.000000000 +0200 @@ -21,7 +21,8 @@

- <%! What's on: !%> <%! now !%> |<%! at: !%>  + <%! What's on: !%> <%! now !%> | + <%! next !%> |<%! at: !%>   <%! o'clock !%> diff -Nur -x '*.orig' -x '*~' -x '*.patch' -x '*.at' -x '*.done' -x '*.conf' -x '*.pid' vdradmin-am-3.4.4.orig/template/default/style.css vdradmin-am-3.4.4/template/default/style.css --- vdradmin-am-3.4.4.orig/template/default/style.css 2006-03-13 12:03:31.000000000 +0100 +++ vdradmin-am-3.4.4/template/default/style.css 2006-04-28 18:49:35.000000000 +0200 @@ -68,6 +68,9 @@ .col_edit, .col_delete, .col_checkbox { text-align: center; width: 30px; max-width: 30px; } #rec_list .col_date, #rec_list .col_time { width: 76px; } +#prog_summary2 .elapsed { font-size: 3px; background-image: url("bilder/elapsed.gif"); } +#prog_summary2 .remaining { font-size: 3px; background-image: url("bilder/remaining.gif"); } + #heading { height: 39px; } #heading tr, #heading td { vertical-align: middle; } #heading .col_left { min-width: 15px; width: 15px; background-image: url("bilder/nav_button_back_start.gif"); } diff -Nur -x '*.orig' -x '*~' -x '*.patch' -x '*.at' -x '*.done' -x '*.conf' -x '*.pid' vdradmin-am-3.4.4.orig/vdradmind.pl vdradmin-am-3.4.4/vdradmind.pl --- vdradmin-am-3.4.4.orig/vdradmind.pl 2006-04-06 12:57:26.000000000 +0200 +++ vdradmin-am-3.4.4/vdradmind.pl 2006-04-27 18:24:44.000000000 +0200 @@ -252,7 +252,7 @@ js => "application/x-javascript", swf => "application/x-shockwave-flash" ); -my @LOGINPAGES = qw(prog_summary prog_list2 prog_timeline prog_list timer_list rec_list); +my @LOGINPAGES = qw(prog_summary prog_summary2 prog_list2 prog_timeline prog_list timer_list rec_list); $SIG{INT} = \&Shutdown; $SIG{TERM} = \&Shutdown; @@ -381,7 +381,7 @@ ## my($Client, $MyURL, $Referer, $Request, $Query, $Guest); my @GUEST_USER = qw(prog_detail prog_list prog_list2 prog_timeline timer_list at_timer_list - prog_summary rec_list rec_detail show_top toolbar show_help about); + prog_summary prog_summary2 rec_list rec_detail show_top toolbar show_help about); my @TRUSTED_USER = (@GUEST_USER, qw(at_timer_edit at_timer_new at_timer_save at_timer_test at_timer_delete timer_new_form timer_add timer_delete timer_toggle rec_delete rec_rename rec_edit config prog_switch rc_show rc_hitk grab_picture at_timer_toggle tv_show tv_switch @@ -3792,6 +3792,7 @@ return if(UptoDate()); my $time = $q->param("time"); my $search = $q->param("search"); + my $next = $q->param("next"); # zeitpunkt bestimmen my $event_time; @@ -3853,7 +3854,8 @@ } next if(!$f); } - next if($event_time > $event->{stop}); + next if(!$next && $event_time > $event->{stop}); + next if($next && $event_time >= $event->{start}); } else { my($found); if($pattern) { @@ -3940,12 +3942,179 @@ # my $template = TemplateNew("prog_summary.html"); + my $label = $next ? gettext("after") : gettext("at"); my $vars = { usercss => $UserCSS, rows => \@shows, now => strftime("%H:%M", localtime($event_time)), - title => $search ? gettext("Suitable matches for:") . " " . $search : strftime("%H:%M", localtime($event_time)) . " " . gettext("o'clock"), + title => $search ? gettext("Suitable matches for:") . " " . $search : $label . " " . strftime("%H:%M", localtime($event_time)) . " " . gettext("o'clock"), nowurl => $MyURL . "?aktion=prog_summary", + nexturl => $MyURL . "?aktion=prog_summary&next=1", + url => $MyURL + }; + $template->param($vars); + my $output; + my $out = $template->output; + $Xtemplate->process(\$out, $vars, \$output) || return(header("500", "text/html", $Xtemplate->error())); + return(header("200", "text/html", $output)); +} + + +############################################################################# +# one line summary +############################################################################# +sub prog_summary2 { + return if(UptoDate()); + my $time = $q->param("time"); + my $search = $q->param("search"); + my $next = $q->param("next"); + + # zeitpunkt bestimmen + my $event_time; + if($time) { + my ($hour, $minute); + if($time =~ /(\d{1,2})(\D?)(\d{1,2})/) { + if(length($1) == 1 && length($3) == 1 && !$2) { + $hour = $1 . $3; + } else { + ($hour, $minute) = ($1, $3); + } + } elsif($time =~ /\d/) { + $hour = $time; + } + + if($hour <= my_strftime("%H") && $minute < my_strftime("%M")) { + $event_time = timelocal( + 0, + $minute, + $hour, + my_strftime("%d", time + 86400), + (my_strftime("%m", time + 86400) - 1), + my_strftime("%Y") + ) + 1; + } else { + $event_time = timelocal( + 0, + $minute, + $hour, + my_strftime("%d"), + (my_strftime("%m") - 1), + my_strftime("%Y") + ) + 1; + } + } else { + $event_time = time(); + } + + my $pattern; + my $mode; + if($search) { + if($search =~ /^\/(.*)\/(i?)$/) { + $pattern=$1; + $mode=$2 + } else { + $search =~ s/([\+\?\.\*\^\$\(\)\[\]\{\}\|\\])/\\$1/g; + } + } + + my $now = time(); + my(@show, @shows, @temp); + for(keys(%EPG)) { + for my $event (@{$EPG{$_}}) { + if(!$search) { + if($CONFIG{CHANNELS_WANTED_SUMMARY}) { + my $f = 0; + for my $n (split(/\,/, $CONFIG{CHANNELS_WANTED})) { + ($f = 1) if($n eq $event->{vdr_id}); + } + next if(!$f); + } + next if(!$next && $event_time > $event->{stop}); + next if($next && $event_time >= $event->{start}); + } else { + my($found); + if($pattern) { + # We have a RegExp + next if(!length($pattern)); + next if(!defined($pattern)); + my $SearchStr = $event->{title} . "~" . $event->{subtitle} . "~" . $event->{summary}; + # Shall we search case insensitive? + if(($mode eq "i") && ($SearchStr !~ /$pattern/i)) { + next; + } elsif(($mode ne "i") && ($SearchStr !~ /$pattern/)) { + next; + } else { + $found = 1; + } + } else { + next if(! length($search)); + for my $word (split(/ +/, $search)) { + $found = 0; + for my $section (qw(title subtitle summary)) { + if($event->{$section} =~ /$word/i) { + $found = 1; + } + } + if(!$found) { + last; + } + } + } + next if(!$found); + } + + my $displaytext = CGI::escapeHTML($event->{summary}); + my $displaytitle = CGI::escapeHTML($event->{title}); + my $displaysubtitle = CGI::escapeHTML($event->{subtitle}); + + $displaytext =~ s/\n/
\n/g; + $displaytext =~ s/\|/
\n/g; + $displaytitle =~ s/\n/
\n/g; + $displaytitle =~ s/\|/
\n/g; + if ($displaysubtitle) { + $displaysubtitle =~ s/\n/
\n/g; + $displaysubtitle =~ s/\|/
\n/g; + } + my $myself = Encode_Referer($MyURL . "?" . $Query); + push(@show, { + date => my_strftime("%x", $event->{start}), + longdate => my_strftime("%A, %x", $event->{start}), + start => my_strftime("%H:%M", $event->{start}), + stop => my_strftime("%H:%M", $event->{stop}), + percent => int(($now-$event->{start})/($event->{stop}-$event->{start})*100), + title => $displaytitle, + subtitle => $displaysubtitle, + progname => CGI::escapeHTML($event->{channel_name}), + summary => $displaytext, + vdr_id => $event->{vdr_id}, + proglink => sprintf("%s?aktion=prog_list&vdr_id=%s", $MyURL, $event->{vdr_id}), + switchurl => sprintf("%s?aktion=prog_switch&channel=%s", $MyURL, $event->{vdr_id}), + streamurl => sprintf("%s%s?aktion=live_stream&channel=%s", $MyStreamBase, $CONFIG{TV_EXT}, $event->{vdr_id}), + stream_live_on => $event->{start} <= $now && $now <= $event->{stop} ? $CONFIG{ST_FUNC} && $CONFIG{ST_LIVE_ON} : undef, + infurl => $event->{summary} ? sprintf("%s?aktion=prog_detail&epg_id=%s&vdr_id=%s&referer=%s", $MyURL, $event->{event_id}, $event->{vdr_id}, $myself) : undef, + recurl => sprintf("%s?aktion=timer_new_form&epg_id=%s&vdr_id=%s&referer=%s", $MyURL, $event->{event_id}, $event->{vdr_id}, $myself), + find_title => uri_escape($event->{title}), + anchor => "id" . $event->{event_id} + }); + last if(!$search); + } + } + + # needed for vdr 1.0.x, dunno why + @show = sort({ $a->{vdr_id} <=> $b->{vdr_id} } @show); + + push(@shows, { day => [ @show ], status => [ @show ] }); + + # + my $template = TemplateNew("prog_summary2.html"); + my $label = $next ? gettext("after") : gettext("at"); + my $vars = { + usercss => $UserCSS, + rows => \@shows, + now => strftime("%H:%M", localtime($event_time)), + title => $search ? gettext("Suitable matches for:") . " " . $search : $label . " " . strftime("%H:%M", localtime($event_time)) . " " . gettext("o'clock"), + nowurl => $MyURL . "?aktion=prog_summary2", + nexturl => $MyURL . "?aktion=prog_summary2&next=1", url => $MyURL }; $template->param($vars);