Ticket #622: mythweb_deletion.diff
File mythweb_deletion.diff, 4.9 KB (added by , 18 years ago) |
---|
-
themes/Default/recorded_programs.php
47 47 foreach ($All_Shows as $show) { 48 48 ?> 49 49 file = new Object(); 50 file.chanid = '<?php echo addslashes($show->chanid) ?>'; 51 file.starttime = '<?php echo addslashes($show->starttime) ?>'; 50 52 file.title = '<?php echo addslashes($show->title) ?>'; 51 53 file.subtitle = '<?php echo addslashes($show->subtitle) ?>'; 52 54 file.group = '<?php echo addslashes(urlencode($show->group)) ?>'; … … 64 66 if (confirm("<?php echo t('Are you sure you want to delete the following show?') ?>\n\n "+file.title+": "+file.subtitle)) { 65 67 // Do the actual deletion 66 68 if (programs_shown == 1) 67 location.href = 'recorded_programs.php?delete=yes& file='+file.filename;69 location.href = 'recorded_programs.php?delete=yes&chanid='+file.chanid+'&starttime='+file.starttime; 68 70 else 69 submit_url('recorded_programs.php?ajax&delete=yes& file='+file.filename, http_success, http_failure, id, file);71 submit_url('recorded_programs.php?ajax&delete=yes&chanid='+file.chanid+'&starttime='+file.starttime, http_success, http_failure, id, file); 70 72 // Debug statements - uncomment to verify that the right file is being deleted 71 73 //alert('row number ' + id + ' belonged to section ' + section + ' which now has ' + rowcount[section] + ' elements'); 72 74 //alert('just deleted an episode of "' + title + '" which now has ' + episode_count + ' episodes left'); … … 279 281 <?php } else { ?> 280 282 <td width="5%" rowspan="<?php echo $_SESSION['recorded_descunder'] ? 2 : 1 ?>" class="command command_border_l command_border_t command_border_b command_border_r" align="center"> 281 283 <a id="delete_<?php echo $row ?>" 282 href="recorded_programs.php?delete=yes& file=<?php echo urlencode($show->filename) ?>"284 href="recorded_programs.php?delete=yes&chanid=<?php echo urlencode($show->chanid) ?>&starttime=<?php echo urlencode($show->starttime) ?>" 283 285 js_href="javascript:confirm_delete(<?php echo $row ?>, false)"; 284 286 title="<?php echo htmlentities(t('Delete $1', preg_replace('/: $/', '', $show->title.': '.$show->subtitle))) ?>" 285 287 ><?php echo t('Delete') ?></a> … … 304 306 </td> 305 307 <td width="5%" class="command command_border_l command_border_t command_border_b command_border_r" align="center"> 306 308 <a id="delete_rerecord_<?php echo $row ?>" 307 href="recorded_programs.php?delete=yes& file=<?php echo urlencode($show->filename) ?>&forget_old"309 href="recorded_programs.php?delete=yes&chanid=<?php echo urlencode($show->chanid) ?>&starttime=<?php echo urlencode($show->starttime) ?>&forget_old" 308 310 js_href="javascript:confirm_delete(<?php echo $row ?>, true)"; 309 311 title="<?php echo htmlentities(t('Delete and rerecord $1', preg_replace('/: $/', '', $show->title.': '.$show->subtitle))) ?>" 310 312 ><?php echo t('Delete + Rerecord') ?></a></td> -
recorded_programs.php
21 21 // Delete a program? 22 22 isset($_GET['forget_old']) or $_GET['forget_old'] = $_POST['forget_old']; 23 23 isset($_GET['delete']) or $_GET['delete'] = $_POST['delete']; 24 isset($_GET['file']) or $_GET['file'] = $_POST['file']; 25 if ($_GET['delete'] && preg_match('/\\d+_\\d+/', $_GET['file'])) { 24 isset($_GET['chanid']) or $_GET['chanid'] = $_POST['chanid']; 25 isset($_GET['starttime']) or $_GET['starttime'] = $_POST['starttime']; 26 if ($_GET['delete']) { 26 27 // Keep a previous-row counter to return to after deleting 27 28 $prev_row = -2; 28 29 // We need to scan through the available recordings to get at the additional information required by the DELETE_RECORDING query … … 31 32 if (($_SESSION['recorded_title'] == $row[0]) || ($_SESSION['recorded_title'] == '')) 32 33 $prev_row++; 33 34 // This row isn't the one we're looking for 34 if ( $row[8] != $_GET['file'])35 if (($row[4] != $_GET['chanid']) or ($row[11] != $_GET['starttime'])) 35 36 continue; 36 37 // Forget all knowledge of old recordings 37 38 if (isset($_GET['forget_old'])) { 38 preg_match('/\/(\d+)_(\d+)_\d+\.nuv$/', $_GET['file'], $matches); 39 // What does this following line do? Commented it out as it wouldn't work anyway (matches nuv files only) 40 // preg_match('/\/(\d+)_(\d+)_\d+\.nuv$/', $_GET['file'], $matches); 39 41 $show = new Program($row); 40 42 $show->rec_forget_old(); 41 43 }