diff --git a/view/modeYoutube.php b/view/modeYoutube.php index fb3e653e0..9cbf3a2bb 100644 --- a/view/modeYoutube.php +++ b/view/modeYoutube.php @@ -1,450 +1,450 @@ thumbnails; $poster = $evideo->thumbnails; $imgw = 1280; $imgh = 720; $autoPlaySources = array(); $autoPlayURL = ''; $autoPlayPoster = ''; $autoPlayThumbsSprit = ''; } else { require_once $global['systemRootPath'] . 'objects/user.php'; require_once $global['systemRootPath'] . 'objects/category.php'; require_once $global['systemRootPath'] . 'objects/subscribe.php'; require_once $global['systemRootPath'] . 'objects/functions.php'; $img = "".getCDN()."view/img/notfound.jpg"; $poster = "".getCDN()."view/img/notfound.jpg"; $imgw = 1280; $imgh = 720; if (!empty($_GET['type'])) { if ($_GET['type'] == 'audio') { $_SESSION['type'] = 'audio'; } else if ($_GET['type'] == 'video') { $_SESSION['type'] = 'video'; } else if ($_GET['type'] == 'pdf') { $_SESSION['type'] = 'pdf'; } else { $_SESSION['type'] = ""; unset($_SESSION['type']); } } else { unset($_SESSION['type']); } session_write_close(); $modeYouTubeTimeLog['Code part 1'] = microtime(true) - $modeYouTubeTime; $modeYouTubeTime = microtime(true); if (!empty($_GET['playlist_id'])) { $isSerie = 1; if (preg_match("/^[0-9]+$/", $_GET['playlist_id'])) { $playlist_id = $_GET['playlist_id']; } else if (User::isLogged()) { if ($_GET['playlist_id'] == "favorite") { $playlist_id = PlayList::getFavoriteIdFromUser(User::getId()); } else { $playlist_id = PlayList::getWatchLaterIdFromUser(User::getId()); } } if (!empty($_GET['playlist_index'])) { $playlist_index = $_GET['playlist_index']; } $videosArrayId = PlayList::getVideosIdFromPlaylist($playlist_id); if (empty($videosArrayId)) { videoNotFound(__('Playlist is empty or does not exist')); } $videosPlayList = Video::getAllVideos("viewable", false, false, $videosArrayId, false, true); $videosPlayList = PlayList::sortVideos($videosPlayList, $videosArrayId); $videoSerie = Video::getVideoFromSeriePlayListsId($playlist_id); unset($_GET['playlist_id']); $isPlayListTrailer = false; $playListObject = AVideoPlugin::getObjectData("PlayLists"); if (!empty($videoSerie)) { $videoSerie = Video::getVideo($videoSerie["id"], "", true); if (!empty($playListObject->showTrailerInThePlayList) && !empty($videoSerie["trailer1"]) && filter_var($videoSerie["trailer1"], FILTER_VALIDATE_URL) !== FALSE) { $videoSerie["type"] = "embed"; $videoSerie["videoLink"] = $videoSerie["trailer1"]; array_unshift($videosPlayList, $videoSerie); array_unshift($videosArrayId, $videoSerie['id']); $isPlayListTrailer = true; } } if (empty($playlist_index) && $isPlayListTrailer) { $video = $videoSerie; } else { $vid = new Video("", "", $videosPlayList[$playlist_index]['id']); $_GET['videoName'] = $vid->getClean_title(); $video = Video::getVideo($videosPlayList[$playlist_index]['id'], "viewable", false, false, false, true); } if (!empty($videosPlayList[$playlist_index + 1])) { $autoPlayVideo = Video::getVideo($videosPlayList[$playlist_index + 1]['id'], "viewableNotUnlisted", false, false, false, true); $autoPlayVideo['url'] = $global['webSiteRootURL'] . "playlist/{$playlist_id}/" . ($playlist_index + 1); } else if (!empty($videosPlayList[0])) { $autoPlayVideo = Video::getVideo($videosPlayList[0]['id'], "viewableNotUnlisted", false, false, false, true); $autoPlayVideo['url'] = $global['webSiteRootURL'] . "playlist/{$playlist_id}/0"; } if ($serie = PlayLists::isPlayListASerie($playlist_id)) { setVideos_id($serie['id']); } else if (!empty($videosPlayList[$playlist_index])) { setVideos_id($videosPlayList[$playlist_index]['id']); } } else { $catLink = ""; if (!empty($_GET['catName'])) { $catLink = "cat/{$_GET['catName']}/"; } // add this because if you change the video category the video was not loading anymore $catName = @$_GET['catName']; if (empty($_GET['clean_title']) && (isset($advancedCustom->forceCategory) && $advancedCustom->forceCategory === false)) { $_GET['catName'] = ""; } if (empty($video)) { $video = Video::getVideo("", "viewable", false, false, true, true); } if (empty($video)) { $video = Video::getVideo("", "viewable", false, false, false, true); } if (empty($video)) { $video = AVideoPlugin::getVideo(); } if (!empty($_GET['v']) && (empty($video) || $video['id'] != $_GET['v'])) { $video = false; } if (!empty($video['id'])) { // allow users to count a view again in case it is refreshed Video::unsetAddView($video['id']); // add this because if you change the video category the video was not loading anymore $_GET['catName'] = $catName; $_GET['isMediaPlaySite'] = $video['id']; $obj = new Video("", "", $video['id']); } /* if (empty($_SESSION['type'])) { $_SESSION['type'] = $video['type']; } * */ // $resp = $obj->addView(); $get = array('channelName' => @$_GET['channelName'], 'catName' => @$_GET['catName']); $modeYouTubeTimeLog['Code part 1.1'] = microtime(true) - $modeYouTubeTime; $modeYouTubeTime = microtime(true); if (!empty($video['next_videos_id'])) { $modeYouTubeTimeLog['Code part 1.2'] = microtime(true) - $modeYouTubeTime; $modeYouTubeTime = microtime(true); $autoPlayVideo = Video::getVideo($video['next_videos_id']); } else { $modeYouTubeTimeLog['Code part 1.3'] = microtime(true) - $modeYouTubeTime; $modeYouTubeTime = microtime(true); $modeYouTubeTimeLog['Code part 1.5'] = microtime(true) - $modeYouTubeTime; $modeYouTubeTime = microtime(true); if (!empty($video['id'])) { $autoPlayVideo = Video::getRandom($video['id']); } //} } $modeYouTubeTimeLog['Code part 1.6'] = microtime(true) - $modeYouTubeTime; $modeYouTubeTime = microtime(true); if (!empty($autoPlayVideo)) { $name2 = User::getNameIdentificationById($autoPlayVideo['users_id']) . ' ' . User::getEmailVerifiedIcon($autoPlayVideo['users_id']); $autoPlayVideo['creator'] = '