[mythtv] [PATCH][mythweb] fixes for the wml theme

Chris Petersen lists at forevermore.net
Sun Apr 3 07:20:24 UTC 2005


> The attached patch contains a couple of fixes for the wml theme.

None of these worked.  Patch doesn't line up.

-Chris

> channel_detail.php:
> *Fixed the 'Jump to date' option.
> *The results are now divided over several pages, to avoid the page
> getting too big for the phones browser.
> 
> program_detail.php:
> *The id parameter in the select tag for the 'record' drop down list
> was not accepted by my wap gateway (made it impossible to view the
> page). I removed all the id parameters, since they are not really
> needed(?).
> 
> program_listing.php:
> *Added a date variable when generating links for 'View listings by
> Channel Number/Call Sign'. The links now take you directly to todays
> listings.
> 
> theme.php and status.php:
> *Added 'charset=utf-8' to the header.
> 
> 
> Regards,
> Petter
> 
> 
> ------------------------------------------------------------------------
> 
> Index: mythweb/themes/wml/channel_detail.php
> ===================================================================
> RCS file: /var/lib/mythcvs/mythweb/themes/wml/channel_detail.php,v
> retrieving revision 1.2
> diff -u -r1.2 channel_detail.php
> --- mythweb/themes/wml/channel_detail.php	5 Dec 2004 19:52:58 -0000	1.2
> +++ mythweb/themes/wml/channel_detail.php	23 Mar 2005 18:04:47 -0000
> @@ -56,15 +56,15 @@
>      function print_shows($carddata) {
>  
>          global $this_channel;
> +
> +        if (isset($_GET['jump'])) {
> +            echo '<br/>';
> +            echo $carddata;
> +            echo '</p></card>';
> +        }
>          // No search was performed, just return
> -        if (!is_array($this_channel->programs)) {
> +        elseif (!is_array($this_channel->programs)) {
>              return;
> -        }
> -
> -        if (isset($_GET['jump'])) {
> -            echo '<br/>';
> -            echo $carddata;
> -            echo '</p></card>';
>          } else {
>  ?>
>  <do type="accept">
> @@ -73,17 +73,32 @@
>  <postfield name="starttime" value="$(starttime)"/>
>  </go>
>  </do>
> -<select name="starttime">
>  <?php
>  
>              // Display the results
> -            $row = 0;
> -
> -            foreach ($this_channel->programs as $show) {
> +            $page_size=15;
> +            $page = $_GET['page'];
> +            $time = $_GET['time'];
> +            $programs = count($this_channel->programs);
> +
> +            if (! isset($page)) $page=1;
> +            $page_start = ($page - 1) * $page_size ;
> +            if ($page_start + $page_size < $programs -1) $page_end = $page_start + $page_size -1 ; else $page_end = $programs-1;
> +            if ($page != 1) echo '<a href="channel_detail.php?chanid='.$_GET['chanid']."&amp;time=".$time.'&amp;page='.($page - 1).'">&lt; prev</a>';
> +            if (($page * $page_size) < $programs) echo ' <a href="channel_detail.php?chanid='.$_GET['chanid']."&amp;time=".$time.'&amp;page='.($page + 1).'">next &gt;</a>';
> +            echo "<br/>";
> +
> +            echo '<select name="starttime">';
> +            for( $key=$page_start; $key <= $page_end ; $key++) {
> +                $show = &$this_channel->programs[$key];
>                  // Print the content
>                  echo '<option value="'.$show->starttime.'">'.htmlspecialchars($show->title)." (".strftime(t('generic_time'), $show->starttime).")</option>\n";
> -            }
> -            echo '</select></p></card>';
> +            }
> +
> +            echo '</select><br/>';
> +            if ($page != 1) echo '<a href="channel_detail.php?chanid='.$_GET['chanid']."&amp;time=".$time.'&amp;page='.($page - 1).'">&lt; prev</a>';
> +            if (($page * $page_size) < $programs) echo ' <a href="channel_detail.php?chanid='.$_GET['chanid']."&amp;time=".$time.'&amp;page='.($page + 1).'">next &gt;</a>';
> +            echo '</p></card>';
>          }
>      }
>  }
> Index: mythweb/themes/wml/program_detail.php
> ===================================================================
> RCS file: /var/lib/mythcvs/mythweb/themes/wml/program_detail.php,v
> retrieving revision 1.3
> diff -u -r1.3 program_detail.php
> --- mythweb/themes/wml/program_detail.php	11 Feb 2005 18:02:48 -0000	1.3
> +++ mythweb/themes/wml/program_detail.php	23 Mar 2005 18:04:47 -0000
> @@ -74,16 +74,16 @@
>  <p>
>  <?php echo t('Recording Options') ?>:
>  <select name="record" value="<?php echo $schedule->type ?>">
> -<option value="<?php echo rectype_dontrec ?>" id="<?php echo rectype_dontrec ?>"><?php if (!$schedule->recordid) echo "(*)"; ?><?php echo t('rectype: dontrec') ?></option>
> -<option value="<?php echo rectype_once ?>" id="<?php echo rectype_once ?>"><?php if ($schedule->type == rectype_once) echo "(*)"; ?><?php echo t('rectype: once') ?></option>
> -<option value="<?php echo rectype_daily ?>" id="<?php echo rectype_daily ?>"><?php if ($schedule->type == retype_daily) echo "(*)"; ?>Record <?php echo t('rectype: daily') ?></option>
> -<option value="<?php echo rectype_weekly ?>" id="<?php echo rectype_weekly ?>"><?php if ($schedule->type ==rectype_weekly) echo "(*)"; ?>Record <?php echo t('rectype: weekly') ?></option>
> -<option value="<?php echo rectype_channel ?>" id="<?php echo rectype_channel ?>"><?php if ($schedule->type == rectype_channel) echo "(*)"; ?><?php echo t('rectype: channel') ?></option>
> -<option value="<?php echo rectype_always ?>" id="<?php echo rectype_always ?>"><?php if ($schedule->type == rectype_always) echo "(*)"; ?><?php echo t('rectype: always') ?></option>
> -<option value="<?php echo rectype_findone ?>" id="<?php echo rectype_findone ?>"><?php if ($schedule->type == rectype_findone) echo "(*)"; ?><?php echo t('rectype: findone') ?></option>
> -<option value="<?php echo rectype_finddaily ?>" id="<?php echo rectype_finddaily ?>"><?php if ($schedule->type == rectype_finddaily) echo "(*)"; ?><?php echo t('rectype-long: finddaily') ?></option>
> -<option value="<?php echo rectype_findweekly ?>" id="<?php echo rectype_findweekly ?>"><?php if ($schedule->type == rectype_findweekly) echo "(*)"; ?><?php echo t('rectype-long: findweekly') ?></option>
> -<option value="<?php echo rectype_override ?>" id="<?php echo rectype_override ?>"><?php if ($schedule->type == rectype_override) echo "(*)"; ?><?php echo t('rectype: override') ?></option>
> +<option value="<?php echo rectype_dontrec ?>" ><?php if (!$schedule->recordid) echo "(*)"; ?><?php echo t('rectype: dontrec') ?></option>
> +<option value="<?php echo rectype_once ?>" ><?php if ($schedule->type == rectype_once) echo "(*)"; ?><?php echo t('rectype: once') ?></option>
> +<option value="<?php echo rectype_daily ?>" ><?php if ($schedule->type == retype_daily) echo "(*)"; ?>Record <?php echo t('rectype: daily') ?></option>
> +<option value="<?php echo rectype_weekly ?>" ><?php if ($schedule->type ==rectype_weekly) echo "(*)"; ?>Record <?php echo t('rectype: weekly') ?></option>
> +<option value="<?php echo rectype_channel ?>" ><?php if ($schedule->type == rectype_channel) echo "(*)"; ?><?php echo t('rectype: channel') ?></option>
> +<option value="<?php echo rectype_always ?>" ><?php if ($schedule->type == rectype_always) echo "(*)"; ?><?php echo t('rectype: always') ?></option>
> +<option value="<?php echo rectype_findone ?>" ><?php if ($schedule->type == rectype_findone) echo "(*)"; ?><?php echo t('rectype: findone') ?></option>
> +<option value="<?php echo rectype_finddaily ?>" ><?php if ($schedule->type == rectype_finddaily) echo "(*)"; ?><?php echo t('rectype-long: finddaily') ?></option>
> +<option value="<?php echo rectype_findweekly ?>" ><?php if ($schedule->type == rectype_findweekly) echo "(*)"; ?><?php echo t('rectype-long: findweekly') ?></option>
> +<option value="<?php echo rectype_override ?>" ><?php if ($schedule->type == rectype_override) echo "(*)"; ?><?php echo t('rectype: override') ?></option>
>  </select>
>  <?php echo t('Recording Profile') ?>:
>  <select name="profile" value="<?php echo $program->profile ?>">
> Index: mythweb/themes/wml/program_listing.php
> ===================================================================
> RCS file: /var/lib/mythcvs/mythweb/themes/wml/program_listing.php,v
> retrieving revision 1.2
> diff -u -r1.2 program_listing.php
> --- mythweb/themes/wml/program_listing.php	5 Dec 2004 19:52:58 -0000	1.2
> +++ mythweb/themes/wml/program_listing.php	23 Mar 2005 18:04:47 -0000
> @@ -70,7 +70,8 @@
>  
>          $bytime = $_GET['listbytime'];
>          $bynum = $_GET['listbychannum'];
> -        $bycall = $_GET['listbycallsign'];
> +        $bycall = $_GET['listbycallsign'];
> +        $cur_time = time();
>  
>          if (isset($bynum)) {
>              echo '<p>';
> @@ -99,7 +100,7 @@
>                      continue;
>                  }
>  
> -                echo "<a href='channel_detail.php?chanid=".$Channels[$key]->chanid."'>".$Channels[$key]->channum."</a> ";
> +                echo "<a href='channel_detail.php?chanid=".$Channels[$key]->chanid.'&amp;time='.$cur_time."'>".$Channels[$key]->channum."</a> ";
>                  // Count this channel
>                  $channel_count++;
>              }
> @@ -133,7 +134,7 @@
>                      continue;
>                  }
>  
> -                echo "<a href='channel_detail.php?chanid=".$Channels[$key]->chanid."'>".$Channels[$key]->callsign."</a><br/> ";
> +                echo "<a href='channel_detail.php?chanid=".$Channels[$key]->chanid.'&amp;time='.$cur_time."'>".$Channels[$key]->callsign."</a><br/> ";
>  
>                  // Count this channel
>                  $channel_count++;
> Index: mythweb/themes/wml/status.php
> ===================================================================
> RCS file: /var/lib/mythcvs/mythweb/themes/wml/status.php,v
> retrieving revision 1.1
> diff -u -r1.1 status.php
> --- mythweb/themes/wml/status.php	13 Nov 2004 19:46:55 -0000	1.1
> +++ mythweb/themes/wml/status.php	23 Mar 2005 18:04:47 -0000
> @@ -19,7 +19,7 @@
>  $str = file_get_contents("http://$masterhost:$statusport");
>  
>  // Make sure the content is interpreted as UTF-8
> -header("Content-Type: text/vnd.wap.wml");
> +header("Content-Type: text/vnd.wap.wml; charset=utf-8");
>  header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
>  header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
>  header("Cache-Control: no-cache, must-revalidate");
> Index: mythweb/themes/wml/theme.php
> ===================================================================
> RCS file: /var/lib/mythcvs/mythweb/themes/wml/theme.php,v
> retrieving revision 1.2
> diff -u -r1.2 theme.php
> --- mythweb/themes/wml/theme.php	5 Dec 2004 19:52:58 -0000	1.2
> +++ mythweb/themes/wml/theme.php	23 Mar 2005 18:04:47 -0000
> @@ -11,7 +11,7 @@
>  
>      function print_header($page_title = 'MythWeb') {
>          // Print the appropriate header information
> -        header("Content-Type: text/vnd.wap.wml");
> +        header("Content-Type: text/vnd.wap.wml; charset=utf-8");
>          //header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
>          header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
>          //header("Cache-Control: no-cache, must-revalidate");
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> mythtv-dev mailing list
> mythtv-dev at mythtv.org
> http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev


More information about the mythtv-dev mailing list