Example #1
0
     echo show($cols, $_GET['table']);
     break;
 case 'addvideo':
     if (isset($_POST['id'])) {
         sync_delete(array($_POST['id']), $_GET['t']);
         sync_add($mysql_tables);
     } else {
         echo 'No POST data';
     }
     break;
 case 'removevideo':
     sync_delete($_POST, $_GET['t']);
     break;
 case 'updatevideo':
     if (isset($_POST['id'])) {
         sync_delete(array($_POST['id']), $_GET['t']);
         sync_add($mysql_tables);
     } else {
         echo 'No POST data';
     }
     break;
     /* ##########
      * # IMAGES #
      */
     ##########
 /* ##########
  * # IMAGES #
  */
 ##########
 case 'showimages':
     show_images();
Example #2
0
    if (!isset($_SESSION['logged_admin']) or $_SESSION['logged_admin'] !== true) {
        die('no permission');
    }
    include 'function.php';
    connect($mysql_ml);
    if ($option == 'deletemovie') {
        sync_delete(array($_GET['id']), 'movies');
    } else {
        $episodes_sql = 'SELECT id FROM episodes WHERE tvshow = "' . $_GET['id'] . '"';
        $episodes_res = mysql_q($episodes_sql);
        $episodes_id = array();
        while ($epi = mysql_fetch_assoc($episodes_res)) {
            $episodes_id[] = $epi['id'];
        }
        sync_delete(array($_GET['id']), 'tvshows');
        sync_delete($episodes_id, 'episodes');
    }
}
// delete img
if ($option == 'deleteposter' or $option == 'deletefanart') {
    // admin permission
    if (!isset($_SESSION['logged_admin']) or $_SESSION['logged_admin'] !== true) {
        die('no permission');
    }
    include 'function.php';
    connect($mysql_ml);
    $filename = $_GET['video'] . '_' . $_GET['id'] . ($option == 'deletefanart' ? '_f' : '') . '.jpg';
    remove_images(array($filename));
}
// hide movie or tvshow
if ($option == 'hidemovie' or $option == 'hidetvshow' or $option == 'visiblemovie' or $option == 'visibletvshow') {