diff --git a/plugin/API/API.php b/plugin/API/API.php index e084bf58a..d30ff1f96 100644 --- a/plugin/API/API.php +++ b/plugin/API/API.php @@ -1,533 +1,548 @@ APISecret = md5($global['systemRootPath']); return $obj; } public function getPluginMenu() { global $global; $fileAPIName = $global['systemRootPath'] . 'plugin/API/pluginMenu.html'; return file_get_contents($fileAPIName); } public function set($parameters) { if (empty($parameters['APIName'])) { $object = new ApiObject("Parameter APIName can not be empty"); } else { if (!empty($parameters['pass'])) { $parameters['password'] = $parameters['pass']; } if (!empty($parameters['encodedPass']) && strtolower($parameters['encodedPass']) === 'false') { $parameters['encodedPass'] = false; } if (!empty($parameters['user']) && !empty($parameters['password'])) { $user = new User("", $parameters['user'], $parameters['password']); $user->login(false, @$parameters['encodedPass']); } $APIName = $parameters['APIName']; if (method_exists($this, "set_api_$APIName")) { $str = "\$object = \$this->set_api_$APIName(\$parameters);"; eval($str); } else { $object = new ApiObject(); } } return $object; } public function get($parameters) { if (empty($parameters['APIName'])) { $object = new ApiObject("Parameter APIName can not be empty"); } else { if (!empty($parameters['pass'])) { $parameters['password'] = $parameters['pass']; } if (!empty($parameters['user']) && !empty($parameters['password'])) { if (!empty($parameters['encodedPass']) && strtolower($parameters['encodedPass']) === 'false') { $parameters['encodedPass'] = false; } $user = new User("", $parameters['user'], $parameters['password']); $user->login(false, @$parameters['encodedPass']); } $APIName = $parameters['APIName']; if (method_exists($this, "get_api_$APIName")) { $str = "\$object = \$this->get_api_$APIName(\$parameters);"; eval($str); } else { $object = new ApiObject(); } } return $object; } private function startResponseObject($parameters) { $obj = new stdClass(); if (empty($parameters['sort']) && !empty($parameters['order'][0]['dir'])) { $index = intval($parameters['order'][0]['column']); $parameters['sort'][$parameters['columns'][$index]['data']] = $_GET['order'][0]['dir']; } $array = array('sort', 'rowCount', 'current', 'searchPhrase'); foreach ($array as $value) { if (!empty($parameters[$value])) { $obj->$value = $parameters[$value]; $_POST[$value] = $parameters[$value]; } } return $obj; } private function getToPost() { foreach ($_GET as $key => $value) { $_POST[$key] = $value; } } /** * @param type $parameters * ['sort' database sort column] * ['rowCount' max numbers of rows] * ['current' current page] * ['searchPhrase' to search on the categories] * ['parentsOnly' will bring only the parents, not children categories] * @example {webSiteRootURL}plugin/API/{getOrSet}.json.php?APIName={APIName}&rowCount=3¤t=1&sort[created]=DESC * @return \ApiObject */ public function get_api_category($parameters) { global $global; require_once $global['systemRootPath'] . 'objects/category.php'; $obj = $this->startResponseObject($parameters); $rows = Category::getAllCategories(); array_multisort(array_column($rows, 'hierarchyAndName'), SORT_ASC, $rows); $totalRows = Category::getTotalCategories(); $obj->totalRows = $totalRows; $obj->rows = $rows; return new ApiObject("", false, $obj); } /** * @param type $parameters * ['APISecret' to list all videos] * ['sort' database sort column] * ['videos_id' the video id (will return only 1 or 0 video)] * ['clean_title' the video clean title (will return only 1 or 0 video)] * ['rowCount' max numbers of rows] * ['current' current page] * ['searchPhrase' to search on the categories] * ['tags_id' the ID of the tag you want to filter] * ['catName' the clean_APIName of the category you want to filter] * ['channelName' the channelName of the videos you want to filter] * @example {webSiteRootURL}plugin/API/{getOrSet}.json.php?APIName={APIName}&catName=default&rowCount=10 * @return \ApiObject */ public function get_api_video($parameters) { global $global; require_once $global['systemRootPath'] . 'objects/video.php'; $obj = $this->startResponseObject($parameters); $dataObj = $this->getDataObject(); if (!empty($parameters['videos_id'])) { $status = "viewable"; $ignoreGroup = false; if ($dataObj->APISecret === @$_GET['APISecret']) { $status = ""; $ignoreGroup = true; } $rows = array(Video::getVideo($parameters['videos_id'], $status, $ignoreGroup)); $totalRows = empty($rows) ? 0 : 1; } else if ($dataObj->APISecret === @$_GET['APISecret']) { $rows = Video::getAllVideos("viewable", false, true); $totalRows = Video::getTotalVideos("viewable", false, true); } else if (!empty($parameters['clean_title'])) { $rows = Video::getVideoFromCleanTitle($parameters['clean_title']); $totalRows = empty($rows) ? 0 : 1; } else { $rows = Video::getAllVideos(); $totalRows = Video::getTotalVideos(); } $objMob = AVideoPlugin::getObjectData("MobileManager"); $SubtitleSwitcher = AVideoPlugin::loadPluginIfEnabled("SubtitleSwitcher"); foreach ($rows as $key => $value) { if (is_object($value)) { $value = object_to_array($value); } if (empty($value['filename'])) { continue; } if($value['type']=='serie'){ require_once $global['systemRootPath'] . 'objects/playlist.php'; $rows[$key]['playlist'] = PlayList::getVideosFromPlaylist($value['serie_playlists_id']); } $images = Video::getImageFromFilename($rows[$key]['filename'], $rows[$key]['type']); $rows[$key]['images'] = $images; $rows[$key]['videos'] = Video::getVideosPaths($value['filename'], true); $rows[$key]['Poster'] = !empty($objMob->portraitImage) ? $images->posterPortrait : $images->poster; $rows[$key]['Thumbnail'] = !empty($objMob->portraitImage) ? $images->posterPortraitThumbs : $images->thumbsJpg; $rows[$key]['imageClass'] = !empty($objMob->portraitImage) ? "portrait" : "landscape"; $rows[$key]['createdHumanTiming'] = humanTiming(strtotime($rows[$key]['created'])); $rows[$key]['pageUrl'] = "{$global['webSiteRootURL']}video/" . $rows[$key]['clean_title']; $rows[$key]['embedUrl'] = "{$global['webSiteRootURL']}videoEmbeded/" . $rows[$key]['clean_title']; $rows[$key]['UserPhoto'] = User::getPhoto($rows[$key]['users_id']); if ($SubtitleSwitcher) { $rows[$key]['subtitles'] = getVTTTracks($value['filename'], true); } if (!empty($_REQUEST['complete'])) { require_once $global['systemRootPath'] . 'objects/comment.php'; require_once $global['systemRootPath'] . 'objects/subscribe.php'; unset($_POST['sort']); unset($_POST['current']); unset($_POST['searchPhrase']); $_POST['rowCount'] = 10; $_POST['sort']['created'] = "desc"; $rows[$key]['comments'] = Comment::getAllComments($rows[$key]['id']); $rows[$key]['commentsTotal'] = Comment::getTotalComments($rows[$key]['id']); foreach ($rows[$key]['comments'] as $key2 => $value2) { $user = new User($value2['users_id']); $rows[$key]['comments'][$key2]['userPhotoURL'] = User::getPhoto($rows[$key]['comments'][$key2]['users_id']); $rows[$key]['comments'][$key2]['userName'] = $user->getNameIdentificationBd(); } $rows[$key]['subscribers'] = Subscribe::getTotalSubscribes($rows[$key]['users_id']); } + //wwbn elements + $rows[$key]['wwbnURL'] = $rows[$key]['pageUrl']; + $rows[$key]['wwbnEmbedURL'] = $rows[$key]['embedUrl']; + $rows[$key]['wwbnImgThumbnail'] = $rows[$key]['Thumbnail']; + $rows[$key]['wwbnImgPoster'] = $rows[$key]['Poster']; + //$rows[$key]['wwbnImgGif'] = $rows[$key]['pageUrl']; + //$rows[$key]['wwbnTags'] = $rows[$key]['pageUrl']; + $rows[$key]['wwbnTitle'] = $rows[$key]['title']; + $rows[$key]['wwbnDescription'] = $rows[$key]['description']; + //$rows[$key]['wwbnChannel'] = User::getChannelLink($rows[$key]['users_id']); + $rows[$key]['wwbnChannelURL'] = User::getChannelLink($rows[$key]['users_id']); + $rows[$key]['wwbnImgChannel'] = $rows[$key]['UserPhoto']; + //$rows[$key]['wwbnProgram'] = $rows[$key]['pageUrl']; + //$rows[$key]['wwbnProgramURL'] = $rows[$key]['pageUrl']; + $rows[$key]['wwbnType'] = $rows[$key]['type']; } $obj->totalRows = $totalRows; $obj->rows = $rows; return new ApiObject("", false, $obj); } /** * @param type $parameters * ['APISecret' to list all videos] * ['searchPhrase' to search on the categories] * ['tags_id' the ID of the tag you want to filter] * ['catName' the clean_APIName of the category you want to filter] * ['channelName' the channelName of the videos you want to filter] * @example {webSiteRootURL}plugin/API/{getOrSet}.json.php?APIName={APIName}&APISecret={APISecret} * @return \ApiObject */ public function get_api_videosCount($parameters) { global $global; require_once $global['systemRootPath'] . 'objects/video.php'; $obj = $this->startResponseObject($parameters); $dataObj = $this->getDataObject(); if ($dataObj->APISecret === @$_GET['APISecret']) { $totalRows = Video::getTotalVideos("viewable", false, true); } else { $totalRows = Video::getTotalVideos(); } $objMob = AVideoPlugin::getObjectData("MobileManager"); $SubtitleSwitcher = AVideoPlugin::loadPluginIfEnabled("SubtitleSwitcher"); $obj->totalRows = $totalRows; return new ApiObject("", false, $obj); } /** * @param type $parameters * ['APISecret' to list all videos] * ['sort' database sort column] * ['videos_id' the video id (will return only 1 or 0 video)] * ['clean_title' the video clean title (will return only 1 or 0 video)] * ['rowCount' max numbers of rows] * ['current' current page] * ['searchPhrase' to search on the categories] * ['tags_id' the ID of the tag you want to filter] * ['catName' the clean_APIName of the category you want to filter] * ['channelName' the channelName of the videos you want to filter] * @example {webSiteRootURL}plugin/API/{getOrSet}.json.php?APIName={APIName}&APISecret={APISecret} * @return \ApiObject */ public function get_api_videosViewsCount($parameters) { global $global; require_once $global['systemRootPath'] . 'objects/video.php'; $obj = $this->startResponseObject($parameters); $dataObj = $this->getDataObject(); if ($dataObj->APISecret === @$_GET['APISecret']) { $rows = Video::getAllVideos("viewable", false, true); $totalRows = Video::getTotalVideos("viewable", false, true); } else if (!empty($parameters['videos_id'])) { $rows = array(Video::getVideo($parameters['videos_id'])); $totalRows = empty($rows) ? 0 : 1; } else if (!empty($parameters['clean_title'])) { $rows = Video::getVideoFromCleanTitle($parameters['clean_title']); $totalRows = empty($rows) ? 0 : 1; } else { $rows = Video::getAllVideos(); $totalRows = Video::getTotalVideos(); } $objMob = AVideoPlugin::getObjectData("MobileManager"); $viewsCount = 0; foreach ($rows as $key => $value) { if (is_object($value)) { $value = object_to_array($value); } $viewsCount += $value['views_count']; } $obj->totalRows = $totalRows; $obj->viewsCount = $viewsCount; return new ApiObject("", false, $obj); } /** * @param type $parameters * 'videos_id' the video ID what you want to get the likes * @example {webSiteRootURL}plugin/API/{getOrSet}.json.php?APIName={APIName}&videos_id=1 * @return \ApiObject */ public function get_api_likes($parameters) { global $global; require_once $global['systemRootPath'] . 'objects/like.php'; if (empty($parameters['videos_id'])) { return new ApiObject("Videos ID can not be empty"); } return new ApiObject("", false, Like::getLikes($parameters['videos_id'])); } /** * @param type $parameters (all parameters are mandatories) * 'videos_id' the video ID what you want to send the like * 'user' usename of the user that will like the video * 'pass' password of the user that will like the video * @example {webSiteRootURL}plugin/API/{getOrSet}.json.php?APIName={APIName}&videos_id=1&user=admin&pass=123 * @return \ApiObject */ public function set_api_like($parameters) { return $this->like($parameters, 1); } /** * @param type $parameters (all parameters are mandatories) * 'videos_id' the video ID what you want to send the like * 'user' usename of the user that will like the video * 'pass' password of the user that will like the video * @example {webSiteRootURL}plugin/API/{getOrSet}.json.php?APIName={APIName}&videos_id=1&user=admin&pass=123 * @return \ApiObject */ public function set_api_dislike($parameters) { return $this->like($parameters, -1); } /** * @param type $parameters (all parameters are mandatories) * 'videos_id' the video ID what you want to send the like * 'user' usename of the user that will like the video * 'pass' password of the user that will like the video * @example {webSiteRootURL}plugin/API/{getOrSet}.json.php?APIName={APIName}&videos_id=1&user=admin&pass=123 * @return \ApiObject */ public function set_api_removelike($parameters) { return $this->like($parameters, 0); } /** * * @param type $parameters * 'user' usename of the user * 'pass' password of the user * ['encodedPass' tell the script id the password submited is raw or encrypted] * @example {webSiteRootURL}plugin/API/{getOrSet}.json.php?APIName={APIName}&user=admin&pass=f321d14cdeeb7cded7489f504fa8862b&encodedPass=true * @return type */ public function get_api_signIn($parameters) { global $global; $this->getToPost(); require_once $global['systemRootPath'] . 'objects/login.json.php'; exit; } /** * * @param type $parameters * 'user' usename of the user * 'pass' password of the user * 'email' email of the user * 'name' real name of the user * 'APISecret' mandatory for security reasons * @example {webSiteRootURL}plugin/API/{getOrSet}.json.php?APIName={APIName}&APISecret={APISecret}&user=admin&pass=123&email=me@mysite.com&name=Yeshua * @return type */ public function set_api_signUp($parameters) { global $global; $this->getToPost(); $obj = $this->getDataObject(); if ($obj->APISecret !== @$_GET['APISecret']) { return new ApiObject("APISecret Not valid"); } $ignoreCaptcha = 1; require_once $global['systemRootPath'] . 'objects/userCreate.json.php'; exit; } private function like($parameters, $like) { global $global; require_once $global['systemRootPath'] . 'objects/like.php'; if (empty($parameters['videos_id'])) { return new ApiObject("Videos ID can not be empty"); } if (!User::isLogged()) { return new ApiObject("User must be logged"); } new Like($like, $parameters['videos_id']); return new ApiObject("", false, Like::getLikes($parameters['videos_id'])); } /** * If you do not pass the user and password, it will always show ads, if you pass it the script will check if will display ads or not * @param type $parameters * 'videos_id' the video id to calculate the ads length * ['optionalAdTagUrl' a tag number 1 or 2 or 3 or 4 to use another tag, if do not pass it will use the default tag] * ['user' usename of the user] * ['pass' password of the user] * ['encodedPass' tell the script id the password submited is raw or encrypted] * @example {webSiteRootURL}plugin/API/{getOrSet}.json.php?APIName={APIName}&videos_id=3&user=admin&pass=f321d14cdeeb7cded7489f504fa8862b&encodedPass=true&optionalAdTagUrl=2 * @return type */ public function get_api_vmap($parameters) { global $global; $this->getToPost(); require_once $global['systemRootPath'] . 'plugin/GoogleAds_IMA/VMAP.php'; exit; } /** * Return the location based on the provided IP * @param type $parameters * 'APISecret' mandatory for security reasons * 'ip' Ip to verify * @example {webSiteRootURL}plugin/API/{getOrSet}.json.php?APIName={APIName}&APISecret={APISecret}&ip=2.20.147.123 * @return type */ public function get_api_IP2Location($parameters) { global $global; $this->getToPost(); $obj = $this->getDataObject(); if ($obj->APISecret !== @$_GET['APISecret']) { return new ApiObject("APISecret Not valid"); } if (AVideoPlugin::isEnabledByName("User_Location")) { $row = IP2Location::getLocation($parameters['ip']); if (!empty($row)) { return new ApiObject("", false, $row); } } return new ApiObject("IP2Location not working"); exit; } /** * Return all favorites from a user * @param type $parameters * 'user' usename of the user * 'pass' password of the user * 'encodedPass' tell the script id the password submited is raw or encrypted * @example {webSiteRootURL}plugin/API/{getOrSet}.json.php?APIName={APIName}&user=admin&pass=f321d14cdeeb7cded7489f504fa8862b&encodedPass=true * @return type */ public function get_api_favorite($parameters) { $plugin = AVideoPlugin::loadPluginIfEnabled("PlayLists"); if (empty($plugin)) { return new ApiObject("Plugin disabled"); } if (!User::isLogged()) { return new ApiObject("User must be logged"); } $row = PlayList::getAllFromUser(User::getId(), false, 'favorite'); foreach ($row as $key => $value) { unset($row[$key]['password']); unset($row[$key]['recoverPass']); foreach ($value['videos'] as $key2 => $value2) { //$row[$key]['videos'][$key2] = Video::getVideo($value2['id']); unset($row[$key]['videos'][$key2]['password']); unset($row[$key]['videos'][$key2]['recoverPass']); if (!empty($row[$key]['videos'][$key2]['next_videos_id'])) { unset($_POST['searchPhrase']); $row[$key]['videos'][$key2]['next_video'] = Video::getVideo($row[$key]['videos'][$key2]['next_videos_id']); } $row[$key]['videos'][$key2]['videosURL'] = getVideosURL($row[$key]['videos'][$key2]['filename']); unset($row[$key]['videos'][$key2]['password']); unset($row[$key]['videos'][$key2]['recoverPass']); } } echo json_encode($row); exit; } /** * add a video into a user favorite play list * @param type $parameters * 'videos_id' the video id that you want to add * 'user' usename of the user * 'pass' password of the user * 'encodedPass' tell the script id the password submited is raw or encrypted * @example {webSiteRootURL}plugin/API/{getOrSet}.json.php?APIName={APIName}&videos_id=3&user=admin&pass=f321d14cdeeb7cded7489f504fa8862b&encodedPass=true * @return type */ public function set_api_favorite($parameters) { $this->favorite($parameters, true); } /** * @param type $parameters * 'videos_id' the video id that you want to remove * 'user' usename of the user * 'pass' password of the user * 'encodedPass' tell the script id the password submited is raw or encrypted * @example {webSiteRootURL}plugin/API/{getOrSet}.json.php?APIName={APIName}&videos_id=3&user=admin&pass=f321d14cdeeb7cded7489f504fa8862b&encodedPass=true * @return type */ public function set_api_removeFavorite($parameters) { $this->favorite($parameters, false); } private function favorite($parameters, $add) { global $global; $plugin = AVideoPlugin::loadPluginIfEnabled("PlayLists"); if (empty($plugin)) { return new ApiObject("Plugin disabled"); } if (!User::isLogged()) { return new ApiObject("Wrong user or password"); } $_POST['videos_id'] = $parameters['videos_id']; $_POST['add'] = $add; $_POST['playlists_id'] = PlayLists::getFavoriteIdFromUser(User::getId()); require_once $global['systemRootPath'] . 'objects/playListAddVideo.json.php'; exit; } } class ApiObject { public $error; public $message; public $response; function __construct($message = "api not started or not found", $error = true, $response = array()) { $this->error = $error; $this->message = $message; $this->response = $response; } } diff --git a/plugin/Gallery/functions.php b/plugin/Gallery/functions.php index d91f56ed1..3e36cfb1b 100644 --- a/plugin/Gallery/functions.php +++ b/plugin/Gallery/functions.php @@ -1,381 +1,381 @@

" . $info[1] . ""; } else { echo "{$title}"; } ?>

" . __("Up") . ""; $mostLess = $mostWord; } else { if (strpos($orderString, $getName . "=ASC")) { $tmpOrderString = substr($orderString, 0, strpos($orderString, $getName . "=ASC")) . $getName . "=DESC" . substr($orderString, strpos($orderString, $getName . "=ASC") + strlen($getName . "=ASC"), strlen($orderString)); } else { $tmpOrderString .= $getName . "=DESC"; } $upDown = "" . __("Down") . ""; $mostLess = $lessWord; } if (substr($tmpOrderString, strlen($tmpOrderString) - 1, strlen($tmpOrderString)) == "&") { $tmpOrderString = substr($tmpOrderString, 0, strlen($tmpOrderString) - 1); } return array($tmpOrderString, $upDown, $mostLess); } function createGallerySection($videos, $crc = "", $get = array()) { global $global, $config, $obj, $advancedCustom; $countCols = 0; $obj = AVideoPlugin::getObjectData("Gallery"); $zindex = 1000; $startG = microtime(true); foreach ($videos as $value) { // that meas auto generate the channelName if (empty($get) && !empty($obj->filterUserChannel)) { $getCN = array('channelName' => $value['channelName'], 'catName' => @$_GET['catName']); } else { $getCN = $get; } $img_portrait = ($value['rotation'] === "90" || $value['rotation'] === "270") ? "img-portrait" : ""; $name = User::getNameIdentificationById($value['users_id']); $name .= " ".User::getEmailVerifiedIcon($value['users_id']);; // make a row each 6 cols if ($countCols % $obj->screenColsLarge === 0) { echo '
'; } $countCols ++; ?>
thumbsGif = ""; $images->poster = "{$global['webSiteRootURL']}view/img/notfound.jpg"; $images->thumbsJpg = "{$global['webSiteRootURL']}view/img/notfoundThumbs.jpg"; $images->thumbsJpgSmall = "{$global['webSiteRootURL']}view/img/notfoundThumbsSmall.jpg"; } $startG = microtime(true); $imgGif = $images->thumbsGif; $poster = $images->thumbsJpg; ?>
<?php echo $value['title']; ?>" id="thumbsJPG" />

showTags)) { $value['tags'] = Video::getTags($value['id']); foreach ($value['tags'] as $value2) { if (!empty($value2->label) && $value2->label === __("Paid Content")) { ?>text; ?>label) && $value2->label === __("Group")) { ?>text; ?>label) && $value2->label === __("Plugin")) { ?> text; ?>
doNotDisplayViews)) { ?>
- +
Description)) { ?>
" >

diff --git a/plugin/Gallery/view/BigVideo.php b/plugin/Gallery/view/BigVideo.php index d22603952..d86576e42 100644 --- a/plugin/Gallery/view/BigVideo.php +++ b/plugin/Gallery/view/BigVideo.php @@ -1,206 +1,206 @@ BigVideo && empty($_GET['showOnly'])) { if (!empty($obj->useSuggestedVideosAsCarouselInBigVideo)) { //getAllVideos($status = "viewable", $showOnlyLoggedUserVideos = false, $ignoreGroup = false, $videosArrayId = array(), $getStatistcs = false, $showUnlisted = false, $activeUsersOnly = true) //$videoRows = Video::getAllVideosLight("viewable", !$obj->hidePrivateVideos, false, true); $videoRows = Video::getAllVideos("viewable", false, !$obj->hidePrivateVideos, array(), false, false, true, true); } if (empty($videoRows)) { $videoRows = array($video); } ?> BigVideo && empty($_GET['showOnly'])) { $name = User::getNameIdentificationById($video['users_id']); if (empty($get)) { $get = array(); } ?>

showTags)) { $video['tags'] = Video::getTags($video['id']); if (!empty($video['tags'])) { foreach ($video['tags'] as $value2) { if (!empty($value2->label) && $value2->label === __("Group")) { ?>text; ?>
doNotDisplayViews)) { ?>
- +
AsyncJobs) { - //var_dump(PlayLists::isPlayListASerie($playlist['id'])); $videosP = Video::getAllVideosAsync("viewable", false, true, $videosArrayId, false, true); } else { - //var_dump(PlayLists::isPlayListASerie($playlist['id'])); $videosP = Video::getAllVideos("viewable", false, true, $videosArrayId, false, true); } $_POST['rowCount'] = $rowCount; @$timesC[__LINE__] += microtime(true) - $startC; $startC = microtime(true); //_error_log("channelPlaylist videosP: ".json_encode($videosP)); $videosP = PlayList::sortVideos($videosP, $videosArrayId); @$timesC[__LINE__] += microtime(true) - $startC; $startC = microtime(true); //_error_log("channelPlaylist videosP2: ".json_encode($videosP)); //_error_log("channelPlaylist videosArrayId: ".json_encode($videosArrayId)); $playListButtons = AVideoPlugin::getPlayListButtons($playlist['id']); @$timesC[__LINE__] += microtime(true) - $startC; $startC = microtime(true); ?>
plugin/PlayLists/embed.php?playlists_id=" frameborder="0" allowfullscreen="allowfullscreen" allow="autoplay">'/>
+ thumbsGif; + $poster = $images->thumbsJpg; + $category = new Category($serie['categories_id']); + ?> +
+
+ <?php echo $serie['title']; ?> +
+
+ +

+
+ + + getIconClass())) { + ?> + + + getName(); ?> + + label === __("Group")) { + ?> + text; ?> + + + + + + + + + + +

+ +

+
+
+ +
thumbsGif; $poster = $images->thumbsJpg; $class = ""; ?>
<?php echo $value['title']; ?>

label === __("Group")) { ?> text; ?>
doNotDisplayViews)) { ?>
- +
\ No newline at end of file diff --git a/view/channelProgram.php b/view/channelProgram.php index 4f4cc7179..cfd0094f9 100644 --- a/view/channelProgram.php +++ b/view/channelProgram.php @@ -1,585 +1,585 @@ getUsers_id(); } $user_id = $_GET['user_id']; $publicOnly = true; $isMyChannel = false; if (User::isLogged() && $user_id == User::getId()) { $publicOnly = false; $isMyChannel = true; } $programs = PlayList::getAllFromUser($user_id, $publicOnly, false, @$_GET['program_id']); if (empty($programs)) { $programs = PlayList::getAllFromUser($user_id, $publicOnly); }else{ $videosArrayId = PlayList::getVideosIdFromPlaylist($_GET['program_id']); $videos_id = $videosArrayId[0]; } $playListsObj = AVideoPlugin::getObjectData("PlayLists"); ?> <?php echo $config->getWebSiteTitle(); ?> :: <?php echo __("Program"); ?> \ No newline at end of file diff --git a/view/js/script.js b/view/js/script.js index 05ca55f07..ce67f13cf 100644 --- a/view/js/script.js +++ b/view/js/script.js @@ -1,553 +1,553 @@ var modal; var player; var floatLeft = ""; var floatTop = ""; var floatWidth = ""; var floatHeight = ""; var changingVideoFloat = 0; var floatClosed = 0; var fullDuration = 0; var isPlayingAd = false; var mainVideoHeight = 0; var doNotFloatVideo = false; var mouseX; var mouseY; $(document).mousemove(function (e) { mouseX = e.pageX; mouseY = e.pageY; }); String.prototype.stripAccents = function () { var translate_re = /[àáâãäçèéêëìíîïñòóôõöùúûüýÿÀÁÂÃÄÇÈÉÊËÌÍÎÏÑÒÓÔÕÖÙÚÛÜÝ]/g; var translate = 'aaaaaceeeeiiiinooooouuuuyyAAAAACEEEEIIIINOOOOOUUUUY'; return (this.replace(translate_re, function (match) { return translate.substr(translate_re.source.indexOf(match) - 1, 1); }) ); }; function clean_name(str) { str = str.stripAccents().toLowerCase(); return str.replace(/\W+/g, "-"); } try { if ($(".thumbsJPG").length) { $('.thumbsJPG').lazy({ effect: 'fadeIn', visibleOnly: true, // called after an element was successfully handled afterLoad: function (element) { element.removeClass('blur'); } }); } } catch (e) { } var pleaseWaitIsINUse = false; $(document).ready(function () { modal = modal || (function () { var pleaseWaitDiv = $("#pleaseWaitDialog"); if (pleaseWaitDiv.length === 0) { pleaseWaitDiv = $('').appendTo('body'); } return { showPleaseWait: function () { if (pleaseWaitIsINUse) { return false; } pleaseWaitIsINUse = true; pleaseWaitDiv.modal(); }, hidePleaseWait: function () { pleaseWaitDiv.modal('hide'); pleaseWaitIsINUse = false; }, setProgress: function (valeur) { pleaseWaitDiv.find('.progress-bar').css('width', valeur + '%').attr('aria-valuenow', valeur); }, setText: function (text) { pleaseWaitDiv.find('h2').html(text); }, }; })(); $('[data-toggle="popover"]').popover(); $('[data-toggle="tooltip"]').tooltip(); $(".thumbsImage").on("mouseenter", function () { gifId = $(this).find(".thumbsGIF").attr('id'); $(".thumbsGIF").fadeOut(); if (gifId != undefined) { id = gifId.replace('thumbsGIF', ''); $(this).find(".thumbsGIF").height($(this).find(".thumbsJPG").height()); $(this).find(".thumbsGIF").width($(this).find(".thumbsJPG").width()); try { $(this).find(".thumbsGIF").lazy({effect: 'fadeIn'}); } catch (e) { } $(this).find(".thumbsGIF").stop(true, true).fadeIn(); } }); $(".thumbsImage").on("mouseleave", function () { $(this).find(".thumbsGIF").stop(true, true).fadeOut(); }); if ($(".thumbsJPG").length) { $('.thumbsJPG').lazy({ effect: 'fadeIn', visibleOnly: true, // called after an element was successfully handled afterLoad: function (element) { element.removeClass('blur'); } }); } mainVideoHeight = $('#videoContainer').innerHeight(); $(window).resize(function () { mainVideoHeight = $('#videoContainer').innerHeight(); }); $(window).scroll(function () { if (changingVideoFloat || doNotFloatVideo) { return false; } changingVideoFloat = 1; var s = $(window).scrollTop(); if (s > mainVideoHeight) { if (!$('#videoContainer').hasClass("floatVideo") && !floatClosed) { $('#videoContainer').hide(); $('#videoContainer').addClass('floatVideo'); $('#videoContainer').parent().css('height', mainVideoHeight); if (parseInt(floatTop) < 70) { floatTop = "70px"; } if (parseInt(floatLeft) < 10) { floatLeft = "10px"; } $("#videoContainer").css({"top": floatTop}); $("#videoContainer").css({"left": floatLeft}); $("#videoContainer").css({"height": floatHeight}); $("#videoContainer").css({"width": floatWidth}); $("#videoContainer").resizable({ aspectRatio: 16 / 9, minHeight: 150, minWidth: 266 }); $("#videoContainer").draggable({ handle: ".move", containment: ".principalContainer" }); changingVideoFloat = 0; $('#videoContainer').fadeIn(); $('#floatButtons').fadeIn(); } else { changingVideoFloat = 0; } } else { floatClosed = 0; if ($('#videoContainer').hasClass("floatVideo")) { closeFloatVideo(); } else { changingVideoFloat = 0; } } }); $("a").each(function () { var location = window.location.toString() var res = location.split("?"); pathWitoutGet = res[0]; if ($(this).attr("href") == window.location.pathname || $(this).attr("href") == window.location || $(this).attr("href") == pathWitoutGet) { $(this).addClass("selected"); } }); $('#clearCache, .clearCacheButton').on('click', function (ev) { ev.preventDefault(); modal.showPleaseWait(); $.ajax({ url: webSiteRootURL + 'objects/configurationClearCache.json.php', success: function (response) { if (!response.error) { swal("Congratulations!", "Your cache has been cleared!", "success"); } else { swal("Sorry!", "Your cache has NOT been cleared!", "error"); } modal.hidePleaseWait(); } }); }); $('.clearCacheFirstPageButton').on('click', function (ev) { ev.preventDefault(); modal.showPleaseWait(); $.ajax({ url: webSiteRootURL + 'objects/configurationClearCache.json.php?FirstPage=1', success: function (response) { if (!response.error) { swal("Congratulations!", "Your First Page cache has been cleared!", "success"); } else { swal("Sorry!", "Your First Page cache has NOT been cleared!", "error"); } modal.hidePleaseWait(); } }); }); $('#generateSiteMap, .generateSiteMapButton').on('click', function (ev) { ev.preventDefault(); modal.showPleaseWait(); $.ajax({ url: webSiteRootURL + 'objects/configurationGenerateSiteMap.json.php', success: function (response) { if (!response.error) { swal("Congratulations!", "File created!", "success"); } else { swal("Sorry!", "File NOT created!", "error"); } modal.hidePleaseWait(); } }); }); }); function removeTracks() { var oldTracks = player.remoteTextTracks(); var i = oldTracks.length; while (i--) { player.removeRemoteTextTrack(oldTracks[i]); } } function changeVideoSrc(vid_obj, source) { var srcs = []; removeTracks(); for (i = 0; i < source.length; i++) { if (source[i].type) { srcs.push(source[i]); } else if (source[i].srclang) { player.addRemoteTextTrack(source[i]); } } vid_obj.src(srcs); setTimeout(function () { changeVideoSrcLoad(); }, 1000); } function changeVideoSrcLoad() { console.log("changeVideoSrcLoad: Try to load player"); player.load(); player.ready(function () { console.log("changeVideoSrcLoad: Player ready"); var err = this.error(); if (err && err.code) { console.log("changeVideoSrcLoad: Load player Error"); setTimeout(function () { changeVideoSrcLoad(); }, 1000); } else { console.log("changeVideoSrcLoad: Load player Success, Play"); setTimeout(function () { player.load(); player.play(); }, 1000); } }); ; } /** * * @param {String} str 00:00:00 * @returns {int} int of seconds */ function strToSeconds(str) { var partsOfStr = str.split(':'); var seconds = parseInt(partsOfStr[2]); seconds += parseInt(partsOfStr[1]) * 60; seconds += parseInt(partsOfStr[0]) * 60 * 60; return seconds; } /** * * @param {int} seconds * @param {int} level 3 = 00:00:00 2 = 00:00 1 = 00 * @returns {String} 00:00:00 */ function secondsToStr(seconds, level) { var hours = parseInt(seconds / (60 * 60)); var minutes = parseInt(seconds / (60)); seconds = parseInt(seconds % (60)); hours = hours > 9 ? hours : "0" + hours; minutes = minutes > 9 ? minutes : "0" + minutes; seconds = seconds > 9 ? seconds : "0" + seconds; switch (level) { case 3: return hours + ":" + minutes + ":" + seconds; break; case 2: return minutes + ":" + seconds; break; case 1: return seconds; break; default: return hours + ":" + minutes + ":" + seconds; } } function validateEmail(email) { var re = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; return re.test(email); } function subscribe(email, user_id) { $.ajax({ url: webSiteRootURL + 'objects/subscribe.json.php', method: 'POST', data: { 'email': email, 'user_id': user_id }, success: function (response) { if (response.subscribe == "i") { $('.subs' + user_id).removeClass("subscribed"); $('.subs' + user_id + ' b.text').text("Subscribe"); $('b.textTotal' + user_id).text(parseInt($('b.textTotal' + user_id).first().text()) - 1); } else { $('.subs' + user_id).addClass("subscribed"); $('.subs' + user_id + ' b.text').text("Subscribed"); $('b.textTotal' + user_id).text(parseInt($('b.textTotal' + user_id).first().text()) + 1); } $('#popover-content #subscribeEmail').val(email); $('.subscribeButton' + user_id).popover('hide'); } }); } function subscribeNotify(email, user_id) { $.ajax({ url: webSiteRootURL + 'objects/subscribeNotify.json.php', method: 'POST', data: { 'email': email, 'user_id': user_id }, success: function (response) { if (response.notify) { $('.notNotify' + user_id).addClass("hidden"); $('.notify' + user_id).removeClass("hidden"); } else { $('.notNotify' + user_id).removeClass("hidden"); $('.notify' + user_id).addClass("hidden"); } } }); } function closeFloatVideo() { $('#videoContainer').fadeOut('fast', function () { // this is to remove the dragable and resize floatLeft = $("#videoContainer").css("left"); floatTop = $("#videoContainer").css("top"); floatWidth = $("#videoContainer").css("width"); floatHeight = $("#videoContainer").css("height"); $("#videoContainer").css({"top": ""}); $("#videoContainer").css({"left": ""}); $("#videoContainer").css({"height": ""}); $("#videoContainer").css({"width": ""}); $('#videoContainer').parent().css('height', ''); $('#videoContainer').removeClass('floatVideo'); $("#videoContainer").resizable('destroy'); $("#videoContainer").draggable('destroy'); $('#floatButtons').hide(); changingVideoFloat = 0; }); $('#videoContainer').fadeIn(); } function mouseEffect() { $(".thumbsImage").on("mouseenter", function () { try { $(this).find(".thumbsGIF").lazy({effect: 'fadeIn'}); } catch (e) { } $(this).find(".thumbsGIF").height($(this).find(".thumbsJPG").height()); $(this).find(".thumbsGIF").width($(this).find(".thumbsJPG").width()); $(this).find(".thumbsGIF").stop(true, true).fadeIn(); }); $(".thumbsImage").on("mouseleave", function () { $(this).find(".thumbsGIF").stop(true, true).fadeOut(); }); } function isMobile() { var check = false; (function (a) { if (/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(a) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0, 4))) check = true })(navigator.userAgent || navigator.vendor || window.opera); return check; } function copyToClipboard(text) { var $temp = $(""); $("body").append($temp); $temp.val(text).select(); document.execCommand("copy"); $temp.remove(); } var last_videos_id = 0; var last_currentTime = -1; function addView(videos_id, currentTime) { if (last_videos_id == videos_id && last_currentTime == currentTime) { return false; } last_videos_id = videos_id; last_currentTime = currentTime; $.ajax({ url: webSiteRootURL + 'objects/videoAddViewCount.json.php', method: 'POST', data: { 'id': videos_id, 'currentTime': currentTime }, success: function (response) { $('.view-count' + videos_id).text(response.count); } }); } function getPlayerButtonIndex(name) { var children = player.getChild('controlBar').children(); for (i = 0; i < children.length; i++) { if (children[i].name_ === name) { return i; } } return children.length; } function copyToClipboard(text) { $('#elementToCopy').css({'top': mouseY, 'left': mouseX}).fadeIn('slow'); $('#elementToCopy').val(text); $('#elementToCopy').focus(); $('#elementToCopy').select(); document.execCommand('copy'); } function nl2br(str, is_xhtml) { if (typeof str === 'undefined' || str === null) { return ''; } var breakTag = (is_xhtml || typeof is_xhtml === 'undefined') ? '
' : '
'; return (str + '').replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g, '$1' + breakTag + '$2'); } function inIframe() { try { return window.self !== window.top; } catch (e) { return true; } } var promisePlaytry = 10; var promisePlayTimeoutTime = 0; var promisePlayTimeout; var promisePlay; function playerPlay(currentTime) { if (promisePlaytry <= 0) { return false; } promisePlaytry--; if (typeof player !== 'undefined') { promisePlayTimeoutTime += 1000; if (currentTime) { player.currentTime(currentTime); } try { console.log("playerPlay: Trying to play"); promisePlay = player.play(); if (promisePlay !== undefined) { promisePlayTimeout = setTimeout(function () { console.log("playerPlay: Promise is Pending, try again"); playerPlay(currentTime); }, promisePlayTimeoutTime); console.log("playerPlay: promise found"); promisePlay.then(function () { console.log("playerPlay: Autoplay started"); clearTimeout(promisePlayTimeout); setTimeout(function () { if (player.paused()) { console.log("The video still paused, trying to mute and play"); player.muted(true); playerPlay(currentTime); } else { - if (player.muted()) { + if (player.muted() && !inIframe()) { swal({ html: true, title: "Your Media is Muted", text: "Would you like to unmute it?
", type: "warning", showCancelButton: true, confirmButtonColor: "#DD6B55", confirmButtonText: "Yes, unmute it!", closeOnConfirm: true }, function () { player.muted(false); }); setTimeout(function () { $("#allowAutoplay").load(webSiteRootURL + "plugin/PlayerSkins/allowAutoplay/"); }, 500); } } }, 1000); }).catch(function (error) { console.log("playerPlay: Autoplay was prevented, trying to mute and play ***"); player.muted(true); playerPlay(currentTime); }); } else { promisePlayTimeout = setTimeout(function () { if (player.paused()) { console.log("playerPlay: promise Undefined"); playerPlay(currentTime); } }, promisePlayTimeoutTime); } } catch (e) { console.log("playerPlay: We could not autoplay, trying again in 1 second"); promisePlayTimeout = setTimeout(function () { playerPlay(currentTime); }, promisePlayTimeoutTime); } } else { console.log("playerPlay: Player is Undefined"); } } diff --git a/view/report0.php b/view/report0.php index 3f1e8a5a5..b60a27ef4 100644 --- a/view/report0.php +++ b/view/report0.php @@ -1,468 +1,468 @@
0
0
0
0
0
0
0
- +
0
$value) { ?>
#
#
#
#
\ No newline at end of file diff --git a/view/trending.php b/view/trending.php index 386f1f54e..b20524ce7 100644 --- a/view/trending.php +++ b/view/trending.php @@ -1,251 +1,251 @@ <?php echo $config->getWebSiteTitle(); ?> <?php echo __("Trending"); ?>

End of content

No more pages to load