Ticket #1574: video.php

File video.php, 5.5 KB (added by ATSantema@…, 18 years ago)

mythweb/themes/default/video/video.php

Line 
1<?php
2/**
3 * Rudimentary interface to MythVideo data
4 *
5 * @url         $URL$
6 * @date        $Date: 2006-02-02 02:59:05 -0500 (Thu, 02 Feb 2006) $
7 * @version     $Revision: 8837 $
8 * @author      $Author: xris $
9 * @license     GPL
10 *
11 * @package     MythWeb
12 * @subpackage  Video
13 *
14/**/
15
16// Set the desired page title
17    $page_title = 'MythWeb - '.t('Videos');
18
19// Print the page header
20    require_once theme_dir.'/header.php';
21?>
22
23<SCRIPT LANGUAGE=JAVASCRIPT TYPE="TEXT/JAVASCRIPT">
24<!--Hide script from old browsers
25
26function newWindow(newContent)
27 {
28  winContent = window.open(newContent, 'nextWin', 'right=0, top=20,width=350,height=440, toolbar=no,scrollbars=no, resizable=yes')
29 }
30
31 //Stop hiding script from old browsers -->
32 </SCRIPT>
33<table width="100%" border="0" cellpadding="4" cellspacing="2" class="list small">
34<tr class="menu">
35<td>
36<?php
37    echo '<form action="'.root."video\" method=\"GET\">\n";
38    echo t('Display') . ": ";
39    echo "<select name=\"category\">\n";
40    echo '<option value="-1"';
41    if( $Filter_Category == -1)
42        echo ' SELECTED';
43    echo ">All Categories</option>\n";
44    foreach (array_keys($Category_String) as $i) {
45        echo "<option value=\"$i\"";
46        if( $i == $Filter_Category )
47            echo ' SELECTED';
48        echo '>';
49        echo html_entities($Category_String[$i])."</option>\n";
50    }
51    echo '</select>';
52   
53    echo "&nbsp;&nbsp;<select name=\"genre\">\n";
54    echo '<option value="-1"';
55    if( $Filter_Genre == -1)
56        echo ' SELECTED';
57    echo ">All Genres</option>\n";
58    foreach (array_keys($Genre_String) as $i) {
59        echo "<option value=\"$i\"";
60        if( $i == $Filter_Genre )
61            echo ' SELECTED';
62        echo '>';
63        echo html_entities($Genre_String[$i])."</option>\n";
64    }
65    echo '</select>';
66   
67    echo "&nbsp;&nbsp;<select name=\"browse\">\n";
68    echo '<option value="-1"';
69    if( $Filter_Browse == -1)
70        echo ' SELECTED';
71    echo ">Browse all</option>\n";
72    echo "<option value=\"1\"";
73     if( $Filter_Browse == 1)
74        echo ' SELECTED';
75    echo ">Browse = yes</option>\n";
76    echo "<option value=\"0\"";
77    if( $Filter_Browse == 0)
78        echo ' SELECTED';
79    echo ">Browse = no</option>\n";
80    echo '</select>';
81
82    echo "&nbsp;&nbsp;Title search:&nbsp;<input name=\"search\" value=\"$Filter_Search\">";
83
84?>   
85   
86    <input type="submit" value="<?php echo t('Update') ?>">
87</form>
88</td>
89</tr>
90</table>
91
92<table width="100%" border="0" cellpadding="4" cellspacing="2" class="list small">
93<tr class="menu">
94<?php   if (show_video_covers) { ?>
95    <td><?php echo t('cover') ?></td>
96<?php   }
97$filters="&category=$Filter_Category&browse=$Filter_Browse&genre=$Filter_Genre&search=$Filter_Search";
98?>
99    <td><a href="<?php echo root ?>video?sortby=title<?php echo $filters ?> "><?php    echo t('title') ?></a></td>
100    <td><a href="<?php echo root ?>video?sortby=director<?php echo $filters ?>"><?php echo t('director') ?></a></td>
101    <td><?php echo t('plot')     ?></td>
102    <td><a href="<?php echo root ?>video?sortby=category<?php echo $filters ?>"><?php echo t('category') ?></a></td>
103    <td><?php echo t('rating')   ?></a></td>
104    <td><?php echo t('IMDB')     ?></a></td>
105    <td><a href="<?php echo root ?>video?sortby=length<?php echo $filters ?>"><?php     echo t('length') ?></a></td>
106    <td><a href="<?php echo root ?>video?sortby=userrating<?php echo $filters ?>"><?php echo t('imdb rating') ?></a></td>
107    <td><a href="<?php echo root ?>video?sortby=year<?php echo $filters ?>"><?php       echo t('year') ?></a></td>
108    <td><?php echo t('Edit') ?></a></td>
109</tr><?php
110    $row = 0;
111    foreach ($All_Shows as $show) {
112    ?><tr class="recorded">
113    <td><?php
114        if (show_video_covers && file_exists(video_img_path.'/'.basename($show->coverfile)))
115            echo '<a href="'.$show->url.'"><img id="'.html_entities($show->filename).'" src="'.video_img_path.'/'.basename($show->coverfile).'" width="'.video_img_width.'" height="'.video_img_height.'">';
116        else
117            echo '&nbsp;';
118    ?></td>
119    <td><?php echo '<a href="'.$show->url.'">'.html_entities($show->title).'</a>' ?></td>
120    <td><?php echo $show->director                   ?></td>
121    <td><?php echo $show->plot                       ?></td>
122    <td><?php echo $Category_String[$show->category] ?></td>
123    <td><?php echo $show->rating                     ?></td>
124    <td><a href="http://www.imdb.com/Title?<?php echo $show->inetref ?>"><?php echo $show->inetref ?></a></td>
125    <td nowrap><?php echo nice_length($show->length * 60) ?></td>
126    <td nowrap><?php echo $show->userrating ?></td>
127    <td nowrap><?php echo $show->year ?></td>
128    <td><a href="javascript:newWindow ('<?php echo root ?>video/edit?intid=<?php echo $show->intid ?>')" ><?php echo t('Edit') ?></a>
129<?php
130        $row++;
131    }
132?>
133
134</table>
135<?php
136    echo '<p align="right" style="padding-right: 75px">'.$row.' videos</p>';
137
138
139// Print the page footer
140    require_once theme_dir.'/footer.php';
141
142    function print_menu_content() {
143        if($_GET['sortby'])
144            $new_sortby = $_GET['sortby'];
145        if ( $_GET['reverse'] == 1 )  {
146            $new_reverse = 0;
147        } else  {
148            $new_reverse = 1;
149        }
150        if ( $_GET['category'] )
151            $new_cat = $_GET['category'];
152
153        echo 'MythVideo:';
154        echo "&nbsp; &nbsp;";
155        echo '<a href="'.root."video?reverse=$new_reverse";
156        if($new_sortby)
157            echo "&sortby=$new_sortby";
158        if($new_cat)
159            echo "&category=$new_cat";
160        echo '">';
161        echo t('Reverse Order');
162        echo "</a>";
163    }
164