PageRenderTime 39ms CodeModel.GetById 12ms RepoModel.GetById 1ms app.codeStats 0ms

/modules/tv/tmpl/default/channel.php

https://github.com/fracmak/mythweb
PHP | 105 lines | 76 code | 12 blank | 17 comment | 14 complexity | 7eca6f43b087bfdc89b1732a5bba1eeb MD5 | raw file
  1. <?php
  2. /**
  3. * Show the current lineup for a specific channel
  4. *
  5. * @license GPL
  6. *
  7. * @package MythWeb
  8. * @subpackage TV
  9. *
  10. /**/
  11. // Set the desired page title
  12. $page_title = 'MythWeb - '.t('Channel Detail');
  13. // Custom headers
  14. $headers[] = '<link rel="stylesheet" type="text/css" href="'.skin_url.'/tv_channel.css">';
  15. // Print the page header
  16. require 'modules/_shared/tmpl/'.tmpl.'/header.php';
  17. // Print out some header info about this channel and time
  18. ?>
  19. <div id="list_head" class="clearfix">
  20. <form method="get" id="program_listing" action="<?php echo root_url ?>tv/channel">
  21. <div id="x_current_time">
  22. <?php if ($_SESSION["show_channel_icons"] && !empty($this_channel->icon)) { ?>
  23. <img src="<?php echo $this_channel->icon ?>">
  24. <?php } ?>
  25. Channel <?php echo $this_channel->channum ?>: <?php echo $this_channel->callsign ?> on <?php echo strftime('%B %e, %Y', $_SESSION['list_time']) ?>
  26. </div>
  27. <table id="x-jumpto" class="commandbox commands" border="0" cellspacing="0" cellpadding="0">
  28. <tr>
  29. <td class="x-jumpto"><?php echo t('Jump To') ?>:</td>
  30. <td class="x-hour"><?php channel_select('onchange="$(\'program_listing\').submit()"', $this_channel->chanid) ?></td>
  31. <td class="x-day"><a href="<?php echo root_url ?>tv/channel/<?php echo $this_channel->chanid, '/', $_SESSION['list_time'] - (24 * 60 * 60) ?>"
  32. ><img src="<?php echo skin_url ?>img/left.gif" alt="<?php echo t('leftl'); ?>"></a>
  33. <?php date_select('onchange="$(\'program_listing\').submit()"') ?>
  34. <a href="<?php echo root_url ?>tv/channel/<?php echo $this_channel->chanid, '/', $_SESSION['list_time'] + (24 * 60 * 60) ?>"
  35. ><img src="<?php echo skin_url ?>img/right.gif" alt="<?php echo t('right'); ?>"></a>
  36. </td>
  37. </tr>
  38. </table>
  39. </form>
  40. </div>
  41. <?php
  42. // Only show the programs if there are some to display
  43. if (is_array($programs)) {
  44. ?><table width="100%" border="0" cellpadding="4" cellspacing="2" class="list small">
  45. <tr class="menu">
  46. <td><?php echo t('Time') ?></td>
  47. <td><?php echo t('Title') ?></td>
  48. <td><?php echo t('Episode') ?></td>
  49. <td><?php echo t('Description') ?></td>
  50. <td><?php echo t('Length') ?></td>
  51. </tr><?php
  52. $row = 0;
  53. foreach ($programs as $show) {
  54. // Print some additional information for movies
  55. $additional = '';
  56. if ($show->category_type == 'movie'
  57. || $show->category_type == 'Film') {
  58. if ($show->airdate > 0)
  59. $additional = sprintf('%4d', $show->airdate);
  60. if (strlen($show->rating) > 0) {
  61. if ($additional)
  62. $additional .= ", ";
  63. $additional .= "<i>$show->rating</i>";
  64. }
  65. if (strlen($show->starstring) > 0) {
  66. if ($additional)
  67. $additional .= ", ";
  68. $additional .= $show->starstring;
  69. }
  70. if ($additional)
  71. $additional = ' (' . $additional . ')';
  72. }
  73. // Print the content
  74. ?><tr class="<?php echo $show->css_class ?>">
  75. <td class="nowrap" align="center"><a href="<?php echo root_url ?>tv/list?time=<?php echo $show->starttime ?>"><?php echo strftime($_SESSION['time_format'], $show->starttime) ?> - <?php echo strftime($_SESSION['time_format'], $show->endtime) ?></a></td>
  76. <td class="<?php echo $show->css_class ?>"><?php
  77. if ($show->hdtv)
  78. echo '<span class="hdtv_icon">HD</span>';
  79. echo '<a href="'.root_url.'tv/detail/'.$show->chanid.'/'.$show->starttime.'">'
  80. .$show->title.$additional.'</a>';
  81. ?></td>
  82. <td><?php echo $show->subtitle ?></td>
  83. <td><?php echo $show->description ?></td>
  84. <td class="nowrap"><?php echo nice_length($show->length) ?></td>
  85. </tr><?php
  86. $row++;
  87. }
  88. ?>
  89. </table>
  90. <?php
  91. }
  92. // Print the page footer
  93. require 'modules/_shared/tmpl/'.tmpl.'/footer.php';