diff -NBurp mythweb-old/includes/sorting.php mythweb/includes/sorting.php
old
|
new
|
|
70 | 70 | isset($_GET['reverse']) or $_GET['reverse'] = $_POST['reverse']; |
71 | 71 | isset($_GET['sortby']) or $_GET['sortby'] = $_POST['sortby']; |
72 | 72 | // Now we build an array the user's sort preferences |
73 | | if (!is_array($_SESSION[$session]) || !count($_SESSION[$session])) |
| 73 | if (!is_array($_SESSION[$session]) || !count($_SESSION[$session])) { |
74 | 74 | $_SESSION[$session] = array(array('field' => 'airdate', |
75 | 75 | 'reverse' => false), |
76 | 76 | array('field' => 'title', |
77 | 77 | 'reverse' => false)); |
| 78 | } |
78 | 79 | // If we were given a sort parameter, let's put it into the sort preferences |
79 | 80 | if ($_GET['sortby']) { |
80 | 81 | $_GET['sortby'] = strtolower($_GET['sortby']); |
81 | | if (!function_exists('by_'.$_GET['sortby'])) |
| 82 | if (!function_exists('by_'.$_GET['sortby'])) { |
82 | 83 | $_GET['sortby'] = 'title'; |
| 84 | } |
83 | 85 | // This sortby method is the first element in the sort array, let's reverse it (unless told otherwise) |
84 | 86 | if ($_SESSION[$session][0]['field'] == $_GET['sortby']) { |
85 | | if (isset($_GET['reverse'])) |
| 87 | if (isset($_GET['reverse'])) { |
86 | 88 | $_SESSION[$session][0]['reverse'] = ($_GET['reverse'] > 0 || eregi('^y', $_GET['reverse'])) ? true : false; |
87 | | else |
| 89 | } |
| 90 | else { |
88 | 91 | $_SESSION[$session][0]['reverse'] = $_SESSION[$session][0]['reverse'] ? false : true; |
| 92 | } |
89 | 93 | } |
90 | 94 | // Otherwise, we need to parse the array, and add the current choice to the top |
91 | 95 | else { |
92 | 96 | // Scan the sort array for any entries matching the current choice, and remove them |
93 | 97 | foreach ($_SESSION[$session] as $key => $sort) { |
94 | 98 | // Found a match, or an old/accidental sort method - remove the sort entry |
95 | | if ($sort['field'] == $_GET['sortby'] || !function_exists('by_'.$sort['field'])) |
| 99 | if ($sort['field'] == $_GET['sortby'] || !function_exists('by_'.$sort['field'])) { |
96 | 100 | unset($_SESSION[$session][$key]); |
| 101 | } |
97 | 102 | } |
98 | 103 | // Add this choice to the top of the list |
99 | 104 | array_unshift($_SESSION[$session], array('field' => $_GET['sortby'], |
100 | | 'reverse' => $_GET['reverse'] ? true : false)); |
| 105 | 'reverse' => $_GET['reverse'] ? false : false)); |
101 | 106 | } |
102 | 107 | } |
103 | 108 | // No sortby, but requested a reversal of the main field |
104 | | elseif ($_GET['reverse']) |
| 109 | elseif ($_GET['reverse']) { |
105 | 110 | $_SESSION[$session][0]['reverse'] = $_SESSION[$session][0]['reverse'] ? false : true; |
| 111 | } |
| 112 | else { |
| 113 | $_SESSION[$session][0]['reverse'] = false; |
| 114 | } |
106 | 115 | // Once we've processed the information, we should make sure that we're actually sorting an array |
107 | | if (!count($programs)) |
| 116 | if (!count($programs)) { |
108 | 117 | return; |
| 118 | } |
109 | 119 | // Now we just need to sort the array |
110 | 120 | $GLOBALS['user_sort_choice'] = &$_SESSION[$session]; |
111 | 121 | usort($programs, 'by_user_choice'); |
diff -NBurp mythweb-old/modules/video/edit.php mythweb/modules/video/edit.php
old
|
new
|
if (isset($_POST['submit'])) { |
44 | 44 | ?> |
45 | 45 | <html> |
46 | 46 | <head> |
47 | | <script language="JavaScript"> |
| 47 | <script type="text/javascript"> |
48 | 48 | <!-- |
49 | 49 | function refreshParent() { |
50 | 50 | window.opener.location.href = window.opener.location.href; |
… |
… |
if (isset($_POST['submit'])) { |
99 | 99 | <table width="302" border="0" cellspacing="0" cellpadding="3"> |
100 | 100 | <tr> |
101 | 101 | <td width="99">Title:</td> |
102 | | <td width="301"><input name="title" type="text" value="<?php if (isset($title)) print $title ?>"></td> |
| 102 | <td width="301"><input name="title" type="text" value="<?php if (isset($title)) echo $title ?>"></td> |
103 | 103 | </tr><tr> |
104 | 104 | <td>Director:</td> |
105 | | <td><input name="director" type="text" value="<?php if (isset($director)) print $director ?>"></td> |
| 105 | <td><input name="director" type="text" value="<?php if (isset($director)) echo $director ?>"></td> |
106 | 106 | </tr><tr> |
107 | 107 | <td>Plot:</td> |
108 | | <td><textarea name="plot" rows="5" cols="30" wrap="VIRTUAL"><?php if (isset($plot)) print $plot ?></textarea></td> |
| 108 | <td><textarea name="plot" rows="5" cols="30" wrap="VIRTUAL"><?php if (isset($plot)) echo $plot ?></textarea></td> |
109 | 109 | </tr><tr> |
110 | 110 | <td>Category:</td> |
111 | 111 | <td><select name="category"> |
… |
… |
if (isset($_POST['submit'])) { |
122 | 122 | ?></select></td> |
123 | 123 | </tr><tr> |
124 | 124 | <td>Rating:</td> |
125 | | <td><input name="rating" type="text" value="<?php if (isset($rating)) print $rating ?>"></td> |
| 125 | <td><input name="rating" type="text" value="<?php if (isset($rating)) echo $rating ?>"></td> |
126 | 126 | </tr><tr> |
127 | 127 | <td>IMDB:</td> |
128 | | <td><input name="inetref" type="text" value="<?php if (isset($inetref)) print $inetref ?>"></td> |
| 128 | <td><input name="inetref" type="text" value="<?php if (isset($inetref)) echo $inetref ?>"></td> |
129 | 129 | </tr><tr> |
130 | 130 | <td>Year:</td> |
131 | | <td><input name="year" type="text" size=4 value="<?php if (isset($year)) print $year ?>"></td> |
| 131 | <td><input name="year" type="text" size=4 value="<?php if (isset($year)) echo $year ?>"></td> |
132 | 132 | </tr><tr> |
133 | 133 | <td>Userrating:</td> |
134 | | <td><input name="userrating" type="text" size=3 value="<?php if (isset($userrating)) print $userrating ?>"></td> |
| 134 | <td><input name="userrating" type="text" size=3 value="<?php if (isset($userrating)) echo $userrating ?>"></td> |
135 | 135 | </tr><tr> |
136 | 136 | <td>Length:</td> |
137 | | <td><input name="length" type="text" size=3 value="<?php if (isset($length)) print $length ?>"> in minutes</td> |
| 137 | <td><input name="length" type="text" size=3 value="<?php if (isset($length)) echo $length ?>"> in minutes</td> |
138 | 138 | </tr><tr> |
139 | 139 | <td></td> |
140 | | <td><input type="hidden" name="intid" value="<?php if (isset($_REQUEST['intid'])) print $_REQUEST['intid'] ?>"> |
| 140 | <td><input type="hidden" name="intid" value="<?php if (isset($_REQUEST['intid'])) echo $_REQUEST['intid'] ?>"> |
141 | 141 | <input type="submit" name="submit" value="submit"></td> |
142 | 142 | </tr> |
143 | 143 | </table> |
diff -NBurp mythweb-old/themes/default/video/video.php mythweb/themes/default/video/video.php
old
|
new
|
|
20 | 20 | require_once theme_dir.'/header.php'; |
21 | 21 | ?> |
22 | 22 | |
23 | | <SCRIPT LANGUAGE=JAVASCRIPT TYPE="TEXT/JAVASCRIPT"> |
| 23 | <script type="text/javascript"> |
24 | 24 | <!--Hide script from old browsers |
25 | 25 | |
26 | 26 | function newWindow(newContent) |
… |
… |
function newWindow(newContent) |
29 | 29 | } |
30 | 30 | |
31 | 31 | //Stop hiding script from old browsers --> |
32 | | </SCRIPT> |
| 32 | </script> |
33 | 33 | <table width="100%" border="0" cellpadding="4" cellspacing="2" class="list small"> |
34 | 34 | <tr class="menu"> |
35 | 35 | <td> |
36 | 36 | <?php |
37 | | echo '<form action="'.root."video\" method=\"GET\">\n"; |
| 37 | echo '<form action="'.root."video\" method=\"get\">\n"; |
38 | 38 | echo t('Display') . ": "; |
39 | 39 | echo "<select name=\"category\">\n"; |
40 | 40 | echo '<option value="-1"'; |
… |
… |
function newWindow(newContent) |
61 | 61 | <?php if (show_video_covers) { ?> |
62 | 62 | <td><?php echo t('cover') ?></td> |
63 | 63 | <?php } ?> |
64 | | <td><a href="<?php echo root ?>video?sortby=title"><?php echo t('title') ?></a></td> |
65 | | <td><a href="<?php echo root ?>video?sortby=director"><?php echo t('director') ?></a></td> |
| 64 | <td><a href="<?php echo root ?>video?sortby=title<?php echo $_GET['category'] ? ('&category=' . $_GET['category']) : ''?>"><?php echo t('title') ?></a></td> |
| 65 | <td><a href="<?php echo root ?>video?sortby=director<?php echo $_GET['category'] ? ('&category=' . $_GET['category']) : ''?>"><?php echo t('director') ?></a></td> |
66 | 66 | <td><?php echo t('plot') ?></td> |
67 | | <td><a href="<?php echo root ?>video?sortby=category"><?php echo t('category') ?></a></td> |
68 | | <td><?php echo t('rating') ?></a></td> |
69 | | <td><?php echo t('IMDB') ?></a></td> |
70 | | <td><a href="<?php echo root ?>video?sortby=length"><?php echo t('length') ?></a></td> |
71 | | <td><a href="<?php echo root ?>video?sortby=userrating"><?php echo t('imdb rating') ?></a></td> |
72 | | <td><a href="<?php echo root ?>video?sortby=year"><?php echo t('year') ?></a></td> |
73 | | <td><?php echo t('Edit') ?></a></td> |
| 67 | <td><a href="<?php echo root ?>video?sortby=category<?php echo $_GET['category'] ? ('&category=' . $_GET['category']) : ''?>"><?php echo t('category') ?></a></td> |
| 68 | <td><?php echo t('rating') ?></td> |
| 69 | <td><?php echo t('IMDB') ?></td> |
| 70 | <td><a href="<?php echo root ?>video?sortby=length<?php echo $_GET['category'] ? ('&category=' . $_GET['category']) : ''?>"><?php echo t('length') ?></a></td> |
| 71 | <td><a href="<?php echo root ?>video?sortby=userrating<?php echo $_GET['category'] ? ('&category=' . $_GET['category']) : ''?>"><?php echo t('imdb rating') ?></a></td> |
| 72 | <td><a href="<?php echo root ?>video?sortby=year<?php echo $_GET['category'] ? ('&category=' . $_GET['category']) : ''?>"><?php echo t('year') ?></a></td> |
| 73 | <td><?php echo t('Edit') ?></td> |
74 | 74 | </tr><?php |
75 | 75 | $row = 0; |
76 | 76 | foreach ($All_Shows as $show) { |
77 | 77 | ?><tr class="recorded"> |
78 | 78 | <td><?php |
79 | 79 | if (show_video_covers && file_exists(video_img_path.'/'.basename($show->coverfile))) |
80 | | 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.'">'; |
| 80 | echo '<a href="'.$show->url.'"><img src="'.video_img_path.'/'.basename($show->coverfile).'" width="'.video_img_width.'" height="'.video_img_height.'" alt="' . html_entities($show->title) . '"/></a>'; |
81 | 81 | else |
82 | 82 | echo ' '; |
83 | 83 | ?></td> |
84 | 84 | <td><?php echo '<a href="'.$show->url.'">'.html_entities($show->title).'</a>' ?></td> |
85 | | <td><?php echo $show->director ?></td> |
86 | | <td><?php echo $show->plot ?></td> |
87 | | <td><?php echo $Category_String[$show->category] ?></td> |
| 85 | <td><?php echo html_entities($show->director) ?></td> |
| 86 | <td><?php echo html_entities($show->plot) ?></td> |
| 87 | <td><?php echo html_entities($Category_String[$show->category]) ?></td> |
88 | 88 | <td><?php echo $show->rating ?></td> |
89 | 89 | <td><a href="http://www.imdb.com/Title?<?php echo $show->inetref ?>"><?php echo $show->inetref ?></a></td> |
90 | 90 | <td nowrap><?php echo nice_length($show->length * 60) ?></td> |
91 | 91 | <td nowrap><?php echo $show->userrating ?></td> |
92 | 92 | <td nowrap><?php echo $show->year ?></td> |
93 | | <td><a href="javascript:newWindow ('<?php echo root ?>video/edit?intid=<?php echo $show->intid ?>')" ><?php echo t('Edit') ?></a> |
| 93 | <td><a href="javascript:newWindow('<?php echo root ?>video/edit?intid=<?php echo $show->intid ?>')"><?php echo t('Edit') ?></a> |
94 | 94 | <?php |
95 | 95 | $row++; |
96 | 96 | } |
… |
… |
function newWindow(newContent) |
105 | 105 | require_once theme_dir.'/footer.php'; |
106 | 106 | |
107 | 107 | function print_menu_content() { |
108 | | if($_GET['sortby']) |
| 108 | global $_SESSION; |
| 109 | if ($_GET['sortby']) { |
109 | 110 | $new_sortby = $_GET['sortby']; |
110 | | if ( $_GET['reverse'] == 1 ) { |
| 111 | } |
| 112 | if ($_GET['reverse'] || ($_SESSION['video_sortby'][0]['field'] != $new_sortby)) { |
111 | 113 | $new_reverse = 0; |
112 | | } else { |
| 114 | } elseif ($_GET['sortby'] == $new_sortby) { |
113 | 115 | $new_reverse = 1; |
114 | 116 | } |
| 117 | |
115 | 118 | if ( $_GET['category'] ) |
116 | 119 | $new_cat = $_GET['category']; |
117 | 120 | |