mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-03 01:39:24 +02:00
1. add seasons support that will group multiple series as part of a big serie.
2. update the netflix layout to display more details about the selected series.
This commit is contained in:
parent
e29ca5570e
commit
890a14d244
65 changed files with 2381 additions and 742 deletions
|
@ -4,7 +4,7 @@ if (file_exists("../videos/configuration.php")) {
|
|||
exit;
|
||||
}
|
||||
|
||||
$installationVersion = "10.2";
|
||||
$installationVersion = "10.3";
|
||||
|
||||
error_log("Installation: ".__LINE__." ". json_encode($_POST));
|
||||
header('Content-Type: application/json');
|
||||
|
|
|
@ -147,6 +147,7 @@ CREATE TABLE IF NOT EXISTS `videos` (
|
|||
`encoderURL` VARCHAR(255) NULL DEFAULT NULL,
|
||||
`filepath` VARCHAR(255) NULL DEFAULT NULL,
|
||||
`filesize` BIGINT(19) UNSIGNED NULL DEFAULT 0,
|
||||
`live_transmitions_history_id` INT(11) NULL DEFAULT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
INDEX `fk_videos_users_idx` (`users_id` ASC),
|
||||
INDEX `fk_videos_categories1_idx` (`categories_id` ASC),
|
||||
|
@ -158,6 +159,7 @@ CREATE TABLE IF NOT EXISTS `videos` (
|
|||
INDEX `video_filename_INDEX` (`filename` ASC),
|
||||
INDEX `video_status_idx` (`status` ASC),
|
||||
INDEX `video_type_idx` (`type` ASC) ,
|
||||
INDEX `fk_videos_live_transmitions_history1_idx` (`live_transmitions_history_id` ASC),
|
||||
FULLTEXT INDEX `index17vname` (`title`),
|
||||
FULLTEXT INDEX `index18vdesc` (`description`),
|
||||
CONSTRAINT `fk_videos_sites1`
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
});
|
||||
$container$uid.on('append.infiniteScroll', function (event, response, path, items) {
|
||||
lazyImage();
|
||||
avideoSocket();
|
||||
});
|
||||
|
||||
});
|
||||
|
|
|
@ -3309,7 +3309,7 @@ function TimeLogStart($name) {
|
|||
|
||||
function TimeLogEnd($name, $line, $TimeLogLimit = 0.7) {
|
||||
global $global;
|
||||
if (!empty($global['noDebug'])) {
|
||||
if (!empty($global['noDebug']) || empty($global['start'][$name])) {
|
||||
return false;
|
||||
}
|
||||
$time = microtime();
|
||||
|
@ -3843,7 +3843,7 @@ function _dieAndLogObject($obj, $prefix = "") {
|
|||
}
|
||||
|
||||
function isAVideoPlayer() {
|
||||
if (isVideo()) {
|
||||
if (isVideo() || isSerie()) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
@ -3998,12 +3998,53 @@ function URLsAreSameVideo($url1, $url2) {
|
|||
}
|
||||
|
||||
function getVideos_id() {
|
||||
global $_getVideos_id;
|
||||
if(isset($_getVideos_id)){
|
||||
return $_getVideos_id;
|
||||
}
|
||||
if (isVideo()) {
|
||||
return getVideoIDFromURL(getSelfURI());
|
||||
$videos_id = getVideoIDFromURL(getSelfURI());
|
||||
if(empty($videos_id) && !empty($_REQUEST['videoName'])){
|
||||
$video = Video::getVideoFromCleanTitle($_REQUEST['videoName']);
|
||||
if(!empty($video)){
|
||||
$videos_id = $video['id'];
|
||||
}
|
||||
}
|
||||
setVideos_id($videos_id);
|
||||
return $videos_id;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function setVideos_id($videos_id) {
|
||||
global $_getVideos_id;
|
||||
$_getVideos_id = $videos_id;
|
||||
}
|
||||
|
||||
function getPlaylists_id() {
|
||||
global $_isPlayList;
|
||||
if(!isset($_isPlayList)){
|
||||
$_isPlayList = false;
|
||||
if(isPlayList()){
|
||||
$_isPlayList = intval(@$_GET['playlists_id']);
|
||||
if(empty($_isPlayList)){
|
||||
$videos_id = getVideos_id();
|
||||
if(empty($videos_id)){
|
||||
$_isPlayList = false;
|
||||
}else{
|
||||
$v = Video::getVideoLight($videos_id);
|
||||
if(empty($v) || empty($v['serie_playlists_id'])){
|
||||
$_isPlayList = false;
|
||||
}else{
|
||||
$_isPlayList = $v['serie_playlists_id'];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return $_isPlayList;
|
||||
}
|
||||
|
||||
function isVideoOrAudioNotEmbed(){
|
||||
if(!isVideo()){
|
||||
return false;
|
||||
|
|
|
@ -125,6 +125,13 @@ if (empty($global['bodyClass'])) {
|
|||
$global['bodyClass'] = '';
|
||||
}
|
||||
$global['allowedExtension'] = array('gif', 'jpg', 'mp4', 'webm', 'mp3', 'm4a', 'ogg', 'zip', 'm3u8');
|
||||
|
||||
if(empty($global['avideo_resolutions'])){
|
||||
$global['avideo_resolutions'] = array(240, 360, 480, 540, 720, 1080, 1440, 2160);
|
||||
}
|
||||
|
||||
sort($global['avideo_resolutions']);
|
||||
|
||||
$advancedCustom = AVideoPlugin::getObjectData('CustomizeAdvanced');
|
||||
|
||||
if (empty($global['disableTimeFix'])) {
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
<?php
|
||||
|
||||
global $global, $config, $refreshCacheFromPlaylist;
|
||||
$refreshCacheFromPlaylist = false; // this is because it was creating playlists multiple times
|
||||
|
||||
|
@ -7,8 +8,8 @@ if (!isset($global['systemRootPath'])) {
|
|||
}
|
||||
require_once $global['systemRootPath'] . 'objects/user.php';
|
||||
|
||||
class PlayList extends ObjectYPT
|
||||
{
|
||||
class PlayList extends ObjectYPT {
|
||||
|
||||
protected $id;
|
||||
protected $name;
|
||||
protected $users_id;
|
||||
|
@ -16,18 +17,15 @@ class PlayList extends ObjectYPT
|
|||
protected $showOnTV;
|
||||
public static $validStatus = array('public', 'private', 'unlisted', 'favorite', 'watch_later');
|
||||
|
||||
public static function getSearchFieldsNames()
|
||||
{
|
||||
public static function getSearchFieldsNames() {
|
||||
return array('pl.name');
|
||||
}
|
||||
|
||||
public static function getTableName()
|
||||
{
|
||||
public static function getTableName() {
|
||||
return 'playlists';
|
||||
}
|
||||
|
||||
protected static function getFromDbFromName($name)
|
||||
{
|
||||
protected static function getFromDbFromName($name) {
|
||||
global $global;
|
||||
$sql = "SELECT * FROM " . static::getTableName() . " WHERE name = ? users_id = " . User::getId() . " LIMIT 1";
|
||||
$res = sqlDAL::readSql($sql, "s", array($name));
|
||||
|
@ -41,8 +39,7 @@ class PlayList extends ObjectYPT
|
|||
return $row;
|
||||
}
|
||||
|
||||
public function loadFromName($name)
|
||||
{
|
||||
public function loadFromName($name) {
|
||||
if (!User::isLogged()) {
|
||||
return false;
|
||||
}
|
||||
|
@ -57,6 +54,24 @@ class PlayList extends ObjectYPT
|
|||
return true;
|
||||
}
|
||||
|
||||
public static function getAllFromPlaylistsID($playlists_id) {
|
||||
if (empty($playlists_id)) {
|
||||
return false;
|
||||
}
|
||||
$videosArrayId = PlayList::getVideosIdFromPlaylist($playlists_id);
|
||||
$videosP = Video::getAllVideos("viewable", false, true, $videosArrayId, false, true);
|
||||
$videosP = PlayList::sortVideos($videosP, $videosArrayId);
|
||||
foreach ($videosP as $key => $value2) {
|
||||
if (!empty($value2['serie_playlists_id'])) {
|
||||
$videosP[$key]['icon'] = '<i class=\'fas fa-layer-group\'></i>';
|
||||
} else {
|
||||
$videosP[$key]['icon'] = '<i class=\'fas fa-film\'></i>';
|
||||
}
|
||||
}
|
||||
|
||||
return $videosP;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @global type $global
|
||||
|
@ -65,8 +80,7 @@ class PlayList extends ObjectYPT
|
|||
* @param type $isVideoIdPresent pass the ID of the video checking
|
||||
* @return boolean
|
||||
*/
|
||||
public static function getAllFromUser($userId, $publicOnly = true, $status = false, $playlists_id = 0, $try = 0)
|
||||
{
|
||||
public static function getAllFromUser($userId, $publicOnly = true, $status = false, $playlists_id = 0, $try = 0) {
|
||||
global $global, $config, $refreshCacheFromPlaylist;
|
||||
$playlists_id = intval($playlists_id);
|
||||
$formats = "";
|
||||
|
@ -162,9 +176,62 @@ class PlayList extends ObjectYPT
|
|||
}
|
||||
return $rows;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @global type $global
|
||||
* @param type $publicOnly
|
||||
* @param type $userId if not present check session
|
||||
* @param type $isVideoIdPresent pass the ID of the video checking
|
||||
* @return boolean
|
||||
*/
|
||||
public static function getAllFromUserLight($userId, $publicOnly = true, $status = false, $playlists_id = 0, $onlyWithVideos = false) {
|
||||
global $global, $config, $refreshCacheFromPlaylist;
|
||||
$playlists_id = intval($playlists_id);
|
||||
$formats = "";
|
||||
$values = array();
|
||||
$sql = "SELECT u.*, pl.* FROM " . static::getTableName() . " pl "
|
||||
. " LEFT JOIN users u ON u.id = users_id WHERE 1=1 ";
|
||||
if (!empty($playlists_id)) {
|
||||
$sql .= " AND pl.id = '{$playlists_id}' ";
|
||||
}
|
||||
if (!empty($status)) {
|
||||
$status = str_replace("'", "", $status);
|
||||
$sql .= " AND pl.status = '{$status}' ";
|
||||
} elseif ($publicOnly) {
|
||||
if(User::getId() != $userId){
|
||||
$sql .= " AND pl.status = 'public' ";
|
||||
}
|
||||
}
|
||||
if (!empty($userId)) {
|
||||
$sql .= " AND users_id = ? ";
|
||||
$formats .= "i";
|
||||
$values[] = $userId;
|
||||
}
|
||||
$sql .= self::getSqlFromPost("pl.");
|
||||
//echo $sql, $userId;exit;
|
||||
$res = sqlDAL::readSql($sql, $formats, $values, $refreshCacheFromPlaylist);
|
||||
$fullData = sqlDAL::fetchAllAssoc($res);
|
||||
sqlDAL::close($res);
|
||||
$rows = array();
|
||||
if ($res != false) {
|
||||
foreach ($fullData as $row) {
|
||||
$row = cleanUpRowFromDatabase($row);
|
||||
if($onlyWithVideos){
|
||||
$videos = self::getVideosIDFromPlaylistLight($row['id']);
|
||||
if(empty($videos)){
|
||||
continue;
|
||||
}
|
||||
}
|
||||
$rows[] = $row;
|
||||
}
|
||||
} else {
|
||||
die($sql . '\nError : (' . $global['mysqli']->errno . ') ' . $global['mysqli']->error);
|
||||
}
|
||||
return $rows;
|
||||
}
|
||||
|
||||
public static function fixDuplicatePlayList($user_id)
|
||||
{
|
||||
public static function fixDuplicatePlayList($user_id) {
|
||||
if (empty($user_id)) {
|
||||
return false;
|
||||
}
|
||||
|
@ -217,8 +284,7 @@ class PlayList extends ObjectYPT
|
|||
}
|
||||
}
|
||||
|
||||
public static function getAllFromUserVideo($userId, $videos_id, $publicOnly = true, $status = false)
|
||||
{
|
||||
public static function getAllFromUserVideo($userId, $videos_id, $publicOnly = true, $status = false) {
|
||||
if (empty($_SESSION['user']['sessionCache']['getAllFromUserVideo'][$videos_id][$userId][intval($publicOnly)][intval($status)])) {
|
||||
$rows = self::getAllFromUser($userId, $publicOnly, $status);
|
||||
foreach ($rows as $key => $value) {
|
||||
|
@ -235,25 +301,32 @@ class PlayList extends ObjectYPT
|
|||
return $rows;
|
||||
}
|
||||
|
||||
private static function removeCache($videos_id)
|
||||
{
|
||||
private static function removeCache($videos_id) {
|
||||
$close = false;
|
||||
_session_start();
|
||||
unset($_SESSION['user']['sessionCache']['getAllFromUserVideo'][$videos_id]);
|
||||
unset($_SESSION['user']['sessionCache']['getAllFromUserVideo'][$videos_id]);
|
||||
}
|
||||
|
||||
public static function getVideosIDFromPlaylistLight($playlists_id)
|
||||
{
|
||||
global $global;
|
||||
public static function getVideosIDFromPlaylistLight($playlists_id) {
|
||||
global $global, $getVideosIDFromPlaylistLight;
|
||||
|
||||
if(!isset($getVideosIDFromPlaylistLight)){
|
||||
$getVideosIDFromPlaylistLight = array();
|
||||
}
|
||||
|
||||
if(isset($getVideosIDFromPlaylistLight[$playlists_id])){
|
||||
return $getVideosIDFromPlaylistLight[$playlists_id];
|
||||
}
|
||||
|
||||
$sql = "SELECT * FROM playlists_has_videos p WHERE playlists_id = ? ORDER BY `order` ";
|
||||
/*
|
||||
cleanSearchVar();
|
||||
$sort = @$_POST['sort'];
|
||||
$_POST['sort'] = array();
|
||||
$sql .= self::getSqlFromPost();
|
||||
$_POST['sort'] = $sort;
|
||||
reloadSearchVar();
|
||||
cleanSearchVar();
|
||||
$sort = @$_POST['sort'];
|
||||
$_POST['sort'] = array();
|
||||
$sql .= self::getSqlFromPost();
|
||||
$_POST['sort'] = $sort;
|
||||
reloadSearchVar();
|
||||
*
|
||||
*/
|
||||
$res = sqlDAL::readSql($sql, "i", array($playlists_id));
|
||||
|
@ -267,16 +340,15 @@ class PlayList extends ObjectYPT
|
|||
} else {
|
||||
die($sql . '\nError : (' . $global['mysqli']->errno . ') ' . $global['mysqli']->error);
|
||||
}
|
||||
$getVideosIDFromPlaylistLight[$playlists_id] = $rows;
|
||||
return $rows;
|
||||
}
|
||||
|
||||
public static function setCache($name, $value)
|
||||
{
|
||||
public static function setCache($name, $value) {
|
||||
parent::setCache($name, $value);
|
||||
}
|
||||
|
||||
public static function getVideosFromPlaylist($playlists_id)
|
||||
{
|
||||
public static function getVideosFromPlaylist($playlists_id) {
|
||||
$sql = "SELECT *,v.created as cre, p.`order` as video_order, v.externalOptions as externalOptions "
|
||||
. ", (SELECT count(id) FROM likes as l where l.videos_id = v.id AND `like` = 1 ) as likes "
|
||||
. " FROM playlists_has_videos p "
|
||||
|
@ -290,7 +362,7 @@ class PlayList extends ObjectYPT
|
|||
$sql .= self::getSqlFromPost();
|
||||
reloadSearchVar();
|
||||
$_POST['sort'] = $sort;
|
||||
$cacheName = "getVideosFromPlaylist{$playlists_id}".md5($sql);
|
||||
$cacheName = "getVideosFromPlaylist{$playlists_id}" . md5($sql);
|
||||
$rows = self::getCache($cacheName, 0);
|
||||
if (empty($rows)) {
|
||||
global $global;
|
||||
|
@ -301,8 +373,6 @@ class PlayList extends ObjectYPT
|
|||
$rows = array();
|
||||
$SubtitleSwitcher = AVideoPlugin::loadPluginIfEnabled("SubtitleSwitcher");
|
||||
if ($res != false) {
|
||||
$timeLog2 = __FILE__ . " - getVideosFromPlaylist: {$playlists_id}";
|
||||
TimeLogStart($timeLog2);
|
||||
foreach ($fullData as $row) {
|
||||
$row = cleanUpRowFromDatabase($row);
|
||||
if (!empty($_GET['isChannel'])) {
|
||||
|
@ -310,35 +380,26 @@ class PlayList extends ObjectYPT
|
|||
$row['pluginBtns'] = AVideoPlugin::getPlayListButtons($playlists_id);
|
||||
$row['humancreate'] = humanTiming(strtotime($row['cre']));
|
||||
}
|
||||
TimeLogEnd($timeLog2, __LINE__);
|
||||
$images = Video::getImageFromFilename($row['filename'], $row['type']);
|
||||
TimeLogEnd($timeLog2, __LINE__);
|
||||
if (!file_exists($images->posterLandscapePath) && !empty($row['serie_playlists_id'])) {
|
||||
$images = self::getRandomImageFromPlayList($row['serie_playlists_id']);
|
||||
}
|
||||
$row['images'] = $images;
|
||||
$row['videos'] = Video::getVideosPaths($row['filename'], true);
|
||||
TimeLogEnd($timeLog2, __LINE__);
|
||||
$row['progress'] = Video::getVideoPogressPercent($row['videos_id']);
|
||||
TimeLogEnd($timeLog2, __LINE__);
|
||||
$row['title'] = UTF8encode($row['title']);
|
||||
TimeLogEnd($timeLog2, __LINE__);
|
||||
$row['description'] = UTF8encode($row['description']);
|
||||
TimeLogEnd($timeLog2, __LINE__);
|
||||
$row['tags'] = Video::getTags($row['videos_id']);
|
||||
TimeLogEnd($timeLog2, __LINE__);
|
||||
if (AVideoPlugin::isEnabledByName("VideoTags")) {
|
||||
$row['videoTags'] = Tags::getAllFromVideosId($row['videos_id']);
|
||||
$row['videoTagsObject'] = Tags::getObjectFromVideosId($row['videos_id']);
|
||||
}
|
||||
TimeLogEnd($timeLog2, __LINE__);
|
||||
if ($SubtitleSwitcher) {
|
||||
$row['subtitles'] = getVTTTracks($row['filename'], true);
|
||||
foreach ($row['subtitles'] as $value) {
|
||||
$row['subtitlesSRT'][] = convertSRTTrack($value);
|
||||
}
|
||||
}
|
||||
TimeLogEnd($timeLog2, __LINE__);
|
||||
unset($row['password']);
|
||||
unset($row['recoverPass']);
|
||||
//unset($row['description']);
|
||||
$rows[] = $row;
|
||||
}
|
||||
|
||||
|
@ -352,18 +413,86 @@ class PlayList extends ObjectYPT
|
|||
return $rows;
|
||||
}
|
||||
|
||||
public static function isVideoOnFavorite($videos_id, $users_id)
|
||||
{
|
||||
public static function getRandomImageFromPlayList($playlists_id) {
|
||||
global $global;
|
||||
$sql = "SELECT v.* "
|
||||
. " FROM playlists_has_videos p "
|
||||
. " LEFT JOIN videos as v ON videos_id = v.id "
|
||||
. " WHERE playlists_id = ? AND v.status != 'i' ORDER BY RAND()
|
||||
LIMIT 1";
|
||||
$res = sqlDAL::readSql($sql, "i", array($playlists_id));
|
||||
$data = sqlDAL::fetchAssoc($res);
|
||||
sqlDAL::close($res);
|
||||
if ($res) {
|
||||
$row = $data;
|
||||
$images = Video::getImageFromFilename($row['filename'], $row['type']);
|
||||
|
||||
if (!file_exists($images->posterLandscapePath) && !empty($row['serie_playlists_id'])) {
|
||||
return self::getRandomImageFromPlayList($row['serie_playlists_id']);
|
||||
}
|
||||
return $images;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static function isAGroupOfPlayLists($playlists_id) {
|
||||
|
||||
$rows = self::getAllSubPlayLists($playlists_id);
|
||||
|
||||
return count($rows);
|
||||
}
|
||||
|
||||
public static function getAllSubPlayLists($playlists_id, $NOTSubPlaylists = 0) {
|
||||
global $getAllSubPlayLists;
|
||||
if (empty($playlists_id)) {
|
||||
return false;
|
||||
}
|
||||
if (!isset($getAllSubPlayLists)) {
|
||||
$getAllSubPlayLists = array();
|
||||
}
|
||||
if (!isset($getAllSubPlayLists[$playlists_id])) {
|
||||
$getAllSubPlayLists[$playlists_id] = array();
|
||||
}
|
||||
if (isset($getAllSubPlayLists[$playlists_id][$NOTSubPlaylists])) {
|
||||
return $getAllSubPlayLists[$playlists_id][$NOTSubPlaylists];
|
||||
}
|
||||
$sql = "SELECT v.* "
|
||||
. " FROM playlists_has_videos p "
|
||||
. " LEFT JOIN videos as v ON videos_id = v.id "
|
||||
. " WHERE playlists_id = ? AND v.status != 'i' ";
|
||||
|
||||
if ($NOTSubPlaylists) {
|
||||
$sql .= ' AND serie_playlists_id IS NULL ';
|
||||
} else {
|
||||
$sql .= ' AND serie_playlists_id IS NOT NULL ';
|
||||
}
|
||||
|
||||
$res = sqlDAL::readSql($sql, "i", array($playlists_id));
|
||||
$fullData = sqlDAL::fetchAllAssoc($res);
|
||||
sqlDAL::close($res);
|
||||
$rows = array();
|
||||
if ($res != false) {
|
||||
foreach ($fullData as $row) {
|
||||
$rows[] = $row;
|
||||
}
|
||||
}
|
||||
$getAllSubPlayLists[$playlists_id][$NOTSubPlaylists] = $rows;
|
||||
return $rows;
|
||||
}
|
||||
|
||||
public static function getAllNOTSubPlayLists($playlists_id) {
|
||||
return self::getAllSubPlayLists($playlists_id, 1);
|
||||
}
|
||||
|
||||
public static function isVideoOnFavorite($videos_id, $users_id) {
|
||||
return self::isVideoOn($videos_id, $users_id, 'favorite');
|
||||
}
|
||||
|
||||
public static function isVideoOnWatchLater($videos_id, $users_id)
|
||||
{
|
||||
public static function isVideoOnWatchLater($videos_id, $users_id) {
|
||||
return self::isVideoOn($videos_id, $users_id, 'watch_later');
|
||||
}
|
||||
|
||||
private static function isVideoOn($videos_id, $users_id, $status)
|
||||
{
|
||||
private static function isVideoOn($videos_id, $users_id, $status) {
|
||||
global $global;
|
||||
$status = str_replace("'", "", $status);
|
||||
|
||||
|
@ -385,8 +514,7 @@ class PlayList extends ObjectYPT
|
|||
return $row;
|
||||
}
|
||||
|
||||
public static function getFavoriteIdFromUser($users_id)
|
||||
{
|
||||
public static function getFavoriteIdFromUser($users_id) {
|
||||
global $refreshCacheFromPlaylist;
|
||||
$favorite = self::getIdFromUser($users_id, "favorite");
|
||||
if (empty($favorite)) {
|
||||
|
@ -401,8 +529,7 @@ class PlayList extends ObjectYPT
|
|||
return $favorite;
|
||||
}
|
||||
|
||||
public static function getWatchLaterIdFromUser($users_id)
|
||||
{
|
||||
public static function getWatchLaterIdFromUser($users_id) {
|
||||
global $refreshCacheFromPlaylist;
|
||||
$watch_later = self::getIdFromUser($users_id, "watch_later");
|
||||
|
||||
|
@ -418,8 +545,7 @@ class PlayList extends ObjectYPT
|
|||
return $watch_later;
|
||||
}
|
||||
|
||||
private static function getIdFromUser($users_id, $status)
|
||||
{
|
||||
private static function getIdFromUser($users_id, $status) {
|
||||
global $global;
|
||||
|
||||
$status = str_replace("'", "", $status);
|
||||
|
@ -436,8 +562,7 @@ class PlayList extends ObjectYPT
|
|||
return $row;
|
||||
}
|
||||
|
||||
public static function getVideosIdFromPlaylist($playlists_id)
|
||||
{
|
||||
public static function getVideosIdFromPlaylist($playlists_id) {
|
||||
global $getVideosIdFromPlaylist;
|
||||
if (empty($getVideosIdFromPlaylist)) {
|
||||
$getVideosIdFromPlaylist = array();
|
||||
|
@ -455,8 +580,7 @@ class PlayList extends ObjectYPT
|
|||
return $videosId;
|
||||
}
|
||||
|
||||
public static function sortVideos($videosList, $listIdOrder)
|
||||
{
|
||||
public static function sortVideos($videosList, $listIdOrder) {
|
||||
$list = array();
|
||||
foreach ($listIdOrder as $value) {
|
||||
$found = false;
|
||||
|
@ -478,8 +602,7 @@ class PlayList extends ObjectYPT
|
|||
return $list;
|
||||
}
|
||||
|
||||
public function save()
|
||||
{
|
||||
public function save() {
|
||||
if (!User::isLogged()) {
|
||||
return false;
|
||||
}
|
||||
|
@ -498,15 +621,13 @@ class PlayList extends ObjectYPT
|
|||
* This is just to fix errors from the update 6.4 to 6.5, where empty playlists were created before the update
|
||||
* @return type
|
||||
*/
|
||||
private function clearEmptyLists()
|
||||
{
|
||||
private function clearEmptyLists() {
|
||||
$sql = "DELETE FROM " . static::getTableName() . " WHERE status = ''";
|
||||
|
||||
return sqlDAL::writeSql($sql);
|
||||
}
|
||||
|
||||
public function addVideo($videos_id, $add, $order = 0)
|
||||
{
|
||||
public function addVideo($videos_id, $add, $order = 0) {
|
||||
global $global;
|
||||
$formats = "";
|
||||
$values = array();
|
||||
|
@ -528,8 +649,7 @@ class PlayList extends ObjectYPT
|
|||
return sqlDAL::writeSql($sql, $formats, $values);
|
||||
}
|
||||
|
||||
public function delete()
|
||||
{
|
||||
public function delete() {
|
||||
if (empty($this->id)) {
|
||||
return false;
|
||||
}
|
||||
|
@ -540,38 +660,31 @@ class PlayList extends ObjectYPT
|
|||
return sqlDAL::writeSql($sql, "i", array($this->id));
|
||||
}
|
||||
|
||||
public function getId()
|
||||
{
|
||||
public function getId() {
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function getName()
|
||||
{
|
||||
public function getName() {
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
public function getModified()
|
||||
{
|
||||
public function getModified() {
|
||||
return $this->modified;
|
||||
}
|
||||
|
||||
public function getUsers_id()
|
||||
{
|
||||
public function getUsers_id() {
|
||||
return $this->users_id;
|
||||
}
|
||||
|
||||
public function getStatus()
|
||||
{
|
||||
public function getStatus() {
|
||||
return $this->status;
|
||||
}
|
||||
|
||||
public function setId($id)
|
||||
{
|
||||
public function setId($id) {
|
||||
$this->id = $id;
|
||||
}
|
||||
|
||||
public function setName($name)
|
||||
{
|
||||
public function setName($name) {
|
||||
if (strlen($name) > 45) {
|
||||
$name = substr($name, 0, 42) . '...';
|
||||
}
|
||||
|
@ -579,21 +692,18 @@ class PlayList extends ObjectYPT
|
|||
//var_dump($name,$this->name);exit;
|
||||
}
|
||||
|
||||
public function setUsers_id($users_id)
|
||||
{
|
||||
public function setUsers_id($users_id) {
|
||||
$this->users_id = $users_id;
|
||||
}
|
||||
|
||||
public function setStatus($status)
|
||||
{
|
||||
public function setStatus($status) {
|
||||
if (!in_array($status, self::$validStatus)) {
|
||||
$status = 'public';
|
||||
}
|
||||
$this->status = $status;
|
||||
}
|
||||
|
||||
public static function canSee($playlist_id, $users_id)
|
||||
{
|
||||
public static function canSee($playlist_id, $users_id) {
|
||||
$obj = new PlayList($playlist_id);
|
||||
$status = $obj->getStatus();
|
||||
if ($status !== 'public' && $status !== 'unlisted' && $users_id != $obj->getUsers_id()) {
|
||||
|
@ -602,33 +712,29 @@ class PlayList extends ObjectYPT
|
|||
return true;
|
||||
}
|
||||
|
||||
public static function getEPG()
|
||||
{
|
||||
public static function getEPG() {
|
||||
global $config, $global;
|
||||
$encoder = $config->_getEncoderURL();
|
||||
$url = "{$encoder}view/videosListEPG.php?date_default_timezone=". urlencode(date_default_timezone_get());
|
||||
$url = "{$encoder}view/videosListEPG.php?date_default_timezone=" . urlencode(date_default_timezone_get());
|
||||
|
||||
$content = url_get_contents($url);
|
||||
return json_decode($content);
|
||||
}
|
||||
|
||||
public function getShowOnTV()
|
||||
{
|
||||
public function getShowOnTV() {
|
||||
return intval($this->showOnTV);
|
||||
}
|
||||
|
||||
public function setShowOnTV($showOnTV)
|
||||
{
|
||||
if (strtolower($showOnTV)==="false") {
|
||||
public function setShowOnTV($showOnTV) {
|
||||
if (strtolower($showOnTV) === "false") {
|
||||
$showOnTV = 0;
|
||||
} elseif (strtolower($showOnTV)==="true") {
|
||||
} elseif (strtolower($showOnTV) === "true") {
|
||||
$showOnTV = 1;
|
||||
}
|
||||
$this->showOnTV = intval($showOnTV);
|
||||
}
|
||||
|
||||
public static function getAllToShowOnTV()
|
||||
{
|
||||
public static function getAllToShowOnTV() {
|
||||
global $global;
|
||||
if (!static::isTableInstalled()) {
|
||||
return false;
|
||||
|
@ -653,4 +759,26 @@ class PlayList extends ObjectYPT
|
|||
}
|
||||
return $rows;
|
||||
}
|
||||
|
||||
public static function showPlayListSelector($playListArray) {
|
||||
$collections = array();
|
||||
$videos = array();
|
||||
foreach ($playListArray as $value) {
|
||||
if ($value['type'] === 'serie' && !empty($value['serie_playlists_id'])) {
|
||||
$collections[] = $value;
|
||||
} else {
|
||||
$videos[] = $value;
|
||||
}
|
||||
}
|
||||
$countCollections = count($collections);
|
||||
$countVideos = count($videos);
|
||||
if(!empty($countCollections)){
|
||||
if($countCollections===1 && empty($countVideos)){
|
||||
return false;
|
||||
}
|
||||
return $collections;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -54,6 +54,7 @@ if (!class_exists('Video')) {
|
|||
private $encoderURL;
|
||||
private $filepath;
|
||||
private $filesize;
|
||||
private $live_transmitions_history_id;
|
||||
public static $statusDesc = array(
|
||||
'a' => 'active',
|
||||
'k' => 'active and encoding',
|
||||
|
@ -166,6 +167,14 @@ if (!class_exists('Video')) {
|
|||
}
|
||||
}
|
||||
|
||||
function getLive_transmitions_history_id() {
|
||||
return $this->live_transmitions_history_id;
|
||||
}
|
||||
|
||||
function setLive_transmitions_history_id($live_transmitions_history_id) {
|
||||
$this->live_transmitions_history_id = intval($live_transmitions_history_id);
|
||||
}
|
||||
|
||||
public function getEncoderURL()
|
||||
{
|
||||
return $this->encoderURL;
|
||||
|
@ -321,6 +330,10 @@ if (!class_exists('Video')) {
|
|||
$this->type = 'video';
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($this->live_transmitions_history_id)) {
|
||||
$this->live_transmitions_history_id = 'NULL';
|
||||
}
|
||||
|
||||
if (!empty($this->id)) {
|
||||
if (!$this->userCanManageVideo() && !$allowOfflineUser && !Permissions::canModerateVideos()) {
|
||||
|
@ -330,13 +343,13 @@ if (!class_exists('Video')) {
|
|||
$sql = "UPDATE videos SET title = '{$this->title}',clean_title = '{$this->clean_title}',"
|
||||
. " filename = '{$this->filename}', categories_id = '{$this->categories_id}', status = '{$this->status}',"
|
||||
. " description = '{$this->description}', duration = '{$this->duration}', type = '{$this->type}', videoDownloadedLink = '{$this->videoDownloadedLink}', youtubeId = '{$this->youtubeId}', videoLink = '{$this->videoLink}', next_videos_id = {$this->next_videos_id}, isSuggested = {$this->isSuggested}, users_id = {$this->users_id}, "
|
||||
. " trailer1 = '{$this->trailer1}', trailer2 = '{$this->trailer2}', trailer3 = '{$this->trailer3}', rate = '{$this->rate}', can_download = '{$this->can_download}', can_share = '{$this->can_share}', only_for_paid = '{$this->only_for_paid}', rrating = '{$this->rrating}', externalOptions = '{$this->externalOptions}', sites_id = {$this->sites_id}, serie_playlists_id = {$this->serie_playlists_id} , video_password = '{$this->video_password}', "
|
||||
. " trailer1 = '{$this->trailer1}', trailer2 = '{$this->trailer2}', trailer3 = '{$this->trailer3}', rate = '{$this->rate}', can_download = '{$this->can_download}', can_share = '{$this->can_share}', only_for_paid = '{$this->only_for_paid}', rrating = '{$this->rrating}', externalOptions = '{$this->externalOptions}', sites_id = {$this->sites_id}, serie_playlists_id = {$this->serie_playlists_id} ,live_transmitions_history_id = {$this->live_transmitions_history_id} , video_password = '{$this->video_password}', "
|
||||
. " encoderURL = '{$this->encoderURL}', filepath = '{$this->filepath}' , filesize = '{$this->filesize}' , modified = now()"
|
||||
. " WHERE id = {$this->id}";
|
||||
} else {
|
||||
$sql = "INSERT INTO videos "
|
||||
. "(title,clean_title, filename, users_id, categories_id, status, description, duration,type,videoDownloadedLink, next_videos_id, created, modified, videoLink, can_download, can_share, only_for_paid, rrating, externalOptions, sites_id, serie_playlists_id, video_password, encoderURL, filepath , filesize) values "
|
||||
. "('{$this->title}','{$this->clean_title}', '{$this->filename}', {$this->users_id},{$this->categories_id}, '{$this->status}', '{$this->description}', '{$this->duration}', '{$this->type}', '{$this->videoDownloadedLink}', {$this->next_videos_id},now(), now(), '{$this->videoLink}', '{$this->can_download}', '{$this->can_share}','{$this->only_for_paid}', '{$this->rrating}', '$this->externalOptions', {$this->sites_id}, {$this->serie_playlists_id}, '{$this->video_password}', '{$this->encoderURL}', '{$this->filepath}', '{$this->filesize}')";
|
||||
. "(title,clean_title, filename, users_id, categories_id, status, description, duration,type,videoDownloadedLink, next_videos_id, created, modified, videoLink, can_download, can_share, only_for_paid, rrating, externalOptions, sites_id, serie_playlists_id,live_transmitions_history_id, video_password, encoderURL, filepath , filesize) values "
|
||||
. "('{$this->title}','{$this->clean_title}', '{$this->filename}', {$this->users_id},{$this->categories_id}, '{$this->status}', '{$this->description}', '{$this->duration}', '{$this->type}', '{$this->videoDownloadedLink}', {$this->next_videos_id},now(), now(), '{$this->videoLink}', '{$this->can_download}', '{$this->can_share}','{$this->only_for_paid}', '{$this->rrating}', '$this->externalOptions', {$this->sites_id}, {$this->serie_playlists_id},{$this->live_transmitions_history_id}, '{$this->video_password}', '{$this->encoderURL}', '{$this->filepath}', '{$this->filesize}')";
|
||||
}
|
||||
$insert_row = sqlDAL::writeSql($sql);
|
||||
if ($insert_row) {
|
||||
|
@ -566,8 +579,7 @@ if (!class_exists('Video')) {
|
|||
$this->clean_title = cleanURLName($clean_title);
|
||||
}
|
||||
|
||||
public function setDuration($duration)
|
||||
{
|
||||
public function setDuration($duration){
|
||||
$this->duration = $duration;
|
||||
}
|
||||
|
||||
|
@ -769,12 +781,14 @@ if (!class_exists('Video')) {
|
|||
$sql .= " AND (";
|
||||
$sql .= "v.id IN (select videos_id FROM tags_has_videos LEFT JOIN tags as t ON tags_id = t.id AND t.name LIKE '%{$_POST['searchPhrase']}%' WHERE t.id is NOT NULL)";
|
||||
$sql .= BootGrid::getSqlSearchFromPost($searchFieldsNames, "OR");
|
||||
$searchFieldsNames = array('v.title');
|
||||
$sql .= self::getFullTextSearch($searchFieldsNames, $_POST['searchPhrase']);
|
||||
$sql .= ")";
|
||||
} else {
|
||||
$sql .= BootGrid::getSqlSearchFromPost($searchFieldsNames);
|
||||
$sql .= ' AND (1=1 '.BootGrid::getSqlSearchFromPost($searchFieldsNames);
|
||||
$searchFieldsNames = array('v.title');
|
||||
$sql .= self::getFullTextSearch($searchFieldsNames, $_POST['searchPhrase']).')';
|
||||
}
|
||||
$searchFieldsNames = array('v.title');
|
||||
$sql .= self::getFullTextSearch($searchFieldsNames, $_POST['searchPhrase']);
|
||||
}
|
||||
if (!$ignoreGroup) {
|
||||
$arrayNotIN = AVideoPlugin::getAllVideosExcludeVideosIDArray();
|
||||
|
@ -946,14 +960,8 @@ if (!class_exists('Video')) {
|
|||
|
||||
public static function getVideoFromCleanTitle($clean_title)
|
||||
{
|
||||
// for some reason in some servers (CPanel) we got the error "Error while sending QUERY packet centos on a select"
|
||||
// even increasing the max_allowed_packet it only goes away when close and reopen the connection
|
||||
global $global, $mysqlHost, $mysqlUser, $mysqlPass, $mysqlDatabase, $mysqlPort;
|
||||
$global['mysqli']->close();
|
||||
_mysql_connect();
|
||||
if (!empty($global['mysqli_charset'])) {
|
||||
$global['mysqli']->set_charset($global['mysqli_charset']);
|
||||
}
|
||||
global $global;
|
||||
$sql = "SELECT id FROM videos WHERE clean_title = ? LIMIT 1";
|
||||
$res = sqlDAL::readSql($sql, "s", array($clean_title));
|
||||
$video = sqlDAL::fetchAssoc($res);
|
||||
|
@ -975,7 +983,7 @@ if (!class_exists('Video')) {
|
|||
* @param type $videosArrayId an array with videos to return (for filter only)
|
||||
* @return boolean
|
||||
*/
|
||||
public static function getAllVideos($status = "viewable", $showOnlyLoggedUserVideos = false, $ignoreGroup = false, $videosArrayId = array(), $getStatistcs = false, $showUnlisted = false, $activeUsersOnly = true, $suggestedOnly = false)
|
||||
public static function getAllVideos($status = "viewable", $showOnlyLoggedUserVideos = false, $ignoreGroup = false, $videosArrayId = array(), $getStatistcs = false, $showUnlisted = false, $activeUsersOnly = true, $suggestedOnly = false, $is_serie = null)
|
||||
{
|
||||
global $global, $config, $advancedCustom;
|
||||
if ($config->currentVersionLowerThen('5')) {
|
||||
|
@ -1017,6 +1025,19 @@ if (!class_exists('Video')) {
|
|||
$uid = intval($user['id']);
|
||||
$sql .= " AND v.users_id = '{$uid}' ";
|
||||
}
|
||||
|
||||
if (isset($_REQUEST['is_serie']) && empty($is_serie)) {
|
||||
$is_serie = intval($_REQUEST['is_serie']);
|
||||
}
|
||||
|
||||
if (isset($is_serie)) {
|
||||
if(empty($is_serie)){
|
||||
$sql .= " AND v.serie_playlists_id IS NULL ";
|
||||
}else{
|
||||
$sql .= " AND v.serie_playlists_id IS NOT NULL ";
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($videosArrayId) && is_array($videosArrayId)) {
|
||||
$sql .= " AND v.id IN ( '" . implode("', '", $videosArrayId) . "') ";
|
||||
}
|
||||
|
@ -1087,9 +1108,9 @@ if (!class_exists('Video')) {
|
|||
$sql .= self::getFullTextSearch($searchFieldsNames, $_POST['searchPhrase']);
|
||||
$sql .= ")";
|
||||
} else {
|
||||
$sql .= BootGrid::getSqlSearchFromPost($searchFieldsNames);
|
||||
$sql .= ' AND (1=1 '.BootGrid::getSqlSearchFromPost($searchFieldsNames);
|
||||
$searchFieldsNames = array('v.title');
|
||||
$sql .= self::getFullTextSearch($searchFieldsNames, $_POST['searchPhrase']);
|
||||
$sql .= self::getFullTextSearch($searchFieldsNames, $_POST['searchPhrase']).')';
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1145,7 +1166,7 @@ if (!class_exists('Video')) {
|
|||
}
|
||||
}
|
||||
|
||||
//echo $sql;exit;
|
||||
//echo $sql;//exit;
|
||||
//_error_log("getAllVideos($status, $showOnlyLoggedUserVideos , $ignoreGroup , ". json_encode($videosArrayId).")" . $sql);
|
||||
$res = sqlDAL::readSql($sql);
|
||||
$fullData = sqlDAL::fetchAllAssoc($res);
|
||||
|
@ -1487,6 +1508,16 @@ if (!class_exists('Video')) {
|
|||
} elseif (is_int($showOnlyLoggedUserVideos)) {
|
||||
$sql .= " AND v.users_id = '{$showOnlyLoggedUserVideos}'";
|
||||
}
|
||||
|
||||
if (isset($_REQUEST['is_serie'])) {
|
||||
$is_serie = intval($_REQUEST['is_serie']);
|
||||
if(empty($is_serie)){
|
||||
$sql .= " AND v.serie_playlists_id IS NULL ";
|
||||
}else{
|
||||
$sql .= " AND v.serie_playlists_id IS NOT NULL ";
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($_GET['catName'])) {
|
||||
$catName = $global['mysqli']->real_escape_string($_GET['catName']);
|
||||
$sql .= " AND c.clean_name = '{$catName}'";
|
||||
|
@ -1524,9 +1555,9 @@ if (!class_exists('Video')) {
|
|||
$sql .= self::getFullTextSearch($searchFieldsNames, $_POST['searchPhrase']);
|
||||
$sql .= ")";
|
||||
} else {
|
||||
$sql .= BootGrid::getSqlSearchFromPost($searchFieldsNames);
|
||||
$sql .= ' AND (1=1 '.BootGrid::getSqlSearchFromPost($searchFieldsNames);
|
||||
$searchFieldsNames = array('v.title');
|
||||
$sql .= self::getFullTextSearch($searchFieldsNames, $_POST['searchPhrase']);
|
||||
$sql .= self::getFullTextSearch($searchFieldsNames, $_POST['searchPhrase']).')';
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2030,7 +2061,7 @@ if (!class_exists('Video')) {
|
|||
$res = sqlDAL::writeSql($sql, "si", array($this->duration, $this->id));
|
||||
return $this->id;
|
||||
} else {
|
||||
_error_log("Do not need update duration: " . json_encode($this));
|
||||
_error_log("Do not need update duration: ");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -2909,17 +2940,25 @@ if (!class_exists('Video')) {
|
|||
return $VideoGetSourceFile[$cacheName];
|
||||
}
|
||||
|
||||
public static function getCleanFilenameFromFile($filename)
|
||||
{
|
||||
public static function getCleanFilenameFromFile($filename){
|
||||
global $global;
|
||||
if (empty($filename)) {
|
||||
return "";
|
||||
}
|
||||
$cleanName = str_replace(
|
||||
array('_Low', '_SD', '_HD', '_thumbsV2', '_thumbsSmallV2', '_thumbsSprit', '_roku',
|
||||
'_2160', '_1440', '_1080', '_720', '_480', '_360', '_240', '_portrait', '_portrait_thumbsV2', '_portrait_thumbsSmallV2'),
|
||||
array('', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''),
|
||||
$filename
|
||||
);
|
||||
|
||||
$search = array('_Low', '_SD', '_HD', '_thumbsV2', '_thumbsSmallV2', '_thumbsSprit', '_roku', '_portrait', '_portrait_thumbsV2', '_portrait_thumbsSmallV2');
|
||||
$replace = array('', '', '', '', '', '', '', '', '', '');
|
||||
|
||||
if(empty($global['avideo_resolutions']) || !is_array($global['avideo_resolutions'])){
|
||||
$global['avideo_resolutions'] = array(240, 360, 480, 540, 720, 1080, 1440, 2160);
|
||||
}
|
||||
|
||||
foreach ($global['avideo_resolutions'] as $value) {
|
||||
$search[] = "_{$value}";
|
||||
$replace[] = '';
|
||||
}
|
||||
|
||||
$cleanName = str_replace($search,$replace,$filename);
|
||||
$path_parts = pathinfo($cleanName);
|
||||
|
||||
if (!empty($path_parts["extension"]) && $path_parts["extension"] === "m3u8") {
|
||||
|
@ -3060,13 +3099,14 @@ if (!class_exists('Video')) {
|
|||
return false;
|
||||
}
|
||||
|
||||
public static function getHigherVideoPathFromID($videos_id)
|
||||
{
|
||||
public static function getHigherVideoPathFromID($videos_id){
|
||||
global $global;
|
||||
if (empty($videos_id)) {
|
||||
return false;
|
||||
}
|
||||
$paths = self::getVideosPathsFromID($videos_id);
|
||||
$types = array(0, 2160, 1330, 1080, 720, 'HD', 'SD', 'Low', 480, 360, 240);
|
||||
|
||||
$types = array(0, 2160, 1440, 1080, 720, 'HD', 'SD', 'Low', 540, 480, 360, 240);
|
||||
|
||||
if (!empty($paths['mp4'])) {
|
||||
foreach ($types as $value) {
|
||||
|
@ -3116,9 +3156,14 @@ if (!class_exists('Video')) {
|
|||
return self::getVideosPaths($video->getFilename(), true);
|
||||
}
|
||||
|
||||
public static function getVideosPaths($filename, $includeS3 = false)
|
||||
{
|
||||
$types = array('', '_Low', '_SD', '_HD', '_2160', '_1440', '_1080', '_720', '_480', '_360', '_240');
|
||||
public static function getVideosPaths($filename, $includeS3 = false){
|
||||
global $global;
|
||||
$types = array('', '_Low', '_SD', '_HD');
|
||||
|
||||
foreach ($global['avideo_resolutions'] as $value) {
|
||||
$types[] = "_{$value}";
|
||||
}
|
||||
|
||||
$videos = array();
|
||||
|
||||
$plugin = AVideoPlugin::loadPluginIfEnabled("VideoHLS");
|
||||
|
@ -3927,8 +3972,7 @@ if (!class_exists('Video')) {
|
|||
$this->serie_playlists_id = $serie_playlists_id;
|
||||
}
|
||||
|
||||
public static function getVideoFromSeriePlayListsId($serie_playlists_id)
|
||||
{
|
||||
public static function getVideoFromSeriePlayListsId($serie_playlists_id){
|
||||
global $global, $config;
|
||||
$serie_playlists_id = intval($serie_playlists_id);
|
||||
$sql = "SELECT * FROM videos WHERE serie_playlists_id = '$serie_playlists_id' LIMIT 1";
|
||||
|
@ -4056,6 +4100,21 @@ if (!class_exists('Video')) {
|
|||
$sql .= ")";
|
||||
return "{$connection} {$sql}";
|
||||
}
|
||||
|
||||
public static function getChangeVideoStatusButton($videos_id){
|
||||
|
||||
$video = new Video('', '', $videos_id);
|
||||
$status = $video->getStatus();
|
||||
|
||||
$activeBtn = '<button onclick="changeVideoStatus('.$videos_id.', \'u\');" style="color: #090" type="button" '
|
||||
. 'class="btn btn-default btn-xs getChangeVideoStatusButton_a" data-toggle="tooltip" title="'.str_replace("'", "\\'", __("This video is Active and Listed, click here to unlist it")).'"><span class="glyphicon glyphicon-eye-open" aria-hidden="true"></span></button>';
|
||||
$inactiveBtn = '<button onclick="changeVideoStatus('.$videos_id.', \'a\');" style="color: #A00" type="button" '
|
||||
. 'class="btn btn-default btn-xs getChangeVideoStatusButton_i" data-toggle="tooltip" title="'.str_replace("'", "\\'", __("This video is inactive, click here to activate it")).'"><span class="glyphicon glyphicon-eye-close" aria-hidden="true"></span></button>';
|
||||
$unlistedBtn = '<button onclick="changeVideoStatus('.$videos_id.', \'i\');" style="color: #BBB" type="button" '
|
||||
. 'class="btn btn-default btn-xs getChangeVideoStatusButton_u" data-toggle="tooltip" title="'.str_replace("'", "\\'", __("This video is unlisted, click here to inactivate it")).'"><span class="glyphicon glyphicon-eye-open" aria-hidden="true"></span></button>';
|
||||
|
||||
return "<span class='getChangeVideoStatusButton getChangeVideoStatusButton_{$videos_id} status_{$status}'>{$activeBtn}{$inactiveBtn}{$unlistedBtn}</span>";
|
||||
}
|
||||
}
|
||||
}
|
||||
// just to convert permalink into clean_title
|
||||
|
|
|
@ -16,16 +16,41 @@ if (!is_array($_POST['id'])) {
|
|||
require_once 'video.php';
|
||||
|
||||
$id = 0;
|
||||
|
||||
$obj = new stdClass();
|
||||
$obj->error = true;
|
||||
$obj->status = array();
|
||||
$obj->msg = '';
|
||||
|
||||
foreach ($_POST['id'] as $value) {
|
||||
$obj = new Video("", "", $value);
|
||||
if (empty($obj)) {
|
||||
die("Object not found");
|
||||
$obj2 = new stdClass();
|
||||
$obj2->error = true;
|
||||
$obj2->videos_id = $value;
|
||||
$obj2->status = $_POST['status'];
|
||||
$obj2->msg = '';
|
||||
|
||||
|
||||
$v = new Video("", "", $value);
|
||||
if (empty($v)) {
|
||||
$obj2->msg = __("Video NOT Found");
|
||||
$obj->status[] = $obj2;
|
||||
continue;
|
||||
}
|
||||
if (!$obj->userCanManageVideo() && !Permissions::canModerateVideos()) {
|
||||
$obj->msg = __("You can not Manage This Video");
|
||||
die(json_encode($obj));
|
||||
if (!$v->userCanManageVideo() && !Permissions::canModerateVideos()) {
|
||||
$obj2->msg = __("You can not Manage This Video");
|
||||
$obj->status[] = $obj2;
|
||||
continue;
|
||||
}
|
||||
$obj->setStatus($_POST['status']);
|
||||
$resp = $value;
|
||||
$v->setStatus($_POST['status']);
|
||||
$obj2->error = false;
|
||||
$obj->status[] = $obj2;
|
||||
}
|
||||
echo '{"status":"' . !empty($resp) . '"}';
|
||||
|
||||
foreach ($obj->status as $value) {
|
||||
if($value->error){
|
||||
break;
|
||||
}
|
||||
$obj->error = false;
|
||||
}
|
||||
|
||||
die(json_encode($obj));
|
||||
|
|
|
@ -261,6 +261,7 @@ class API extends PluginAbstract {
|
|||
* ['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]
|
||||
* ['is_serie' if is 0 return only videos, if is 1 return only series, if is not set, return all]
|
||||
* @example {webSiteRootURL}plugin/API/{getOrSet}.json.php?APIName={APIName}&catName=default&rowCount=10
|
||||
* @return \ApiObject
|
||||
*/
|
||||
|
|
|
@ -1168,28 +1168,28 @@ class AVideoPlugin {
|
|||
}
|
||||
}
|
||||
|
||||
public static function onUserSocketConnect($users_id, $data) {
|
||||
public static function onUserSocketConnect() {
|
||||
_mysql_connect();
|
||||
$plugins = Plugin::getAllEnabled();
|
||||
foreach ($plugins as $value) {
|
||||
self::YPTstart();
|
||||
$p = static::loadPlugin($value['dirName']);
|
||||
if (is_object($p)) {
|
||||
$p->onUserSocketConnect($users_id, $data);
|
||||
$p->onUserSocketConnect();
|
||||
}
|
||||
self::YPTend("{$value['dirName']}::" . __FUNCTION__);
|
||||
}
|
||||
_mysql_close();
|
||||
}
|
||||
|
||||
public static function onUserSocketDisconnect($users_id, $data) {
|
||||
public static function onUserSocketDisconnect() {
|
||||
_mysql_connect();
|
||||
$plugins = Plugin::getAllEnabled();
|
||||
foreach ($plugins as $value) {
|
||||
self::YPTstart();
|
||||
$p = static::loadPlugin($value['dirName']);
|
||||
if (is_object($p)) {
|
||||
$p->onUserSocketConnect($users_id, $data);
|
||||
$p->onUserSocketDisconnect();
|
||||
}
|
||||
self::YPTend("{$value['dirName']}::" . __FUNCTION__);
|
||||
}
|
||||
|
|
|
@ -63,13 +63,11 @@ class AdsForJesus extends PluginAbstract {
|
|||
$js = '';
|
||||
$css = '';
|
||||
//if (!empty($_GET['videoName']) || !empty($_GET['u'])) {
|
||||
if (!empty($_GET['videoName'])) {
|
||||
if (empty($_GET['u'])) {
|
||||
$video = Video::getVideoFromCleanTitle($_GET['videoName']);
|
||||
$showAds = AVideoPlugin::showAds($video['id']);
|
||||
if (!$showAds) {
|
||||
return "";
|
||||
}
|
||||
$videos_id = getVideos_id();
|
||||
if (!empty($videos_id)) {
|
||||
$showAds = AVideoPlugin::showAds($videos_id);
|
||||
if (!$showAds) {
|
||||
return "";
|
||||
}
|
||||
global $global;
|
||||
$css .= '<link href="' . $global['webSiteRootURL'] . 'plugin/AD_Server/videojs-ima/videojs.ima.css" rel="stylesheet" type="text/css"/>';
|
||||
|
@ -86,7 +84,12 @@ class AdsForJesus extends PluginAbstract {
|
|||
$js .= '<script src="' . $global['webSiteRootURL'] . 'plugin/AD_Server/videojs-ima/videojs.ima.js" type="text/javascript"></script>';
|
||||
|
||||
//if (!empty($_GET['videoName']) || !empty($_GET['u'])) {
|
||||
if (!empty($_GET['videoName'])) {
|
||||
$videos_id = getVideos_id();
|
||||
if (!empty($videos_id)) {
|
||||
$showAds = AVideoPlugin::showAds($videos_id);
|
||||
if (!$showAds) {
|
||||
return "";
|
||||
}
|
||||
if (empty($_GET['u'])) {
|
||||
$video = Video::getVideoFromCleanTitle($_GET['videoName']);
|
||||
$showAds = AVideoPlugin::showAds($video['id']);
|
||||
|
@ -101,10 +104,7 @@ class AdsForJesus extends PluginAbstract {
|
|||
$video_length = parseDurationToSeconds($video['duration']);
|
||||
$obj = $this->getDataObject();
|
||||
PlayerSkins::setIMAADTag("https://forjesus.tv/vmap.xml?video_durarion={$video_length}&start={$obj->start}&mid25Percent={$obj->mid25Percent}&mid50Percent={$obj->mid50Percent}&mid75Percent={$obj->mid75Percent}&end={$obj->end}");
|
||||
}else if(isLive()){
|
||||
//PlayerSkins::setIMAADTag("https://forjesus.tv/vmap.xml?video_durarion=0&start=1&mid25Percent=0&mid50Percent=0&mid75Percent=0&end=1");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return $js;
|
||||
}
|
||||
|
|
|
@ -176,6 +176,9 @@ function createGallerySection($videos, $crc = "", $get = array(), $ignoreAds = f
|
|||
$images->thumbsJpg = "{$global['webSiteRootURL']}view/img/notfoundThumbs.jpg";
|
||||
$images->thumbsJpgSmall = "{$global['webSiteRootURL']}view/img/notfoundThumbsSmall.jpg";
|
||||
}
|
||||
if ($value['type'] === 'serie' && !empty($value['serie_playlists_id']) && stripos($images->thumbsJpg, 'notfound') !== false) {
|
||||
$images = PlayList::getRandomImageFromPlayList($value['serie_playlists_id']);
|
||||
}
|
||||
$startG = microtime(true);
|
||||
$imgGif = $images->thumbsGif;
|
||||
$poster = $images->thumbsJpg;
|
||||
|
@ -331,7 +334,7 @@ function createGallerySection($videos, $crc = "", $get = array(), $ignoreAds = f
|
|||
</div>
|
||||
<?php if (Video::canEdit($value['id'])) { ?>
|
||||
<div>
|
||||
<a href="<?php echo $global['webSiteRootURL']; ?>mvideos?video_id=<?php echo $value['id']; ?>" class="text-primary">
|
||||
<a href="#" onclick="avideoModalIframe('<?php echo $global['webSiteRootURL']; ?>mvideos?video_id=<?php echo $value['id']; ?>');return false;" class="text-primary">
|
||||
<i class="fa fa-edit"></i> <?php echo __("Edit Video"); ?>
|
||||
</a>
|
||||
</div>
|
||||
|
|
|
@ -221,7 +221,7 @@ if ($obj->BigVideo && empty($_GET['showOnly'])) {
|
|||
</div>
|
||||
<?php if (Video::canEdit($videoRow['id'])) { ?>
|
||||
<div>
|
||||
<a href="<?php echo $global['webSiteRootURL']; ?>mvideos?video_id=<?php echo $videoRow['id']; ?>" class="text-primary"><i class="fa fa-edit"></i> <?php echo __("Edit Video"); ?></a>
|
||||
<a href="#" onclick="avideoModalIframe('<?php echo $global['webSiteRootURL']; ?>mvideos?video_id=<?php echo $videoRow['id']; ?>');return false;" class="text-primary"><i class="fa fa-edit"></i> <?php echo __("Edit Video"); ?></a>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<?php if (!empty($videoRow['trailer1'])) { ?>
|
||||
|
|
|
@ -1,24 +1,8 @@
|
|||
<!-- Modal -->
|
||||
<div id="TrailerModal" class="modal fade" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
<!-- Modal content-->
|
||||
<div class="modal-content">
|
||||
<div class="modal-body">
|
||||
<div class="embed-responsive embed-responsive-16by9">
|
||||
<iframe class="embed-responsive-item" frameborder="0"></iframe>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="<?php echo $global['webSiteRootURL']; ?>plugin/Gallery/script.js" type="text/javascript"></script>
|
||||
<?php include $global['systemRootPath'] . 'view/include/footer.php'; ?>
|
||||
<script>
|
||||
$('#TrailerModal').modal({show: false});
|
||||
function showTrailer(iframe) {
|
||||
$('#TrailerModal iframe').attr('src', iframe);
|
||||
$('#TrailerModal').modal("show");
|
||||
return false;
|
||||
avideoModalIframe(iframe);
|
||||
}
|
||||
$('#TrailerModal').on('hidden.bs.modal', function () {
|
||||
$('#TrailerModal iframe').attr('src', '');
|
||||
|
|
|
@ -115,6 +115,7 @@
|
|||
$container.on('append.infiniteScroll', function (event, response, path, items) {
|
||||
//console.log('Append page: ' + path);
|
||||
lazyImage();
|
||||
avideoSocket();
|
||||
<?php
|
||||
if($obj->playVideoOnFullscreenOnIframe){
|
||||
echo "if(typeof linksToFullscreen === 'function'){ linksToFullscreen('a.galleryLink');}";
|
||||
|
|
|
@ -40,6 +40,7 @@ class Layout extends PluginAbstract {
|
|||
$obj->showCustomCSS = true;
|
||||
*
|
||||
*/
|
||||
$obj->showButtonNotification = false;
|
||||
return $obj;
|
||||
}
|
||||
|
||||
|
@ -230,5 +231,14 @@ class Layout extends PluginAbstract {
|
|||
$LayoutaddFooterCode = array_unique($LayoutaddFooterCode);
|
||||
return implode(PHP_EOL, $LayoutaddFooterCode);
|
||||
}
|
||||
|
||||
public function getHTMLMenuRight() {
|
||||
global $global;
|
||||
$obj = $this->getDataObject();
|
||||
if(empty($obj->showButtonNotification)){
|
||||
return false;
|
||||
}
|
||||
include $global['systemRootPath'] . 'plugin/Layout/menuRight.php';
|
||||
}
|
||||
|
||||
}
|
||||
|
|
24
plugin/Layout/menuRight.php
Normal file
24
plugin/Layout/menuRight.php
Normal file
|
@ -0,0 +1,24 @@
|
|||
<script src="<?php echo $global['webSiteRootURL']; ?>plugin/Layout/notifications.js" type="text/javascript"></script>
|
||||
<style>
|
||||
#LayoutNotification .navbar-btn .LayoutNotificationCount{
|
||||
background: rgba(255,0,0,1); color: #FFF;
|
||||
}
|
||||
#LayoutNotificationItems li{
|
||||
margin-right: 0;
|
||||
}
|
||||
#LayoutNotificationItems .notificationLink{
|
||||
display: inline-flex;
|
||||
padding: 5px;
|
||||
}
|
||||
#LayoutNotificationItems .notificationLink img{
|
||||
margin: 2px 10px 2px 5px;
|
||||
max-width: 38px;
|
||||
}
|
||||
</style>
|
||||
<li class="dropdown" id="LayoutNotification">
|
||||
<a href="#" class=" btn btn-default navbar-btn" data-toggle="dropdown">
|
||||
<i class="fa fa-bell"></i>
|
||||
<span class="badge LayoutNotificationCount" >0</span>
|
||||
</a>
|
||||
<ul class="dropdown-menu dropdown-menu-right notify-drop" id="LayoutNotificationItems"></ul>
|
||||
</li>
|
60
plugin/Layout/notifications.js
Normal file
60
plugin/Layout/notifications.js
Normal file
|
@ -0,0 +1,60 @@
|
|||
|
||||
var avideoNotifications = [
|
||||
{title: 'test 1', text: 'text 1', image: 'http://192.168.1.4/YouPHPTube/videos/userPhoto/photo1.png', link: 'https://google.com'},
|
||||
{title: 'test 2', text: 'text 2', image: 'http://192.168.1.4/YouPHPTube/videos/userPhoto/photo2.png', link: 'https://yahoo.com'}
|
||||
];
|
||||
|
||||
$(document).ready(function () {
|
||||
var avideoNotificationsCookie = Cookies.get('avideoNotifications');
|
||||
if (typeof avideoNotificationsCookie !== 'undefined') {
|
||||
//avideoNotifications = avideoNotificationsCookie;
|
||||
}
|
||||
processNotifications();
|
||||
});
|
||||
|
||||
function processNotifications() {
|
||||
console.log('processNotifications', avideoNotifications);
|
||||
$('.LayoutNotificationCount').text(avideoNotifications.length);
|
||||
$('#LayoutNotificationItems').empty();
|
||||
for (var item in avideoNotifications) {
|
||||
if (typeof avideoNotifications[item] == 'function') {
|
||||
continue;
|
||||
}
|
||||
|
||||
var html = '<li>';
|
||||
html += '<a href="'+avideoNotifications[item].link+'" class="notificationLink">';
|
||||
html += '<img src="'+avideoNotifications[item].image+'" class="img img-circle img-responsive">';
|
||||
html += '<div>'+avideoNotifications[item].text+'</div>';
|
||||
html += '</a></li>';
|
||||
|
||||
$('#LayoutNotificationItems').prepend(html);
|
||||
console.log('processNotifications item', item);
|
||||
console.log('processNotifications', avideoNotifications[item]);
|
||||
}
|
||||
}
|
||||
|
||||
function addNotification(title, text, image, link) {
|
||||
var obj = {title: title, text: text, image: image, link:link};
|
||||
console.log('addNotification type', typeof avideoNotifications);
|
||||
console.log('addNotification=', avideoNotifications);
|
||||
console.log('addNotification', obj);
|
||||
avideoNotifications.push(obj);
|
||||
/*
|
||||
Cookies.set('avideoNotifications', avideoNotifications, {
|
||||
path: '/',
|
||||
expires: 365
|
||||
});
|
||||
*
|
||||
*/
|
||||
}
|
||||
|
||||
function removeNotification(index) {
|
||||
avideoNotifications.splice(index, 1);
|
||||
/*
|
||||
Cookies.set('avideoNotifications', avideoNotifications, {
|
||||
path: '/',
|
||||
expires: 365
|
||||
});
|
||||
*
|
||||
*/
|
||||
}
|
|
@ -54,7 +54,7 @@ class Live extends PluginAbstract {
|
|||
}
|
||||
|
||||
public function getPluginVersion() {
|
||||
return "5.3";
|
||||
return "7.0";
|
||||
}
|
||||
|
||||
public function updateScript() {
|
||||
|
@ -111,7 +111,6 @@ class Live extends PluginAbstract {
|
|||
sqlDal::writeSql(trim($value));
|
||||
}
|
||||
}
|
||||
//update version 5.2
|
||||
if (AVideoPlugin::compareVersion($this->getName(), "6.0") < 0) {
|
||||
$sqls = file_get_contents($global['systemRootPath'] . 'plugin/Live/install/updateV6.0.sql');
|
||||
$sqlParts = explode(";", $sqls);
|
||||
|
@ -119,6 +118,13 @@ class Live extends PluginAbstract {
|
|||
sqlDal::writeSql(trim($value));
|
||||
}
|
||||
}
|
||||
if (AVideoPlugin::compareVersion($this->getName(), "7.0") < 0) {
|
||||
$sqls = file_get_contents($global['systemRootPath'] . 'plugin/Live/install/updateV7.0.sql');
|
||||
$sqlParts = explode(";", $sqls);
|
||||
foreach ($sqlParts as $value) {
|
||||
sqlDal::writeSql(trim($value));
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -1505,5 +1511,9 @@ class Live extends PluginAbstract {
|
|||
}
|
||||
return $videos;
|
||||
}
|
||||
|
||||
static function finishLive($key){
|
||||
$lh = LiveTransmitionHistory::finish($key);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@ require_once dirname(__FILE__) . '/../../../objects/user.php';
|
|||
|
||||
class LiveTransmitionHistory extends ObjectYPT {
|
||||
|
||||
protected $id, $title, $description, $key, $created, $modified, $users_id, $live_servers_id;
|
||||
protected $id, $title, $description, $key, $created, $modified, $users_id, $live_servers_id, $finished;
|
||||
|
||||
static function getSearchFieldsNames() {
|
||||
return array('title', 'description');
|
||||
|
@ -47,7 +47,11 @@ class LiveTransmitionHistory extends ObjectYPT {
|
|||
function setId($id) {
|
||||
$this->id = $id;
|
||||
}
|
||||
|
||||
|
||||
function getFinished() {
|
||||
return $this->finished;
|
||||
}
|
||||
|
||||
function setTitle($title) {
|
||||
global $global;
|
||||
$title = $global['mysqli']->real_escape_string($title);
|
||||
|
@ -231,9 +235,13 @@ class LiveTransmitionHistory extends ObjectYPT {
|
|||
return $rows;
|
||||
}
|
||||
|
||||
static function getLatest($key) {
|
||||
static function getLatest($key, $live_servers_id=null) {
|
||||
global $global;
|
||||
$sql = "SELECT * FROM " . static::getTableName() . " WHERE `key` = ? ORDER BY created DESC LIMIT 1";
|
||||
$sql = "SELECT * FROM " . static::getTableName() . " WHERE `key` = ? ";
|
||||
if(isset($live_servers_id)){
|
||||
$sql .= " AND live_servers_id = ".intval($live_servers_id);
|
||||
}
|
||||
$sql .= " ORDER BY created DESC LIMIT 1";
|
||||
// I had to add this because the about from customize plugin was not loading on the about page http://127.0.0.1/AVideo/about
|
||||
|
||||
$res = sqlDAL::readSql($sql, "s", array($key));
|
||||
|
@ -246,6 +254,28 @@ class LiveTransmitionHistory extends ObjectYPT {
|
|||
}
|
||||
return $row;
|
||||
}
|
||||
|
||||
static function finish($key) {
|
||||
$row = self::getLatest($key);
|
||||
if(empty($row) || empty($row['id']) || !empty($row['finished'])){
|
||||
return false;
|
||||
}
|
||||
|
||||
return self::finishFromTransmitionHistoryId($row['id']);
|
||||
}
|
||||
|
||||
static function finishFromTransmitionHistoryId($live_transmitions_history_id) {
|
||||
$live_transmitions_history_id = intval($live_transmitions_history_id);
|
||||
if(empty($live_transmitions_history_id)){
|
||||
return false;
|
||||
}
|
||||
|
||||
$sql = "UPDATE " . static::getTableName() . " SET finished = now() WHERE id = {$live_transmitions_history_id} ";
|
||||
|
||||
$insert_row = sqlDAL::writeSql($sql);
|
||||
|
||||
return $row;
|
||||
}
|
||||
|
||||
static function getLatestFromUser($users_id) {
|
||||
global $global;
|
||||
|
|
|
@ -109,6 +109,7 @@ if (!empty($chat2) && !empty($chat2->useStaticLayout)) {
|
|||
$activeServerFound = false;
|
||||
if (!$obj->useLiveServers) {
|
||||
$activeServerFound = true;
|
||||
$_REQUEST['live_servers_id'] = 0;
|
||||
?>
|
||||
<li class="active">
|
||||
<a href="<?php echo $global['webSiteRootURL']; ?>plugin/Live/?live_servers_id=0">
|
||||
|
@ -118,6 +119,7 @@ if (!empty($chat2) && !empty($chat2->useStaticLayout)) {
|
|||
<?php
|
||||
} else {
|
||||
$servers = Live::getAllServers();
|
||||
$activeFound = false;
|
||||
foreach ($servers as $key => $value) {
|
||||
$active = "";
|
||||
if (isset($_REQUEST['live_servers_id'])) {
|
||||
|
@ -144,17 +146,21 @@ if (!empty($chat2) && !empty($chat2->useStaticLayout)) {
|
|||
<?php
|
||||
}
|
||||
}
|
||||
if (empty($activeServerFound)) {
|
||||
?>
|
||||
<li>
|
||||
<a href="<?php echo $global['webSiteRootURL']; ?>plugin/Live/view/editor.php" class="btn btn-danger">
|
||||
<i class="fas fa-exclamation-triangle"></i> <?php echo __("Server not found or inactive"); ?>
|
||||
</a>
|
||||
</li>
|
||||
<?php
|
||||
if (empty($activeServerFound)) {
|
||||
if(!empty($servers[0])){
|
||||
$_REQUEST['live_servers_id'] = $servers[0]['id'];
|
||||
}else{
|
||||
?>
|
||||
<li>
|
||||
<a href="<?php echo $global['webSiteRootURL']; ?>plugin/Live/view/editor.php" class="btn btn-danger">
|
||||
<i class="fas fa-exclamation-triangle"></i> <?php echo __("Server not found or inactive"); ?>
|
||||
</a>
|
||||
</li>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
|
||||
$_REQUEST['live_servers_id'] = Live::getLiveServersIdRequest();
|
||||
$getLiveKey['live_servers_id'] = $_REQUEST['live_servers_id'];
|
||||
$poster = Live::getPosterImage(User::getId(), $_REQUEST['live_servers_id']);
|
||||
?>
|
||||
</ul>
|
||||
|
|
|
@ -74,6 +74,7 @@ CREATE TABLE IF NOT EXISTS `live_transmitions_history` (
|
|||
`modified` DATETIME NULL,
|
||||
`users_id` INT(11) NOT NULL,
|
||||
`live_servers_id` INT(11) NULL DEFAULT NULL,
|
||||
`finished` DATETIME NULL DEFAULT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
INDEX `fk_live_transmitions_history_users_idx` (`users_id` ASC),
|
||||
INDEX `fk_live_transmitions_history_live_servers1_idx` (`live_servers_id` ASC),
|
||||
|
|
2
plugin/Live/install/updateV7.0.sql
Normal file
2
plugin/Live/install/updateV7.0.sql
Normal file
|
@ -0,0 +1,2 @@
|
|||
ALTER TABLE `live_transmitions_history`
|
||||
ADD COLUMN `finished` DATETIME NULL DEFAULT NULL;
|
|
@ -122,7 +122,7 @@ include $global['systemRootPath'] . 'plugin/Meet/api.js.php';
|
|||
on_meetStop();
|
||||
modal.hidePleaseWait();
|
||||
} else {
|
||||
aVideoMeetStart('<?php echo $domain; ?>', response.roomName, response.jwt, '<?php echo User::getEmail_(); ?>', '<?php echo User::getNameIdentification(); ?>', <?php echo json_encode(Meet::getButtons(0)); ?>);
|
||||
aVideoMeetStart('<?php echo $domain; ?>', response.roomName, response.jwt, '<?php echo User::getEmail_(); ?>', '<?php echo addcslashes(User::getNameIdentification(), "'"); ?>', <?php echo json_encode(Meet::getButtons(0)); ?>);
|
||||
|
||||
meetPassword = response.password;
|
||||
$('#meetPassword').val(meetPassword);
|
||||
|
|
|
@ -46,6 +46,7 @@ if (strpos($_GET['p'], '/') !== false) {
|
|||
|
||||
|
||||
$row = LiveTransmitionHistory::getLatest($_POST['name']);
|
||||
LiveTransmitionHistory::finishFromTransmitionHistoryId($row['id']);
|
||||
$array = setLiveKey($row['key'], $row['live_servers_id']);
|
||||
$array['stats'] = LiveTransmitionHistory::getStatsAndRemoveApplication($row['id']);
|
||||
$socketObj = sendSocketMessageToAll($array, "socketLiveOFFCallback");
|
||||
|
|
|
@ -38,6 +38,7 @@ if (AVideoPlugin::isEnabledByName('YPTSocket')) {
|
|||
break;
|
||||
}
|
||||
}
|
||||
$array['live_transmitions_history_id'] = $liveTransmitionHistory_id;
|
||||
if ($is200) {
|
||||
$array['stats'] = LiveTransmitionHistory::getStatsAndAddApplication($liveTransmitionHistory_id);
|
||||
} else {
|
||||
|
|
|
@ -329,6 +329,17 @@ if (!empty($obj->playLiveInFullScreenOnIframe)) {
|
|||
$('.live_' + json.live_servers_id + "_" + json.key).slideDown();
|
||||
var selector = '#liveViewStatusID_' + json.key + '_' + json.live_servers_id;
|
||||
onlineLabelOnline(selector);
|
||||
|
||||
// update the chat if the history changes
|
||||
var IframeClass = ".yptchat2IframeClass_"+json.key+"_"+json.live_servers_id;
|
||||
if($( IframeClass ).length){
|
||||
var src = $( IframeClass ).attr('src');
|
||||
if(src){
|
||||
avideoToast('Loading new chat');
|
||||
var newSRC = addGetParam(src, 'live_transmitions_history_id', json.live_transmitions_history_id);
|
||||
$( IframeClass ).attr('src', newSRC);
|
||||
}
|
||||
}
|
||||
}
|
||||
function socketLiveOFFCallback(json) {
|
||||
console.log('socketLiveOFFCallback', json);
|
||||
|
|
|
@ -4,7 +4,7 @@ class PlayListElement {
|
|||
|
||||
public $name, $description, $duration, $sources, $thumbnail, $poster, $videoStartSeconds, $created, $likes, $views, $videos_id;
|
||||
|
||||
function __construct($name, $description, $duration, $playListSource, $playListThumbnail, $poster, $videoStartSeconds, $created, $likes, $views, $videos_id) {
|
||||
function __construct($name, $description, $duration, $playListSource, $playListThumbnail, $poster, $videoStartSeconds, $created, $likes, $views, $videos_id, $className='') {
|
||||
$this->name = $name;
|
||||
$this->description = $description;
|
||||
$this->setDuration($duration);
|
||||
|
@ -16,6 +16,7 @@ class PlayListElement {
|
|||
$this->likes = $likes;
|
||||
$this->views = $views;
|
||||
$this->videos_id = $videos_id;
|
||||
$this->className = $className;
|
||||
}
|
||||
|
||||
|
||||
|
@ -74,6 +75,12 @@ class playListSource {
|
|||
|
||||
function __construct($src, $youtube = false) {
|
||||
$this->src = $src;
|
||||
$this->label = getResolutionFromFilename($src);
|
||||
if(empty($this->label)){
|
||||
$this->label = 'Auto';
|
||||
}else{
|
||||
$this->label .= 'p';
|
||||
}
|
||||
if($youtube){
|
||||
$this->type = "video/youtube";
|
||||
}else{
|
||||
|
|
|
@ -98,6 +98,10 @@ class PlayLists extends PluginAbstract {
|
|||
|
||||
$css = '<link href="' . $global['webSiteRootURL'] . 'plugin/PlayLists/style.css" rel="stylesheet" type="text/css"/>';
|
||||
$css .= '<style>.epgProgress.progress-bar-primary{opacity: 0.5;}.epgProgress:hover{opacity: 1.0;}.epgProgressText{border-right: 1px solid #FFF; height:100%;}</style>';
|
||||
|
||||
if(!empty(getPlaylists_id())){
|
||||
$css .= "<link href=\"{$global['webSiteRootURL']}plugin/PlayLists/playerButton.css\" rel=\"stylesheet\" type=\"text/css\"/>";
|
||||
}
|
||||
|
||||
return $css;
|
||||
}
|
||||
|
@ -123,6 +127,10 @@ class PlayLists extends PluginAbstract {
|
|||
}
|
||||
}
|
||||
|
||||
if(!empty(getPlaylists_id())){
|
||||
PlayerSkins::getStartPlayerJS(file_get_contents("{$global['systemRootPath']}plugin/PlayLists/playerButton.js"));
|
||||
}
|
||||
|
||||
return $js;
|
||||
}
|
||||
|
||||
|
@ -194,8 +202,9 @@ class PlayLists extends PluginAbstract {
|
|||
$video = self::isPlayListASerie($serie_playlists_id);
|
||||
if (!empty($video)) {
|
||||
$video = new Video("", "", $video['id']);
|
||||
$video->delete();
|
||||
return $video->delete();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
static function saveSerie($serie_playlists_id) {
|
||||
|
@ -281,6 +290,14 @@ class PlayLists extends PluginAbstract {
|
|||
</div>
|
||||
</li>';
|
||||
}
|
||||
$str .= '<li>
|
||||
<div>
|
||||
<a href="' . "{$global['webSiteRootURL']}plugin/PlayLists/managerPlaylists.php" . '" class="btn btn-default btn-block" style="border-radius: 0;">
|
||||
<i class="fas fa-list"></i>
|
||||
' . __("Organize") . ' ' .$obj->name . '
|
||||
</a>
|
||||
</div>
|
||||
</li>';
|
||||
return $str;
|
||||
}
|
||||
|
||||
|
@ -480,10 +497,10 @@ class PlayLists extends PluginAbstract {
|
|||
if (!self::canManagePlaylist($playlists_id)) {
|
||||
return "";
|
||||
}
|
||||
$input = __('Show on TV') . '<div class="material-switch" style="margin:0 10px;">
|
||||
$input = '<i class="fas fa-tv" style="margin:2px 5px;"></i> <span class="hidden-xs hidden-sm">'.__('Show on TV') . '</span> <div class="material-switch material-small" style="margin:0 10px;">
|
||||
<input class="ShowOnTVSwitch" data-toggle="toggle" type="checkbox" id="ShowOnTVSwitch' . $playlists_id . '" name="ShowOnTVSwitch' . $playlists_id . '" value="1" ' . (self::showOnTV($playlists_id) ? "checked" : "") . ' onchange="saveShowOnTV(' . $playlists_id . ', $(this).is(\':checked\'))" >
|
||||
<label for="ShowOnTVSwitch' . $playlists_id . '" class="label-primary"></label>
|
||||
</div> ';
|
||||
<label for="ShowOnTVSwitch' . $playlists_id . '" class="label-primary" data-toggle="tooltip" title="'.__('Show on TV').'"></label>
|
||||
</div>';
|
||||
return $input;
|
||||
}
|
||||
|
||||
|
|
15
plugin/PlayLists/collections.php
Normal file
15
plugin/PlayLists/collections.php
Normal file
|
@ -0,0 +1,15 @@
|
|||
<?php
|
||||
global $global, $config;
|
||||
if (!isset($global['systemRootPath'])) {
|
||||
require_once '../../videos/configuration.php';
|
||||
}
|
||||
require_once $global['systemRootPath'] . 'objects/playlist.php';
|
||||
require_once $global['systemRootPath'] . 'plugin/PlayLists/PlayListElement.php';
|
||||
|
||||
if (!User::isAdmin() && !PlayList::canSee($_GET['playlists_id'], User::getId())) {
|
||||
die('{"error":"' . __("Permission denied") . '"}');
|
||||
}
|
||||
|
||||
$playList = PlayList::getVideosFromPlaylist($_GET['playlists_id']);
|
||||
|
||||
|
|
@ -2,6 +2,7 @@
|
|||
global $global, $config;
|
||||
global $isEmbed;
|
||||
$isEmbed = 1;
|
||||
$isPlayList = 1;
|
||||
if (!isset($global['systemRootPath'])) {
|
||||
require_once '../../videos/configuration.php';
|
||||
}
|
||||
|
@ -13,35 +14,80 @@ if (!empty($objSecure)) {
|
|||
require_once $global['systemRootPath'] . 'objects/playlist.php';
|
||||
require_once $global['systemRootPath'] . 'plugin/PlayLists/PlayListElement.php';
|
||||
|
||||
if (!PlayList::canSee($_GET['playlists_id'], User::getId())) {
|
||||
if (!User::isAdmin() && !PlayList::canSee($_GET['playlists_id'], User::getId())) {
|
||||
die('{"error":"' . __("Permission denied") . '"}');
|
||||
}
|
||||
|
||||
$playlist_index = intval(@$_REQUEST['playlist_index']);
|
||||
|
||||
$pl = new PlayList($_GET['playlists_id']);
|
||||
|
||||
$playList = PlayList::getVideosFromPlaylist($_GET['playlists_id']);
|
||||
|
||||
$playListData = array();
|
||||
$collectionsList = PlayList::showPlayListSelector($playList);
|
||||
$videoStartSeconds = array();
|
||||
foreach ($playList as $value) {
|
||||
$oldValue = $value;
|
||||
if ($oldValue['type'] === 'serie' && !empty($oldValue['serie_playlists_id'])) {
|
||||
$subPlayList = PlayList::getVideosFromPlaylist($value['serie_playlists_id']);
|
||||
foreach ($subPlayList as $value) {
|
||||
$sources = getVideosURL($value['filename']);
|
||||
$images = Video::getImageFromFilename($value['filename'], $value['type']);
|
||||
$externalOptions = json_decode($value['externalOptions']);
|
||||
|
||||
$sources = getVideosURL($value['filename']);
|
||||
$images = Video::getImageFromFilename($value['filename'], $value['type']);
|
||||
$externalOptions = json_decode($value['externalOptions']);
|
||||
$src = new stdClass();
|
||||
$src->src = $images->thumbsJpg;
|
||||
$thumbnail = array();
|
||||
$thumbnail[] = $src;
|
||||
|
||||
$src = new stdClass();
|
||||
$src->src = $images->thumbsJpg;
|
||||
$thumbnail = array($src);
|
||||
$playListSources = array();
|
||||
foreach ($sources as $value2) {
|
||||
if ($value2['type'] !== 'video' && $value2['type'] !== 'audio') {
|
||||
continue;
|
||||
}
|
||||
$playListSources[] = new playListSource($value2['url']);
|
||||
}
|
||||
if (empty($playListSources)) {
|
||||
continue;
|
||||
}
|
||||
$playListData[] = new PlayListElement($value['title'], $value['description'], $value['duration'], $playListSources, $thumbnail, $images->poster, parseDurationToSeconds(@$externalOptions->videoStartSeconds), $value['cre'], $value['likes'], $value['views_count'], $value['videos_id'], "embedPlayList subPlaylistCollection-{$oldValue['serie_playlists_id']}");
|
||||
}
|
||||
} else {
|
||||
$sources = getVideosURL($value['filename']);
|
||||
$images = Video::getImageFromFilename($value['filename'], $value['type']);
|
||||
$externalOptions = json_decode($value['externalOptions']);
|
||||
|
||||
$playListSources = array();
|
||||
foreach ($sources as $value2) {
|
||||
if ($value2['type'] !== 'video' && $value2['type'] !== 'audio') {
|
||||
$src = new stdClass();
|
||||
$src->src = $images->thumbsJpg;
|
||||
$thumbnail = array();
|
||||
$thumbnail[] = $src;
|
||||
|
||||
$playListSources = array();
|
||||
foreach ($sources as $value2) {
|
||||
if ($value2['type'] !== 'video' && $value2['type'] !== 'audio') {
|
||||
continue;
|
||||
}
|
||||
$playListSources[] = new playListSource($value2['url']);
|
||||
}
|
||||
if (empty($playListSources)) {
|
||||
continue;
|
||||
}
|
||||
$playListSources[] = new playListSource($value2['url']);
|
||||
$playListData[] = new PlayListElement($value['title'], $value['description'], $value['duration'], $playListSources, $thumbnail, $images->poster, parseDurationToSeconds(@$externalOptions->videoStartSeconds), $value['cre'], $value['likes'], $value['views_count'], $value['videos_id'], "embedPlayList ");
|
||||
}
|
||||
if (empty($playListSources)) {
|
||||
continue;
|
||||
}
|
||||
$playListData[] = new PlayListElement($value['title'], $value['description'], $value['duration'], $playListSources, $thumbnail, $images->poster, parseDurationToSeconds(@$externalOptions->videoStartSeconds), $value['cre'], $value['likes'], $value['views_count'], $value['videos_id']);
|
||||
}
|
||||
|
||||
if (empty($playListData)) {
|
||||
forbiddenPage(__("The program is empty"));
|
||||
}
|
||||
|
||||
$url = PlayLists::getLink($pl->getId());
|
||||
$title = $pl->getName();
|
||||
|
||||
if($serie = PlayLists::isPlayListASerie($pl->getId())){
|
||||
setVideos_id($serie['id']);
|
||||
}else if(!empty($playList[$playlist_index])){
|
||||
setVideos_id($playList[$playlist_index]['id']);
|
||||
}
|
||||
//var_dump($playListData);exit;
|
||||
?>
|
||||
|
@ -89,6 +135,35 @@ foreach ($playList as $value) {
|
|||
.vjs-control-bar{
|
||||
z-index: 1;
|
||||
}
|
||||
.form-control{
|
||||
background-color: #333 !important;
|
||||
color: #AAA !important;
|
||||
}
|
||||
|
||||
#playListHolder{
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 0;
|
||||
width: 30%;
|
||||
max-width: 320px;
|
||||
height: 100%;
|
||||
overflow-y: scroll;
|
||||
margin-right: 0;
|
||||
background-color: #00000077;
|
||||
}
|
||||
#playList{
|
||||
margin-top: 40px;
|
||||
margin-bottom: 60px;
|
||||
}
|
||||
#playListFilters{
|
||||
width: 30%;
|
||||
max-width: 320px;
|
||||
display: inline-flex;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
right: 0;
|
||||
z-index: 1;
|
||||
}
|
||||
</style>
|
||||
|
||||
<?php
|
||||
|
@ -98,29 +173,44 @@ foreach ($playList as $value) {
|
|||
|
||||
<body>
|
||||
<video style="width: 100%; height: 100%;" playsinline
|
||||
<?php if ($config->getAutoplay() && false) { // disable it for now ?>
|
||||
<?php if ($config->getAutoplay() && false) { // disable it for now ?>
|
||||
autoplay="true"
|
||||
muted="muted"
|
||||
<?php } ?>
|
||||
preload="auto"
|
||||
controls class="embed-responsive-item video-js vjs-default-skin vjs-big-play-centered" id="mainVideo">
|
||||
</video>
|
||||
<button class="btn btn-sm btn-xs btn-default" style="position: absolute; top: 5px; right:35%;" id="closeButton"><i class="fas fa-times-circle"></i></button>
|
||||
<div style="position: absolute; right: 0; top: 0; width: 35%; height: 100%; overflow-y: scroll; margin-right: 0; " id="playListHolder">
|
||||
<input type="search" id="playListSearch" class="form-control" placeholder=" <?php echo __("Search"); ?>"/>
|
||||
<select class="form-control" id="embededSortBy" >
|
||||
<option value="default"> <?php echo __("Default"); ?></option>
|
||||
<option value="titleAZ" data-icon="glyphicon-sort-by-attributes"> <?php echo __("Title (A-Z)"); ?></option>
|
||||
<option value="titleZA" data-icon="glyphicon-sort-by-attributes-alt"> <?php echo __("Title (Z-A)"); ?></option>
|
||||
<option value="newest" data-icon="glyphicon-sort-by-attributes"> <?php echo __("Date added (newest)"); ?></option>
|
||||
<option value="oldest" data-icon="glyphicon-sort-by-attributes-alt" > <?php echo __("Date added (oldest)"); ?></option>
|
||||
<option value="popular" data-icon="glyphicon-thumbs-up"> <?php echo __("Most popular"); ?></option>
|
||||
<div style="display: none;" id="playListHolder">
|
||||
<div id="playListFilters">
|
||||
<?php
|
||||
if (empty($advancedCustom->doNotDisplayViews)) {
|
||||
?>
|
||||
<option value="views_count" data-icon="glyphicon-eye-open" <?php echo (!empty($_POST['sort']['views_count'])) ? "selected='selected'" : "" ?>> <?php echo __("Most watched"); ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
if (!empty($collectionsList)) {
|
||||
?>
|
||||
<select class="form-control" id="subPlaylistsCollection" >
|
||||
<option value="0"> <?php echo __("Show all"); ?></option>
|
||||
<?php
|
||||
foreach ($collectionsList as $value) {
|
||||
echo '<option value="' . $value['serie_playlists_id'] . '">' . $value['title'] . '</option>';
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<input type="search" id="playListSearch" class="form-control" placeholder=" <?php echo __("Search"); ?>"/>
|
||||
<select class="form-control" id="embededSortBy" >
|
||||
<option value="default"> <?php echo __("Sort"); ?></option>
|
||||
<option value="titleAZ" data-icon="glyphicon-sort-by-attributes"> <?php echo __("Title (A-Z)"); ?></option>
|
||||
<option value="titleZA" data-icon="glyphicon-sort-by-attributes-alt"> <?php echo __("Title (Z-A)"); ?></option>
|
||||
<option value="newest" data-icon="glyphicon-sort-by-attributes"> <?php echo __("Date added (newest)"); ?></option>
|
||||
<option value="oldest" data-icon="glyphicon-sort-by-attributes-alt" > <?php echo __("Date added (oldest)"); ?></option>
|
||||
<option value="popular" data-icon="glyphicon-thumbs-up"> <?php echo __("Most popular"); ?></option>
|
||||
<?php
|
||||
if (empty($advancedCustom->doNotDisplayViews)) {
|
||||
?>
|
||||
<option value="views_count" data-icon="glyphicon-eye-open" <?php echo (!empty($_POST['sort']['views_count'])) ? "selected='selected'" : "" ?>> <?php echo __("Most watched"); ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
<div class="vjs-playlist" style="" id="playList">
|
||||
<!--
|
||||
The contents of this element will be filled based on the
|
||||
|
@ -131,13 +221,8 @@ foreach ($playList as $value) {
|
|||
|
||||
<script src="<?php echo $global['webSiteRootURL']; ?>view/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
|
||||
<?php
|
||||
include $global['systemRootPath'] . 'view/include/video.min.js.php';
|
||||
?>
|
||||
<?php
|
||||
echo AVideoPlugin::afterVideoJS();
|
||||
?>
|
||||
<?php
|
||||
$jsFiles = array();
|
||||
$jsFiles[] = "view/js/BootstrapMenu.min.js";
|
||||
$jsFiles[] = "view/js/seetalert/sweetalert.min.js";
|
||||
$jsFiles[] = "view/js/bootpag/jquery.bootpag.min.js";
|
||||
$jsFiles[] = "view/js/bootgrid/jquery.bootgrid.js";
|
||||
|
@ -147,33 +232,82 @@ foreach ($playList as $value) {
|
|||
$jsFiles[] = "view/css/flagstrap/js/jquery.flagstrap.min.js";
|
||||
$jsFiles[] = "view/js/jquery.lazy/jquery.lazy.min.js";
|
||||
$jsFiles[] = "view/js/jquery.lazy/jquery.lazy.plugins.min.js";
|
||||
$jsFiles[] = "view/js/jquery-ui/jquery-ui.min.js";
|
||||
$jsFiles[] = "view/js/jquery-toast/jquery.toast.min.js";
|
||||
$jsFiles[] = "view/bootstrap/js/bootstrap.min.js";
|
||||
$jsURL = combineFiles($jsFiles, "js");
|
||||
?>
|
||||
<script src="<?php echo $global['webSiteRootURL']; ?>view/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
|
||||
<script src="<?php echo $jsURL; ?>" type="text/javascript"></script>
|
||||
<?php
|
||||
echo AVideoPlugin::getFooterCode();
|
||||
include $global['systemRootPath'] . 'view/include/video.min.js.php';
|
||||
?>
|
||||
|
||||
<script src="<?php echo $global['webSiteRootURL']; ?>plugin/PlayLists/videojs-playlist/videojs-playlist.js"></script>
|
||||
<script src="<?php echo $global['webSiteRootURL']; ?>plugin/PlayLists/videojs-playlist-ui/videojs-playlist-ui.js"></script>
|
||||
<script>
|
||||
if (typeof player === 'undefined') {
|
||||
player = videojs('mainVideo');
|
||||
}
|
||||
|
||||
var playerPlaylist = <?php echo json_encode($playListData); ?>;
|
||||
var originalPlayerPlaylist = playerPlaylist;
|
||||
var updatePLSourcesTimeout;
|
||||
function updatePLSources(_index){
|
||||
clearTimeout(updatePLSourcesTimeout);
|
||||
if (typeof player.updateSrc == 'function' && playerPlaylist[_index].sources != 'undefined') {
|
||||
player.updateSrc(playerPlaylist[_index].sources);
|
||||
}else{
|
||||
updatePLSourcesTimeout = setTimeout(function () {
|
||||
updatePLSources(_index);
|
||||
}, 500);
|
||||
return false;
|
||||
}
|
||||
setTimeout(function () {
|
||||
userIsControling = false;
|
||||
if(typeof player.ima != 'undefined'){
|
||||
console.log('updatePLSources ADs reloaded');
|
||||
player.ima.requestAds();
|
||||
}
|
||||
if (typeof playerPlaylist[index] !== 'undefined') {
|
||||
playerPlay(playerPlaylist[index].videoStartSeconds);
|
||||
}
|
||||
}, 500);
|
||||
}
|
||||
|
||||
player.playlist(playerPlaylist);
|
||||
<?php
|
||||
$str = "player.playlist(playerPlaylist);
|
||||
player.playlist.autoadvance(0);
|
||||
player.on('play', function () {
|
||||
//console.log(player.playlist.currentIndex());
|
||||
//console.log(playerPlaylist[player.playlist.currentIndex()].videos_id);
|
||||
addView(playerPlaylist[player.playlist.currentIndex()].videos_id, 0);
|
||||
});
|
||||
// Initialize the playlist-ui plugin with no option (i.e. the defaults).
|
||||
player.playlistUi();
|
||||
var timeout;
|
||||
player.on('playlistchange', function() {
|
||||
console.log('event playlistchange');
|
||||
});
|
||||
player.on('duringplaylistchange', function() {
|
||||
console.log('event duringplaylistchange');
|
||||
});
|
||||
player.on('playlistitem', function() {
|
||||
console.log('event playlistitem');
|
||||
var t = $(this);
|
||||
index = t.index();
|
||||
updatePLSources(index);
|
||||
});
|
||||
player.playlistUi();";
|
||||
if (!empty($playlist_index)) {
|
||||
$str .= 'player.playlist.currentItem(' . $playlist_index . ');';
|
||||
}
|
||||
$str .= "if (typeof playerPlaylist[0] !== 'undefined') {
|
||||
updatePLSources({$playlist_index});
|
||||
}
|
||||
$('.vjs-playlist-item ').click(function () {
|
||||
var t = $(this);
|
||||
index = t.index();
|
||||
updatePLSources(index);
|
||||
});";
|
||||
PlayerSkins::getStartPlayerJS($str);
|
||||
?>
|
||||
</script>
|
||||
<?php
|
||||
echo AVideoPlugin::afterVideoJS();
|
||||
?>
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
|
||||
$("#playListSearch").keyup(function () {
|
||||
|
@ -187,29 +321,6 @@ foreach ($playList as $value) {
|
|||
});
|
||||
});
|
||||
|
||||
timeout = setTimeout(function () {
|
||||
$('#playList, #embededSortBy, #playListSearch, #closeButton').fadeOut();
|
||||
}, 2000);
|
||||
$('#playListHolder').mouseenter(function () {
|
||||
$('#playList, #embededSortBy, #playListSearch, #closeButton').fadeIn();
|
||||
clearTimeout(timeout);
|
||||
});
|
||||
$('#playListHolder').mouseleave(function () {
|
||||
timeout = setTimeout(function () {
|
||||
$('#playList, #embededSortBy, #playListSearch, #closeButton').fadeOut();
|
||||
}, 3000);
|
||||
});
|
||||
|
||||
$('#closeButton').click(function () {
|
||||
$('#playList, #embededSortBy, #playListSearch, #closeButton').fadeOut();
|
||||
});
|
||||
|
||||
$('#embededSortBy').click(function () {
|
||||
setTimeout(function () {
|
||||
clearTimeout(timeout);
|
||||
}, 2000);
|
||||
});
|
||||
|
||||
$('#embededSortBy').change(function () {
|
||||
var value = $(this).val();
|
||||
playerPlaylist.sort(function (a, b) {
|
||||
|
@ -220,21 +331,24 @@ foreach ($playList as $value) {
|
|||
});
|
||||
});
|
||||
|
||||
$('#subPlaylistsCollection').change(function () {
|
||||
var value = parseInt($(this).val());
|
||||
console.log('subPlaylistsCollection', value);
|
||||
if (value) {
|
||||
var className = '.subPlaylistCollection-' + value;
|
||||
$(className).slideDown();
|
||||
$('.embedPlayList').not(className).slideUp();
|
||||
} else {
|
||||
$('.embedPlayList').slideDown();
|
||||
}
|
||||
});
|
||||
|
||||
//Prevent HTML5 video from being downloaded (right-click saved)?
|
||||
$('#mainVideo').bind('contextmenu', function () {
|
||||
return false;
|
||||
});
|
||||
|
||||
player.currentTime(playerPlaylist[0].videoStartSeconds);
|
||||
$(".vjs-playlist-item ").click(function () {
|
||||
index = $(this).index();
|
||||
setTimeout(function () {
|
||||
player.currentTime(playerPlaylist[index].videoStartSeconds);
|
||||
}, 500);
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
function compare(a, b, type) {
|
||||
console.log(a);
|
||||
console.log(b);
|
||||
|
@ -269,6 +383,39 @@ foreach ($playList as $value) {
|
|||
return s1 > s2 ? 1 : (s1 < s2 ? -1 : 0);
|
||||
}
|
||||
</script>
|
||||
<script>
|
||||
var topInfoTimeout;
|
||||
$(document).ready(function () {
|
||||
setInterval(function () {
|
||||
if (typeof player !== 'undefined') {
|
||||
if (!player.paused() && (!player.userActive() || !$('.vjs-control-bar').is(":visible") || $('.vjs-control-bar').css('opacity') == "0")) {
|
||||
$('#topInfo').fadeOut();
|
||||
} else {
|
||||
$('#topInfo').fadeIn();
|
||||
}
|
||||
}
|
||||
}, 200);
|
||||
|
||||
$("iframe, #topInfo").mouseover(function (e) {
|
||||
clearTimeout(topInfoTimeout);
|
||||
$('#mainVideo').addClass("vjs-user-active");
|
||||
topInfoTimeout = setTimeout(function () {
|
||||
$('#mainVideo').removeClass("vjs-user-active");
|
||||
}, 5000);
|
||||
});
|
||||
|
||||
$("iframe").mouseout(function (e) {
|
||||
topInfoTimeout = setTimeout(function () {
|
||||
$('#mainVideo').removeClass("vjs-user-active");
|
||||
}, 500);
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
<?php
|
||||
echo AVideoPlugin::getFooterCode();
|
||||
?>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
|
397
plugin/PlayLists/managerPlaylists.php
Normal file
397
plugin/PlayLists/managerPlaylists.php
Normal file
|
@ -0,0 +1,397 @@
|
|||
<?php
|
||||
global $global, $config;
|
||||
if (!isset($global['systemRootPath'])) {
|
||||
require_once '../../videos/configuration.php';
|
||||
}
|
||||
require_once $global['systemRootPath'] . 'objects/user.php';
|
||||
if (!User::isLogged()) {
|
||||
gotToLoginAndComeBackHere('');
|
||||
}
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="<?php echo $_SESSION['language']; ?>">
|
||||
<head>
|
||||
<title><?php echo __("Users") . $config->getPageTitleSeparator() . $config->getWebSiteTitle(); ?></title>
|
||||
<?php
|
||||
include $global['systemRootPath'] . 'view/include/head.php';
|
||||
include $global['systemRootPath'] . 'view/managerUsers_head.php';
|
||||
?>
|
||||
<style>
|
||||
.playLists li{
|
||||
min-height: 45px;
|
||||
}
|
||||
.playLists .list-group{
|
||||
height: 221px;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.videoTitle.ellipsis{
|
||||
width: calc(100% - 90px);
|
||||
float: left;
|
||||
}
|
||||
|
||||
.playLists .tab-content{
|
||||
min-height: 250px;
|
||||
}
|
||||
|
||||
.playLists {
|
||||
min-height: 330px;
|
||||
}
|
||||
.pl .panel-footer{
|
||||
min-height: 42px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body class="<?php echo $global['bodyClass']; ?>">
|
||||
<?php
|
||||
include $global['systemRootPath'] . 'view/include/navbar.php';
|
||||
?>
|
||||
<div class="container-fluid">
|
||||
<br>
|
||||
|
||||
<div class="panel">
|
||||
<div class="panel-heading">
|
||||
<ul class="nav nav-tabs">
|
||||
<li class="active pl_filter" onclick="pl_filter('all', $(this));" data-toggle="tooltip"
|
||||
title="<?php echo __('Show all types'); ?>">
|
||||
<a href="#"><i class="fas fa-layer-group"></i>
|
||||
<i class="fas fa-list"></i>
|
||||
<i class="fas fa-film"></i> <?php echo __('All'); ?></a></li>
|
||||
<li class="pl_filter" onclick="pl_filter('serie', $(this));" data-toggle="tooltip"
|
||||
title="<?php echo __('Show all programs that are listed in your video library'); ?>">
|
||||
<a href="#"><span class="label label-success"><i class="fas fa-list"></i>
|
||||
<?php echo __('Series'); ?></span></a></li>
|
||||
<li class="pl_filter" onclick="pl_filter('collection', $(this));" data-toggle="tooltip"
|
||||
title="<?php echo __('Show all that is a collection of programs'); ?>">
|
||||
<a href="#"><span class="label label-primary"><i class="fas fa-layer-group"></i>
|
||||
<?php echo __('Collections'); ?></span></a></li>
|
||||
<li class="pl_filter" onclick="pl_filter('videos', $(this));" data-toggle="tooltip"
|
||||
title="<?php echo __('Show all that include a list of videos'); ?>">
|
||||
<a href="#"><span class="label label-default"><i class="fas fa-film"></i>
|
||||
<?php echo __('Videos'); ?></span></a></li>
|
||||
<li class="pull-right" >
|
||||
<button type="button" class="btn btn-default pull-right" data-toggle="tooltip" title="<?php echo __('New'); ?>"
|
||||
onclick="createNewProgram();" >
|
||||
<i class="fas fa-plus"></i>
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div class="row">
|
||||
<?php
|
||||
$pl = PlayList::getAllFromUser(User::getId());
|
||||
$count = 0;
|
||||
foreach ($pl as $value) {
|
||||
$count++;
|
||||
//var_dump($value);
|
||||
|
||||
$rowsSubPlaylists = PlayList::getAllSubPlayLists($value["id"]);
|
||||
$totalSubPlaylists = count($rowsSubPlaylists);
|
||||
|
||||
|
||||
$rowsNOTSubPlaylists = PlayList::getAllNOTSubPlayLists($value["id"]);
|
||||
$totalNOTSubPlaylists = count($rowsNOTSubPlaylists);
|
||||
|
||||
$classes = array();
|
||||
$isASerie = PlayLists::isPlayListASerie($value["id"]);
|
||||
if ($isASerie) {
|
||||
$classes[] = 'pl_serie';
|
||||
}
|
||||
if ($totalSubPlaylists) {
|
||||
$classes[] = 'pl_collection';
|
||||
}
|
||||
if ($totalNOTSubPlaylists) {
|
||||
$classes[] = 'pl_videos';
|
||||
}
|
||||
?>
|
||||
<div class="col-sm-6 col-md-4 col-lg-3 pl pl<?php echo $value["id"]; ?> <?php echo implode(' ', $classes) ?>" >
|
||||
<div class="panel panel-<?php echo $totalSubPlaylists ? 'primary' : 'default'; ?>">
|
||||
<div class="panel-heading">
|
||||
<?php
|
||||
if (!empty($totalSubPlaylists)) {
|
||||
echo '<i class="fas fa-layer-group"></i> ';
|
||||
} else {
|
||||
echo '<i class="fas fa-film"></i> ';
|
||||
}
|
||||
echo $value['name_translated'];
|
||||
?>
|
||||
|
||||
<div class="btn-group pull-right" playlists_id="<?php echo $value["id"]; ?>">
|
||||
<button type="button" class="btn btn-default btn-xs pull-right" data-toggle="tooltip"
|
||||
title="<?php echo __('Delete'); ?>"
|
||||
onclick="deleteProgram(<?php echo $value["id"]; ?>);" >
|
||||
<i class="fas fa-trash"></i>
|
||||
</button>
|
||||
<button type="button" class="btn btn-default btn-xs pull-right" data-toggle="tooltip"
|
||||
title="<?php echo __('Play'); ?>" onclick="avideoModalIframe('<?php echo PlayLists::getLink($value["id"], true); ?>');" >
|
||||
<i class="fas fa-play"></i>
|
||||
</button>
|
||||
<button type="button" class="btn btn-default btn-xs editBtn " onclick="editPlayList(<?php echo $value["id"]; ?>);" data-toggle="tooltip"
|
||||
title="<?php echo __('Edit'); ?>" >
|
||||
<i class="fas fa-edit"></i>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="panel-body playLists">
|
||||
|
||||
<ul class="nav nav-tabs">
|
||||
<?php
|
||||
$active = 'active';
|
||||
if (!empty($totalSubPlaylists)) {
|
||||
?>
|
||||
<li class="<?php echo $active; ?>">
|
||||
<a data-toggle="tab" href="#seasons<?php echo $value["id"]; ?>"><i class="fas fa-list"></i> <?php echo __('Seasons'); ?>
|
||||
<span class="badge" id="badge_playlists_id_<?php echo $value["id"]; ?>">
|
||||
<?php
|
||||
echo $totalSubPlaylists;
|
||||
?>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
<?php
|
||||
$active = '';
|
||||
}
|
||||
if (!empty($totalNOTSubPlaylists)) {
|
||||
?>
|
||||
<li class="<?php echo $active; ?>">
|
||||
<a data-toggle="tab" href="#videos<?php echo $value["id"]; ?>"><i class="fas fa-video"></i> <?php echo __('Videos'); ?>
|
||||
<span class="badge" id="badge_playlists_id_<?php echo $value["id"]; ?>">
|
||||
<?php
|
||||
echo $totalNOTSubPlaylists;
|
||||
?>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
<?php
|
||||
$active = '';
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
|
||||
<div class="tab-content">
|
||||
<?php
|
||||
$active = ' in active';
|
||||
if (!empty($totalSubPlaylists)) {
|
||||
?>
|
||||
<div id="seasons<?php echo $value["id"]; ?>" class="tab-pane fade <?php echo $active; ?>">
|
||||
<ul class="list-group">
|
||||
<?php
|
||||
if ($totalSubPlaylists > 0) {
|
||||
foreach ($rowsSubPlaylists as $row) {
|
||||
?>
|
||||
<li class="list-group-item" id="videos_id_<?php echo $row["id"]; ?>_playlists_id_<?php echo $value["id"]; ?>">
|
||||
<div class="ellipsis videoTitle">
|
||||
<?php
|
||||
echo $row['title'];
|
||||
?>
|
||||
</div>
|
||||
<button type="button" class="btn btn-default btn-xs pull-right" data-toggle="tooltip" title="<?php echo __('Remove Serie'); ?>" onclick="removeFromSerie(<?php echo $value["id"]; ?>, <?php echo $row["id"]; ?>);" >
|
||||
<i class="fas fa-trash"></i>
|
||||
</button>
|
||||
<button type="button" class="btn btn-default btn-xs pull-right" data-toggle="tooltip" title="<?php echo __('Play Video'); ?>" onclick="avideoModalIframe('<?php echo Video::getPermaLink($row["id"], true); ?>');" >
|
||||
<i class="fas fa-play"></i>
|
||||
</button>
|
||||
<button type="button" class="btn btn-default btn-xs pull-right" data-toggle="tooltip" title="<?php echo __('Edit Video'); ?>" onclick="avideoModalIframe(webSiteRootURL + 'mvideos?video_id=<?php echo $row["id"]; ?>');" >
|
||||
<i class="fas fa-edit"></i>
|
||||
</button>
|
||||
</li>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
<?php
|
||||
$active = '';
|
||||
}
|
||||
if (!empty($totalNOTSubPlaylists)) {
|
||||
?>
|
||||
<div id="videos<?php echo $value["id"]; ?>" class="tab-pane fade <?php echo $active; ?>">
|
||||
<ul class="list-group">
|
||||
<?php
|
||||
foreach ($rowsNOTSubPlaylists as $row) {
|
||||
if ($totalNOTSubPlaylists > 0) {
|
||||
?>
|
||||
<li class="list-group-item" id="videos_id_<?php echo $row["id"]; ?>_playlists_id_<?php echo $value["id"]; ?>">
|
||||
<div class="ellipsis videoTitle">
|
||||
<?php
|
||||
echo $row['title'];
|
||||
?>
|
||||
</div>
|
||||
<button type="button" class="btn btn-default btn-xs pull-right" data-toggle="tooltip" title="<?php echo __('Remove Video'); ?>" onclick="removeFromSerie(<?php echo $value["id"]; ?>, <?php echo $row["id"]; ?>);" >
|
||||
<i class="fas fa-trash"></i>
|
||||
</button>
|
||||
<button type="button" class="btn btn-default btn-xs pull-right" data-toggle="tooltip" title="<?php echo __('Play Video'); ?>" onclick="avideoModalIframe('<?php echo Video::getPermaLink($row["id"], true); ?>');" >
|
||||
<i class="fas fa-play"></i>
|
||||
</button>
|
||||
<button type="button" class="btn btn-default btn-xs pull-right" data-toggle="tooltip" title="<?php echo __('Edit Video'); ?>" onclick="avideoModalIframe(webSiteRootURL + 'mvideos?video_id=<?php echo $row["id"]; ?>');" >
|
||||
<i class="fas fa-edit"></i>
|
||||
</button>
|
||||
</li>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
<?php
|
||||
$active = '';
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="panel-footer text-right">
|
||||
<?php
|
||||
if ($isASerie) {
|
||||
echo '<div class="pull-left" style="margin-right:5px;">'.Video::getChangeVideoStatusButton($isASerie['id']).'</div> ';
|
||||
echo '<span class="label label-success"><i class="fas fa-list"></i> ' . $isASerie['title'];
|
||||
echo '</span>';
|
||||
}
|
||||
if ($totalSubPlaylists) {
|
||||
echo '<span class="label label-primary"><i class="fas fa-layer-group"></i> ' . __('Collections') . '</span>';
|
||||
}
|
||||
if ($totalNOTSubPlaylists) {
|
||||
echo '<span class="label label-default"><i class="fas fa-film"></i> ' . __('Videos') . '</span>';
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
if (empty($count)) {
|
||||
?>
|
||||
<div class="col-sm-12">
|
||||
<div class="alert alert-info">
|
||||
<?php echo __('Sorry you do not have any playlist yet'); ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
include $global['systemRootPath'] . 'view/include/footer.php';
|
||||
?>
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
|
||||
|
||||
});
|
||||
|
||||
function pl_filter(filter, t) {
|
||||
$('.pl_filter').removeClass('active');
|
||||
t.addClass('active');
|
||||
if (filter === 'all') {
|
||||
$('.pl').show();
|
||||
} else {
|
||||
var selector = '.pl_' + filter;
|
||||
$(selector).show();
|
||||
$('.pl').not(selector).hide();
|
||||
}
|
||||
}
|
||||
|
||||
function editPlayList(playlists_id) {
|
||||
avideoModalIframe(webSiteRootURL + 'viewProgram/' + playlists_id);
|
||||
}
|
||||
|
||||
function removeFromSerie(playlists_id, videos_id) {
|
||||
swal({
|
||||
title: "<?php echo __('Are you sure?'); ?>",
|
||||
text: "<?php echo __('You will not be able to recover this action!'); ?>",
|
||||
icon: "warning",
|
||||
buttons: true,
|
||||
dangerMode: true,
|
||||
})
|
||||
.then(function (willDelete) {
|
||||
if (willDelete) {
|
||||
addVideoToPlayList(videos_id, false, playlists_id);
|
||||
$('#videos_id_' + videos_id + '_playlists_id_' + playlists_id).fadeOut();
|
||||
$('#badge_playlists_id_' + playlists_id).text(parseInt($('#badge_playlists_id_' + playlists_id).text()) - 1);
|
||||
} else {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function deleteProgram(playlists_id) {
|
||||
swal({
|
||||
title: "<?php echo __('Are you sure?'); ?>",
|
||||
text: "<?php echo __('You will not be able to recover this action!'); ?>",
|
||||
icon: "warning",
|
||||
buttons: true,
|
||||
dangerMode: true,
|
||||
})
|
||||
.then(function (willDelete) {
|
||||
if (willDelete) {
|
||||
modal.showPleaseWait();
|
||||
$.ajax({
|
||||
url: webSiteRootURL + 'objects/playlistRemove.php',
|
||||
data: {
|
||||
"playlist_id": playlists_id
|
||||
},
|
||||
type: 'post',
|
||||
success: function (response) {
|
||||
$('.pl' + playlists_id).fadeOut();
|
||||
modal.hidePleaseWait();
|
||||
avideoToastSuccess('<?php echo __('Deleted'); ?>');
|
||||
}
|
||||
});
|
||||
} else {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function createNewProgram() {
|
||||
swal({
|
||||
title: "<?php echo __('New program'); ?>",
|
||||
text: "<?php echo __('Type your program title'); ?>",
|
||||
content: {
|
||||
element: "input",
|
||||
attributes: {
|
||||
placeholder: "<?php echo __('Program title'); ?>",
|
||||
type: "text",
|
||||
},
|
||||
},
|
||||
showCancelButton: true,
|
||||
closeOnConfirm: true,
|
||||
inputPlaceholder: "<?php echo __('Program title'); ?>"
|
||||
}).then((inputValue) => {
|
||||
if (inputValue === false)
|
||||
return false;
|
||||
|
||||
if (inputValue === "") {
|
||||
swal.showInputError("<?php echo __('Please provide a title'); ?>");
|
||||
return false
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
url: webSiteRootURL + 'objects/playlistAddNew.json.php',
|
||||
method: 'POST',
|
||||
data: {
|
||||
'status': "public",
|
||||
'name': inputValue
|
||||
},
|
||||
success: function (response) {
|
||||
if (response.status > 0) {
|
||||
location.reload();
|
||||
} else {
|
||||
modal.hidePleaseWait();
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
27
plugin/PlayLists/managerPlaylistsSearchVideo.php
Normal file
27
plugin/PlayLists/managerPlaylistsSearchVideo.php
Normal file
|
@ -0,0 +1,27 @@
|
|||
<?php
|
||||
global $global, $config;
|
||||
if (!isset($global['systemRootPath'])) {
|
||||
require_once '../../videos/configuration.php';
|
||||
}
|
||||
require_once $global['systemRootPath'] . 'objects/user.php';
|
||||
if (!User::isLogged()) {
|
||||
forbiddenPage();
|
||||
}
|
||||
?>
|
||||
<form id="search-form" name="search-form" action="<?php echo $global['webSiteRootURL'].''; ?>" method="get">
|
||||
<div id="custom-search-input">
|
||||
<div class="input-group col-md-12">
|
||||
<input type="search" name="searchPhrase" class="form-control input-lg" placeholder="<?php echo __('Search Videos'); ?>" value="">
|
||||
<span class="input-group-btn">
|
||||
<button class="btn btn-info btn-lg" type="submit">
|
||||
<i class="glyphicon glyphicon-search"></i>
|
||||
</button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<script>
|
||||
function searchVideos() {
|
||||
avideoAlertHTMLText("<?php echo __('Search Video'); ?>", "");
|
||||
}
|
||||
</script>
|
|
@ -25,23 +25,22 @@ if (User::getId() != $pl->getUsers_id()) {
|
|||
die('{"error":"' . __("Permission denied") . '"}');
|
||||
}
|
||||
$msg = "";
|
||||
if(!empty($_GET['action'])){
|
||||
if (!empty($_GET['action'])) {
|
||||
switch ($_GET['action']) {
|
||||
case 'delete':
|
||||
$id = PlayLists::removeSerie($serie_playlists_id);
|
||||
if(empty($id)){
|
||||
if (empty($id)) {
|
||||
$msg = "Serie NOT deleted";
|
||||
}
|
||||
break;
|
||||
case 'create':
|
||||
$id = PlayLists::saveSerie($serie_playlists_id);
|
||||
if(empty($id)){
|
||||
if (empty($id)) {
|
||||
$msg = "Serie NOT saved";
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="<?php echo $_SESSION['language']; ?>">
|
||||
|
@ -66,32 +65,60 @@ if(!empty($_GET['action'])){
|
|||
|
||||
<body style="background-color: transparent;">
|
||||
<div class="container-fluid">
|
||||
<h1><?php echo $pl->getName(); ?></h1>
|
||||
<?php
|
||||
$videoPL = PlayLists::isPlayListASerie($serie_playlists_id);
|
||||
if (!empty($videoPL)) {
|
||||
?>
|
||||
<a class="btn btn-primary btn-block" href="<?php echo $global['webSiteRootURL']; ?>mvideos?iframe=1&video_id=<?php echo $videoPL['id']; ?>"><?php echo __('Edit'); ?></a>
|
||||
<a class="btn btn-danger btn-block" href="<?php echo $global['webSiteRootURL']; ?>plugin/PlayLists/playListToSerie.php?playlist_id=<?php echo $serie_playlists_id; ?>&action=delete"><?php echo __('Delete'); ?></a>
|
||||
<div class="alert alert-danger">
|
||||
<p>Deleting this series will remove only the video linked to it. All items in your playlist will remain unchanged.</p>
|
||||
|
||||
<div class="panel panel-info">
|
||||
<div class="panel-heading">
|
||||
<h1><?php echo $pl->getName(); ?></h1>
|
||||
</div>
|
||||
<?php
|
||||
} else {
|
||||
?>
|
||||
<a class="btn btn-success btn-block" href="<?php echo $global['webSiteRootURL']; ?>plugin/PlayLists/playListToSerie.php?playlist_id=<?php echo $serie_playlists_id; ?>&action=create"><?php echo __('Create'); ?></a>
|
||||
<div class="alert alert-info">
|
||||
<p>In order to create series and make it easier to play videos in sequence, on this page we will create a video linked to this playlist.</p>
|
||||
<p>This video can be set up just like any other video by adding posters and viewing permissions</p>
|
||||
<div class="panel-body">
|
||||
<?php
|
||||
$videoPL = PlayLists::isPlayListASerie($serie_playlists_id);
|
||||
if (!empty($videoPL)) {
|
||||
?>
|
||||
<div class="alert alert-danger">
|
||||
<p>Deleting this series will remove only the video linked to it. All items in your playlist will remain unchanged.</p>
|
||||
</div>
|
||||
<?php
|
||||
} else {
|
||||
?>
|
||||
<div class="alert alert-info">
|
||||
<p>In order to create series and make it easier to play videos in sequence, on this page we will create a video linked to this playlist.</p>
|
||||
<p>This video can be set up just like any other video by adding posters and viewing permissions</p>
|
||||
|
||||
Programs can be expanded to Series, when a program becomes a series, a new "video" is created. In this video, you can choose the title, thumbnail images, visibility, etc. in other words all the characteristics that a video can have you also can have for your playlist.
|
||||
|
||||
The benefit to this is that you can add all needed metadata to your program, for example, create a cover and a specific name for your program, and manage it all in the video management menu.
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
if (!empty($msg)) {
|
||||
?>
|
||||
<div class="alert alert-danger"><?php echo $msg; ?></div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
if(!empty($msg)){
|
||||
?>
|
||||
<div class="alert alert-danger"><?php echo $msg; ?></div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<div class="panel-footer text-right">
|
||||
<?php
|
||||
if (!empty($videoPL)) {
|
||||
?>
|
||||
<a class="btn btn-primary" href="<?php echo $global['webSiteRootURL']; ?>mvideos?iframe=1&video_id=<?php echo $videoPL['id']; ?>">
|
||||
<i class="fas fa-edit"></i> <?php echo __('Edit'); ?>
|
||||
</a>
|
||||
<a class="btn btn-danger" href="<?php echo $global['webSiteRootURL']; ?>plugin/PlayLists/playListToSerie.php?playlist_id=<?php echo $serie_playlists_id; ?>&action=delete">
|
||||
<i class="fas fa-trash"></i> <?php echo __('Delete'); ?>
|
||||
</a>
|
||||
<?php
|
||||
} else {
|
||||
?>
|
||||
<a class="btn btn-success" href="<?php echo $global['webSiteRootURL']; ?>plugin/PlayLists/playListToSerie.php?playlist_id=<?php echo $serie_playlists_id; ?>&action=create">
|
||||
<i class="fas fa-film"></i> <?php echo __('Create'); ?>
|
||||
</a>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
$jsFiles = array();
|
||||
|
|
14
plugin/PlayLists/playerButton.css
Normal file
14
plugin/PlayLists/playerButton.css
Normal file
|
@ -0,0 +1,14 @@
|
|||
.playListProgram-button{
|
||||
outline: none;
|
||||
}
|
||||
.playListProgram-button:before {
|
||||
display: inline-block;
|
||||
font-style: normal;
|
||||
font-variant: normal;
|
||||
text-rendering: auto;
|
||||
content: "\f5fd";
|
||||
font-size: 1.2em;
|
||||
line-height: 1.0em;
|
||||
font-family: "Font Awesome\ 5 Free";
|
||||
font-weight: 900;
|
||||
}
|
33
plugin/PlayLists/playerButton.js
Normal file
33
plugin/PlayLists/playerButton.js
Normal file
|
@ -0,0 +1,33 @@
|
|||
var Button = videojs.getComponent('Button');
|
||||
|
||||
var playListProgramButton = videojs.extend(Button, {
|
||||
//constructor: function(player, options) {
|
||||
constructor: function () {
|
||||
Button.apply(this, arguments);
|
||||
this.addClass('playListProgram-button');
|
||||
this.controlText("playListProgram");
|
||||
},
|
||||
handleClick: function () {
|
||||
console.log('playListProgramButton clicked');
|
||||
$('#playListHolder').fadeToggle();
|
||||
}
|
||||
});
|
||||
|
||||
videojs.registerComponent('playListProgramButton', playListProgramButton);
|
||||
player.getChild('controlBar').addChild('playListProgramButton', {}, getPlayerButtonIndex('fullscreenToggle') - 1);
|
||||
|
||||
function playListFadeIn() {
|
||||
$('#playListHolder').fadeIn();
|
||||
}
|
||||
|
||||
function playListFadeOut() {
|
||||
$('#playListHolder').fadeOut();
|
||||
}
|
||||
|
||||
function startTrackDisplayPlayListHolder() {
|
||||
if ($(".vjs-text-track-display").length === 0) {
|
||||
setTimeout(function () {
|
||||
startTrackDisplayPlayListHolder();
|
||||
}, 1000);
|
||||
}
|
||||
}
|
|
@ -168,8 +168,9 @@
|
|||
li.dataset[key] = value;
|
||||
});
|
||||
}
|
||||
|
||||
li.className = 'vjs-playlist-item';
|
||||
|
||||
/* AVideo add classname on item */
|
||||
li.className = 'vjs-playlist-item '+item.className;
|
||||
li.setAttribute('tabIndex', 0); // Thumbnail image
|
||||
|
||||
this.thumbnail = createThumbnail(item.thumbnail);
|
||||
|
|
|
@ -66,8 +66,7 @@ class Message implements MessageComponentInterface {
|
|||
|
||||
if ($this->shouldPropagateInfo($client)) {
|
||||
//_log_message("shouldPropagateInfo {$json->yptDeviceId}");
|
||||
$this->msgToAll($conn, array(), \SocketMessageType::NEW_CONNECTION, true);
|
||||
//\AVideoPlugin::onUserSocketConnect($json->from_users_id, $this->clients[$conn->resourceId]);
|
||||
$this->msgToAll($conn, array('users_id'=>$client['users_id']), \SocketMessageType::NEW_CONNECTION, true);
|
||||
} else {
|
||||
//_log_message("NOT shouldPropagateInfo ");
|
||||
}
|
||||
|
@ -100,7 +99,7 @@ class Message implements MessageComponentInterface {
|
|||
$videos_id = $client['videos_id'];
|
||||
$live_key = $client['live_key'];
|
||||
if ($this->shouldPropagateInfo($client)) {
|
||||
$this->msgToAll($conn, array(), \SocketMessageType::NEW_DISCONNECTION);
|
||||
$this->msgToAll($conn, array('users_id'=>$client['users_id']), \SocketMessageType::NEW_DISCONNECTION);
|
||||
//\AVideoPlugin::onUserSocketDisconnect($users_id, $this->clients[$conn->resourceId]);
|
||||
if (!empty($videos_id)) {
|
||||
$this->msgToAllSameVideo($videos_id, "");
|
||||
|
|
|
@ -208,7 +208,7 @@ if (!empty($obj->debugAllUsersSocket) || (User::isAdmin() && !empty($obj->debugS
|
|||
});
|
||||
}
|
||||
});
|
||||
}else{
|
||||
} else {
|
||||
$("#socket_info_container").hide();
|
||||
}
|
||||
$("#socketBtnMinimize").click(function () {
|
||||
|
@ -272,5 +272,22 @@ if (!empty($obj->debugAllUsersSocket) || (User::isAdmin() && !empty($obj->debugS
|
|||
var webSocketToken = '';
|
||||
var webSocketURL = '';
|
||||
var webSocketTypes = <?php echo json_encode($refl->getConstants()); ?>;
|
||||
|
||||
|
||||
function onUserSocketConnect(response) {
|
||||
try {
|
||||
<?php echo AVideoPlugin::onUserSocketConnect(); ?>
|
||||
} catch (e) {
|
||||
console.log('onUserSocketConnect:error', e.message);
|
||||
}
|
||||
}
|
||||
|
||||
function onUserSocketDisconnect(response) {
|
||||
try {
|
||||
<?php echo AVideoPlugin::onUserSocketDisconnect(); ?>
|
||||
} catch (e) {
|
||||
console.log('onUserSocketConnect:error', e.message);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<script src="<?php echo $global['webSiteRootURL']; ?>plugin/YPTSocket/script.js?<?php echo filectime($global['systemRootPath'] . 'plugin/YPTSocket/script.js'); ?>" type="text/javascript"></script>
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
var socketConnectRequested = 0;
|
||||
var totalDevicesOnline = 0;
|
||||
var yptSocketResponse;
|
||||
|
||||
function socketConnect() {
|
||||
if (socketConnectRequested) {
|
||||
return false;
|
||||
|
@ -14,7 +16,8 @@ function socketConnect() {
|
|||
};
|
||||
conn.onmessage = function (e) {
|
||||
var json = JSON.parse(e.data);
|
||||
parseSocketResponse(json);
|
||||
yptSocketResponse = json;
|
||||
parseSocketResponse();
|
||||
if (json.type == webSocketTypes.ON_VIDEO_MSG) {
|
||||
console.log("Socket onmessage ON_VIDEO_MSG", json);
|
||||
$('.videoUsersOnline, .videoUsersOnline_' + json.videos_id).text(json.total);
|
||||
|
@ -30,8 +33,14 @@ function socketConnect() {
|
|||
}
|
||||
if (json.type == webSocketTypes.NEW_CONNECTION) {
|
||||
//console.log("Socket onmessage NEW_CONNECTION", json);
|
||||
if(typeof onUserSocketConnect === 'function'){
|
||||
onUserSocketConnect(json);
|
||||
}
|
||||
} else if (json.type == webSocketTypes.NEW_DISCONNECTION) {
|
||||
//console.log("Socket onmessage NEW_DISCONNECTION", json);
|
||||
if(typeof onUserSocketDisconnect === 'function'){
|
||||
onUserSocketDisconnect(json);
|
||||
}
|
||||
} else {
|
||||
var myfunc;
|
||||
if (json.callback) {
|
||||
|
@ -56,7 +65,7 @@ function socketConnect() {
|
|||
|
||||
conn.onerror = function (err) {
|
||||
socketConnectRequested = 0;
|
||||
console.error('Socket encountered error: ', err.message, 'Closing socket');
|
||||
console.error('Socket encountered error: ', err, 'Closing socket');
|
||||
conn.close();
|
||||
};
|
||||
}
|
||||
|
@ -88,7 +97,11 @@ function defaultCallback(json) {
|
|||
//console.log('defaultCallback', json);
|
||||
}
|
||||
|
||||
function parseSocketResponse(json) {
|
||||
function parseSocketResponse() {
|
||||
json = yptSocketResponse;
|
||||
if(typeof json === 'undefined'){
|
||||
return false;
|
||||
}
|
||||
console.log("parseSocketResponse", json);
|
||||
if (json.isAdmin && webSocketServerVersion > json.webSocketServerVersion) {
|
||||
if (typeof avideoToastWarning == 'funciton') {
|
||||
|
|
|
@ -37,6 +37,8 @@ class YouPHPFlix2 extends PluginAbstract {
|
|||
$obj->SuggestedAutoPlay = true;
|
||||
$obj->PlayList = true;
|
||||
$obj->PlayListAutoPlay = true;
|
||||
$obj->Channels = true;
|
||||
$obj->ChannelsAutoPlay = true;
|
||||
$obj->Trending = true;
|
||||
$obj->TrendingAutoPlay = true;
|
||||
$obj->DateAdded = true;
|
||||
|
|
|
@ -19,7 +19,7 @@ if ($obj->BigVideo && empty($_GET['showOnly'])) {
|
|||
$poster = $images->poster;
|
||||
$canWatchPlayButton = "";
|
||||
$get = $_GET;
|
||||
if (User::canWatchVideoWithAds($video['id']) && !Video::isSerie($video['id'])) {
|
||||
if (User::canWatchVideoWithAds($video['id'])) {
|
||||
$canWatchPlayButton = "canWatchPlayButton";
|
||||
}
|
||||
$_GET = $get;
|
||||
|
|
|
@ -29,7 +29,7 @@ function flixFullScreen(link, url) {
|
|||
setTimeout(function(){flixFullScreenActive=false;}, 500);
|
||||
$('body').addClass('fullScreen');
|
||||
var divHTML = '<div id="divIframeFull" style="background-color:black; text-align: center; position: fixed; top: 0;left: 0; z-index: 9999;">';
|
||||
divHTML += '<div id="divTopBar" style="position: fixed; top: 0; left: 0; height: 50px; width: 100vw; z-index: 99999; padding:10px; ">';
|
||||
divHTML += '<div id="divTopBar" style="position: fixed; top: 0; right: 0; height: 50px; width: 45px; z-index: 99999; padding:10px; ">';
|
||||
divHTML += '<span id="closeBtnFull" class="pull-right" onclick="closeFlixFullScreen(\''+window.location.href+'\');">';
|
||||
divHTML += '<i class="fa fa-times"></i></span></div></div>';
|
||||
var div = $(divHTML).append('<iframe src="' + link + '" style="background-color:black; position: fixed; top: 0; left: 0; height: 100vh; width: 100vw; z-index: 9999; overflow: hidden;" frameBorder="0" id="iframeFull" allow="autoplay" allowfullscreen webkitallowfullscreen mozallowfullscreen oallowfullscreen msallowfullscreen>');
|
||||
|
|
|
@ -34,7 +34,7 @@ $(function () {
|
|||
}, 2000);
|
||||
|
||||
isFlickityEnabled('.carousel');
|
||||
if($("body.userChannel").length===0){
|
||||
if ($("body.userChannel").length === 0) {
|
||||
if ($(window).scrollTop() < 60) {
|
||||
$("#mainNavBar").addClass("bgTransparent");
|
||||
}
|
||||
|
@ -49,8 +49,8 @@ $(function () {
|
|||
});
|
||||
|
||||
function startModeFlix(container) {
|
||||
|
||||
if ($(container + ".thumbsImage").attr('startModeFlix') == 1) {
|
||||
|
||||
if ($(container).attr('startModeFlix') == 1) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -67,24 +67,32 @@ function startModeFlix(container) {
|
|||
|
||||
$(container + ".thumbsImage").on("click", function () {
|
||||
var crc = $(this).attr('crc');
|
||||
var ajaxLoad = $(this).attr('ajaxLoad');
|
||||
var myEleTop = $('.navbar-fixed-top .items-container').outerHeight(true);
|
||||
var row = $(this).closest('.row');
|
||||
$(this).addClass('active');
|
||||
$(this).parent().find(".arrow-down").fadeIn('slow');
|
||||
|
||||
var ajaxLoadID = "#ajaxLoad-" + crc;
|
||||
if (ajaxLoad && !$(ajaxLoadID).attr('ajaxLoaded')) {
|
||||
$(ajaxLoadID).load(ajaxLoad);
|
||||
$(ajaxLoadID).attr('ajaxLoaded', 1);
|
||||
}
|
||||
|
||||
$(".arrow-down").fadeOut();
|
||||
$(".thumbsImage").removeClass('active');
|
||||
$('.poster').not('#poster' + crc).slideUp();
|
||||
console.log("crc", crc);
|
||||
$(this).closest('.flickity-area').find('.poster').not('#poster' + crc).slideUp();
|
||||
if ($('#poster' + crc).is(":hidden")) {
|
||||
$('#poster' + crc).css('background-image', 'url(' + $('#poster' + crc).attr('poster') + ')');
|
||||
$('#poster' + crc).slideDown('slow', function () {
|
||||
$('#poster' + crc).slideDown('fast', function () {
|
||||
var top = row.offset().top;
|
||||
$('html, body').animate({
|
||||
scrollTop: top - myEleTop
|
||||
}, 'slow');
|
||||
}, 'fast');
|
||||
});
|
||||
} else {
|
||||
$('#poster' + crc).slideUp();
|
||||
$(this).closest('.flickity-area').find('#poster' + crc).slideUp();
|
||||
for (i = 0; i < $carousel.length; i++) {
|
||||
$carousel[i].flickity('playPlayer');
|
||||
}
|
||||
|
@ -100,8 +108,13 @@ function startModeFlix(container) {
|
|||
}
|
||||
});
|
||||
|
||||
$(container + ".thumbsImage").attr('startModeFlix', 1);
|
||||
if(typeof transformLinksToEmbed == 'function'){
|
||||
$(container).attr('startModeFlix', 1);
|
||||
if (typeof transformLinksToEmbed == 'function') {
|
||||
transformLinksToEmbed(container + ' a.canWatchPlayButton');
|
||||
}
|
||||
|
||||
$("img.thumbsJPG").not('flickity-lazyloaded').each(function (index) {
|
||||
$(this).attr('src', $(this).attr('data-flickity-lazyload'));
|
||||
$(this).addClass('flickity-lazyloaded');
|
||||
});
|
||||
}
|
|
@ -8,8 +8,6 @@ require_once $global['systemRootPath'] . 'objects/category.php';
|
|||
|
||||
|
||||
$obj = AVideoPlugin::getObjectData("YouPHPFlix2");
|
||||
$timeLog = __FILE__ . " - modeFlix";
|
||||
TimeLogStart($timeLog);
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
@ -27,7 +25,7 @@ TimeLogStart($timeLog);
|
|||
<body class="<?php echo $global['bodyClass']; ?>">
|
||||
<?php include $global['systemRootPath'] . 'view/include/navbar.php'; ?>
|
||||
|
||||
<div class="container-fluid nopadding" id="mainContainer" style="display:none;">
|
||||
<div class="container-fluid nopadding flickity-area" id="mainContainer" style="display:none;">
|
||||
<?php
|
||||
include $global['systemRootPath'] . 'plugin/YouPHPFlix2/view/modeFlixBody.php';
|
||||
?>
|
||||
|
|
|
@ -13,7 +13,6 @@ $percent = 90;
|
|||
$_REQUEST['current'] = 1;
|
||||
$_REQUEST['rowCount'] = $obj->maxVideos;
|
||||
|
||||
TimeLogEnd($timeLog, __LINE__);
|
||||
if ($obj->Suggested) {
|
||||
$dataFlickirty = new stdClass();
|
||||
$dataFlickirty->wrapAround = true;
|
||||
|
@ -45,7 +44,102 @@ $percent = 90;
|
|||
<?php
|
||||
}
|
||||
}
|
||||
TimeLogEnd($timeLog, __LINE__);
|
||||
|
||||
if ($obj->Channels) {
|
||||
require_once $global['systemRootPath'] . 'objects/Channel.php';
|
||||
$dataFlickirty = new stdClass();
|
||||
$dataFlickirty->wrapAround = true;
|
||||
$dataFlickirty->pageDots = !empty($obj->pageDots);
|
||||
$dataFlickirty->lazyLoad = 15;
|
||||
$dataFlickirty->setGallerySize = false;
|
||||
$dataFlickirty->cellAlign = 'left';
|
||||
$dataFlickirty->groupCells = true;
|
||||
if ($obj->ChannelsAutoPlay) {
|
||||
$dataFlickirty->autoPlay = 10000;
|
||||
}
|
||||
$users_id_array = VideoStatistic::getUsersIDFromChannelsWithMoreViews();
|
||||
$channels = Channel::getChannels(true, "u.id, '" . implode(",", $users_id_array) . "'");
|
||||
if (!empty($channels)) {
|
||||
foreach ($channels as $channel) {
|
||||
$_POST['sort']['created'] = "DESC";
|
||||
$videos = Video::getAllVideosAsync("viewable", $channel['id']);
|
||||
unset($_POST['sort']['created']);
|
||||
$link = User::getChannelLinkFromChannelName($channel["channelName"]);
|
||||
?>
|
||||
<div class="row topicRow">
|
||||
<h2>
|
||||
<a href="<?php echo $link; ?>">
|
||||
<img src="<?php echo $global['webSiteRootURL'] . $channel["photoURL"]; ?>" class="img img-responsive pull-left" style="max-width: 18px; max-height: 18px; margin-right: 5px;"> <?php
|
||||
echo $channel["channelName"];
|
||||
?>
|
||||
</a>
|
||||
</h2>
|
||||
<!-- Date Programs/Playlists -->
|
||||
<?php
|
||||
include $global['systemRootPath'] . 'plugin/YouPHPFlix2/view/row.php';
|
||||
?>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$plObj = AVideoPlugin::getDataObjectIfEnabled('PlayLists');
|
||||
if ($obj->PlayList && !empty($plObj)) {
|
||||
$dataFlickirty = new stdClass();
|
||||
$dataFlickirty->wrapAround = true;
|
||||
$dataFlickirty->pageDots = !empty($obj->pageDots);
|
||||
$dataFlickirty->lazyLoad = 15;
|
||||
$dataFlickirty->setGallerySize = false;
|
||||
$dataFlickirty->cellAlign = 'left';
|
||||
$dataFlickirty->groupCells = true;
|
||||
if ($obj->PlayListAutoPlay) {
|
||||
$dataFlickirty->autoPlay = 10000;
|
||||
}
|
||||
|
||||
$programs = Video::getAllVideos("viewableNotUnlisted", false, true, array(), false, false, true, false, true);
|
||||
cleanSearchVar();
|
||||
if (!empty($programs)) {
|
||||
foreach ($programs as $serie) {
|
||||
$videos = PlayList::getAllFromPlaylistsID($serie['serie_playlists_id']);
|
||||
|
||||
foreach ($videos as $key => $value) {
|
||||
$videos[$key]['title'] = "{$value['icon']} {$value['title']}";
|
||||
}
|
||||
|
||||
$link = PlayLists::getLink($serie['serie_playlists_id']);
|
||||
$linkEmbed = PlayLists::getLink($serie['serie_playlists_id'], true);
|
||||
$canWatchPlayButton = "";
|
||||
if (User::canWatchVideoWithAds($value['id'])) {
|
||||
$canWatchPlayButton = "canWatchPlayButton";
|
||||
}
|
||||
?>
|
||||
<div class="row topicRow">
|
||||
<h2>
|
||||
<a href="<?php echo $link; ?>" embed="<?php echo $linkEmbed; ?>" class="<?php echo $canWatchPlayButton; ?>">
|
||||
<i class="fas fa-list"></i> <?php
|
||||
echo $serie['title'];
|
||||
?>
|
||||
</a>
|
||||
</h2>
|
||||
<!-- Date Programs/Playlists -->
|
||||
<?php
|
||||
$rowPlayListLink = PlayLists::getLink($serie['serie_playlists_id']);
|
||||
$rowPlayListLinkEmbed = PlayLists::getLink($serie['serie_playlists_id'], true);
|
||||
include $global['systemRootPath'] . 'plugin/YouPHPFlix2/view/row.php';
|
||||
unset($rowPlayListLink);
|
||||
unset($rowPlayListLinkEmbed);
|
||||
?>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
}
|
||||
}
|
||||
reloadSearchVar();
|
||||
}
|
||||
|
||||
if ($obj->Trending) {
|
||||
$dataFlickirty = new stdClass();
|
||||
$dataFlickirty->wrapAround = true;
|
||||
|
@ -79,7 +173,6 @@ $percent = 90;
|
|||
<?php
|
||||
}
|
||||
}
|
||||
TimeLogEnd($timeLog, __LINE__);
|
||||
if ($obj->DateAdded) {
|
||||
$dataFlickirty = new stdClass();
|
||||
$dataFlickirty->wrapAround = true;
|
||||
|
@ -113,7 +206,6 @@ $percent = 90;
|
|||
<?php
|
||||
}
|
||||
}
|
||||
TimeLogEnd($timeLog, __LINE__);
|
||||
if ($obj->MostPopular) {
|
||||
$_REQUEST['rowCount'] = $obj->maxVideos;
|
||||
$dataFlickirty = new stdClass();
|
||||
|
@ -148,7 +240,6 @@ $percent = 90;
|
|||
|
||||
<?php
|
||||
}
|
||||
TimeLogEnd($timeLog, __LINE__);
|
||||
if ($obj->MostWatched) {
|
||||
$_REQUEST['rowCount'] = $obj->maxVideos;
|
||||
$dataFlickirty = new stdClass();
|
||||
|
@ -181,7 +272,6 @@ $percent = 90;
|
|||
</div>
|
||||
<?php
|
||||
}
|
||||
TimeLogEnd($timeLog, __LINE__);
|
||||
if ($obj->SortByName) {
|
||||
$_REQUEST['rowCount'] = $obj->maxVideos;
|
||||
$dataFlickirty = new stdClass();
|
||||
|
@ -214,14 +304,13 @@ $percent = 90;
|
|||
</div>
|
||||
<?php
|
||||
}
|
||||
TimeLogEnd($timeLog, __LINE__);
|
||||
if ($obj->Categories) {
|
||||
$url = "{$global['webSiteRootURL']}plugin/YouPHPFlix2/view/modeFlixCategory.php";
|
||||
if(!empty($_GET['catName'])){
|
||||
if (!empty($_GET['catName'])) {
|
||||
$url = addQueryStringParameter($url, 'catName', $_GET['catName']);
|
||||
}
|
||||
$search = getSearchVar();
|
||||
if(!empty($search)){
|
||||
if (!empty($search)) {
|
||||
$url = addQueryStringParameter($url, 'search', $search);
|
||||
}
|
||||
$url = addQueryStringParameter($url, 'tags_id', intval(@$_GET['tags_id']));
|
||||
|
@ -253,7 +342,7 @@ $percent = 90;
|
|||
$container.on('append.infiniteScroll', function (event, response, path, items) {
|
||||
//console.log('Append page: ' + path);
|
||||
|
||||
$("img.thumbsJPG").each(function (index) {
|
||||
$("img.thumbsJPG").not('flickity-lazyloaded').each(function (index) {
|
||||
$(this).attr('src', $(this).attr('data-flickity-lazyload'));
|
||||
$(this).addClass('flickity-lazyloaded');
|
||||
});
|
||||
|
@ -274,7 +363,6 @@ $percent = 90;
|
|||
</script>
|
||||
<?php
|
||||
}
|
||||
TimeLogEnd($timeLog, __LINE__);
|
||||
unset($_POST['sort']);
|
||||
unset($_REQUEST['current']);
|
||||
unset($_REQUEST['rowCount']);
|
||||
|
|
|
@ -14,10 +14,12 @@ if (empty($_GET['current'])) {
|
|||
$_REQUEST['current'] = intval($_GET['current']);
|
||||
}
|
||||
|
||||
$uid = '{serie_uid}';
|
||||
|
||||
$cacheName = "modeFlixCategory" . md5(json_encode($_GET)) . User::getId();
|
||||
$cache = ObjectYPT::getCache($cacheName, 600);
|
||||
if (!empty($cache)) {
|
||||
echo $cache;
|
||||
echo str_replace('{serie_uid}', uniqid(), $cache);
|
||||
return false;
|
||||
}
|
||||
ob_start();
|
||||
|
@ -141,5 +143,5 @@ $cache = ob_get_clean();
|
|||
|
||||
ObjectYPT::setCache($cacheName, $cache);
|
||||
|
||||
echo $cache;
|
||||
echo str_replace('{serie_uid}', uniqid(), $cache);
|
||||
?>
|
|
@ -4,7 +4,6 @@
|
|||
</div>
|
||||
<div style="display:none;" id="footerDiv">
|
||||
<?php
|
||||
TimeLogEnd($timeLog, __LINE__);
|
||||
include $global['systemRootPath'] . 'view/include/footer.php';
|
||||
|
||||
if (!empty($tmpSessionType)) {
|
||||
|
@ -14,7 +13,6 @@
|
|||
}
|
||||
$jsFiles = array("view/js/bootstrap-list-filter/bootstrap-list-filter.min.js", "plugin/YouPHPFlix2/view/js/flickity/flickity.pkgd.min.js", "view/js/webui-popover/jquery.webui-popover.min.js", "plugin/YouPHPFlix2/view/js/script.js");
|
||||
$jsURL = combineFiles($jsFiles, "js");
|
||||
TimeLogEnd($timeLog, __LINE__);
|
||||
?>
|
||||
</div>
|
||||
<script src="<?php echo $global['webSiteRootURL']; ?>view/js/infinite-scroll.pkgd.min.js" type="text/javascript"></script>
|
||||
|
|
83
plugin/YouPHPFlix2/view/modeFlixSerie.php
Normal file
83
plugin/YouPHPFlix2/view/modeFlixSerie.php
Normal file
|
@ -0,0 +1,83 @@
|
|||
<?php
|
||||
global $global, $config;
|
||||
|
||||
$playlists_id = intval(@$_REQUEST['playlists_id']);
|
||||
|
||||
if (empty($playlists_id)) {
|
||||
die('Playlist ID is empty');
|
||||
}
|
||||
|
||||
if (!isset($global['systemRootPath'])) {
|
||||
require_once '../../../videos/configuration.php';
|
||||
}
|
||||
session_write_close();
|
||||
|
||||
$video = Video::getVideoFromSeriePlayListsId($playlists_id);
|
||||
if (empty($video)) {
|
||||
die('Video from playlist is empty ' . $playlists_id);
|
||||
}
|
||||
|
||||
if (empty($_REQUEST['uid'])) {
|
||||
$uid = uniqid();
|
||||
} else {
|
||||
$uid = preg_replace('/[^a-z0-0_]/i', '', $_REQUEST['uid']);
|
||||
}
|
||||
/*
|
||||
* If enable the cache the javascript fails due the uuid
|
||||
$uid = '{serie_uid}';
|
||||
|
||||
$cacheName = "modeFlixSerie" . md5(json_encode($_GET)) . User::getId();
|
||||
$cache = ObjectYPT::getCache($cacheName, 600);
|
||||
if (!empty($cache)) {
|
||||
echo str_replace('{serie_uid}', uniqid(), $cache);
|
||||
return false;
|
||||
}
|
||||
ob_start();
|
||||
*
|
||||
*/
|
||||
$obj = AVideoPlugin::getObjectData("YouPHPFlix2");
|
||||
|
||||
if ($obj->PlayList) {
|
||||
$dataFlickirty = new stdClass();
|
||||
$dataFlickirty->wrapAround = true;
|
||||
$dataFlickirty->pageDots = !empty($obj->pageDots);
|
||||
$dataFlickirty->lazyLoad = true;
|
||||
$dataFlickirty->fade = true;
|
||||
$dataFlickirty->setGallerySize = false;
|
||||
$dataFlickirty->cellAlign = 'left';
|
||||
$dataFlickirty->groupCells = true;
|
||||
if ($obj->PlayListAutoPlay) {
|
||||
$dataFlickirty->autoPlay = 10000;
|
||||
$dataFlickirty->wrapAround = true;
|
||||
} else {
|
||||
$dataFlickirty->wrapAround = true;
|
||||
}
|
||||
$videos = PlayList::getAllFromPlaylistsID($playlists_id);
|
||||
$uidFlickirty = uniqid();
|
||||
?>
|
||||
<div class="row topicRow" id="<?php echo $uidFlickirty; ?>-Flickirty">
|
||||
<!-- Serie -->
|
||||
<?php
|
||||
$rowPlayListLink = PlayLists::getLink($playlists_id);
|
||||
$rowPlayListLinkEmbed = PlayLists::getLink($playlists_id, true);
|
||||
include $global['systemRootPath'] . 'plugin/YouPHPFlix2/view/row.php';
|
||||
unset($rowPlayListLink);
|
||||
unset($rowPlayListLinkEmbed);
|
||||
?>
|
||||
</div>
|
||||
<script>
|
||||
startModeFlix('#<?php echo $uidFlickirty; ?>-Flickirty ');
|
||||
</script>
|
||||
<?php
|
||||
$rowlink = false;
|
||||
$rowlinkEmbed = false;
|
||||
}
|
||||
/*
|
||||
$cache = ob_get_clean();
|
||||
|
||||
ObjectYPT::setCache($cacheName, $cache);
|
||||
|
||||
echo str_replace('{serie_uid}', uniqid(), $cache);
|
||||
*
|
||||
*/
|
||||
?>
|
|
@ -1,6 +1,7 @@
|
|||
<?php
|
||||
global $advancedCustom;
|
||||
$uid = uniqid();
|
||||
|
||||
$uidOriginal = uniqid();
|
||||
$landscape = "rowPortrait";
|
||||
$css = "";
|
||||
if (!empty($obj->landscapePosters)) {
|
||||
|
@ -17,14 +18,22 @@ TimeLogStart($timeLog3);
|
|||
<div class="carousel <?php echo $landscape; ?>" data-flickity='<?php echo json_encode($dataFlickirty) ?>' style="<?php echo $css; ?>">
|
||||
<?php
|
||||
TimeLogEnd($timeLog3, __LINE__);
|
||||
if(!isset($videosCounter)){
|
||||
if (!isset($videosCounter)) {
|
||||
$videosCounter = 0;
|
||||
}
|
||||
foreach ($videos as $value) {
|
||||
foreach ($videos as $_index => $value) {
|
||||
$uid = "{$uidOriginal}_{$value['id']}";
|
||||
$videosCounter++;
|
||||
TimeLogStart($timeLog3 . " Video {$value['clean_title']}");
|
||||
$images = Video::getImageFromFilename($value['filename'], $value['type']);
|
||||
TimeLogEnd($timeLog3 . " Video {$value['clean_title']}", __LINE__);
|
||||
if (!empty($value['serie_playlists_id'])) {
|
||||
$images = PlayList::getRandomImageFromPlayList($value['serie_playlists_id']);
|
||||
$ajaxLoad = $global['webSiteRootURL'].'plugin/YouPHPFlix2/view/modeFlixSerie.php?playlists_id='.$value['serie_playlists_id'];
|
||||
$link = PlayLists::getLink($value['serie_playlists_id']);
|
||||
$linkEmbed = PlayLists::getLink($value['serie_playlists_id'], true);
|
||||
$value['title'] = "<a href='{$link}' embed='{$linkEmbed}'>{$value['title']}</a>";
|
||||
} else {
|
||||
$images = Video::getImageFromFilename($value['filename'], $value['type']);
|
||||
$ajaxLoad = '';
|
||||
}
|
||||
$imgGif = $images->thumbsGif;
|
||||
$img = $images->thumbsJpg;
|
||||
$poster = $images->poster;
|
||||
|
@ -37,7 +46,13 @@ TimeLogStart($timeLog3);
|
|||
?>
|
||||
<div class="carousel-cell " itemscope itemtype="http://schema.org/VideoObject">
|
||||
<div class="tile">
|
||||
<div class="slide thumbsImage" crc="<?php echo $value['id'] . $uid; ?>" videos_id="<?php echo $value['id']; ?>" poster="<?php echo $poster; ?>" href="<?php echo Video::getLink($value['id'], $value['clean_title']); ?>" video="<?php echo $value['clean_title']; ?>" iframe="<?php echo $global['webSiteRootURL']; ?>videoEmbeded/<?php echo $value['clean_title']; ?>">
|
||||
<div class="slide thumbsImage" crc="<?php echo $uid; ?>"
|
||||
videos_id="<?php echo $value['id']; ?>"
|
||||
poster="<?php echo $poster; ?>"
|
||||
href="<?php echo Video::getLink($value['id'], $value['clean_title']); ?>"
|
||||
video="<?php echo $value['clean_title']; ?>"
|
||||
iframe="<?php echo $global['webSiteRootURL']; ?>videoEmbeded/<?php echo $value['clean_title']; ?>"
|
||||
ajaxLoad="<?php echo $ajaxLoad; ?>">
|
||||
<div class="tile__media ">
|
||||
<img alt="<?php echo $value['title']; ?>" src="<?php echo $global['webSiteRootURL']; ?>view/img/placeholder-image.png" class="tile__img <?php echo $cssClass; ?> thumbsJPG img img-responsive carousel-cell-image" data-flickity-lazyload="<?php echo $img; ?>" />
|
||||
<?php if (!empty($imgGif)) { ?>
|
||||
|
@ -73,13 +88,6 @@ TimeLogStart($timeLog3);
|
|||
</div>
|
||||
<div class="arrow-down" style="display:none;"></div>
|
||||
</div>
|
||||
<?php
|
||||
TimeLogEnd($timeLog3 . " Video {$value['clean_title']}", __LINE__);
|
||||
getLdJson($value['id']);
|
||||
TimeLogEnd($timeLog3 . " Video {$value['clean_title']}", __LINE__);
|
||||
getItemprop($value['id']);
|
||||
TimeLogEnd($timeLog3 . " Video {$value['clean_title']}", __LINE__);
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
TimeLogEnd($timeLog3 . " Video {$value['clean_title']}", __LINE__);
|
||||
|
@ -90,164 +98,34 @@ TimeLogStart($timeLog3);
|
|||
|
||||
<?php
|
||||
TimeLogEnd($timeLog3, __LINE__);
|
||||
foreach ($videos as $value) {
|
||||
$images = Video::getImageFromFilename($value['filename'], $value['type']);
|
||||
foreach ($videos as $_index => $value) {
|
||||
$uid = "{$uidOriginal}_{$value['id']}";
|
||||
if (!empty($value['serie_playlists_id'])) {
|
||||
$images = PlayList::getRandomImageFromPlayList($value['serie_playlists_id']);
|
||||
} else {
|
||||
$images = Video::getImageFromFilename($value['filename'], $value['type']);
|
||||
}
|
||||
$imgGif = $images->thumbsGif;
|
||||
$img = $images->thumbsJpg;
|
||||
$poster = $images->poster;
|
||||
$canWatchPlayButton = "";
|
||||
if (User::canWatchVideoWithAds($value['id']) && !Video::isSerie($value['id'])) {
|
||||
if (User::canWatchVideoWithAds($value['id'])) {
|
||||
$canWatchPlayButton = "canWatchPlayButton";
|
||||
}
|
||||
?>
|
||||
<div class="poster" id="poster<?php echo $value['id'] . $uid; ?>" poster="<?php echo $poster; ?>"
|
||||
style="
|
||||
display: none;
|
||||
background-image: url(<?php echo $global['webSiteRootURL']; ?>plugin/YouPHPFlix2/view/img/loading.gif);
|
||||
-webkit-background-size: cover;
|
||||
-moz-background-size: cover;
|
||||
-o-background-size: cover;
|
||||
background-size: cover;
|
||||
">
|
||||
<div class="posterDetails " style="
|
||||
background: -webkit-linear-gradient(left, rgba(<?php echo $obj->backgroundRGB; ?>,1) 40%, rgba(<?php echo $obj->backgroundRGB; ?>,0) 100%);
|
||||
background: -o-linear-gradient(right, rgba(<?php echo $obj->backgroundRGB; ?>,1) 40%, rgba(<?php echo $obj->backgroundRGB; ?>,0) 100%);
|
||||
background: linear-gradient(right, rgba(<?php echo $obj->backgroundRGB; ?>,1) 40%, rgba(<?php echo $obj->backgroundRGB; ?>,0) 100%);
|
||||
background: -moz-linear-gradient(to right, rgba(<?php echo $obj->backgroundRGB; ?>,1) 40%, rgba(<?php echo $obj->backgroundRGB; ?>,0) 100%);">
|
||||
<h2 class="infoTitle"><?php echo $value['title']; ?></h2>
|
||||
<h4 class="infoDetails">
|
||||
<?php
|
||||
if (!empty($value['rate'])) {
|
||||
?>
|
||||
<span class="label label-success"><i class="fab fa-imdb"></i> IMDb <?php echo $value['rate']; ?></span>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
<?php
|
||||
if (!empty($advancedCustom) && empty($advancedCustom->doNotDisplayViews)) {
|
||||
?>
|
||||
<span class="label label-default"><i class="fa fa-eye"></i> <?php echo $value['views_count']; ?></span>
|
||||
<?php } ?>
|
||||
<?php
|
||||
if (!empty($advancedCustom) && empty($advancedCustom->doNotDisplayLikes)) {
|
||||
?>
|
||||
<span class="label label-success"><i class="fa fa-thumbs-up"></i> <?php echo $value['likes']; ?></span>
|
||||
<?php } ?>
|
||||
<?php
|
||||
if (!empty($advancedCustom) && empty($advancedCustom->doNotDisplayCategory)) {
|
||||
?>
|
||||
<span class="label label-success"><a style="color: inherit;" class="tile__cat" cat="<?php echo $value['clean_category']; ?>" href="<?php echo $global['webSiteRootURL'] . "cat/" . $value['clean_category']; ?>"><i class="<?php echo $value['iconClass']; ?>"></i> <?php echo $value['category']; ?></a></span>
|
||||
<?php } ?>
|
||||
<?php
|
||||
foreach ($value['tags'] as $value2) {
|
||||
$value2 = (object) $value2;
|
||||
if (!empty($advancedCustom) && empty($advancedCustom->doNotDisplayGroupsTags)) {
|
||||
if ($value2->label === __("Group")) {
|
||||
?>
|
||||
<span class="label label-<?php echo $value2->type; ?>"><?php echo $value2->text; ?></span>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
if ($advancedCustom->paidOnlyFreeLabel && !empty($value2->label) && $value2->label === __("Paid Content")) {
|
||||
?><span class="label label-<?php echo $value2->type; ?>"><?php echo $value2->text; ?></span><?php
|
||||
}
|
||||
if (!empty($advancedCustom) && empty($advancedCustom->doNotDisplayPluginsTags)) {
|
||||
|
||||
if ($value2->label === "Plugin") {
|
||||
?>
|
||||
<span class="label label-<?php echo $value2->type; ?>"><?php echo $value2->text; ?></span>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
if (!empty($value['rrating'])) {
|
||||
include $global['systemRootPath'] . 'view/rrating/rating-' . $value['rrating'] . '.php';
|
||||
} else if (!empty($advancedCustom) && $advancedCustom->showNotRatedLabel) {
|
||||
include $global['systemRootPath'] . 'view/rrating/notRated.php';
|
||||
}
|
||||
?>
|
||||
</h4>
|
||||
<div class="row">
|
||||
<?php
|
||||
if (!empty($images->posterPortrait) && basename($images->posterPortrait) !== 'notfound_portrait.jpg' && basename($images->posterPortrait) !== 'pdf_portrait.png' && basename($images->posterPortrait) !== 'article_portrait.png') {
|
||||
?>
|
||||
<div class="col-md-2 col-sm-3 col-xs-4 hidden-xs">
|
||||
<center>
|
||||
<img alt="<?php echo $value['title']; ?>" class="img img-responsive posterPortrait" src="<?php echo $images->posterPortrait; ?>" style="min-width: 86px;" />
|
||||
</center>
|
||||
</div>
|
||||
<?php
|
||||
} else if (!empty($images->poster) && basename($images->poster) !== 'notfound.jpg' && basename($images->poster) !== 'pdf.png' && basename($images->poster) !== 'article.png') {
|
||||
?>
|
||||
<div class="col-md-2 col-sm-3 col-xs-4 hidden-xs">
|
||||
<center>
|
||||
<img alt="<?php echo $value['title']; ?>" class="img img-responsive" src="<?php echo $images->poster; ?>" style="min-width: 86px;" />
|
||||
</center>
|
||||
</div>
|
||||
<?php
|
||||
} else if (empty($obj->landscapePosters) && !empty($images->posterPortrait)) {
|
||||
?>
|
||||
<div class="col-md-2 col-sm-3 col-xs-4 hidden-xs">
|
||||
<center>
|
||||
<img alt="<?php echo $value['title']; ?>" class="img img-responsive posterPortrait" src="<?php echo $images->posterPortrait; ?>" style="min-width: 86px;" />
|
||||
</center>
|
||||
</div>
|
||||
<?php
|
||||
} else {
|
||||
?>
|
||||
<div class="col-md-2 col-sm-3 col-xs-4 hidden-xs">
|
||||
<center>
|
||||
<img alt="<?php echo $value['title']; ?>" class="img img-responsive" src="<?php echo $images->poster; ?>" style="min-width: 86px;" />
|
||||
</center>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<div class="infoText col-md-4 col-sm-6 col-xs-8">
|
||||
<h4 class="mainInfoText" itemprop="description">
|
||||
<?php
|
||||
if (strip_tags($value['description']) != $value['description']) {
|
||||
echo $value['description'];
|
||||
} else {
|
||||
echo nl2br(textToLink(htmlentities($value['description'])));
|
||||
}
|
||||
?>
|
||||
</h4>
|
||||
<?php
|
||||
if (AVideoPlugin::isEnabledByName("VideoTags")) {
|
||||
echo VideoTags::getLabels($value['id']);
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="footerBtn">
|
||||
<a class="btn btn-danger playBtn <?php echo $canWatchPlayButton; ?>"
|
||||
href="<?php echo YouPHPFlix2::getLinkToVideo($value['id']); ?>"
|
||||
embed="<?php echo Video::getLinkToVideo ($value['id'], $value['clean_title'], true); ?>">
|
||||
<i class="fa fa-play"></i>
|
||||
<span class="hidden-xs"><?php echo __("Play"); ?></span>
|
||||
</a>
|
||||
<?php
|
||||
if (!empty($value['trailer1'])) {
|
||||
?>
|
||||
<a href="#" class="btn btn-warning" onclick="flixFullScreen('<?php echo parseVideos($value['trailer1'], 1, 0, 0, 0, 1); ?>', '');return false;">
|
||||
<span class="fa fa-film"></span>
|
||||
<span class="hidden-xs"><?php echo __("Trailer"); ?></span>
|
||||
</a>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
echo AVideoPlugin::getNetflixActionButton($value['id']);
|
||||
getSharePopupButton($value['id']);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
|
||||
if(!empty($rowPlayListLink)){
|
||||
$rowLink = addQueryStringParameter($rowPlayListLink,'playlist_index',$_index);
|
||||
$rowLinkEmbed = addQueryStringParameter($rowPlayListLinkEmbed,'playlist_index',$_index);
|
||||
}else{
|
||||
$rowLink = YouPHPFlix2::getLinkToVideo($value['id']);
|
||||
$rowLinkEmbed = Video::getLinkToVideo($value['id'], $value['clean_title'], true);
|
||||
}
|
||||
|
||||
if (empty($value['serie_playlists_id'])) {
|
||||
include $global['systemRootPath'] . 'plugin/YouPHPFlix2/view/row_video.php';
|
||||
} else {
|
||||
include $global['systemRootPath'] . 'plugin/YouPHPFlix2/view/row_serie.php';
|
||||
}
|
||||
}
|
||||
|
||||
TimeLogEnd($timeLog3, __LINE__);
|
||||
|
|
25
plugin/YouPHPFlix2/view/row_serie.php
Normal file
25
plugin/YouPHPFlix2/view/row_serie.php
Normal file
|
@ -0,0 +1,25 @@
|
|||
<div class="poster rowSerie" id="poster<?php echo $uid; ?>" poster="<?php echo $poster; ?>"
|
||||
style="
|
||||
display: none;
|
||||
background-image: url(<?php echo $global['webSiteRootURL']; ?>plugin/YouPHPFlix2/view/img/loading.gif);
|
||||
-webkit-background-size: cover;
|
||||
-moz-background-size: cover;
|
||||
-o-background-size: cover;
|
||||
background-size: cover;
|
||||
">
|
||||
<div class="topicRow">
|
||||
<h2 class="infoTitle">
|
||||
<?php
|
||||
$link = PlayLists::getLink($value['serie_playlists_id']);
|
||||
$linkEmbed = PlayLists::getLink($value['serie_playlists_id'], true);
|
||||
$canWatchPlayButton = "";
|
||||
if (User::canWatchVideoWithAds($value['id'])) {
|
||||
$canWatchPlayButton = "canWatchPlayButton";
|
||||
}
|
||||
$value['title'] = "<a href='{$link}' embed='{$linkEmbed}' class='{$canWatchPlayButton}'>{$value['title']}</a>";
|
||||
echo $value['title'];
|
||||
?>
|
||||
</h2>
|
||||
<div id="ajaxLoad-<?php echo $uid; ?>" class="flickity-area col-sm-12"><?php echo __('Loading...'); ?></div>
|
||||
</div>
|
||||
</div>
|
147
plugin/YouPHPFlix2/view/row_video.php
Normal file
147
plugin/YouPHPFlix2/view/row_video.php
Normal file
|
@ -0,0 +1,147 @@
|
|||
<div class="poster rowVideo" id="poster<?php echo $uid; ?>" poster="<?php echo $poster; ?>"
|
||||
style="
|
||||
display: none;
|
||||
background-image: url(<?php echo $global['webSiteRootURL']; ?>plugin/YouPHPFlix2/view/img/loading.gif);
|
||||
-webkit-background-size: cover;
|
||||
-moz-background-size: cover;
|
||||
-o-background-size: cover;
|
||||
background-size: cover;
|
||||
">
|
||||
<div class="posterDetails " style="
|
||||
background: -webkit-linear-gradient(left, rgba(<?php echo $obj->backgroundRGB; ?>,1) 40%, rgba(<?php echo $obj->backgroundRGB; ?>,0) 100%);
|
||||
background: -o-linear-gradient(right, rgba(<?php echo $obj->backgroundRGB; ?>,1) 40%, rgba(<?php echo $obj->backgroundRGB; ?>,0) 100%);
|
||||
background: linear-gradient(right, rgba(<?php echo $obj->backgroundRGB; ?>,1) 40%, rgba(<?php echo $obj->backgroundRGB; ?>,0) 100%);
|
||||
background: -moz-linear-gradient(to right, rgba(<?php echo $obj->backgroundRGB; ?>,1) 40%, rgba(<?php echo $obj->backgroundRGB; ?>,0) 100%);">
|
||||
<h2 class="infoTitle"><?php echo $value['title']; ?></h2>
|
||||
<h4 class="infoDetails">
|
||||
<?php
|
||||
if (!empty($value['rate'])) {
|
||||
?>
|
||||
<span class="label label-success"><i class="fab fa-imdb"></i> IMDb <?php echo $value['rate']; ?></span>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
<?php
|
||||
if (!empty($advancedCustom) && empty($advancedCustom->doNotDisplayViews)) {
|
||||
?>
|
||||
<span class="label label-default"><i class="fa fa-eye"></i> <?php echo $value['views_count']; ?></span>
|
||||
<?php } ?>
|
||||
<?php
|
||||
if (!empty($advancedCustom) && empty($advancedCustom->doNotDisplayLikes)) {
|
||||
?>
|
||||
<span class="label label-success"><i class="fa fa-thumbs-up"></i> <?php echo $value['likes']; ?></span>
|
||||
<?php } ?>
|
||||
<?php
|
||||
if (!empty($advancedCustom) && empty($advancedCustom->doNotDisplayCategory)) {
|
||||
?>
|
||||
<span class="label label-success"><a style="color: inherit;" class="tile__cat" cat="<?php echo $value['clean_category']; ?>" href="<?php echo $global['webSiteRootURL'] . "cat/" . $value['clean_category']; ?>"><i class="<?php echo $value['iconClass']; ?>"></i> <?php echo $value['category']; ?></a></span>
|
||||
<?php } ?>
|
||||
<?php
|
||||
foreach ($value['tags'] as $value2) {
|
||||
$value2 = (object) $value2;
|
||||
if (!empty($advancedCustom) && empty($advancedCustom->doNotDisplayGroupsTags)) {
|
||||
if ($value2->label === __("Group")) {
|
||||
?>
|
||||
<span class="label label-<?php echo $value2->type; ?>"><?php echo $value2->text; ?></span>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
if ($advancedCustom->paidOnlyFreeLabel && !empty($value2->label) && $value2->label === __("Paid Content")) {
|
||||
?><span class="label label-<?php echo $value2->type; ?>"><?php echo $value2->text; ?></span><?php
|
||||
}
|
||||
if (!empty($advancedCustom) && empty($advancedCustom->doNotDisplayPluginsTags)) {
|
||||
|
||||
if ($value2->label === "Plugin") {
|
||||
?>
|
||||
<span class="label label-<?php echo $value2->type; ?>"><?php echo $value2->text; ?></span>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
if (!empty($value['rrating'])) {
|
||||
include $global['systemRootPath'] . 'view/rrating/rating-' . $value['rrating'] . '.php';
|
||||
} else if (!empty($advancedCustom) && $advancedCustom->showNotRatedLabel) {
|
||||
include $global['systemRootPath'] . 'view/rrating/notRated.php';
|
||||
}
|
||||
?>
|
||||
</h4>
|
||||
<div class="row">
|
||||
<?php
|
||||
if (!empty($images->posterPortrait) && basename($images->posterPortrait) !== 'notfound_portrait.jpg' && basename($images->posterPortrait) !== 'pdf_portrait.png' && basename($images->posterPortrait) !== 'article_portrait.png') {
|
||||
?>
|
||||
<div class="col-md-2 col-sm-3 col-xs-4 hidden-xs">
|
||||
<center>
|
||||
<img alt="<?php echo $value['title']; ?>" class="img img-responsive posterPortrait" src="<?php echo $images->posterPortrait; ?>" style="min-width: 86px;" />
|
||||
</center>
|
||||
</div>
|
||||
<?php
|
||||
} else if (!empty($images->poster) && basename($images->poster) !== 'notfound.jpg' && basename($images->poster) !== 'pdf.png' && basename($images->poster) !== 'article.png') {
|
||||
?>
|
||||
<div class="col-md-2 col-sm-3 col-xs-4 hidden-xs">
|
||||
<center>
|
||||
<img alt="<?php echo $value['title']; ?>" class="img img-responsive" src="<?php echo $images->poster; ?>" style="min-width: 86px;" />
|
||||
</center>
|
||||
</div>
|
||||
<?php
|
||||
} else if (empty($obj->landscapePosters) && !empty($images->posterPortrait)) {
|
||||
?>
|
||||
<div class="col-md-2 col-sm-3 col-xs-4 hidden-xs">
|
||||
<center>
|
||||
<img alt="<?php echo $value['title']; ?>" class="img img-responsive posterPortrait" src="<?php echo $images->posterPortrait; ?>" style="min-width: 86px;" />
|
||||
</center>
|
||||
</div>
|
||||
<?php
|
||||
} else {
|
||||
?>
|
||||
<div class="col-md-2 col-sm-3 col-xs-4 hidden-xs">
|
||||
<center>
|
||||
<img alt="<?php echo $value['title']; ?>" class="img img-responsive" src="<?php echo $images->poster; ?>" style="min-width: 86px;" />
|
||||
</center>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<div class="infoText col-md-4 col-sm-6 col-xs-8">
|
||||
<h4 class="mainInfoText" itemprop="description">
|
||||
<?php
|
||||
if (strip_tags($value['description']) != $value['description']) {
|
||||
echo $value['description'];
|
||||
} else {
|
||||
echo nl2br(textToLink(htmlentities($value['description'])));
|
||||
}
|
||||
?>
|
||||
</h4>
|
||||
<?php
|
||||
if (AVideoPlugin::isEnabledByName("VideoTags")) {
|
||||
echo VideoTags::getLabels($value['id']);
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="footerBtn">
|
||||
<a class="btn btn-danger playBtn <?php echo $canWatchPlayButton; ?>"
|
||||
href="<?php echo $rowLink; ?>"
|
||||
embed="<?php echo $rowLinkEmbed; ?>">
|
||||
<i class="fa fa-play"></i>
|
||||
<span class="hidden-xs"><?php echo __("Play"); ?></span>
|
||||
</a>
|
||||
<?php
|
||||
if (!empty($value['trailer1'])) {
|
||||
?>
|
||||
<a href="#" class="btn btn-warning" onclick="flixFullScreen('<?php echo parseVideos($value['trailer1'], 1, 0, 0, 0, 1); ?>', '');return false;">
|
||||
<span class="fa fa-film"></span>
|
||||
<span class="hidden-xs"><?php echo __("Trailer"); ?></span>
|
||||
</a>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
echo AVideoPlugin::getNetflixActionButton($value['id']);
|
||||
getSharePopupButton($value['id']);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
6
updatedb/updateDb.v10.3.sql
Normal file
6
updatedb/updateDb.v10.3.sql
Normal file
|
@ -0,0 +1,6 @@
|
|||
-- Allow save recoded live info on the video
|
||||
ALTER TABLE `videos`
|
||||
ADD COLUMN `live_transmitions_history_id` INT(11) NULL DEFAULT NULL,
|
||||
ADD INDEX `fk_videos_live_transmitions_history1_idx` (`live_transmitions_history_id` ASC);
|
||||
|
||||
UPDATE configurations SET version = '10.3', modified = now() WHERE id = 1;
|
|
@ -165,14 +165,17 @@ TimeLogEnd($timeLog, __LINE__);
|
|||
$active = "";
|
||||
}
|
||||
if ($advancedCustomUser->showChannelProgramsTab && !empty($palyListsObj)) {
|
||||
?>
|
||||
<li class="nav-item <?php echo $active; ?>" id="channelPlayListsLi">
|
||||
<a class="nav-link " href="#channelPlayLists" data-toggle="tab" aria-expanded="true">
|
||||
<?php echo strtoupper(__("Playlists")); ?>
|
||||
</a>
|
||||
</li>
|
||||
<?php
|
||||
$active = "";
|
||||
$totalPrograms = PlayList::getAllFromUserLight($user_id, true, false, 0, true);
|
||||
if($totalPrograms){
|
||||
?>
|
||||
<li class="nav-item <?php echo $active; ?>" id="channelPlayListsLi">
|
||||
<a class="nav-link " href="#channelPlayLists" data-toggle="tab" aria-expanded="true">
|
||||
<?php echo strtoupper($palyListsObj->name); ?> <span class="badge"><?php echo count($totalPrograms); ?></span>
|
||||
</a>
|
||||
</li>
|
||||
<?php
|
||||
$active = "";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
|
@ -265,12 +268,31 @@ TimeLogEnd($timeLog, __LINE__);
|
|||
<?php
|
||||
$active = "fade";
|
||||
}
|
||||
if ($advancedCustomUser->showChannelProgramsTab && !empty($palyListsObj)) {
|
||||
if (!empty($totalPrograms)) {
|
||||
?>
|
||||
<div class="tab-pane <?php echo $active; ?>" id="channelPlayLists" style="min-height: 800px;">
|
||||
<?php
|
||||
include $global['systemRootPath'] . 'view/channelPlaylist.php';
|
||||
?>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading text-right">
|
||||
<?php
|
||||
if($isMyChannel){
|
||||
?>
|
||||
<a class="btn btn-default btn-xs " href="<?php echo $global['webSiteRootURL']; ?>plugin/PlayLists/managerPlaylists.php">
|
||||
<i class="fas fa-edit"></i> <?php echo __('Organize') . ' ' .$palyListsObj->name; ?>
|
||||
</a>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<?php
|
||||
include $global['systemRootPath'] . 'view/channelPlaylist.php';
|
||||
?>
|
||||
</div>
|
||||
<div class="panel-footer">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<?php
|
||||
$active = "fade";
|
||||
|
|
|
@ -46,6 +46,11 @@ unset($_POST['current']);
|
|||
<div class="programsContainerItem">
|
||||
<?php
|
||||
if (empty($playlists)) {
|
||||
|
||||
if($current==1){
|
||||
echo "<div class='alert alert-warning'><i class=\"fas fa-exclamation-triangle\"></i> ".__('Sorry you do not have anything available')."</div>";
|
||||
}
|
||||
|
||||
die("</div>");
|
||||
}
|
||||
$playListsObj = AVideoPlugin::getObjectData("PlayLists");
|
||||
|
@ -142,10 +147,6 @@ unset($_POST['current']);
|
|||
<div id="seriePlaylistModal" class="modal fade" tabindex="-1" role="dialog" >
|
||||
<div class="modal-dialog" role="document" style="width: 90%; margin: auto;">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title"><?php echo __("Serie"); ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<iframe style="width: 100%; height: 80vh;" src="about:blank">
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ if (empty($programs)) {
|
|||
$programs = PlayList::getAllFromUser($user_id, $publicOnly);
|
||||
} else {
|
||||
$videosArrayId = PlayList::getVideosIdFromPlaylist($_GET['program_id']);
|
||||
$videos_id = $videosArrayId[0];
|
||||
$videos_id = @$videosArrayId[0];
|
||||
}
|
||||
$playListsObj = AVideoPlugin::getObjectData("PlayLists");
|
||||
?>
|
||||
|
@ -97,7 +97,7 @@ $playListsObj = AVideoPlugin::getObjectData("PlayLists");
|
|||
@$timesC[__LINE__] += microtime(true) - $startC;
|
||||
$startC = microtime(true);
|
||||
?>
|
||||
|
||||
<br>
|
||||
<div class="panel panel-default program" playListId="<?php echo $program['id']; ?>">
|
||||
<div class="panel-heading">
|
||||
|
||||
|
@ -135,25 +135,28 @@ $playListsObj = AVideoPlugin::getObjectData("PlayLists");
|
|||
<li><a href="<?php echo $global['webSiteRootURL']; ?>objects/playlistSort.php?playlist_id=<?php echo $program['id']; ?>&sort=4"><?php echo __("Created Date"); ?> Desc 9-0</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="pull-right btn-group">
|
||||
<div class="pull-right btn-group" style="display: inline-flex;">
|
||||
<?php
|
||||
echo PlayLists::getShowOnTVSwitch($program['id']);
|
||||
?>
|
||||
<?php
|
||||
if ($program['status'] != "favorite" && $program['status'] != "watch_later") {
|
||||
if (AVideoPlugin::isEnabledByName("PlayLists")) {
|
||||
?>
|
||||
<button class="btn btn-xs btn-default" onclick="copyToClipboard($('#playListEmbedCode<?php echo $program['id']; ?>').val());setTextEmbedCopied();" ><span class="fa fa-copy"></span> <span id="btnEmbedText"><?php echo __("Copy embed code"); ?></span></button>
|
||||
<button class="btn btn-xs btn-default" onclick="copyToClipboard($('#playListEmbedCode<?php echo $program['id']; ?>').val());setTextEmbedCopied();" data-toggle="tooltip" title="<?php echo __('Copy embed code'); ?>" >
|
||||
<span class="fa fa-copy"></span>
|
||||
<span id="btnEmbedText" class="hidden-xs hidden-sm"><?php echo __("Copy embed code"); ?></span></button>
|
||||
<input type="hidden" id="playListEmbedCode<?php echo $program['id']; ?>" value='<iframe width="640" height="480" style="max-width: 100%;max-height: 100%;" src="<?php echo $global['webSiteRootURL']; ?>plugin/PlayLists/embed.php?playlists_id=<?php echo $program['id']; ?>" frameborder="0" allowfullscreen="allowfullscreen" allow="autoplay"></iframe>'/>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<button class="btn btn-xs btn-info seriePlaylist" playlist_id="<?php echo $program['id']; ?>" ><i class="fas fa-film"></i> <?php echo __("Serie"); ?></button>
|
||||
<button class="btn btn-xs btn-info seriePlaylist" playlist_id="<?php echo $program['id']; ?>" data-toggle="tooltip" title="<?php echo __('Add this playlist in your video library'); ?>" >
|
||||
<i class="fas fa-film"></i> <span class="hidden-xs hidden-sm"><?php echo __("Serie"); ?></span>
|
||||
</button>
|
||||
|
||||
<div id="seriePlaylistModal" class="modal fade" tabindex="-1" role="dialog" >
|
||||
<div class="modal-dialog" role="document" style="width: 90%; margin: auto;">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title"><?php echo __("Serie"); ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<iframe style="width: 100%; height: 80vh;" src="about:blank">
|
||||
|
||||
|
@ -174,24 +177,25 @@ $playListsObj = AVideoPlugin::getObjectData("PlayLists");
|
|||
});
|
||||
</script>
|
||||
|
||||
<button class="btn btn-xs btn-danger deletePlaylist" playlist_id="<?php echo $program['id']; ?>" ><i class="fas fa-trash"></i> <?php echo __("Delete"); ?></button>
|
||||
<button class="btn btn-xs btn-primary renamePlaylist" playlist_id="<?php echo $program['id']; ?>" ><i class="fas fa-edit"></i> <?php echo __("Rename"); ?></button>
|
||||
<button class="btn btn-xs btn-danger deletePlaylist" playlist_id="<?php echo $program['id']; ?>" data-toggle="tooltip" title="<?php echo __('Delete'); ?>" ><i class="fas fa-trash"></i> <span class="hidden-xs hidden-sm"><?php echo __("Delete"); ?></span></button>
|
||||
<button class="btn btn-xs btn-primary renamePlaylist" playlist_id="<?php echo $program['id']; ?>" data-toggle="tooltip" title="<?php echo __('Rename'); ?>" ><i class="fas fa-edit"></i> <span class="hidden-xs hidden-sm"><?php echo __("Rename"); ?></span></button>
|
||||
<button class="btn btn-xs btn-success addToPlaylist" playlist_id="<?php echo $program['id']; ?>" data-toggle="tooltip" title="<?php echo __('Add to Program'); ?>" ><i class="fas fa-plus"></i> <span class="hidden-xs hidden-sm"><?php echo __("Add"); ?></span></button>
|
||||
<button class="btn btn-xs btn-default statusPlaylist statusPlaylist<?php echo $program['id']; ?>" playlist_id="<?php echo $program['id']; ?>" style="" >
|
||||
<span class="fa fa-lock" id="statusPrivate<?php echo $program['id']; ?>" style="color: red; <?php
|
||||
if ($program['status'] !== 'private') {
|
||||
echo ' display: none;';
|
||||
}
|
||||
?> " ></span>
|
||||
?> " data-toggle="tooltip" title="<?php echo __('This playlist is private, click to make it public'); ?>" ></span>
|
||||
<span class="fa fa-globe" id="statusPublic<?php echo $program['id']; ?>" style="color: green; <?php
|
||||
if ($program['status'] !== 'public') {
|
||||
echo ' display: none;';
|
||||
}
|
||||
?>"></span>
|
||||
?>" data-toggle="tooltip" title="<?php echo __('This playlist is public, click to make it unlisted'); ?>" ></span>
|
||||
<span class="fa fa-eye-slash" id="statusUnlisted<?php echo $program['id']; ?>" style="color: gray; <?php
|
||||
if ($program['status'] !== 'unlisted') {
|
||||
echo ' display: none;';
|
||||
}
|
||||
?>"></span>
|
||||
?>" data-toggle="tooltip" title="<?php echo __('This playlist is unlisted, click to make it private'); ?>" ></span>
|
||||
</button>
|
||||
<?php
|
||||
}
|
||||
|
@ -328,13 +332,13 @@ $playListsObj = AVideoPlugin::getObjectData("PlayLists");
|
|||
</div>
|
||||
</li>
|
||||
<?php
|
||||
if($count%6===0){
|
||||
if ($count % 6 === 0) {
|
||||
echo '<div class="clearfix hidden-md hidden-sm hidden-xs"></div>';
|
||||
}
|
||||
if($count%3===0){
|
||||
if ($count % 3 === 0) {
|
||||
echo '<div class="clearfix hidden-lg hidden-xs"></div>';
|
||||
}
|
||||
if($count%2===0){
|
||||
if ($count % 2 === 0) {
|
||||
echo '<div class="clearfix hidden-md hidden-sm hidden-lg"></div>';
|
||||
}
|
||||
}
|
||||
|
@ -347,9 +351,9 @@ $playListsObj = AVideoPlugin::getObjectData("PlayLists");
|
|||
if (count($programs) > 1) {
|
||||
?>
|
||||
<button class="btn btn-default btn-xs btn-sm showMoreLessBtn showMoreLessBtn<?php echo $program['id']; ?>" onclick="$('.showMoreLessBtn<?php echo $program['id']; ?>').toggle();
|
||||
$('.<?php echo $class; ?>').slideDown();"><i class="fas fa-angle-down"></i> <?php echo __('Show More'); ?></button>
|
||||
$('.<?php echo $class; ?>').slideDown();"><i class="fas fa-angle-down"></i> <?php echo __('Show More'); ?></button>
|
||||
<button class="btn btn-default btn-xs btn-sm showMoreLessBtn showMoreLessBtn<?php echo $program['id']; ?>" onclick="$('.showMoreLessBtn<?php echo $program['id']; ?>').toggle();
|
||||
$('.<?php echo $class; ?>').slideUp();" style="display: none;"><i class="fas fa-angle-up"></i> <?php echo __('Show Less'); ?></button>
|
||||
$('.<?php echo $class; ?>').slideUp();" style="display: none;"><i class="fas fa-angle-up"></i> <?php echo __('Show Less'); ?></button>
|
||||
<?php
|
||||
}
|
||||
if ($isMyChannel && !empty($videosArrayId)) {
|
||||
|
@ -369,6 +373,60 @@ $playListsObj = AVideoPlugin::getObjectData("PlayLists");
|
|||
|
||||
$_GET['channelName'] = $channelName;
|
||||
?>
|
||||
|
||||
<div class="modal fade" id="videoSearchModal" role="dialog">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-body">
|
||||
|
||||
<div class="panel panle-default">
|
||||
<div class="panel-heading">
|
||||
<ul class="nav nav-tabs">
|
||||
<li class="active"><a data-toggle="tab" href="#addSeries"><i class="fas fa-list"></i> <?php echo __('Series'); ?></a></li>
|
||||
<li><a data-toggle="tab" href="#addVideos"><i class="fas fa-video"></i> <?php echo __('Videos'); ?></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div class="tab-content">
|
||||
<div id="addSeries" class="tab-pane fade in active">
|
||||
<form id="serieSearch-form" name="search-form" action="<?php echo $global['webSiteRootURL'] . ''; ?>" method="get">
|
||||
<div id="custom-search-input">
|
||||
<div class="input-group col-md-12">
|
||||
<input type="search" name="searchPhrase" id="videoSearch-input" class="form-control input-lg" placeholder="<?php echo __('Search Serie'); ?>" value="">
|
||||
<span class="input-group-btn">
|
||||
<button class="btn btn-info btn-lg" type="submit">
|
||||
<i class="fas fa-search"></i>
|
||||
</button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<hr>
|
||||
<div id="searchSerieResult"></div>
|
||||
</div>
|
||||
<div id="addVideos" class="tab-pane fade">
|
||||
<form id="videoSearch-form" name="search-form" action="<?php echo $global['webSiteRootURL'] . ''; ?>" method="get">
|
||||
<div id="custom-search-input">
|
||||
<div class="input-group col-md-12">
|
||||
<input type="search" name="searchPhrase" id="videoSearch-input" class="form-control input-lg" placeholder="<?php echo __('Search Videos'); ?>" value="">
|
||||
<span class="input-group-btn">
|
||||
<button class="btn btn-info btn-lg" type="submit">
|
||||
<i class="fas fa-search"></i>
|
||||
</button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<hr>
|
||||
<div id="searchVideoResult"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
|
||||
var timoutembed;
|
||||
|
@ -603,11 +661,68 @@ if (count($programs) <= 1 || !empty($palyListsObj->expandPlayListOnChannels)) {
|
|||
?>
|
||||
|
||||
<script>
|
||||
|
||||
var videoWasAdded = false;
|
||||
|
||||
$(document).ready(function () {
|
||||
$('.addToPlaylist').click(function () {
|
||||
openVideoSearch();
|
||||
});
|
||||
|
||||
$('#videoSearch-form').submit(function (event) {
|
||||
event.preventDefault();
|
||||
videoSearch(0);
|
||||
});
|
||||
|
||||
$('#serieSearch-form').submit(function (event) {
|
||||
event.preventDefault();
|
||||
videoSearch(1);
|
||||
});
|
||||
|
||||
$('#videoSearchModal').on('hidden.bs.modal', function () {
|
||||
if(videoWasAdded){
|
||||
modal.showPleaseWait();
|
||||
location.reload();
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
function openVideoSearch() {
|
||||
$('#videoSearchModal').modal();
|
||||
}
|
||||
|
||||
function videoSearch(is_serie) {
|
||||
modal.showPleaseWait();
|
||||
var searchPhrase = $('#videoSearch-input').val();
|
||||
$.ajax({
|
||||
url: webSiteRootURL + 'plugin/API/get.json.php?APIName=video&rowCount=10&is_serie=' + is_serie + '&searchPhrase=' + searchPhrase,
|
||||
success: function (response) {
|
||||
console.log(response);
|
||||
var resultId = '#searchVideoResult';
|
||||
if (is_serie) {
|
||||
resultId = '#searchSerieResult';
|
||||
}
|
||||
$(resultId).empty();
|
||||
var rows = response.response.rows;
|
||||
for (var i in rows) {
|
||||
if (typeof rows[i] !== 'object') {
|
||||
continue;
|
||||
}
|
||||
var html = '<button type="button" class="btn btn-default btn-block" data-toggle="tooltip" title="<?php echo __('Add To Serie'); ?>" onclick="addToSerie(<?php echo $program['id']; ?>, ' + rows[i].id + ');" id="videos_id_' + rows[i].id + '_playlists_id_<?php echo $program['id']; ?>" ><i class="fas fa-plus"></i> ' + rows[i].title + '</button>';
|
||||
$(resultId).append(html);
|
||||
}
|
||||
modal.hidePleaseWait();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function addToSerie(playlists_id, videos_id) {
|
||||
addVideoToPlayList(videos_id, true, playlists_id);
|
||||
$('#videos_id_' + videos_id + '_playlists_id_' + playlists_id).fadeOut();
|
||||
videoWasAdded = true;
|
||||
}
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -268,6 +268,14 @@ footer ul.list-inline li {
|
|||
/*overflow: hidden;*/
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.ellipsis {
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.no-outline {
|
||||
border: 0;
|
||||
}
|
||||
|
@ -783,11 +791,11 @@ img.blur{
|
|||
opacity: 0.2;
|
||||
}
|
||||
|
||||
.btn-group.justified {
|
||||
.btn-group.justified, .btn-group-justified {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.justified .btn {
|
||||
.btn-group-justified .btn, .justified .btn {
|
||||
flex: 1
|
||||
}
|
||||
|
||||
|
@ -937,10 +945,61 @@ li.dropdown-submenu > ul > li > a{
|
|||
}
|
||||
}
|
||||
|
||||
.glowBox{
|
||||
animation: glowBox 1s infinite alternate;
|
||||
}
|
||||
|
||||
@keyframes glowBox {
|
||||
from {
|
||||
color: #DFD;
|
||||
box-shadow:
|
||||
0 0 1px #050,
|
||||
0 0 2px #070,
|
||||
0 0 3px #670,
|
||||
0 0 4px #670;
|
||||
}
|
||||
to {
|
||||
color: #FFF;
|
||||
box-shadow:
|
||||
0 0 2px #020,
|
||||
0 0 5px #090,
|
||||
0 0 10px #0F0,
|
||||
0 0 15px #BF0,
|
||||
0 0 20px #B6FF00;
|
||||
}
|
||||
}
|
||||
|
||||
#extraVideos .liveVideo{
|
||||
min-height: 170px;
|
||||
}
|
||||
|
||||
#extraVideos .liveVideo .thumbsImage img{
|
||||
min-height: 90px;
|
||||
}
|
||||
|
||||
.swal-modal.swal-modal-iframe {
|
||||
width: calc(100% - 150px);
|
||||
height: calc(100% - 150px);
|
||||
}
|
||||
.swal-modal.swal-modal-iframe .swal-content {
|
||||
width: calc(100%);
|
||||
height: calc(100% - 50px);
|
||||
}
|
||||
.swal-modal.swal-modal-iframe iframe{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.getChangeVideoStatusButton button{
|
||||
display: none;
|
||||
}
|
||||
|
||||
.getChangeVideoStatusButton.status_i button.getChangeVideoStatusButton_i{
|
||||
display: block;
|
||||
}
|
||||
.getChangeVideoStatusButton.status_a button.getChangeVideoStatusButton_a{
|
||||
display: block;
|
||||
}
|
||||
.getChangeVideoStatusButton.status_u button.getChangeVideoStatusButton_u{
|
||||
display: block;
|
||||
}
|
|
@ -13,19 +13,6 @@
|
|||
</div>
|
||||
|
||||
<?php
|
||||
/* $autoPlayVideo = Video::getVideo($video['next_videos_id']);
|
||||
if($video==$autoPlayVideo){
|
||||
unset($autoPlayVideo);
|
||||
}
|
||||
if ($video['rotation'] === "90" || $video['rotation'] === "270") {
|
||||
$aspectRatio = "9:16";
|
||||
$vjsClass = "vjs-9-16";
|
||||
$embedResponsiveClass = "embed-responsive-9by16";
|
||||
} else {
|
||||
$aspectRatio = "16:9";
|
||||
$vjsClass = "vjs-16-9";
|
||||
$embedResponsiveClass = "embed-responsive-16by9";
|
||||
} */
|
||||
$vjsClass = "";
|
||||
$playNowVideo = $video;
|
||||
$disableYoutubeIntegration = false;
|
||||
|
@ -62,16 +49,16 @@
|
|||
<?php
|
||||
} else {
|
||||
// youtube!
|
||||
if ((strpos($video['videoLink'], "youtube.com") != false) || (strpos($video['videoLink'], "youtu.be") != false)) {
|
||||
if ((stripos($video['videoLink'], "youtube.com") != false) || (stripos($video['videoLink'], "youtu.be") != false)) {
|
||||
$_GET['isEmbedded'] = "y";
|
||||
} else if ((strpos($video['videoLink'], "vimeo.com") != false)) {
|
||||
} else if ((stripos($video['videoLink'], "vimeo.com") != false)) {
|
||||
$_GET['isEmbedded'] = "v";
|
||||
}
|
||||
$_GET['isMediaPlaySite'] = $video['id'];
|
||||
PlayerSkins::playerJSCodeOnLoad($video['id'], @$autoPlayVideo['url']);
|
||||
?>
|
||||
<div id="main-video" class="embed-responsive embed-responsive-16by9">
|
||||
<!-- embed iframe advancedCustom-> YoutubePlayerIntegration -->
|
||||
<!-- embed iframe advancedCustom-> YoutubePlayerIntegration isEmbedded = <?php echo $_GET['isEmbedded']; ?> -->
|
||||
<video playsinline webkit-playsinline="webkit-playsinline" id="mainVideo" class="embed-responsive-item video-js vjs-default-skin <?php echo $vjsClass; ?> vjs-big-play-centered" controls <?php
|
||||
if ($config->getAutoplay()) {
|
||||
echo " autoplay ";
|
||||
|
@ -80,26 +67,20 @@
|
|||
<script>
|
||||
var player;
|
||||
var mediaId = <?php echo $video['id']; ?>;
|
||||
<?php if (!CustomizeUser::canDownloadVideosFromVideo($video['id'])) { ?>
|
||||
// Prevent HTML5 video from being downloaded (right-click saved)?
|
||||
$('#mainVideo').bind('contextmenu', function () {
|
||||
return false;
|
||||
});
|
||||
<?php } ?>
|
||||
// Prevent HTML5 video from being downloaded (right-click saved)?
|
||||
$('#mainVideo').bind('contextmenu', function () {
|
||||
return false;
|
||||
});
|
||||
|
||||
$(document).ready(function () {
|
||||
|
||||
//$(".vjs-big-play-button").hide();
|
||||
$(".vjs-control-bar").css("opacity: 1; visibility: visible;");
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
</div>
|
||||
<?php
|
||||
} // youtube! end
|
||||
require_once $global['systemRootPath'] . 'plugin/AVideoPlugin.php';
|
||||
// the live users plugin
|
||||
// the live users plugin
|
||||
if (AVideoPlugin::isEnabled("0e225f8e-15e2-43d4-8ff7-0cb07c2a2b3b")) {
|
||||
|
||||
require_once $global['systemRootPath'] . 'plugin/VideoLogoOverlay/VideoLogoOverlay.php';
|
||||
|
|
|
@ -112,16 +112,6 @@ if (!empty($advancedCustom->footerHTMLCode->value)) {
|
|||
echo $advancedCustom->footerHTMLCode->value;
|
||||
}
|
||||
?>
|
||||
<textarea id="elementToCopy" style="
|
||||
filter: alpha(opacity=0);
|
||||
-moz-opacity: 0;
|
||||
-khtml-opacity: 0;
|
||||
opacity: 0;
|
||||
position: absolute;
|
||||
z-index: -9999;
|
||||
top: 0;
|
||||
left: 0;
|
||||
pointer-events: none;"></textarea>
|
||||
<script>
|
||||
var checkFooterTimout;
|
||||
$(function () {
|
||||
|
|
|
@ -23,16 +23,21 @@ if (!empty($videoSerie)) {
|
|||
}
|
||||
}
|
||||
?>
|
||||
<style>
|
||||
.playlistList .videoLink {
|
||||
display: inline-flex;
|
||||
}
|
||||
</style>
|
||||
<div class="playlist-nav">
|
||||
<nav class="navbar navbar-inverse">
|
||||
<ul class="nav navbar-nav">
|
||||
<li class="navbar-header">
|
||||
<a>
|
||||
<div class="pull-right">
|
||||
<?php
|
||||
echo PlayLists::getPlayLiveButton($playlist_id);
|
||||
?>
|
||||
</div>
|
||||
<div class="pull-right">
|
||||
<?php
|
||||
echo PlayLists::getPlayLiveButton($playlist_id);
|
||||
?>
|
||||
</div>
|
||||
<h3 class="nopadding">
|
||||
<?php
|
||||
echo $playlist->getName();
|
||||
|
@ -60,14 +65,14 @@ if (!empty($videoSerie)) {
|
|||
}
|
||||
?>
|
||||
<li class="<?php echo $class; ?>">
|
||||
<a href="<?php echo $global['webSiteRootURL']; ?>program/<?php echo $playlist_id; ?>/<?php echo $count . "/".urlencode(cleanURLName($value["channelName"]))."/" . urlencode(cleanURLName($playlist->getName())) . "/{$value['clean_title']}"; ?>" title="<?php echo $value['title']; ?>" class="videoLink row">
|
||||
<a href="<?php echo $global['webSiteRootURL']; ?>program/<?php echo $playlist_id; ?>/<?php echo $count . "/" . urlencode(cleanURLName($value["channelName"])) . "/" . urlencode(cleanURLName($playlist->getName())) . "/{$value['clean_title']}"; ?>" title="<?php echo $value['title']; ?>" class="videoLink row">
|
||||
<div class="col-md-1 col-sm-1 col-xs-1">
|
||||
<?php echo $indicator; ?>
|
||||
</div>
|
||||
<div class="col-md-3 col-sm-3 col-xs-3 nopadding">
|
||||
<?php
|
||||
if (($value['type'] !== "audio") && ($value['type'] !== "linkAudio")) {
|
||||
$img = "{$global['webSiteRootURL']}videos/{$value['filename']}.jpg";
|
||||
$img = $value['images']['poster'];
|
||||
$img_portrait = ($value['rotation'] === "90" || $value['rotation'] === "270") ? "img-portrait" : "";
|
||||
} else {
|
||||
$img = "{$global['webSiteRootURL']}view/img/audio_wave.jpg";
|
||||
|
|
|
@ -9,6 +9,7 @@ if (!empty($video['id'])) {
|
|||
$title = $video->getTitle();
|
||||
}
|
||||
}
|
||||
|
||||
//$originalURL = $url;
|
||||
//$url = urlencode($url);
|
||||
//set the $url and the $title before include this
|
||||
|
|
|
@ -178,6 +178,7 @@ function setPlayerListners() {
|
|||
setPlayerListners();
|
||||
}, 2000);
|
||||
}
|
||||
pauseIfIsPlayinAds();
|
||||
}
|
||||
|
||||
function removeTracks() {
|
||||
|
@ -385,13 +386,13 @@ function getPlayerButtonIndex(name) {
|
|||
}
|
||||
|
||||
function copyToClipboard(text) {
|
||||
|
||||
$('#elementToCopy').css({'top': mouseY, 'left': 0}).fadeIn('slow');
|
||||
$('#elementToCopy').val(text);
|
||||
$('#elementToCopy').focus();
|
||||
$('#elementToCopy').select();
|
||||
$('body').append('<textarea id="elementToCopyAvideo" style="filter: alpha(opacity=0);-moz-opacity: 0;-khtml-opacity: 0; opacity: 0;position: absolute;z-index: -9999;top: 0;left: 0;pointer-events: none;"></textarea>');
|
||||
$('#elementToCopyAvideo').css({'top': mouseY, 'left': 0}).fadeIn('slow');
|
||||
$('#elementToCopyAvideo').val(text);
|
||||
$('#elementToCopyAvideo').focus();
|
||||
$('#elementToCopyAvideo').select();
|
||||
document.execCommand('copy');
|
||||
$('#elementToCopy').hide();
|
||||
$('#elementToCopyAvideo').remove();
|
||||
$.toast("Copied to Clipboard");
|
||||
}
|
||||
|
||||
|
@ -422,6 +423,9 @@ var browserPreventShowed = false;
|
|||
var playerPlayTimeout;
|
||||
function playerPlay(currentTime) {
|
||||
clearTimeout(playerPlayTimeout);
|
||||
if(playerIsPlayingAds()){
|
||||
return false;
|
||||
}
|
||||
if (currentTime) {
|
||||
console.log("playerPlay time:", currentTime);
|
||||
}
|
||||
|
@ -632,7 +636,7 @@ function playerPlayIfAutoPlay(currentTime) {
|
|||
}
|
||||
|
||||
function playNext(url) {
|
||||
if (isPlayingAds()) {
|
||||
if (playerIsPlayingAds()) {
|
||||
setTimeout(function () {
|
||||
playNext(url);
|
||||
}, 1000);
|
||||
|
@ -907,6 +911,31 @@ function avideoAlertHTMLText(title, msg, type) {
|
|||
});
|
||||
}
|
||||
|
||||
function avideoModalIframe(url) {
|
||||
var span = document.createElement("span");
|
||||
span.innerHTML = '<iframe src="' + url + '" />';
|
||||
swal({
|
||||
content: span,
|
||||
closeModal: true,
|
||||
buttons: false,
|
||||
className: 'swal-modal-iframe',
|
||||
onClose: avideoModalIframeRemove
|
||||
});
|
||||
setTimeout(function () {
|
||||
avideoModalIframeRemove();
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
function avideoModalIframeRemove() {
|
||||
if ($('.swal-modal-iframe').parent().hasClass('swal-overlay--show-modal')) {
|
||||
setTimeout(function () {
|
||||
avideoModalIframeRemove();
|
||||
}, 1000);
|
||||
} else {
|
||||
$('.swal-modal-iframe .swal-content').html('');
|
||||
}
|
||||
}
|
||||
|
||||
function avideoAlertText(msg) {
|
||||
avideoAlert("", msg, '');
|
||||
}
|
||||
|
@ -939,7 +968,7 @@ function fixAdSize() {
|
|||
}
|
||||
}
|
||||
|
||||
function isPlayingAds() {
|
||||
function playerIsPlayingAds() {
|
||||
return ($("#mainVideo_ima-ad-container").length && $("#mainVideo_ima-ad-container").is(':visible'));
|
||||
}
|
||||
|
||||
|
@ -947,6 +976,16 @@ function playerHasAds() {
|
|||
return ($("#mainVideo_ima-ad-container").length > 0);
|
||||
}
|
||||
|
||||
function pauseIfIsPlayinAds(){
|
||||
if(playerHasAds()){
|
||||
setTimeout(function(){
|
||||
if(playerIsPlayingAds()){
|
||||
player.pause();
|
||||
}
|
||||
}, 1000);
|
||||
}
|
||||
}
|
||||
|
||||
function countTo(selector, total) {
|
||||
var text = $(selector).text();
|
||||
if (isNaN(text)) {
|
||||
|
@ -1189,7 +1228,7 @@ function getCroppie(uploadCropObject, callback, width, height) {
|
|||
console.log('getCroppie 2 ' + callback, resp);
|
||||
eval(callback + "(resp);");
|
||||
}).catch(function (err) {
|
||||
console.log('cropieError getCroppie => '+callback, err);
|
||||
console.log('cropieError getCroppie => ' + callback, err);
|
||||
eval(callback + "(null);");
|
||||
});
|
||||
|
||||
|
@ -1217,23 +1256,55 @@ function avideoSocketIsActive() {
|
|||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function isMediaSiteURL(url){
|
||||
|
||||
function isMediaSiteURL(url) {
|
||||
if (validURL(url)) {
|
||||
if(url.match(/youtube/i) ||
|
||||
url.match(/youtu\.be/i) ||
|
||||
url.match(/vimeo/i) ||
|
||||
url.match(/dailymotion/i) ||
|
||||
url.match(/metacafe/i) ||
|
||||
url.match(/vid\.me/i) ||
|
||||
url.match(/rutube\.ru/i) ||
|
||||
url.match(/ok\.ru/i) ||
|
||||
url.match(/streamable/i) ||
|
||||
url.match(/twitch/i) ||
|
||||
url.match(/evideoEmbed/i) ||
|
||||
url.match(/videoEmbeded/i) ){
|
||||
return true;
|
||||
if (url.match(/youtube/i) ||
|
||||
url.match(/youtu\.be/i) ||
|
||||
url.match(/vimeo/i) ||
|
||||
url.match(/dailymotion/i) ||
|
||||
url.match(/metacafe/i) ||
|
||||
url.match(/vid\.me/i) ||
|
||||
url.match(/rutube\.ru/i) ||
|
||||
url.match(/ok\.ru/i) ||
|
||||
url.match(/streamable/i) ||
|
||||
url.match(/twitch/i) ||
|
||||
url.match(/evideoEmbed/i) ||
|
||||
url.match(/videoEmbeded/i)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function avideoSocket() {
|
||||
if (typeof parseSocketResponse === 'function') {
|
||||
parseSocketResponse();
|
||||
}
|
||||
}
|
||||
|
||||
function changeVideoStatus(videos_id, status) {
|
||||
modal.showPleaseWait();
|
||||
$.ajax({
|
||||
url: webSiteRootURL + 'objects/videoStatus.json.php',
|
||||
data: {"id": [videos_id], "status": status},
|
||||
type: 'post',
|
||||
success: function (response) {
|
||||
modal.hidePleaseWait();
|
||||
if (response.error) {
|
||||
avideoToast("Sorry!", response.msg, "error");
|
||||
} else {
|
||||
|
||||
for (var item in response.status) {
|
||||
var videos_id = response.status[item].videos_id
|
||||
$(".getChangeVideoStatusButton_" + videos_id).removeClass('status_a');
|
||||
$(".getChangeVideoStatusButton_" + videos_id).removeClass('status_u');
|
||||
$(".getChangeVideoStatusButton_" + videos_id).removeClass('status_i');
|
||||
$(".getChangeVideoStatusButton_" + videos_id).addClass('status_' + response.status[item].status);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
|
@ -66,7 +66,7 @@ if (User::hasBlockedUser($video['users_id'])) {
|
|||
echo $video['title'];
|
||||
if (!empty($video['id']) && Video::showYoutubeModeOptions() && Video::canEdit($video['id'])) {
|
||||
?>
|
||||
<a href="<?php echo $global['webSiteRootURL']; ?>mvideos?video_id=<?php echo $video['id']; ?>" class="btn btn-primary btn-xs" data-toggle="tooltip" title="<?php echo __("Edit Video"); ?>"><i class="fa fa-edit"></i> <?php echo __("Edit Video"); ?></a>
|
||||
<a href="#" onclick="avideoModalIframe('<?php echo $global['webSiteRootURL']; ?>mvideos?video_id=<?php echo $video['id']; ?>');return false;" class="btn btn-primary btn-xs" data-toggle="tooltip" title="<?php echo __("Edit Video"); ?>"><i class="fa fa-edit"></i> <?php echo __("Edit Video"); ?></a>
|
||||
<?php } ?>
|
||||
<small>
|
||||
<?php
|
||||
|
|
|
@ -10,7 +10,7 @@ if (empty($_GET['redirectUri'])) {
|
|||
}
|
||||
}
|
||||
}
|
||||
if (empty($_COOKIE) && get_browser_name()!=='Other (Unknown)') {
|
||||
if (empty($_COOKIE) && get_browser_name() !== 'Other (Unknown)') {
|
||||
?>
|
||||
<div style="padding: 10px;">
|
||||
<div class="alert alert-warning">
|
||||
|
@ -45,87 +45,92 @@ if (empty($_COOKIE) && get_browser_name()!=='Other (Unknown)') {
|
|||
}
|
||||
?>
|
||||
<div class="row">
|
||||
<div class="hidden-xs col-sm-2 col-md-3 col-lg-4"></div>
|
||||
<div class="col-xs-12 col-sm-8 col-md-6 col-lg-4 list-group-item addWidthOnMenuOpen">
|
||||
<fieldset>
|
||||
<legend class=" hidden-xs">
|
||||
<?php
|
||||
echo __("Please sign in");
|
||||
if (!empty($advancedCustomUser->userMustBeLoggedInCloseButtonURL)) {
|
||||
?>
|
||||
<div class="pull-right">
|
||||
<a id="buttonMyNavbar" class=" btn btn-default navbar-btn" style="padding: 6px 12px; margin-right: 40px;" href="<?php echo $advancedCustomUser->userMustBeLoggedInCloseButtonURL; ?>">
|
||||
<i class="fas fa-times"></i>
|
||||
</a>
|
||||
</div>
|
||||
<div class="hidden-xs col-sm-2 col-md-3 "></div>
|
||||
<div class="col-xs-12 col-sm-8 col-md-6 list-group-item addWidthOnMenuOpen">
|
||||
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<div class="">
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</legend>
|
||||
|
||||
|
||||
<?php
|
||||
if (empty($advancedCustomUser->disableNativeSignIn)) {
|
||||
?>
|
||||
<form class="form-compact well form-horizontal" id="loginForm">
|
||||
<input type="hidden" name="redirectUri" value=""/>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label hidden-xs"><?php echo __("User"); ?></label>
|
||||
<div class="col-sm-8 inputGroupContainer">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon"><i class="glyphicon glyphicon-user"></i></span>
|
||||
<input id="inputUser" placeholder="<?php echo!empty($advancedCustomUser->forceLoginToBeTheEmail) ? "me@example.com" : __("User"); ?>" class="form-control" type="text" value="" required >
|
||||
if (!empty($advancedCustomUser->userMustBeLoggedInCloseButtonURL)) {
|
||||
?>
|
||||
<div class="pull-right">
|
||||
<a id="buttonMyNavbar" class=" btn btn-default navbar-btn" style="padding: 6px 12px; margin-right: 40px;" href="<?php echo $advancedCustomUser->userMustBeLoggedInCloseButtonURL; ?>">
|
||||
<i class="fas fa-times"></i>
|
||||
</a>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<?php
|
||||
if (empty($advancedCustomUser->disableNativeSignIn)) {
|
||||
?>
|
||||
<form class="form-horizontal" id="loginForm">
|
||||
<input type="hidden" name="redirectUri" value=""/>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label"><?php echo __("User"); ?></label>
|
||||
<div class="col-sm-8 inputGroupContainer">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon"><i class="glyphicon glyphicon-user"></i></span>
|
||||
<input id="inputUser" placeholder="<?php echo!empty($advancedCustomUser->forceLoginToBeTheEmail) ? "me@example.com" : __("User"); ?>" class="form-control" type="text" value="" required >
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label hidden-xs"><?php echo __("Password"); ?></label>
|
||||
<div class="col-sm-8 inputGroupContainer">
|
||||
<?php
|
||||
getInputPassword("inputPassword");
|
||||
?>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label"><?php echo __("Password"); ?></label>
|
||||
<div class="col-sm-8 inputGroupContainer">
|
||||
<?php
|
||||
getInputPassword("inputPassword");
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
$captcha = User::getCaptchaForm();
|
||||
?>
|
||||
<div class="form-group captcha" style="<?php echo User::isCaptchaNeed() ? "" : "display: none;" ?>" id="captchaForm">
|
||||
<?php echo $captcha; ?>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-sm-4"></div>
|
||||
<div class="col-sm-8">
|
||||
<div class="pull-left" style="margin-right: 10px;">
|
||||
<?php
|
||||
$captcha = User::getCaptchaForm();
|
||||
?>
|
||||
<div class="form-group captcha" style="<?php echo User::isCaptchaNeed() ? "" : "display: none;" ?>" id="captchaForm">
|
||||
<?php echo $captcha; ?>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-xs-4 text-right">
|
||||
<label for="inputRememberMe" ><?php echo __("Remember me"); ?></label>
|
||||
</div>
|
||||
<div class="col-xs-8">
|
||||
<div class="material-switch">
|
||||
<input id="inputRememberMe" class="form-control" type="checkbox">
|
||||
<label for="inputRememberMe" class="label-success"></label>
|
||||
</div>
|
||||
</div>
|
||||
<label class="pull-left"><?php echo __("Remember me"); ?></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-xs-12 inputGroupContainer">
|
||||
<?php
|
||||
if (empty($advancedCustomUser->disableNativeSignUp)) {
|
||||
?>
|
||||
<small><a href="#" class="btn btn-block" id="forgotPassword"><?php echo __("I forgot my password"); ?></a></small>
|
||||
<!-- Button -->
|
||||
<div class="form-group">
|
||||
<div class="col-md-12">
|
||||
<button type="submit" class="btn btn-success btn-block" id="mainButton" ><span class="fas fa-sign-in-alt"></span> <?php echo __("Sign in"); ?></button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-xs-12 inputGroupContainer text-center">
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
if (empty($advancedCustomUser->disableNativeSignUp)) {
|
||||
?>
|
||||
<a href="#" class="btn btn-default btn-xs" id="forgotPassword"><i class="fas fa-redo-alt"></i> <?php echo __("I forgot my password"); ?></a>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Button -->
|
||||
<div class="form-group">
|
||||
<div class="col-md-12">
|
||||
<button type="submit" class="btn btn-success btn-block" id="mainButton" ><span class="fas fa-sign-in-alt"></span> <?php echo __("Sign in"); ?></button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</form>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<div class="panel-footer">
|
||||
<?php
|
||||
if (empty($advancedCustomUser->disableNativeSignUp)) {
|
||||
?>
|
||||
|
@ -136,55 +141,86 @@ if (empty($_COOKIE) && get_browser_name()!=='Other (Unknown)') {
|
|||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<?php
|
||||
$login = AVideoPlugin::getLogin();
|
||||
|
||||
$totalLogins = 0;
|
||||
foreach ($login as $value) {
|
||||
if (is_string($value) && file_exists($value)) { // it is a include path for a form
|
||||
include $value;
|
||||
} else if (is_array($value)) {
|
||||
$totalLogins++;
|
||||
}
|
||||
?>
|
||||
<hr>
|
||||
<?php
|
||||
$login = AVideoPlugin::getLogin();
|
||||
foreach ($login as $value) {
|
||||
if (is_string($value) && file_exists($value)) { // it is a include path for a form
|
||||
include $value;
|
||||
} else if (is_array($value)) {
|
||||
$uid = uniqid();
|
||||
$oauthURL = "{$global['webSiteRootURL']}login?type={$value['parameters']->type}&redirectUri=".(isset($_GET['redirectUri']) ? $_GET['redirectUri'] : "");
|
||||
?>
|
||||
<div class="col-md-6">
|
||||
<button id="login<?php echo $uid; ?>" class="<?php echo $value['parameters']->class; ?>" ><span class="<?php echo $value['parameters']->icon; ?>"></span> <?php echo $value['parameters']->type; ?></button>
|
||||
</div>
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
$('#login<?php echo $uid; ?>').click(function () {
|
||||
modal.showPleaseWait();
|
||||
if (typeof inIframe !== 'undefined' && inIframe()) {
|
||||
var popup = window.open('<?php echo $oauthURL; ?>', 'loginYPT');
|
||||
var popupTick = setInterval(function() {
|
||||
if (popup.closed) {
|
||||
}
|
||||
|
||||
$columSize = 12;
|
||||
if($totalLogins>1){
|
||||
switch ($totalLogins) {
|
||||
case 2:
|
||||
case 4:
|
||||
case 5:
|
||||
case 7:
|
||||
case 8:
|
||||
case 10:
|
||||
case 11:
|
||||
$columSize = 6;
|
||||
break;
|
||||
case 3:
|
||||
case 6:
|
||||
case 9:
|
||||
case 12:
|
||||
$columSize = 4;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($login as $value) {
|
||||
if (is_string($value) && file_exists($value)) {
|
||||
//include $value;
|
||||
} else if (is_array($value)) {
|
||||
$uid = uniqid();
|
||||
$oauthURL = "{$global['webSiteRootURL']}login?type={$value['parameters']->type}&redirectUri=" . (isset($_GET['redirectUri']) ? $_GET['redirectUri'] : "");
|
||||
?>
|
||||
<div class="col-md-<?php echo $columSize; ?>">
|
||||
<button id="login<?php echo $uid; ?>" class="<?php echo $value['parameters']->class; ?>" ><span class="<?php echo $value['parameters']->icon; ?>"></span> <?php echo $value['parameters']->type; ?></button>
|
||||
</div>
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
$('#login<?php echo $uid; ?>').click(function () {
|
||||
modal.showPleaseWait();
|
||||
if (typeof inIframe !== 'undefined' && inIframe()) {
|
||||
var popup = window.open('<?php echo $oauthURL; ?>', 'loginYPT');
|
||||
var popupTick = setInterval(function () {
|
||||
if (popup.closed) {
|
||||
clearInterval(popupTick);
|
||||
console.log('window closed!');
|
||||
location.reload();
|
||||
}
|
||||
}, 500);
|
||||
} else {
|
||||
document.location = "<?php echo $oauthURL; ?>";
|
||||
}
|
||||
});
|
||||
}
|
||||
}, 500);
|
||||
} else {
|
||||
document.location = "<?php echo $oauthURL; ?>";
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<hr>
|
||||
</fieldset>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
if (!empty($advancedCustomUser->messageToAppearBelowLoginBox->value)) {
|
||||
echo "<div class='alert alert-info'>";
|
||||
echo "<div class='alert alert-info'> <i class=\"fas fa-info-circle\"></i> ";
|
||||
echo $advancedCustomUser->messageToAppearBelowLoginBox->value;
|
||||
echo "</div>";
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<div class="hidden-xs col-sm-2 col-md-3 col-lg-4"></div>
|
||||
<div class="hidden-xs col-sm-2 col-md-3"></div>
|
||||
</div>
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
|
@ -197,7 +233,12 @@ if (!empty($_GET['error'])) {
|
|||
?>
|
||||
$('#loginForm').submit(function (evt) {
|
||||
evt.preventDefault();
|
||||
if (!$('#inputUser').val() || !$('#inputPassword').val()) {
|
||||
if (!$('#inputUser').val()) {
|
||||
avideoAlertError('<?php echo __('Please type your username'); ?>');
|
||||
return false;
|
||||
}
|
||||
if (!$('#inputPassword').val()) {
|
||||
avideoAlertError('<?php echo __('Please type your password'); ?>');
|
||||
return false;
|
||||
}
|
||||
<?php
|
||||
|
@ -208,6 +249,7 @@ if (!empty($advancedCustomUser->forceLoginToBeTheEmail)) {
|
|||
// if the user is admin, let it go
|
||||
//avideoAlert("<?php echo __("Sorry!"); ?>", "<?php echo __("The username must be an email"); ?>", "error");
|
||||
//return false;
|
||||
avideoToastWarning('<?php echo __('This is not a valid email'); ?>');
|
||||
}
|
||||
<?php
|
||||
}
|
||||
|
@ -252,7 +294,7 @@ if (!empty($advancedCustomUser->forceLoginToBeTheEmail)) {
|
|||
buttons: true,
|
||||
dangerMode: true,
|
||||
})
|
||||
.then(function(willDelete) {
|
||||
.then(function (willDelete) {
|
||||
if (willDelete) {
|
||||
|
||||
modal.showPleaseWait();
|
||||
|
|
|
@ -543,16 +543,6 @@ if (User::hasBlockedUser($video['users_id'])) {
|
|||
echo AVideoPlugin::getFooterCode();
|
||||
include $global['systemRootPath'] . 'plugin/PlayerSkins/contextMenu.php';
|
||||
?>
|
||||
<textarea id="elementToCopy" style="
|
||||
filter: alpha(opacity=0);
|
||||
-moz-opacity: 0;
|
||||
-khtml-opacity: 0;
|
||||
opacity: 0;
|
||||
position: absolute;
|
||||
z-index: -9999;
|
||||
top: 0;
|
||||
left: 0;
|
||||
pointer-events: none;"></textarea>
|
||||
<script>
|
||||
var topInfoTimeout;
|
||||
$(document).ready(function () {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue