prepare("SELECT * FROM movies WHERE movie_imdb_id = :movie_imdb_id LIMIT 1"); $stmt->bindParam(':movie_imdb_id', $movie_imdb_id, PDO::PARAM_STR); $stmt->execute(); $movieResult = $stmt->fetch(PDO::FETCH_ASSOC); $hasMovieResult = !empty($movieResult); if (!$hasMovieResult) { $stmt = $conn->prepare("SELECT * FROM animovies WHERE movie_imdb_id = :movie_imdb_id LIMIT 1"); $stmt->bindParam(':movie_imdb_id', $movie_imdb_id, PDO::PARAM_STR); $stmt->execute(); $animovieResult = $stmt->fetch(PDO::FETCH_ASSOC); $hasAnimovieResult = !empty($animovieResult); if (!$hasAnimovieResult) { redirectTo404(); } else { if ($animovieResult['animovie_status'] !== 'Active') { redirectToInactive(); } $animovieTitle = $animovieResult['animovie_title']; $animovieReleaseDate = $animovieResult['release_date']; $animovieBackdropPath = $animovieResult['backdrop_path']; $animovieEmbed1 = $animovieResult['embed_1']; $animovieEmbed2 = $animovieResult['embed_2']; $animovieEmbed3 = !empty($animovieResult['embed_3']) ? "https://short.ink/?v=" . $animovieResult['embed_3'] : ''; $animovieEmbed4 = $animovieResult['embed_2']; } } else { if ($movieResult['movie_status'] !== 'Active') { redirectToInactive(); } else { $movieTitle = $movieResult['movie_title']; $releaseDate = $movieResult['release_date']; $backdropPath = $movieResult['backdrop_path']; $embed1 = $movieResult['embed_1']; $embed2 = $movieResult['embed_2']; $embed3 = !empty($movieResult['embed_3']) ? "https://short.ink/?v=" . $movieResult['embed_3'] : ''; $embed4 = $movieResult['embed_4']; } } $stmt = $conn->prepare("SELECT name, value FROM site_settings WHERE name = 'Site Title' AND category = 'General Settings'"); $stmt->execute(); $fetch = $stmt->fetch(PDO::FETCH_ASSOC); $siteTitle = $fetch['value']; // $stmt = $conn->prepare("SELECT name, value FROM site_settings WHERE name = 'Advert 1' AND category = 'General Settings'"); // $stmt->execute(); // $fetch = $stmt->fetch(PDO::FETCH_ASSOC); // $advert1 = $fetch['value']; // $stmt = $conn->prepare("SELECT name, value FROM site_settings WHERE name = 'Advert 2' AND category = 'General Settings'"); // $stmt->execute(); // $fetch = $stmt->fetch(PDO::FETCH_ASSOC); // $advert2 = $fetch['value']; // $stmt = $conn->prepare("SELECT name, value FROM site_settings WHERE name = 'Advert 3' AND category = 'General Settings'"); // $stmt->execute(); // $fetch = $stmt->fetch(PDO::FETCH_ASSOC); // $advert3 = $fetch['value']; // $stmt = $conn->prepare("SELECT name, value FROM site_settings WHERE name = 'Advert 4' AND category = 'General Settings'"); // $stmt->execute(); // $fetch = $stmt->fetch(PDO::FETCH_ASSOC); // $advert4 = $fetch['value']; $videoLinks = array(); if ($hasMovieResult) { if (!empty($embed1)) { $videoLinks[] = "https://src.paxsrc.site/secure/" . urlencode(encrypt_decrypt('encrypt', $embed1)); } if (!empty($embed2)) { $videoLinks[] = "https://src.paxsrc.site/secure/" . urlencode(encrypt_decrypt('encrypt', $embed2)); } if (!empty($embed3)) { $videoLinks[] = "https://src.paxsrc.site/secure/" . urlencode(encrypt_decrypt('encrypt', $embed3)); } if (!empty($embed4)) { $videoLinks[] = "https://src.paxsrc.site/secure/" . urlencode(encrypt_decrypt('encrypt', $embed4)); } } elseif ($hasAnimovieResult) { if (!empty($animovieEmbed1)) { $videoLinks[] = "https://src.paxsrc.site/secure/" . urlencode(encrypt_decrypt('encrypt', $animovieEmbed1)); } if (!empty($animovieEmbed2)) { $videoLinks[] = "https://src.paxsrc.site/secure/" . urlencode(encrypt_decrypt('encrypt', $animovieEmbed2)); } if (!empty($animovieEmbed3)) { $videoLinks[] = "https://src.paxsrc.site/secure/" . urlencode(encrypt_decrypt('encrypt', $animovieEmbed3)); } if (!empty($animovieEmbed4)) { $videoLinks[] = "https://src.paxsrc.site/secure/" . urlencode(encrypt_decrypt('encrypt', $animovieEmbed4)); } } $noServerAvailable = empty($videoLinks); if ($noServerAvailable) { $default404Url = "https://paxsrc.site/embed/f53e0532-96e9-4b87-9e80-1f696ba0281d"; $videoLinks[] = "https://src.paxsrc.site/secure/" . urlencode(encrypt_decrypt('encrypt', $default404Url)); } function encrypt_decrypt($action, $string) { $output = false; $encrypt_method = "AES-256-CBC"; $secret_key = 'hyperV'; $secret_iv = 'hyperV'; $key = hash('sha256', $secret_key); $iv = substr(hash('sha256', $secret_iv), 0, 16); if ($action == 'encrypt') { $output = openssl_encrypt($string, $encrypt_method, $key, 0, $iv); $output = base64_encode($output); } else if($action == 'decrypt') { $output = openssl_decrypt(base64_decode($string), $encrypt_method, $key, 0, $iv); } return $output; } ?>