mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-03 09:49:28 +02:00
Update
This commit is contained in:
parent
4a3c059174
commit
20a971ae4f
34 changed files with 1162 additions and 861 deletions
|
@ -133,7 +133,7 @@ Options All -Indexes
|
||||||
RewriteRule ^videoOnly/?$ view/?type=video [NC,L]
|
RewriteRule ^videoOnly/?$ view/?type=video [NC,L]
|
||||||
RewriteRule ^audioOnly/?$ view/?type=audio [NC,L]
|
RewriteRule ^audioOnly/?$ view/?type=audio [NC,L]
|
||||||
RewriteRule ^download$ view/downloadExternalVideo.php [NC,L]
|
RewriteRule ^download$ view/downloadExternalVideo.php [NC,L]
|
||||||
RewriteRule ^info$ view/info.php [NC,L]
|
RewriteRule ^info$ view/info.php [QSA,L]
|
||||||
RewriteRule ^version$ view/info.php?version=1 [NC,L]
|
RewriteRule ^version$ view/info.php?version=1 [NC,L]
|
||||||
RewriteRule ^downloadNow$ objects/downloadVideo.php [NC,L]
|
RewriteRule ^downloadNow$ objects/downloadVideo.php [NC,L]
|
||||||
RewriteRule ^getDownloadProgress$ objects/downloadVideoProgress.php [NC,L]
|
RewriteRule ^getDownloadProgress$ objects/downloadVideoProgress.php [NC,L]
|
||||||
|
|
BIN
install/assets/Arial.ttf
Normal file
BIN
install/assets/Arial.ttf
Normal file
Binary file not shown.
0
install/assets/subtitle.srt
Normal file
0
install/assets/subtitle.srt
Normal file
2
install/assets/subtitle.vtt
Normal file
2
install/assets/subtitle.vtt
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
WEBVTT
|
||||||
|
|
BIN
install/assets/testMP3.mp3
Normal file
BIN
install/assets/testMP3.mp3
Normal file
Binary file not shown.
BIN
install/assets/testVideo.mp4
Normal file
BIN
install/assets/testVideo.mp4
Normal file
Binary file not shown.
BIN
install/assets/thumbsSprit.jpg
Normal file
BIN
install/assets/thumbsSprit.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 307 KiB |
194
install/populateForTest.php
Normal file
194
install/populateForTest.php
Normal file
|
@ -0,0 +1,194 @@
|
||||||
|
<?php
|
||||||
|
require_once '../videos/configuration.php';
|
||||||
|
|
||||||
|
if (!isCommandLineInterface()) {
|
||||||
|
return die('Command Line only');
|
||||||
|
}
|
||||||
|
|
||||||
|
error_reporting(E_ALL);
|
||||||
|
ini_set('display_errors', 1);
|
||||||
|
|
||||||
|
$_SESSION['user'] = array();
|
||||||
|
$_SESSION['user']['id'] = 1;
|
||||||
|
ob_end_flush();
|
||||||
|
|
||||||
|
$videoFile = 'assets/testVideo.mp4';
|
||||||
|
$audioFile = 'assets/testMP3.mp3';
|
||||||
|
$spritFile = 'assets/thumbsSprit.jpg';
|
||||||
|
$subtitleSRT = 'assets/subtitle.srt';
|
||||||
|
$subtitleVTT = 'assets/subtitle.vtt';
|
||||||
|
$totalVideos = 50;
|
||||||
|
$totalPlaylists = 10;
|
||||||
|
$totalVideosPerPlaylist = 30;
|
||||||
|
$totalCategories = 10;
|
||||||
|
$totalSubCategories = 5;
|
||||||
|
/*
|
||||||
|
for ($i = 0; $i < $totalCategories; $i++) {
|
||||||
|
$date = date('Y/m/d H:i:s');
|
||||||
|
$catTitle = "$i Auto Category $date";
|
||||||
|
$catCleanTitle = "{$i}-Auto-Category-".date('YmdHis');
|
||||||
|
$cat = new Category(0);
|
||||||
|
$cat->setName($catTitle);
|
||||||
|
$cat->setClean_name($catCleanTitle);
|
||||||
|
$parentId = $cat->save(true);
|
||||||
|
echo "pupulating [$totalVideos/$i] category saved [id=$parentId]" . PHP_EOL;
|
||||||
|
for ($j = 0; $j < $totalSubCategories; $j++) {
|
||||||
|
$catTitle = "$i Auto SubCategory $date";
|
||||||
|
$catCleanTitle = "{$i}-Auto-SubCategory-".date('YmdHis');
|
||||||
|
$cat = new Category(0);
|
||||||
|
$cat->setName($catTitle);
|
||||||
|
$cat->setClean_name($catCleanTitle);
|
||||||
|
$cat->setParentId($parentId);
|
||||||
|
$id = $cat->save(true);
|
||||||
|
echo "pupulating [$totalVideos/$i] subcategory saved [id=$id]" . PHP_EOL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
echo "pupulating ... ";
|
||||||
|
$cats = Category::getAllCategories();
|
||||||
|
echo "pupulating ... ".__LINE__;
|
||||||
|
$videos = Video::getAllVideosLight('');
|
||||||
|
echo "pupulating ... ".__LINE__;
|
||||||
|
$total = count($videos);
|
||||||
|
echo "[{$total}/{$key}] pupulating video start ";
|
||||||
|
foreach ($videos as $key => $value) {
|
||||||
|
$video = new Video('', '', $value['id']);
|
||||||
|
$index = array_rand($cats);
|
||||||
|
$video->setCategories_id($cats[$index]['id']);
|
||||||
|
$id = $video->save(false, true);
|
||||||
|
echo "[{$total}/{$key}] pupulating video category saved [id=$id catId={$cats[$index]['id']}]" . PHP_EOL;
|
||||||
|
}
|
||||||
|
exit;
|
||||||
|
|
||||||
|
$newVideosIds = array();
|
||||||
|
|
||||||
|
// create videos
|
||||||
|
for ($i = 0; $i < $totalVideos; $i++) {
|
||||||
|
$date = date('Y/m/d H:i:s');
|
||||||
|
$title = "[$i] Auto {$date}";
|
||||||
|
$filename = "testvideo{$i}_" . uniqid();
|
||||||
|
$video = new Video($title, $filename);
|
||||||
|
|
||||||
|
$video->setDuration("00:00:45");
|
||||||
|
$video->setType('video');
|
||||||
|
$video->setDuration_in_seconds(45);
|
||||||
|
$video->setDescription($title);
|
||||||
|
$video->setUsers_id(1);
|
||||||
|
|
||||||
|
$index = array_rand($cats);
|
||||||
|
|
||||||
|
$video->setCategories_id($cats[$index]['id']);
|
||||||
|
$video->setStatus(Video::$statusActive);
|
||||||
|
$video->setFilesize(2858747);
|
||||||
|
$video->setLikes(rand(0, 1000));
|
||||||
|
$video->setDislikes(rand(0, 1000));
|
||||||
|
|
||||||
|
$path = Video::getPathToFile($filename, true);
|
||||||
|
|
||||||
|
$mp4Filename = "{$path}_480.mp4";
|
||||||
|
$mp3Filename = "{$path}.mp3";
|
||||||
|
$jpgFilename = "{$path}.jpg";
|
||||||
|
$spritFilename = "{$path}_thumbsSprit.jpg";
|
||||||
|
$subtitleSRTFilename = "{$path}.srt";
|
||||||
|
$subtitleVTTFilename = "{$path}.vtt";
|
||||||
|
|
||||||
|
createImageWithText("[$i] Auto Pupulated", $date, $jpgFilename);
|
||||||
|
copy($videoFile, $mp4Filename);
|
||||||
|
copy($audioFile, $mp3Filename);
|
||||||
|
copy($spritFile, $spritFilename);
|
||||||
|
copy($subtitleSRT, $subtitleSRTFilename);
|
||||||
|
copy($subtitleVTT, $subtitleVTTFilename);
|
||||||
|
|
||||||
|
$id = $video->save(false, true);
|
||||||
|
$newVideosIds[] = $id;
|
||||||
|
echo "pupulating [$totalVideos/$i] Video saved [id=$id]" . PHP_EOL;
|
||||||
|
}
|
||||||
|
|
||||||
|
AVideoPlugin::loadPlugin('PlayLists');
|
||||||
|
|
||||||
|
for ($i = 0; $i < $totalPlaylists; $i++) {
|
||||||
|
$name = "Playlist test autogenerated $i " . date('Y/m/d H:i:s');
|
||||||
|
$playlist = new PlayList(0);
|
||||||
|
$playlist->setName($name);
|
||||||
|
$playlist->setStatus('a');
|
||||||
|
$id = $playlist->save();
|
||||||
|
echo "pupulating [$totalPlaylists/$i] Playlist saved [id=$id]" . PHP_EOL;
|
||||||
|
for ($j = 0; $j < $totalVideosPerPlaylist; $j++) {
|
||||||
|
$playList = new PlayList($id);
|
||||||
|
$playList->addVideo($newVideosIds[array_rand($newVideosIds)], 1);
|
||||||
|
echo "pupulating [$totalVideosPerPlaylist/$j] Video added in a Playlist" . PHP_EOL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
die();
|
||||||
|
|
||||||
|
function createImageWithText($text1, $text2, $filename)
|
||||||
|
{
|
||||||
|
// Create a blank image
|
||||||
|
$width = 640;
|
||||||
|
$height = 360;
|
||||||
|
$image = imagecreatetruecolor($width, $height);
|
||||||
|
|
||||||
|
// Allocate a color for the background and fill the background
|
||||||
|
$red = rand(0, 255);
|
||||||
|
$green = rand(0, 255);
|
||||||
|
$blue = rand(0, 255);
|
||||||
|
$backgroundColor = imagecolorallocate($image, $red, $green, $blue);
|
||||||
|
imagefilledrectangle($image, 0, 0, $width, $height, $backgroundColor);
|
||||||
|
|
||||||
|
// Calculate the luminance of the background color
|
||||||
|
$luminance = (0.299 * $red + 0.587 * $green + 0.114 * $blue) / 255;
|
||||||
|
|
||||||
|
// Allocate a color for the text
|
||||||
|
if ($luminance > 0.5) {
|
||||||
|
$textColor = imagecolorallocate($image, 0, 0, 0); // Use black text for a light background
|
||||||
|
} else {
|
||||||
|
$textColor = imagecolorallocate($image, 255, 255, 255); // Use white text for a dark background
|
||||||
|
}
|
||||||
|
|
||||||
|
// Font size and path
|
||||||
|
$fontSize = 48;
|
||||||
|
$fontPath = 'assets/Arial.ttf';
|
||||||
|
|
||||||
|
// Calculate x position of the first line of text
|
||||||
|
$box1 = imagettfbbox($fontSize, 0, $fontPath, $text1);
|
||||||
|
$textWidth1 = $box1[2] - $box1[0];
|
||||||
|
$x1 = ($width - $textWidth1) / 2;
|
||||||
|
|
||||||
|
// Calculate x position of the second line of text
|
||||||
|
$box2 = imagettfbbox($fontSize, 0, $fontPath, $text2);
|
||||||
|
$textWidth2 = $box2[2] - $box2[0];
|
||||||
|
$x2 = ($width - $textWidth2) / 2;
|
||||||
|
|
||||||
|
// Y positions for each line of text
|
||||||
|
$y1 = ceil($height / 3);
|
||||||
|
$y2 = $y1 * 2;
|
||||||
|
|
||||||
|
// Add the text to the image
|
||||||
|
imagettftext($image, $fontSize, 0, $x1, $y1, $textColor, $fontPath, $text1);
|
||||||
|
imagettftext($image, $fontSize, 0, $x2, $y2, $textColor, $fontPath, $text2);
|
||||||
|
|
||||||
|
// Save the image
|
||||||
|
imagejpeg($image, $filename);
|
||||||
|
|
||||||
|
// Free up memory
|
||||||
|
imagedestroy($image);
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
/*
|
||||||
|
AVideoPlugin::loadPlugin('PlayLists');
|
||||||
|
$pls = PlayList::getAll();
|
||||||
|
$videos = Video::getAllVideosLight('');
|
||||||
|
$total = count($videos);
|
||||||
|
foreach ($pls as $key => $value) {
|
||||||
|
echo "[{$total}/{$key}] playlists_id={$value['id']} pupulating video start " . PHP_EOL;
|
||||||
|
for ($j = 0; $j < 50; $j++) {
|
||||||
|
$playlist = new PlayList($value['id']);
|
||||||
|
$index = array_rand($videos);
|
||||||
|
$videos_id = $videos[$index]['id'];
|
||||||
|
echo "[{$total}/{$key}/{$j}] pupulating [$videos_id] type={$videos[$index]['type']} Video added in a Playlist start" . PHP_EOL;
|
||||||
|
$playlist->addVideo($videos[$index]['id'], 1, 0, false);
|
||||||
|
echo "[{$total}/{$key}/{$j}] pupulating done [$videos_id] Video added in a Playlist" . PHP_EOL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
*/
|
|
@ -73,7 +73,6 @@ class Category {
|
||||||
public function setClean_name($clean_name) {
|
public function setClean_name($clean_name) {
|
||||||
$clean_name = preg_replace('/\W+/', '-', strtolower(cleanString($clean_name)));
|
$clean_name = preg_replace('/\W+/', '-', strtolower(cleanString($clean_name)));
|
||||||
$this->clean_name = _substr($clean_name, 0, 45);
|
$this->clean_name = _substr($clean_name, 0, 45);
|
||||||
;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setNextVideoOrder($nextVideoOrder) {
|
public function setNextVideoOrder($nextVideoOrder) {
|
||||||
|
@ -471,7 +470,7 @@ class Category {
|
||||||
//_error_log("getAllCategories id={$row['id']} line=".__LINE__);
|
//_error_log("getAllCategories id={$row['id']} line=".__LINE__);
|
||||||
$row['hierarchyAndName'] = $row['hierarchy'] . __($row['name']);
|
$row['hierarchyAndName'] = $row['hierarchy'] . __($row['name']);
|
||||||
//_error_log("getAllCategories id={$row['id']} line=".__LINE__);
|
//_error_log("getAllCategories id={$row['id']} line=".__LINE__);
|
||||||
$row['description_html'] = textToLink(htmlentities($row['description']));
|
$row['description_html'] = textToLink(htmlentities("{$row['description']}"));
|
||||||
$category[] = $row;
|
$category[] = $row;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -388,6 +388,9 @@ function getRealIpAddr()
|
||||||
|
|
||||||
function cleanString($text)
|
function cleanString($text)
|
||||||
{
|
{
|
||||||
|
if(empty($text)){
|
||||||
|
return '';
|
||||||
|
}
|
||||||
$utf8 = [
|
$utf8 = [
|
||||||
'/[áaâaaäą]/u' => 'a',
|
'/[áaâaaäą]/u' => 'a',
|
||||||
'/[ÁAÂAÄĄ]/u' => 'A',
|
'/[ÁAÂAÄĄ]/u' => 'A',
|
||||||
|
@ -1674,6 +1677,9 @@ function getResolutionFromFilename($filename)
|
||||||
return $getResolutionFromFilenameArray[$filename];
|
return $getResolutionFromFilenameArray[$filename];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(empty($filename)){
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
if (!preg_match('/^http/i', $filename) && !file_exists($filename)) {
|
if (!preg_match('/^http/i', $filename) && !file_exists($filename)) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -10132,7 +10138,7 @@ function forbiddenPageIfCannotEmbed($videos_id)
|
||||||
$reason[] = __('Admin block video sharing');
|
$reason[] = __('Admin block video sharing');
|
||||||
}
|
}
|
||||||
if (!CustomizeUser::canShareVideosFromVideo($videos_id)) {
|
if (!CustomizeUser::canShareVideosFromVideo($videos_id)) {
|
||||||
error_log("forbiddenPageIfCannotEmbed: Embed is forbidden: !CustomizeUser::canShareVideosFromVideo({$video['id']})");
|
error_log("forbiddenPageIfCannotEmbed: Embed is forbidden: !CustomizeUser::canShareVideosFromVideo({$videos_id})");
|
||||||
$reason[] = __('User block video sharing');
|
$reason[] = __('User block video sharing');
|
||||||
}
|
}
|
||||||
forbiddenPage("Embed is forbidden " . implode('<br>', $reason));
|
forbiddenPage("Embed is forbidden " . implode('<br>', $reason));
|
||||||
|
@ -11199,3 +11205,33 @@ function getImageOrientation($imagePath) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function canSearchUsers(){
|
||||||
|
global $advancedCustomUser;
|
||||||
|
if(canAdminUsers()){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if(AVideoPlugin::isEnabledByName('PlayLists')){
|
||||||
|
if(PlayLists::canManageAllPlaylists()){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (empty($advancedCustomUser)) {
|
||||||
|
$advancedCustomUser = AVideoPlugin::getObjectDataIfEnabled('CustomizeUser');
|
||||||
|
}
|
||||||
|
if($advancedCustomUser->userCanChangeVideoOwner){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
function canAdminUsers(){
|
||||||
|
if(Permissions::canAdminUsers()){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if(AVideoPlugin::isEnabledByName('PayPerView')){
|
||||||
|
if(PayPerView::canSeePPVManagementInfo()){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
|
@ -469,7 +469,7 @@ class PlayList extends ObjectYPT {
|
||||||
$row['humancreate'] = humanTiming(strtotime($row['cre']));
|
$row['humancreate'] = humanTiming(strtotime($row['cre']));
|
||||||
}
|
}
|
||||||
$images = Video::getImageFromFilename($row['filename'], $row['type']);
|
$images = Video::getImageFromFilename($row['filename'], $row['type']);
|
||||||
if (!file_exists($images->posterLandscapePath) && !empty($row['serie_playlists_id'])) {
|
if (is_object($images) && !empty($images->posterLandscapePath) && !file_exists($images->posterLandscapePath) && !empty($row['serie_playlists_id'])) {
|
||||||
$images = self::getRandomImageFromPlayList($row['serie_playlists_id']);
|
$images = self::getRandomImageFromPlayList($row['serie_playlists_id']);
|
||||||
}
|
}
|
||||||
$row['images'] = $images;
|
$row['images'] = $images;
|
||||||
|
@ -729,6 +729,7 @@ class PlayList extends ObjectYPT {
|
||||||
if (!empty($playlists_id)) {
|
if (!empty($playlists_id)) {
|
||||||
self::deleteCacheDir($playlists_id);
|
self::deleteCacheDir($playlists_id);
|
||||||
}
|
}
|
||||||
|
$this->id = $playlists_id;
|
||||||
return $playlists_id;
|
return $playlists_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -10,20 +10,16 @@ if (!User::isLogged()) {
|
||||||
die('{"error":"'.__("Permission denied").'"}');
|
die('{"error":"'.__("Permission denied").'"}');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($_POST['playlist_id']) && !empty($_GET['playlist_id'])) {
|
if (!PlayLists::canManagePlaylist($_REQUEST['playlist_id'])) {
|
||||||
$_POST['playlist_id'] = intval($_GET['playlist_id']);
|
|
||||||
}
|
|
||||||
|
|
||||||
$obj = new PlayList($_POST['playlist_id']);
|
|
||||||
if (User::getId() !== $obj->getUsers_id()) {
|
|
||||||
die('{"error":"'.__("Permission denied").'"}');
|
die('{"error":"'.__("Permission denied").'"}');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$obj = new PlayList($_REQUEST['playlist_id']);
|
||||||
$count = 1;
|
$count = 1;
|
||||||
|
|
||||||
if (empty($_POST['list'])) {
|
if (empty($_POST['list'])) {
|
||||||
// get all videos from playlist
|
// get all videos from playlist
|
||||||
$videosArrayId = PlayList::getVideosIdFromPlaylist($_POST['playlist_id']);
|
$videosArrayId = PlayList::getVideosIdFromPlaylist($_REQUEST['playlist_id']);
|
||||||
$videos = [];
|
$videos = [];
|
||||||
foreach ($videosArrayId as $value) {
|
foreach ($videosArrayId as $value) {
|
||||||
$videos[] = Video::getVideoLight($value);
|
$videos[] = Video::getVideoLight($value);
|
||||||
|
|
|
@ -341,7 +341,7 @@ if (typeof gtag !== \"function\") {
|
||||||
|
|
||||||
public static function _recommendChannelName($name = "", $try = 0, $unknown = "", $users_id = 0) {
|
public static function _recommendChannelName($name = "", $try = 0, $unknown = "", $users_id = 0) {
|
||||||
|
|
||||||
$name = preg_replace('/\s+/', '', $name);
|
$name = preg_replace('/\s+/', '', "{$name}");
|
||||||
if (empty($users_id)) {
|
if (empty($users_id)) {
|
||||||
if (!empty(User::getId())) {
|
if (!empty(User::getId())) {
|
||||||
$users_id = User::getId();
|
$users_id = User::getId();
|
||||||
|
@ -694,7 +694,7 @@ if (typeof gtag !== \"function\") {
|
||||||
$password = ($this->password);
|
$password = ($this->password);
|
||||||
$name = ($this->name);
|
$name = ($this->name);
|
||||||
$status = ($this->status);
|
$status = ($this->status);
|
||||||
$this->about = preg_replace("/(\\\)+n/", "\n", $this->about);
|
$this->about = preg_replace("/(\\\)+n/", "\n", "{$this->about}");
|
||||||
$this->channelName = self::_recommendChannelName($this->channelName, 0, $this->user, $this->id);
|
$this->channelName = self::_recommendChannelName($this->channelName, 0, $this->user, $this->id);
|
||||||
$channelName = ($this->channelName);
|
$channelName = ($this->channelName);
|
||||||
if (filter_var($this->donationLink, FILTER_VALIDATE_URL) === false) {
|
if (filter_var($this->donationLink, FILTER_VALIDATE_URL) === false) {
|
||||||
|
@ -749,6 +749,8 @@ if (typeof gtag !== \"function\") {
|
||||||
. " status,photoURL,recoverPass, created, modified, channelName, analyticsCode, externalOptions, phone, is_company,emailVerified) "
|
. " status,photoURL,recoverPass, created, modified, channelName, analyticsCode, externalOptions, phone, is_company,emailVerified) "
|
||||||
. " VALUES (?,?,?,?,?,?,?,?, false, "
|
. " VALUES (?,?,?,?,?,?,?,?, false, "
|
||||||
. "?,?,?, now(), now(),?,?,?,?," . (empty($this->is_company) ? 'NULL' : intval($this->is_company)) . ",?)";
|
. "?,?,?, now(), now(),?,?,?,?," . (empty($this->is_company) ? 'NULL' : intval($this->is_company)) . ",?)";
|
||||||
|
|
||||||
|
_error_log("Insert new user user=$user, email={$this->email}, name=$name ". json_encode(debug_backtrace()));
|
||||||
}
|
}
|
||||||
$insert_row = sqlDAL::writeSql($sql, $formats, $values);
|
$insert_row = sqlDAL::writeSql($sql, $formats, $values);
|
||||||
|
|
||||||
|
@ -771,6 +773,7 @@ if (typeof gtag !== \"function\") {
|
||||||
// update the user groups
|
// update the user groups
|
||||||
UserGroups::updateUserGroups($id, $this->userGroups);
|
UserGroups::updateUserGroups($id, $this->userGroups);
|
||||||
}
|
}
|
||||||
|
$this->id = $id;
|
||||||
return $id;
|
return $id;
|
||||||
} else {
|
} else {
|
||||||
_error_log(' Error : (' . $global['mysqli']->errno . ') ' . $global['mysqli']->error . " $sql");
|
_error_log(' Error : (' . $global['mysqli']->errno . ') ' . $global['mysqli']->error . " $sql");
|
||||||
|
@ -1188,7 +1191,7 @@ if (typeof gtag !== \"function\") {
|
||||||
return !empty($_SESSION['user']['emailVerified']);
|
return !empty($_SESSION['user']['emailVerified']);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function isAdmin($users_id = 0) {
|
public static function isAdmin($users_id = 0) : bool {
|
||||||
if (!empty($users_id)) {
|
if (!empty($users_id)) {
|
||||||
$user = new User($users_id);
|
$user = new User($users_id);
|
||||||
return !empty($user->getIsAdmin());
|
return !empty($user->getIsAdmin());
|
||||||
|
|
|
@ -16,6 +16,15 @@ $obj->status = 0;
|
||||||
if (!Permissions::canAdminUsers()) {
|
if (!Permissions::canAdminUsers()) {
|
||||||
forbiddenPage();
|
forbiddenPage();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(empty($_REQUEST['securityToken'])){
|
||||||
|
forbiddenPage('Security token is empty');
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!isTokenValid($_REQUEST['securityToken'])){
|
||||||
|
forbiddenPage('Security token is invalid');
|
||||||
|
}
|
||||||
|
|
||||||
session_write_close();
|
session_write_close();
|
||||||
if (!empty($advancedCustomUser->forceLoginToBeTheEmail)) {
|
if (!empty($advancedCustomUser->forceLoginToBeTheEmail)) {
|
||||||
$_POST['email'] = $_POST['user'];
|
$_POST['email'] = $_POST['user'];
|
||||||
|
@ -34,7 +43,7 @@ $user->setEmail($_POST['email']);
|
||||||
$user->setName($_POST['name']);
|
$user->setName($_POST['name']);
|
||||||
$user->setIsAdmin($_POST['isAdmin']);
|
$user->setIsAdmin($_POST['isAdmin']);
|
||||||
$user->setCanStream($_POST['canStream']);
|
$user->setCanStream($_POST['canStream']);
|
||||||
$user->setIs_company($_POST['is_company']);
|
$user->setIs_company(@$_POST['is_company']);
|
||||||
$user->setCanUpload($_POST['canUpload']);
|
$user->setCanUpload($_POST['canUpload']);
|
||||||
$user->setCanViewChart($_POST['canViewChart']);
|
$user->setCanViewChart($_POST['canViewChart']);
|
||||||
$user->setCanCreateMeet($_POST['canCreateMeet']);
|
$user->setCanCreateMeet($_POST['canCreateMeet']);
|
||||||
|
|
|
@ -54,9 +54,6 @@ class UserGroups{
|
||||||
public function save()
|
public function save()
|
||||||
{
|
{
|
||||||
global $global;
|
global $global;
|
||||||
if (empty($this->isAdmin)) {
|
|
||||||
$this->isAdmin = "false";
|
|
||||||
}
|
|
||||||
$formats = '';
|
$formats = '';
|
||||||
$values = [];
|
$values = [];
|
||||||
$this->group_name = _substr($this->group_name, 0, 255);
|
$this->group_name = _substr($this->group_name, 0, 255);
|
||||||
|
|
|
@ -8,7 +8,7 @@ require_once $global['systemRootPath'] . 'videos/configuration.php';
|
||||||
require_once $global['systemRootPath'] . 'objects/user.php';
|
require_once $global['systemRootPath'] . 'objects/user.php';
|
||||||
header('Content-Type: application/json');
|
header('Content-Type: application/json');
|
||||||
|
|
||||||
$canAdminUsers = Permissions::canAdminUsers();
|
$canAdminUsers = canAdminUsers();
|
||||||
if (empty($_POST['current'])) {
|
if (empty($_POST['current'])) {
|
||||||
$_POST['current'] = 1;
|
$_POST['current'] = 1;
|
||||||
}
|
}
|
||||||
|
@ -29,7 +29,7 @@ if (!empty($_REQUEST['users_id'])) {
|
||||||
//echo __LINE__, PHP_EOL;
|
//echo __LINE__, PHP_EOL;
|
||||||
$isAdmin = null;
|
$isAdmin = null;
|
||||||
$isCompany = null;
|
$isCompany = null;
|
||||||
$ignoreAdmin = $advancedCustomUser->userCanChangeVideoOwner ? true : false;
|
$ignoreAdmin = canSearchUsers() ? true : false;
|
||||||
if (isset($_REQUEST['isAdmin'])) {
|
if (isset($_REQUEST['isAdmin'])) {
|
||||||
$isAdmin = 1;
|
$isAdmin = 1;
|
||||||
}
|
}
|
||||||
|
@ -48,8 +48,8 @@ if (!empty($_REQUEST['users_id'])) {
|
||||||
$total = User::getTotalUsers($ignoreAdmin, @$_GET['status'], $isAdmin, $isCompany);
|
$total = User::getTotalUsers($ignoreAdmin, @$_GET['status'], $isAdmin, $isCompany);
|
||||||
} else {
|
} else {
|
||||||
//echo __LINE__, PHP_EOL;
|
//echo __LINE__, PHP_EOL;
|
||||||
$users = User::getAllUsersFromUsergroup($_REQUEST['user_groups_id'], $advancedCustomUser->userCanChangeVideoOwner ? true : false, ['name', 'email', 'user', 'channelName', 'about'], @$_GET['status']);
|
$users = User::getAllUsersFromUsergroup($_REQUEST['user_groups_id'], canSearchUsers() ? true : false, ['name', 'email', 'user', 'channelName', 'about'], @$_GET['status']);
|
||||||
$total = User::getTotalUsersFromUsergroup($_REQUEST['user_groups_id'], $advancedCustomUser->userCanChangeVideoOwner ? true : false, @$_GET['status']);
|
$total = User::getTotalUsersFromUsergroup($_REQUEST['user_groups_id'], canSearchUsers() ? true : false, @$_GET['status']);
|
||||||
}
|
}
|
||||||
|
|
||||||
//echo examineJSONError($users);exit;
|
//echo examineJSONError($users);exit;
|
||||||
|
|
|
@ -645,9 +645,9 @@ if (!class_exists('Video')) {
|
||||||
|
|
||||||
public function setDuration($duration) {
|
public function setDuration($duration) {
|
||||||
if (!self::isValidDuration($this->duration) || self::isValidDuration($duration)) {
|
if (!self::isValidDuration($this->duration) || self::isValidDuration($duration)) {
|
||||||
_error_log("setDuration before {$duration}");
|
//_error_log("setDuration before {$duration}");
|
||||||
AVideoPlugin::onVideoSetDuration($this->id, $this->duration, $duration);
|
AVideoPlugin::onVideoSetDuration($this->id, $this->duration, $duration);
|
||||||
_error_log("setDuration after {$duration}");
|
//_error_log("setDuration after {$duration}");
|
||||||
$this->duration = $duration;
|
$this->duration = $duration;
|
||||||
} else {
|
} else {
|
||||||
_error_log("setDuration error is not a valid {$duration}, old duration = {$this->duration}");
|
_error_log("setDuration error is not a valid {$duration}, old duration = {$this->duration}");
|
||||||
|
@ -1669,7 +1669,7 @@ if (!class_exists('Video')) {
|
||||||
$timeLogName = TimeLogStart("video::getInfo getStatistcs");
|
$timeLogName = TimeLogStart("video::getInfo getStatistcs");
|
||||||
$name = "_getVideoInfo_{$row['id']}";
|
$name = "_getVideoInfo_{$row['id']}";
|
||||||
$OneHour = 3600;
|
$OneHour = 3600;
|
||||||
$cache = ObjectYPT::getCache($name, $OneHour);
|
$cache = ObjectYPT::getCacheGlobal($name, $OneHour);
|
||||||
if (!empty($cache)) {
|
if (!empty($cache)) {
|
||||||
$externalOptions = $cache->externalOptions;
|
$externalOptions = $cache->externalOptions;
|
||||||
$obj = object_to_array($cache);
|
$obj = object_to_array($cache);
|
||||||
|
@ -1733,7 +1733,7 @@ if (!class_exists('Video')) {
|
||||||
}
|
}
|
||||||
TimeLogEnd($timeLogName, __LINE__, $TimeLogLimit);
|
TimeLogEnd($timeLogName, __LINE__, $TimeLogLimit);
|
||||||
$otherInfocachename = "otherInfo{$row['id']}";
|
$otherInfocachename = "otherInfo{$row['id']}";
|
||||||
$otherInfo = object_to_array(ObjectYPT::getCache($otherInfocachename, 600));
|
$otherInfo = object_to_array(ObjectYPT::getCacheGlobal($otherInfocachename, 600));
|
||||||
TimeLogEnd($timeLogName, __LINE__, $TimeLogLimit);
|
TimeLogEnd($timeLogName, __LINE__, $TimeLogLimit);
|
||||||
if (empty($otherInfo)) {
|
if (empty($otherInfo)) {
|
||||||
$otherInfo = [];
|
$otherInfo = [];
|
||||||
|
@ -1743,7 +1743,7 @@ if (!class_exists('Video')) {
|
||||||
//TimeLogEnd("video::otherInfo", __LINE__, 0.05);
|
//TimeLogEnd("video::otherInfo", __LINE__, 0.05);
|
||||||
$otherInfo['tags'] = self::getTags($row['id']);
|
$otherInfo['tags'] = self::getTags($row['id']);
|
||||||
//TimeLogEnd("video::otherInfo", __LINE__, 0.05);
|
//TimeLogEnd("video::otherInfo", __LINE__, 0.05);
|
||||||
$cached = ObjectYPT::setCache($otherInfocachename, $otherInfo);
|
$cached = ObjectYPT::setCacheGlobal($otherInfocachename, $otherInfo);
|
||||||
//TimeLogEnd("video::otherInfo", __LINE__, 0.05);
|
//TimeLogEnd("video::otherInfo", __LINE__, 0.05);
|
||||||
//_error_log("video::getInfo cache " . json_encode($cached));
|
//_error_log("video::getInfo cache " . json_encode($cached));
|
||||||
}
|
}
|
||||||
|
@ -1786,7 +1786,7 @@ if (!class_exists('Video')) {
|
||||||
//var_dump($row['userExternalOptions']);exit;
|
//var_dump($row['userExternalOptions']);exit;
|
||||||
$row = array_merge($row, AVideoPlugin::getAllVideosArray($row['id']));
|
$row = array_merge($row, AVideoPlugin::getAllVideosArray($row['id']));
|
||||||
TimeLogEnd($timeLogName, __LINE__, $TimeLogLimit);
|
TimeLogEnd($timeLogName, __LINE__, $TimeLogLimit);
|
||||||
ObjectYPT::setCache($name, $row);
|
ObjectYPT::setCacheGlobal($name, $row);
|
||||||
TimeLogEnd($timeLogName, __LINE__, $TimeLogLimit);
|
TimeLogEnd($timeLogName, __LINE__, $TimeLogLimit);
|
||||||
|
|
||||||
if (self::forceAudio()) {
|
if (self::forceAudio()) {
|
||||||
|
@ -5344,7 +5344,7 @@ if (!class_exists('Video')) {
|
||||||
} else {
|
} else {
|
||||||
if (self::userGroupAndVideoGroupMatch($users_id, $videos_id)) {
|
if (self::userGroupAndVideoGroupMatch($users_id, $videos_id)) {
|
||||||
$videosug = self::getVideoGroups($videos_id);
|
$videosug = self::getVideoGroups($videos_id);
|
||||||
$categoriessug = self::getCategoriesGroups($videos_id);
|
$categoriessug = UserGroups::getCategoriesGroups($videos_id);
|
||||||
$rowsUser = UserGroups::getUserGroups(User::getId());
|
$rowsUser = UserGroups::getUserGroups(User::getId());
|
||||||
// what group the user needs
|
// what group the user needs
|
||||||
}
|
}
|
||||||
|
@ -5355,12 +5355,12 @@ if (!class_exists('Video')) {
|
||||||
if ($p = AVideoPlugin::loadPluginIfEnabled($name)) {
|
if ($p = AVideoPlugin::loadPluginIfEnabled($name)) {
|
||||||
$obj = $p->getDataObject();
|
$obj = $p->getDataObject();
|
||||||
if ($obj->ifExceedQuotaDoNotPlayVideos) {
|
if ($obj->ifExceedQuotaDoNotPlayVideos) {
|
||||||
if ($this->videoOwnerExceedsQuota($videos_id)) {
|
if ($p->videoOwnerExceedsQuota($videos_id)) {
|
||||||
$response->canWatch = false;
|
$response->canWatch = false;
|
||||||
$response->why[] = 'DiskUploadQuota videoOwnerExceedsQuota and ifExceedQuotaDoNotPlayVideos';
|
$response->why[] = 'DiskUploadQuota videoOwnerExceedsQuota and ifExceedQuotaDoNotPlayVideos';
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if ($this->videoOwnerExceedsQuota($videos_id)) {
|
if ($p->videoOwnerExceedsQuota($videos_id)) {
|
||||||
$response->why[] = 'DiskUploadQuota is active but the owner still have quota';
|
$response->why[] = 'DiskUploadQuota is active but the owner still have quota';
|
||||||
} else {
|
} else {
|
||||||
$response->why[] = 'DiskUploadQuota is active but the owner quota os gone but ifExceedQuotaDoNotPlayVideos is deactivated';
|
$response->why[] = 'DiskUploadQuota is active but the owner quota os gone but ifExceedQuotaDoNotPlayVideos is deactivated';
|
||||||
|
|
|
@ -327,6 +327,9 @@ class AVideoPlugin
|
||||||
|
|
||||||
public static function getHTMLMenuRight()
|
public static function getHTMLMenuRight()
|
||||||
{
|
{
|
||||||
|
$name = "getHTMLMenuRight" . User::getId();
|
||||||
|
$str = ObjectYPT::getCache($name, 3600);
|
||||||
|
if (empty($str)) {
|
||||||
$plugins = Plugin::getAllEnabled();
|
$plugins = Plugin::getAllEnabled();
|
||||||
$str = "";
|
$str = "";
|
||||||
foreach ($plugins as $value) {
|
foreach ($plugins as $value) {
|
||||||
|
@ -337,6 +340,9 @@ class AVideoPlugin
|
||||||
}
|
}
|
||||||
self::YPTend("{$value['dirName']}::" . __FUNCTION__);
|
self::YPTend("{$value['dirName']}::" . __FUNCTION__);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ObjectYPT::setCache($name, $str);
|
||||||
|
}
|
||||||
return $str;
|
return $str;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1379,7 +1385,7 @@ class AVideoPlugin
|
||||||
public static function compareVersion($name, $version)
|
public static function compareVersion($name, $version)
|
||||||
{
|
{
|
||||||
$currentVersion = self::getCurrentVersion($name);
|
$currentVersion = self::getCurrentVersion($name);
|
||||||
if(empty($currentVersion)){
|
if (empty($currentVersion)) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
return version_compare($currentVersion, $version);
|
return version_compare($currentVersion, $version);
|
||||||
|
|
|
@ -575,7 +575,7 @@ class Layout extends PluginAbstract
|
||||||
return $content;
|
return $content;
|
||||||
}
|
}
|
||||||
|
|
||||||
static function getUserAutocomplete($default_users_id = 0, $id = '', $parameters = array())
|
static function getUserAutocomplete($default_users_id = 0, $id = '', $parameters = array(), $jsFunctionForSelectCallback = '')
|
||||||
{
|
{
|
||||||
global $global;
|
global $global;
|
||||||
$default_users_id = intval($default_users_id);
|
$default_users_id = intval($default_users_id);
|
||||||
|
|
|
@ -95,6 +95,11 @@ if (empty($name)) {
|
||||||
photoURL = ui.item.photo;
|
photoURL = ui.item.photo;
|
||||||
}
|
}
|
||||||
$("#user-img<?php echo $id; ?>").attr("src", photoURL);
|
$("#user-img<?php echo $id; ?>").attr("src", photoURL);
|
||||||
|
<?php
|
||||||
|
if(!empty($jsFunctionForSelectCallback)){
|
||||||
|
echo $jsFunctionForSelectCallback.';';
|
||||||
|
}
|
||||||
|
?>
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}).autocomplete("instance")._renderItem = function (ul, item) {
|
}).autocomplete("instance")._renderItem = function (ul, item) {
|
||||||
|
|
|
@ -129,6 +129,7 @@ Passcode: {password}
|
||||||
"sub" => "meet.jitsi",
|
"sub" => "meet.jitsi",
|
||||||
"room" => $room,
|
"room" => $room,
|
||||||
"exp" => strtotime("+30 hours"),
|
"exp" => strtotime("+30 hours"),
|
||||||
|
"nbf" => strtotime("-24 hours"),
|
||||||
"moderator" => $isModerator,
|
"moderator" => $isModerator,
|
||||||
];
|
];
|
||||||
return $jitsiPayload; // HS256
|
return $jitsiPayload; // HS256
|
||||||
|
|
|
@ -30,7 +30,9 @@ if (empty($obj->key) || strlen($obj->key) < 50) {
|
||||||
if (empty($server)) {
|
if (empty($server)) {
|
||||||
$obj->msg = "The server URL is empty";
|
$obj->msg = "The server URL is empty";
|
||||||
} else {
|
} else {
|
||||||
$obj->key = url_get_contents("http://key.ypt.me?server=" . urlencode($server));
|
$url = "http://key.ypt.me?server=" . urlencode($server);
|
||||||
|
//$obj->url = $url;
|
||||||
|
$obj->key = url_get_contents($url);
|
||||||
$obj->length = strlen($obj->key); // 1 day
|
$obj->length = strlen($obj->key); // 1 day
|
||||||
if (!empty($obj->key) && $obj->length > 50) {
|
if (!empty($obj->key) && $obj->length > 50) {
|
||||||
$obj->error = false;
|
$obj->error = false;
|
||||||
|
|
|
@ -17,7 +17,8 @@ class MobileYPT extends PluginAbstract {
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getDescription() {
|
public function getDescription() {
|
||||||
$desc = "Manage the Mobile YPTApp";
|
$desc = "Your Media Companion: YPT Mobile App";
|
||||||
|
$desc .= "<p>YPT Media is a dynamic mobile app for streaming high-quality videos, audios, managing playlists, supporting PPV, and live streaming. Enjoy an ad-free experience with our server hosting. <a href=\"https://github.com/WWBN/AVideo/wiki/YPT-Media-Mobile-app\">Learn more</a>.</p>";
|
||||||
$desc .= $this->isReadyLabel(['API']);
|
$desc .= $this->isReadyLabel(['API']);
|
||||||
return $desc;
|
return $desc;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
class PlayListElement {
|
class PlayListElement {
|
||||||
|
|
||||||
public $name, $description, $duration, $sources, $thumbnail, $poster, $videoStartSeconds, $created, $likes, $views, $videos_id;
|
public $name, $description, $duration, $sources, $thumbnail, $poster, $videoStartSeconds, $created, $likes, $views, $videos_id, $className, $tracks;
|
||||||
|
|
||||||
function __construct($name, $description, $duration, $playListSource, $playListThumbnail, $poster, $videoStartSeconds, $created, $likes, $views, $videos_id, $className='', $tracks=array()) {
|
function __construct($name, $description, $duration, $playListSource, $playListThumbnail, $poster, $videoStartSeconds, $created, $likes, $views, $videos_id, $className='', $tracks=array()) {
|
||||||
$this->name = $name;
|
$this->name = $name;
|
||||||
|
@ -12,7 +12,7 @@ class PlayListElement {
|
||||||
$this->thumbnail = $playListThumbnail;
|
$this->thumbnail = $playListThumbnail;
|
||||||
$this->poster = $poster;
|
$this->poster = $poster;
|
||||||
$this->videoStartSeconds = intval($videoStartSeconds);
|
$this->videoStartSeconds = intval($videoStartSeconds);
|
||||||
$this->created = strtotime($created);
|
$this->created = empty($created)?0:strtotime($created);
|
||||||
$this->likes = $likes;
|
$this->likes = $likes;
|
||||||
$this->views = $views;
|
$this->views = $views;
|
||||||
$this->videos_id = $videos_id;
|
$this->videos_id = $videos_id;
|
||||||
|
@ -38,7 +38,7 @@ class PlayListElement {
|
||||||
}
|
}
|
||||||
|
|
||||||
function getPlayListThumbnail() {
|
function getPlayListThumbnail() {
|
||||||
return $this->playListThumbnail;
|
return $this->thumbnail;
|
||||||
}
|
}
|
||||||
|
|
||||||
function setName($name) {
|
function setName($name) {
|
||||||
|
@ -133,7 +133,7 @@ class PlayListElement {
|
||||||
|
|
||||||
class playListSource {
|
class playListSource {
|
||||||
|
|
||||||
public $src, $type;
|
public $src, $type, $label;
|
||||||
|
|
||||||
function __construct($src, $youtube = false) {
|
function __construct($src, $youtube = false) {
|
||||||
$this->src = $src;
|
$this->src = $src;
|
||||||
|
|
|
@ -9,6 +9,8 @@ require_once $global['systemRootPath'] . 'plugin/PlayLists/PlayListElement.php';
|
||||||
|
|
||||||
class PlayLists extends PluginAbstract {
|
class PlayLists extends PluginAbstract {
|
||||||
|
|
||||||
|
const PERMISSION_CAN_MANAGE_ALL_PLAYLISTS = 0;
|
||||||
|
|
||||||
public function getTags() {
|
public function getTags() {
|
||||||
return array(
|
return array(
|
||||||
PluginTags::$RECOMMENDED,
|
PluginTags::$RECOMMENDED,
|
||||||
|
@ -30,6 +32,33 @@ class PlayLists extends PluginAbstract {
|
||||||
return "plist12345-370-4b1f-977a-fd0e5cabtube";
|
return "plist12345-370-4b1f-977a-fd0e5cabtube";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getPermissionsOptions():array {
|
||||||
|
$permissions = array();
|
||||||
|
$permissions[] = new PluginPermissionOption(self::PERMISSION_CAN_MANAGE_ALL_PLAYLISTS, __("Can Manage All Playlists"), __("Can Manage All Playlists"), 'PlayLists');
|
||||||
|
return $permissions;
|
||||||
|
}
|
||||||
|
|
||||||
|
static function canManageAllPlaylists():bool {
|
||||||
|
if(User::isAdmin()){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return Permissions::hasPermission(self::PERMISSION_CAN_MANAGE_ALL_PLAYLISTS, 'PlayLists');
|
||||||
|
}
|
||||||
|
|
||||||
|
static function canManagePlaylist($playlists_id) {
|
||||||
|
if (!User::isLogged()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (self::canManageAllPlaylists()) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
$pl = new PlayList($playlists_id);
|
||||||
|
if ($pl->getUsers_id() == User::getId()) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
public function getPluginVersion() {
|
public function getPluginVersion() {
|
||||||
return "1.0";
|
return "1.0";
|
||||||
}
|
}
|
||||||
|
@ -564,20 +593,6 @@ class PlayLists extends PluginAbstract {
|
||||||
return !empty($obj->showTVFeatures);
|
return !empty($obj->showTVFeatures);
|
||||||
}
|
}
|
||||||
|
|
||||||
static function canManagePlaylist($playlists_id) {
|
|
||||||
if (!User::isLogged()) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (User::isAdmin()) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
$pl = new PlayList($playlists_id);
|
|
||||||
if ($pl->getUsers_id() == User::getId()) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
static function getShowOnTVSwitch($playlists_id) {
|
static function getShowOnTVSwitch($playlists_id) {
|
||||||
if (!self::showTVFeatures()) {
|
if (!self::showTVFeatures()) {
|
||||||
return "";
|
return "";
|
||||||
|
@ -1002,9 +1017,10 @@ class PlayListPlayer {
|
||||||
$playListData = array();
|
$playListData = array();
|
||||||
}
|
}
|
||||||
foreach ($this->videos as $key => $video) {
|
foreach ($this->videos as $key => $video) {
|
||||||
|
|
||||||
if ($video['type'] === 'embed') {
|
if ($video['type'] === 'embed') {
|
||||||
$sources[0]['type'] = 'video';
|
$sources[0]['type'] = 'video';
|
||||||
$sources[0]['url'] = $video["videoLink"];
|
$sources[0]['url'] = @$video["videoLink"];
|
||||||
} else {
|
} else {
|
||||||
$sources = getVideosURL($video['filename']);
|
$sources = getVideosURL($video['filename']);
|
||||||
}
|
}
|
||||||
|
@ -1027,7 +1043,7 @@ class PlayListPlayer {
|
||||||
$messagesFromPlayList[] = "videos_id={$video['videos_id']} empty playlist source ";
|
$messagesFromPlayList[] = "videos_id={$video['videos_id']} empty playlist source ";
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
$playListData[] = new PlayListElement($video['title'], $video['description'], $video['duration'], $playListSources, $thumbnail, $images->poster, parseDurationToSeconds(@$externalOptions->videoStartSeconds), @$video['created'], $video['likes'], $video['views_count'], $video['videos_id']);
|
$playListData[] = new PlayListElement($video['title'], $video['description'], @$video['duration'], $playListSources, $thumbnail, $images->poster, parseDurationToSeconds(@$externalOptions->videoStartSeconds), @$video['created'], @$video['likes'], @$video['views_count'], $video['videos_id']);
|
||||||
}
|
}
|
||||||
return $playListData;
|
return $playListData;
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,8 +9,6 @@ $program = PlayList::getFromDbFromId($playlists_id);
|
||||||
if(empty($program)){
|
if(empty($program)){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//var_dump($playlists_id, $program);
|
|
||||||
$isMyChannel = $program['users_id'] == User::getId();
|
|
||||||
|
|
||||||
$playListButtons = AVideoPlugin::getPlayListButtons($playlists_id);
|
$playListButtons = AVideoPlugin::getPlayListButtons($playlists_id);
|
||||||
$link = PlayLists::getLink($program['id']);
|
$link = PlayLists::getLink($program['id']);
|
||||||
|
@ -28,7 +26,7 @@ if (empty($isASerie)) {
|
||||||
<?php echo $playListButtons; ?>
|
<?php echo $playListButtons; ?>
|
||||||
<?php
|
<?php
|
||||||
echo PlayLists::getPlayLiveButton($program['id']);
|
echo PlayLists::getPlayLiveButton($program['id']);
|
||||||
if ($isMyChannel) {
|
if (PlayLists::canManagePlaylist($playlists_id)) {
|
||||||
?>
|
?>
|
||||||
<script>
|
<script>
|
||||||
$(function () {
|
$(function () {
|
||||||
|
|
|
@ -7,46 +7,56 @@ require_once $global['systemRootPath'] . 'objects/user.php';
|
||||||
if (!User::isLogged()) {
|
if (!User::isLogged()) {
|
||||||
gotToLoginAndComeBackHere('');
|
gotToLoginAndComeBackHere('');
|
||||||
}
|
}
|
||||||
$users_id = User::getId();
|
function getPlaylistOwnerUsersId(){
|
||||||
if(User::isAdmin() && !empty($_REQUEST['users_id'])){
|
if(!empty($_REQUEST['PlaylistOwnerUsersId'])){
|
||||||
$users_id = $_REQUEST['users_id'];
|
return intval($_REQUEST['PlaylistOwnerUsersId']);
|
||||||
|
}else if (User::isAdmin() && !empty($_REQUEST['users_id'])) {
|
||||||
|
return intval($_REQUEST['users_id']);
|
||||||
|
}
|
||||||
|
return User::getId();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$users_id = getPlaylistOwnerUsersId();
|
||||||
?>
|
?>
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="<?php echo getLanguage(); ?>">
|
<html lang="<?php echo getLanguage(); ?>">
|
||||||
<head>
|
|
||||||
|
<head>
|
||||||
<title><?php echo __("Users") . $config->getPageTitleSeparator() . $config->getWebSiteTitle(); ?></title>
|
<title><?php echo __("Users") . $config->getPageTitleSeparator() . $config->getWebSiteTitle(); ?></title>
|
||||||
<?php
|
<?php
|
||||||
include $global['systemRootPath'] . 'view/include/head.php';
|
include $global['systemRootPath'] . 'view/include/head.php';
|
||||||
include $global['systemRootPath'] . 'view/managerUsers_head.php';
|
include $global['systemRootPath'] . 'view/managerUsers_head.php';
|
||||||
?>
|
?>
|
||||||
<style>
|
<style>
|
||||||
.playLists li{
|
.playLists li {
|
||||||
min-height: 45px;
|
min-height: 45px;
|
||||||
}
|
}
|
||||||
.playLists .list-group{
|
|
||||||
|
.playLists .list-group {
|
||||||
height: 221px;
|
height: 221px;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.videoTitle.ellipsis{
|
.videoTitle.ellipsis {
|
||||||
width: calc(100% - 90px);
|
width: calc(100% - 90px);
|
||||||
float: left;
|
float: left;
|
||||||
}
|
}
|
||||||
|
|
||||||
.playLists .tab-content{
|
.playLists .tab-content {
|
||||||
min-height: 250px;
|
min-height: 250px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.playLists {
|
.playLists {
|
||||||
min-height: 330px;
|
min-height: 330px;
|
||||||
}
|
}
|
||||||
.pl .panel-footer{
|
|
||||||
|
.pl .panel-footer {
|
||||||
min-height: 42px;
|
min-height: 42px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body class="<?php echo $global['bodyClass']; ?>">
|
|
||||||
|
<body class="<?php echo $global['bodyClass']; ?>">
|
||||||
<?php
|
<?php
|
||||||
include $global['systemRootPath'] . 'view/include/navbar.php';
|
include $global['systemRootPath'] . 'view/include/navbar.php';
|
||||||
?>
|
?>
|
||||||
|
@ -56,29 +66,41 @@ if(User::isAdmin() && !empty($_REQUEST['users_id'])){
|
||||||
<div class="panel">
|
<div class="panel">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
<ul class="nav nav-tabs">
|
<ul class="nav nav-tabs">
|
||||||
<li class="active pl_filter" onclick="pl_filter('all', $(this));" data-toggle="tooltip"
|
<li class="active pl_filter" onclick="pl_filter('all', $(this));" data-toggle="tooltip" title="<?php echo __('Show all types'); ?>">
|
||||||
title="<?php echo __('Show all types'); ?>">
|
|
||||||
<a href="#"><i class="fas fa-layer-group"></i>
|
<a href="#"><i class="fas fa-layer-group"></i>
|
||||||
<i class="fas fa-list"></i>
|
<i class="fas fa-list"></i>
|
||||||
<i class="fas fa-film"></i> <?php echo __('All'); ?></a></li>
|
<i class="fas fa-film"></i> <?php echo __('All'); ?></a>
|
||||||
<li class="pl_filter" onclick="pl_filter('serie', $(this));" data-toggle="tooltip"
|
</li>
|
||||||
title="<?php echo __('Show all programs that are listed in your video library'); ?>">
|
<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>
|
<a href="#"><span class="label label-success"><i class="fas fa-list"></i>
|
||||||
<?php echo __('Series'); ?></span></a></li>
|
<?php echo __('Series'); ?></span></a>
|
||||||
<li class="pl_filter" onclick="pl_filter('collection', $(this));" data-toggle="tooltip"
|
</li>
|
||||||
title="<?php echo __('Show all that is a collection of programs'); ?>">
|
<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>
|
<a href="#"><span class="label label-primary"><i class="fas fa-layer-group"></i>
|
||||||
<?php echo __('Collections'); ?></span></a></li>
|
<?php echo __('Collections'); ?></span></a>
|
||||||
<li class="pl_filter" onclick="pl_filter('videos', $(this));" data-toggle="tooltip"
|
</li>
|
||||||
title="<?php echo __('Show all that include a list of videos'); ?>">
|
<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>
|
<a href="#"><span class="label label-default"><i class="fas fa-film"></i>
|
||||||
<?php echo __('Videos'); ?></span></a></li>
|
<?php echo __('Videos'); ?></span></a>
|
||||||
<li class="pull-right" >
|
</li>
|
||||||
<button type="button" class="btn btn-default pull-right" data-toggle="tooltip" title="<?php echo __('New'); ?>"
|
<li class="pull-right">
|
||||||
onclick="createNewProgram();" >
|
<button type="button" class="btn btn-default pull-right" data-toggle="tooltip" title="<?php echo __('New'); ?>" onclick="createNewProgram();">
|
||||||
<i class="fas fa-plus"></i>
|
<i class="fas fa-plus"></i>
|
||||||
</button>
|
</button>
|
||||||
</li>
|
</li>
|
||||||
|
<?php
|
||||||
|
if (PlayLists::canManageAllPlaylists()) {
|
||||||
|
?>
|
||||||
|
<li class="pull-right">
|
||||||
|
<?php
|
||||||
|
if (PlayLists::canManageAllPlaylists()) {
|
||||||
|
$autocomplete = Layout::getUserAutocomplete(getPlaylistOwnerUsersId(), 'User_playlist_owner', array(), 'updatePlaylistOwner()');
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</li>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
?>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
|
@ -110,7 +132,7 @@ if(User::isAdmin() && !empty($_REQUEST['users_id'])){
|
||||||
}
|
}
|
||||||
$durationInSeconds = 0;
|
$durationInSeconds = 0;
|
||||||
?>
|
?>
|
||||||
<div class="col-sm-6 col-md-4 col-lg-3 pl pl<?php echo $value["id"]; ?> <?php echo implode(' ', $classes) ?>" >
|
<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 panel-<?php echo $totalSubPlaylists ? 'primary' : 'default'; ?>">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
<?php
|
<?php
|
||||||
|
@ -123,17 +145,13 @@ if(User::isAdmin() && !empty($_REQUEST['users_id'])){
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<div class="btn-group pull-right" playlists_id="<?php echo $value["id"]; ?>">
|
<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"
|
<button type="button" class="btn btn-default btn-xs pull-right" data-toggle="tooltip" title="<?php echo __('Delete'); ?>" onclick="deleteProgram(<?php echo $value["id"]; ?>);">
|
||||||
title="<?php echo __('Delete'); ?>"
|
|
||||||
onclick="deleteProgram(<?php echo $value["id"]; ?>);" >
|
|
||||||
<i class="fas fa-trash"></i>
|
<i class="fas fa-trash"></i>
|
||||||
</button>
|
</button>
|
||||||
<button type="button" class="btn btn-default btn-xs pull-right" data-toggle="tooltip"
|
<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); ?>');">
|
||||||
title="<?php echo __('Play'); ?>" onclick="avideoModalIframe('<?php echo PlayLists::getLink($value["id"], true); ?>');" >
|
|
||||||
<i class="fas fa-play"></i>
|
<i class="fas fa-play"></i>
|
||||||
</button>
|
</button>
|
||||||
<button type="button" class="btn btn-default btn-xs editBtn " onclick="editPlayList(<?php echo $value["id"]; ?>);" data-toggle="tooltip"
|
<button type="button" class="btn btn-default btn-xs editBtn " onclick="editPlayList(<?php echo $value["id"]; ?>);" data-toggle="tooltip" title="<?php echo __('Edit'); ?>">
|
||||||
title="<?php echo __('Edit'); ?>" >
|
|
||||||
<i class="fas fa-edit"></i>
|
<i class="fas fa-edit"></i>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
@ -193,13 +211,13 @@ if(User::isAdmin() && !empty($_REQUEST['users_id'])){
|
||||||
echo $row['title'];
|
echo $row['title'];
|
||||||
?>
|
?>
|
||||||
</div>
|
</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"]; ?>);" >
|
<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>
|
<i class="fas fa-trash"></i>
|
||||||
</button>
|
</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); ?>');" >
|
<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>
|
<i class="fas fa-play"></i>
|
||||||
</button>
|
</button>
|
||||||
<button type="button" class="btn btn-default btn-xs pull-right" data-toggle="tooltip" title="<?php echo __('Edit Video'); ?>" onclick="avideoModalIframe(webSiteRootURL+'view/managerVideosLight.php?avideoIframe=1&videos_id=<?php echo $row['id']; ?>');" >
|
<button type="button" class="btn btn-default btn-xs pull-right" data-toggle="tooltip" title="<?php echo __('Edit Video'); ?>" onclick="avideoModalIframe(webSiteRootURL+'view/managerVideosLight.php?avideoIframe=1&videos_id=<?php echo $row['id']; ?>');">
|
||||||
<i class="fas fa-edit"></i>
|
<i class="fas fa-edit"></i>
|
||||||
</button>
|
</button>
|
||||||
</li>
|
</li>
|
||||||
|
@ -227,19 +245,13 @@ if(User::isAdmin() && !empty($_REQUEST['users_id'])){
|
||||||
echo $row['title'];
|
echo $row['title'];
|
||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
<button type="button" class="btn btn-default btn-xs pull-right"
|
<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"]; ?>);">
|
||||||
data-toggle="tooltip" title="<?php echo __('Remove Video'); ?>"
|
|
||||||
onclick="removeFromSerie(<?php echo $value["id"]; ?>, <?php echo $row["id"]; ?>);" >
|
|
||||||
<i class="fas fa-trash"></i>
|
<i class="fas fa-trash"></i>
|
||||||
</button>
|
</button>
|
||||||
<button type="button" class="btn btn-default btn-xs pull-right"
|
<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); ?>');">
|
||||||
data-toggle="tooltip" title="<?php echo __('Play Video'); ?>"
|
|
||||||
onclick="avideoModalIframe('<?php echo Video::getPermaLink($row["id"], true); ?>');" >
|
|
||||||
<i class="fas fa-play"></i>
|
<i class="fas fa-play"></i>
|
||||||
</button>
|
</button>
|
||||||
<button type="button" class="btn btn-default btn-xs pull-right"
|
<button type="button" class="btn btn-default btn-xs pull-right" data-toggle="tooltip" title="<?php echo __('Edit Video'); ?>" onclick="avideoModalIframe(webSiteRootURL+'view/managerVideosLight.php?avideoIframe=1&videos_id=<?php echo $row['id']; ?>');">
|
||||||
data-toggle="tooltip" title="<?php echo __('Edit Video'); ?>"
|
|
||||||
onclick="avideoModalIframe(webSiteRootURL+'view/managerVideosLight.php?avideoIframe=1&videos_id=<?php echo $row['id']; ?>');" >
|
|
||||||
<i class="fas fa-edit"></i>
|
<i class="fas fa-edit"></i>
|
||||||
</button>
|
</button>
|
||||||
</li>
|
</li>
|
||||||
|
@ -260,7 +272,7 @@ if(User::isAdmin() && !empty($_REQUEST['users_id'])){
|
||||||
<div class="panel-footer text-right">
|
<div class="panel-footer text-right">
|
||||||
<?php
|
<?php
|
||||||
if ($isASerie) {
|
if ($isASerie) {
|
||||||
echo '<div class="pull-left" style="margin-right:5px;">'.Video::getChangeVideoStatusButton($isASerie['id']).'</div> ';
|
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 class="label label-success"><i class="fas fa-list"></i> ' . $isASerie['title'];
|
||||||
echo '</span>';
|
echo '</span>';
|
||||||
}
|
}
|
||||||
|
@ -276,6 +288,15 @@ if(User::isAdmin() && !empty($_REQUEST['users_id'])){
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php
|
<?php
|
||||||
|
if($count % 2 == 0){
|
||||||
|
echo '<div class="clearfix visible-sm"></div>';
|
||||||
|
}
|
||||||
|
if($count % 3 == 0){
|
||||||
|
echo '<div class="clearfix visible-md"></div>';
|
||||||
|
}
|
||||||
|
if($count % 4 == 0){
|
||||||
|
echo '<div class="clearfix visible-lg"></div>';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (empty($count)) {
|
if (empty($count)) {
|
||||||
?>
|
?>
|
||||||
|
@ -296,11 +317,19 @@ if(User::isAdmin() && !empty($_REQUEST['users_id'])){
|
||||||
include $global['systemRootPath'] . 'view/include/footer.php';
|
include $global['systemRootPath'] . 'view/include/footer.php';
|
||||||
?>
|
?>
|
||||||
<script>
|
<script>
|
||||||
$(document).ready(function () {
|
$(document).ready(function() {
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function updatePlaylistOwner(){
|
||||||
|
modal.showPleaseWait();
|
||||||
|
var url = window.location.href;
|
||||||
|
url = addQueryStringParameter(url, 'PlaylistOwnerUsersId', $('#User_playlist_owner').val());
|
||||||
|
console.log('updatePlaylistOwner', url);
|
||||||
|
window.location.href = url;
|
||||||
|
}
|
||||||
|
|
||||||
function pl_filter(filter, t) {
|
function pl_filter(filter, t) {
|
||||||
$('.pl_filter').removeClass('active');
|
$('.pl_filter').removeClass('active');
|
||||||
t.addClass('active');
|
t.addClass('active');
|
||||||
|
@ -325,7 +354,7 @@ if(User::isAdmin() && !empty($_REQUEST['users_id'])){
|
||||||
buttons: true,
|
buttons: true,
|
||||||
dangerMode: true,
|
dangerMode: true,
|
||||||
})
|
})
|
||||||
.then(function (willDelete) {
|
.then(function(willDelete) {
|
||||||
if (willDelete) {
|
if (willDelete) {
|
||||||
addVideoToPlayList(videos_id, false, playlists_id);
|
addVideoToPlayList(videos_id, false, playlists_id);
|
||||||
$('#videos_id_' + videos_id + '_playlists_id_' + playlists_id).fadeOut();
|
$('#videos_id_' + videos_id + '_playlists_id_' + playlists_id).fadeOut();
|
||||||
|
@ -344,7 +373,7 @@ if(User::isAdmin() && !empty($_REQUEST['users_id'])){
|
||||||
buttons: true,
|
buttons: true,
|
||||||
dangerMode: true,
|
dangerMode: true,
|
||||||
})
|
})
|
||||||
.then(function (willDelete) {
|
.then(function(willDelete) {
|
||||||
if (willDelete) {
|
if (willDelete) {
|
||||||
modal.showPleaseWait();
|
modal.showPleaseWait();
|
||||||
$.ajax({
|
$.ajax({
|
||||||
|
@ -353,7 +382,7 @@ if(User::isAdmin() && !empty($_REQUEST['users_id'])){
|
||||||
"playlist_id": playlists_id
|
"playlist_id": playlists_id
|
||||||
},
|
},
|
||||||
type: 'post',
|
type: 'post',
|
||||||
success: function (response) {
|
success: function(response) {
|
||||||
$('.pl' + playlists_id).fadeOut();
|
$('.pl' + playlists_id).fadeOut();
|
||||||
modal.hidePleaseWait();
|
modal.hidePleaseWait();
|
||||||
avideoToastSuccess('<?php echo __('Deleted'); ?>');
|
avideoToastSuccess('<?php echo __('Deleted'); ?>');
|
||||||
|
@ -396,7 +425,7 @@ if(User::isAdmin() && !empty($_REQUEST['users_id'])){
|
||||||
'status': "public",
|
'status': "public",
|
||||||
'name': inputValue
|
'name': inputValue
|
||||||
},
|
},
|
||||||
success: function (response) {
|
success: function(response) {
|
||||||
if (response.status > 0) {
|
if (response.status > 0) {
|
||||||
location.reload();
|
location.reload();
|
||||||
} else {
|
} else {
|
||||||
|
@ -407,5 +436,6 @@ if(User::isAdmin() && !empty($_REQUEST['users_id'])){
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
|
@ -38,16 +38,18 @@ $playListsObj = AVideoPlugin::getObjectData("PlayLists");
|
||||||
?>
|
?>
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="<?php echo getLanguage(); ?>">
|
<html lang="<?php echo getLanguage(); ?>">
|
||||||
<head>
|
|
||||||
|
<head>
|
||||||
<title><?php echo __("Program") . $config->getPageTitleSeparator() . $config->getWebSiteTitle(); ?></title>
|
<title><?php echo __("Program") . $config->getPageTitleSeparator() . $config->getWebSiteTitle(); ?></title>
|
||||||
<?php
|
<?php
|
||||||
include $global['systemRootPath'] . 'view/include/head.php';
|
include $global['systemRootPath'] . 'view/include/head.php';
|
||||||
?>
|
?>
|
||||||
<style>
|
<style>
|
||||||
.galleryVideo .panel{
|
.galleryVideo .panel {
|
||||||
border-color: transparent;
|
border-color: transparent;
|
||||||
box-shadow: none;
|
box-shadow: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.galleryVideo .panel .panel-body {
|
.galleryVideo .panel .panel-body {
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
}
|
}
|
||||||
|
@ -57,9 +59,9 @@ $playListsObj = AVideoPlugin::getObjectData("PlayLists");
|
||||||
getOpenGraph($videos_id);
|
getOpenGraph($videos_id);
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body class="<?php echo $global['bodyClass']; ?>">
|
<body class="<?php echo $global['bodyClass']; ?>">
|
||||||
<?php
|
<?php
|
||||||
include $global['systemRootPath'] . 'view/include/navbar.php';
|
include $global['systemRootPath'] . 'view/include/navbar.php';
|
||||||
?>
|
?>
|
||||||
|
@ -82,7 +84,7 @@ $playListsObj = AVideoPlugin::getObjectData("PlayLists");
|
||||||
$videosP = [];
|
$videosP = [];
|
||||||
} else {
|
} else {
|
||||||
$videosP = Video::getAllVideos("viewable", false, true, $videosArrayId, false, true);
|
$videosP = Video::getAllVideos("viewable", false, true, $videosArrayId, false, true);
|
||||||
}//var_dump($videosArrayId, $videosP);exit;
|
} //var_dump($videosArrayId, $videosP);exit;
|
||||||
@$timesC[__LINE__] += microtime(true) - $startC;
|
@$timesC[__LINE__] += microtime(true) - $startC;
|
||||||
$startC = microtime(true);
|
$startC = microtime(true);
|
||||||
//_error_log("channelPlaylist videosP: ".json_encode($videosP));
|
//_error_log("channelPlaylist videosP: ".json_encode($videosP));
|
||||||
|
@ -174,7 +176,7 @@ $playListsObj = AVideoPlugin::getObjectData("PlayLists");
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<i class="far fa-clock"></i>
|
<i class="far fa-clock"></i>
|
||||||
<?php echo humanTiming(strtotime($value['videoCreation']), 0, true,true); ?>
|
<?php echo humanTiming(strtotime($value['videoCreation']), 0, true, true); ?>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<i class="fa fa-user"></i>
|
<i class="fa fa-user"></i>
|
||||||
|
@ -201,7 +203,7 @@ $playListsObj = AVideoPlugin::getObjectData("PlayLists");
|
||||||
<div>
|
<div>
|
||||||
<span playlist_id="<?php echo $program['id']; ?>" video_id="<?php echo $value['id']; ?>">
|
<span playlist_id="<?php echo $program['id']; ?>" video_id="<?php echo $value['id']; ?>">
|
||||||
<i class="fas fa-sort-numeric-down"></i> <?php echo __("Sort"); ?>
|
<i class="fas fa-sort-numeric-down"></i> <?php echo __("Sort"); ?>
|
||||||
<input type="number" step="1" class="video_order" value="<?php echo intval($program['videos'][$count - 1]['video_order']); ?>" style="max-width: 50px;">
|
<input type="number" step="1" class="video_order" value="<?php echo empty($program['videos'][$count - 1]) ? 0 : intval(@$program['videos'][$count - 1]['video_order']); ?>" style="max-width: 50px;">
|
||||||
<button class="btn btn-sm btn-xs sortNow"><i class="fas fa-check-square"></i></button>
|
<button class="btn btn-sm btn-xs sortNow"><i class="fas fa-check-square"></i></button>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
@ -238,7 +240,7 @@ $playListsObj = AVideoPlugin::getObjectData("PlayLists");
|
||||||
}
|
}
|
||||||
if ($isMyChannel && !empty($videosArrayId)) {
|
if ($isMyChannel && !empty($videosArrayId)) {
|
||||||
?>
|
?>
|
||||||
<span class="label label-info" ><i class="fa fa-info-circle"></i> <?php echo __("Drag and drop to sort"); ?></span>
|
<span class="label label-info"><i class="fa fa-info-circle"></i> <?php echo __("Drag and drop to sort"); ?></span>
|
||||||
<?php }
|
<?php }
|
||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
|
@ -253,12 +255,12 @@ $playListsObj = AVideoPlugin::getObjectData("PlayLists");
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
var timoutembed;
|
var timoutembed;
|
||||||
|
|
||||||
function setTextEmbedCopied() {
|
function setTextEmbedCopied() {
|
||||||
clearTimeout(timoutembed);
|
clearTimeout(timoutembed);
|
||||||
$("#btnEmbedText").html("<?php echo __("Copied!"); ?>");
|
$("#btnEmbedText").html("<?php echo __("Copied!"); ?>");
|
||||||
timoutembed = setTimeout(function () {
|
timoutembed = setTimeout(function() {
|
||||||
$("#btnEmbedText").html("<?php echo __("Copy embed code"); ?>");
|
$("#btnEmbedText").html("<?php echo __("Copy embed code"); ?>");
|
||||||
}, 3000);
|
}, 3000);
|
||||||
}
|
}
|
||||||
|
@ -272,7 +274,7 @@ $playListsObj = AVideoPlugin::getObjectData("PlayLists");
|
||||||
"playlist_id": playlist_id
|
"playlist_id": playlist_id
|
||||||
},
|
},
|
||||||
type: 'post',
|
type: 'post',
|
||||||
success: function (response) {
|
success: function(response) {
|
||||||
//$("#channelPlaylists").load(webSiteRootURL + "view/channelPlaylist.php?channelName=" + channelName);
|
//$("#channelPlaylists").load(webSiteRootURL + "view/channelPlaylist.php?channelName=" + channelName);
|
||||||
modal.hidePleaseWait();
|
modal.hidePleaseWait();
|
||||||
}
|
}
|
||||||
|
@ -288,17 +290,17 @@ $playListsObj = AVideoPlugin::getObjectData("PlayLists");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (position === 0) {
|
if (position === 0) {
|
||||||
$this.slideUp(500, function () {
|
$this.slideUp(500, function() {
|
||||||
$this.insertBefore($this.siblings(':eq(0)'));
|
$this.insertBefore($this.siblings(':eq(0)'));
|
||||||
saveSortable($uiDiv, $playListId);
|
saveSortable($uiDiv, $playListId);
|
||||||
}).slideDown(500);
|
}).slideDown(500);
|
||||||
} else if ($list.length - 1 > position) {
|
} else if ($list.length - 1 > position) {
|
||||||
$this.slideUp(500, function () {
|
$this.slideUp(500, function() {
|
||||||
$this.insertBefore($this.siblings(':eq(' + position + ')'));
|
$this.insertBefore($this.siblings(':eq(' + position + ')'));
|
||||||
saveSortable($uiDiv, $playListId);
|
saveSortable($uiDiv, $playListId);
|
||||||
}).slideDown(500);
|
}).slideDown(500);
|
||||||
} else {
|
} else {
|
||||||
$this.slideUp(500, function () {
|
$this.slideUp(500, function() {
|
||||||
$this.insertAfter($this.siblings(':eq(' + ($list.length - 2) + ')'));
|
$this.insertAfter($this.siblings(':eq(' + ($list.length - 2) + ')'));
|
||||||
saveSortable($uiDiv, $playListId);
|
saveSortable($uiDiv, $playListId);
|
||||||
}).slideDown(500);
|
}).slideDown(500);
|
||||||
|
@ -306,16 +308,16 @@ $playListsObj = AVideoPlugin::getObjectData("PlayLists");
|
||||||
}
|
}
|
||||||
|
|
||||||
var currentObject;
|
var currentObject;
|
||||||
$(function () {
|
$(function() {
|
||||||
<?php
|
<?php
|
||||||
if (count($programs) <= 1 || !empty($palyListsObj->expandPlayListOnChannels)) {
|
if (count($programs) <= 1 || !empty($palyListsObj->expandPlayListOnChannels)) {
|
||||||
?>
|
?>
|
||||||
$('.showMoreLess').slideDown();
|
$('.showMoreLess').slideDown();
|
||||||
$('.showMoreLessBtn').toggle();
|
$('.showMoreLessBtn').toggle();
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
$('.removeVideo').click(function () {
|
$('.removeVideo').click(function() {
|
||||||
currentObject = this;
|
currentObject = this;
|
||||||
|
|
||||||
swal({
|
swal({
|
||||||
|
@ -325,7 +327,7 @@ if (count($programs) <= 1 || !empty($palyListsObj->expandPlayListOnChannels)) {
|
||||||
buttons: true,
|
buttons: true,
|
||||||
dangerMode: true,
|
dangerMode: true,
|
||||||
})
|
})
|
||||||
.then(function (willDelete) {
|
.then(function(willDelete) {
|
||||||
if (willDelete) {
|
if (willDelete) {
|
||||||
|
|
||||||
modal.showPleaseWait();
|
modal.showPleaseWait();
|
||||||
|
@ -338,7 +340,7 @@ if (count($programs) <= 1 || !empty($palyListsObj->expandPlayListOnChannels)) {
|
||||||
"video_id": video_id
|
"video_id": video_id
|
||||||
},
|
},
|
||||||
type: 'post',
|
type: 'post',
|
||||||
success: function (response) {
|
success: function(response) {
|
||||||
reloadPlayLists();
|
reloadPlayLists();
|
||||||
$(".playListsIds" + video_id).prop("checked", false);
|
$(".playListsIds" + video_id).prop("checked", false);
|
||||||
$(currentObject).closest('.galleryVideo').fadeOut();
|
$(currentObject).closest('.galleryVideo').fadeOut();
|
||||||
|
@ -350,7 +352,7 @@ if (count($programs) <= 1 || !empty($palyListsObj->expandPlayListOnChannels)) {
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$('.deletePlaylist').click(function () {
|
$('.deletePlaylist').click(function() {
|
||||||
currentObject = this;
|
currentObject = this;
|
||||||
|
|
||||||
swal({
|
swal({
|
||||||
|
@ -360,7 +362,7 @@ if (count($programs) <= 1 || !empty($palyListsObj->expandPlayListOnChannels)) {
|
||||||
buttons: true,
|
buttons: true,
|
||||||
dangerMode: true,
|
dangerMode: true,
|
||||||
})
|
})
|
||||||
.then(function (willDelete) {
|
.then(function(willDelete) {
|
||||||
if (willDelete) {
|
if (willDelete) {
|
||||||
|
|
||||||
modal.showPleaseWait();
|
modal.showPleaseWait();
|
||||||
|
@ -372,7 +374,7 @@ if (count($programs) <= 1 || !empty($palyListsObj->expandPlayListOnChannels)) {
|
||||||
"playlist_id": playlist_id
|
"playlist_id": playlist_id
|
||||||
},
|
},
|
||||||
type: 'post',
|
type: 'post',
|
||||||
success: function (response) {
|
success: function(response) {
|
||||||
$(currentObject).closest('.panel').slideUp();
|
$(currentObject).closest('.panel').slideUp();
|
||||||
modal.hidePleaseWait();
|
modal.hidePleaseWait();
|
||||||
}
|
}
|
||||||
|
@ -382,7 +384,7 @@ if (count($programs) <= 1 || !empty($palyListsObj->expandPlayListOnChannels)) {
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$('.statusPlaylist').click(function () {
|
$('.statusPlaylist').click(function() {
|
||||||
var playlist_id = $(this).attr('playlist_id');
|
var playlist_id = $(this).attr('playlist_id');
|
||||||
var status = "public";
|
var status = "public";
|
||||||
if ($('#statusPrivate' + playlist_id).is(":visible")) {
|
if ($('#statusPrivate' + playlist_id).is(":visible")) {
|
||||||
|
@ -407,7 +409,7 @@ if (count($programs) <= 1 || !empty($palyListsObj->expandPlayListOnChannels)) {
|
||||||
"status": status
|
"status": status
|
||||||
},
|
},
|
||||||
type: 'post',
|
type: 'post',
|
||||||
success: function (response) {
|
success: function(response) {
|
||||||
|
|
||||||
modal.hidePleaseWait();
|
modal.hidePleaseWait();
|
||||||
}
|
}
|
||||||
|
@ -415,7 +417,7 @@ if (count($programs) <= 1 || !empty($palyListsObj->expandPlayListOnChannels)) {
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$('.renamePlaylist').click(function () {
|
$('.renamePlaylist').click(function() {
|
||||||
currentObject = this;
|
currentObject = this;
|
||||||
swal({
|
swal({
|
||||||
text: "<?php echo __("Change Playlist Name"); ?>!",
|
text: "<?php echo __("Change Playlist Name"); ?>!",
|
||||||
|
@ -424,16 +426,16 @@ if (count($programs) <= 1 || !empty($palyListsObj->expandPlayListOnChannels)) {
|
||||||
text: "<?php echo __("Confirm Playlist name"); ?>",
|
text: "<?php echo __("Confirm Playlist name"); ?>",
|
||||||
closeModal: false,
|
closeModal: false,
|
||||||
},
|
},
|
||||||
}).then(function (name) {
|
}).then(function(name) {
|
||||||
if (!name)
|
if (!name)
|
||||||
throw null;
|
throw null;
|
||||||
modal.showPleaseWait();
|
modal.showPleaseWait();
|
||||||
var playlist_id = $(currentObject).attr('playlist_id');
|
var playlist_id = $(currentObject).attr('playlist_id');
|
||||||
console.log(playlist_id);
|
console.log(playlist_id);
|
||||||
return fetch('<?php echo $global['webSiteRootURL']; ?>objects/playlistRename.php?playlist_id=' + playlist_id + '&name=' + encodeURI(name));
|
return fetch('<?php echo $global['webSiteRootURL']; ?>objects/playlistRename.php?playlist_id=' + playlist_id + '&name=' + encodeURI(name));
|
||||||
}).then(function (results) {
|
}).then(function(results) {
|
||||||
return results.json();
|
return results.json();
|
||||||
}).then(function (response) {
|
}).then(function(response) {
|
||||||
if (response.error) {
|
if (response.error) {
|
||||||
avideoAlert("<?php echo __("Sorry!"); ?>", response.msg, "error");
|
avideoAlert("<?php echo __("Sorry!"); ?>", response.msg, "error");
|
||||||
modal.hidePleaseWait();
|
modal.hidePleaseWait();
|
||||||
|
@ -443,7 +445,7 @@ if (count($programs) <= 1 || !empty($palyListsObj->expandPlayListOnChannels)) {
|
||||||
swal.close();
|
swal.close();
|
||||||
modal.hidePleaseWait();
|
modal.hidePleaseWait();
|
||||||
}
|
}
|
||||||
}).catch(function (err) {
|
}).catch(function(err) {
|
||||||
if (err) {
|
if (err) {
|
||||||
swal("Oh noes!", "The AJAX request failed!", "error");
|
swal("Oh noes!", "The AJAX request failed!", "error");
|
||||||
} else {
|
} else {
|
||||||
|
@ -451,17 +453,16 @@ if (count($programs) <= 1 || !empty($palyListsObj->expandPlayListOnChannels)) {
|
||||||
swal.close();
|
swal.close();
|
||||||
}
|
}
|
||||||
modal.hidePleaseWait();
|
modal.hidePleaseWait();
|
||||||
});
|
});;
|
||||||
;
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$('.sortNow').click(function () {
|
$('.sortNow').click(function() {
|
||||||
var $val = $(this).siblings("input").val();
|
var $val = $(this).siblings("input").val();
|
||||||
sortNow(this, $val);
|
sortNow(this, $val);
|
||||||
});
|
});
|
||||||
|
|
||||||
$('.video_order').keypress(function (e) {
|
$('.video_order').keypress(function(e) {
|
||||||
if (e.which == 13) {
|
if (e.which == 13) {
|
||||||
sortNow(this, $(this).val());
|
sortNow(this, $(this).val());
|
||||||
}
|
}
|
||||||
|
@ -484,5 +485,6 @@ if (count($programs) <= 1 || !empty($palyListsObj->expandPlayListOnChannels)) {
|
||||||
<?php
|
<?php
|
||||||
include $global['systemRootPath'] . 'view/include/footer.php';
|
include $global['systemRootPath'] . 'view/include/footer.php';
|
||||||
?>
|
?>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
|
@ -26,7 +26,7 @@ if (file_exists($extraPluginFile) && AVideoPlugin::isEnabledByName("Customize"))
|
||||||
|
|
||||||
TimeLogEnd($timeLogHead, __LINE__);
|
TimeLogEnd($timeLogHead, __LINE__);
|
||||||
if (!empty($poster)) {
|
if (!empty($poster)) {
|
||||||
$subTitle = str_replace(['"', "\n", "\r"], ["", "", ""], strip_tags($video['description']));
|
$subTitle = str_replace(['"', "\n", "\r"], ["", "", ""], strip_tags("{$video['description']}"));
|
||||||
$custom = [];
|
$custom = [];
|
||||||
$custom[] = $subTitle;
|
$custom[] = $subTitle;
|
||||||
if (!empty($video["category"])) {
|
if (!empty($video["category"])) {
|
||||||
|
|
|
@ -53,7 +53,7 @@ if (!empty($videoSerie)) {
|
||||||
</h3>
|
</h3>
|
||||||
<small>
|
<small>
|
||||||
<?php
|
<?php
|
||||||
echo($playlist_index + 1), "/", count($playlistVideos), " ", __("Videos");
|
echo ($playlist_index + 1), "/", count($playlistVideos), " ", __("Videos");
|
||||||
?>
|
?>
|
||||||
</small>
|
</small>
|
||||||
</a>
|
</a>
|
||||||
|
@ -73,25 +73,27 @@ if (!empty($videoSerie)) {
|
||||||
$indicator = '<span class="fa fa-play text-danger"></span>';
|
$indicator = '<span class="fa fa-play text-danger"></span>';
|
||||||
} ?>
|
} ?>
|
||||||
<li class="<?php echo $class; ?>">
|
<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">
|
<div class="col-md-1 col-sm-1 col-xs-1">
|
||||||
<?php echo $indicator; ?>
|
<?php echo $indicator; ?>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-3 col-sm-3 col-xs-3 nopadding">
|
<div class="col-md-3 col-sm-3 col-xs-3 nopadding">
|
||||||
<?php
|
<?php
|
||||||
if (($value['type'] !== "audio") && ($value['type'] !== "linkAudio")) {
|
if (($value['type'] !== "audio") && ($value['type'] !== "linkAudio")) {
|
||||||
|
if(empty($value['images']['poster'])){
|
||||||
|
$img = Video::getPoster($value['videos_id']);
|
||||||
|
}else{
|
||||||
$img = $value['images']['poster'];
|
$img = $value['images']['poster'];
|
||||||
$img_portrait = ($value['rotation'] === "90" || $value['rotation'] === "270") ? "img-portrait" : "";
|
}
|
||||||
} else {
|
} else {
|
||||||
$img = "".getCDN()."view/img/audio_wave.jpg";
|
$img = "" . getCDN() . "view/img/audio_wave.jpg";
|
||||||
$img_portrait = '';
|
|
||||||
} ?>
|
} ?>
|
||||||
<img src="<?php echo $img; ?>" alt="<?php echo $value['title']; ?>" class="img-responsive <?php echo $img_portrait; ?> rotate<?php echo $value['rotation']; ?>" height="130" itemprop="thumbnail" />
|
<img src="<?php echo $img; ?>" alt="<?php echo $value['title']; ?>" class="img-responsive" height="130" itemprop="thumbnail" />
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
if ($value['type'] !== 'pdf' && $value['type'] !== 'article' && $value['type'] !== 'serie') {
|
if ($value['type'] !== 'pdf' && $value['type'] !== 'article' && $value['type'] !== 'serie') {
|
||||||
?>
|
?>
|
||||||
<time class="duration"><?php echo Video::getCleanDuration($value['duration']); ?></time>
|
<time class="duration"><?php echo Video::getCleanDuration(@$value['duration']); ?></time>
|
||||||
<div class="progress" style="height: 3px; margin-bottom: 2px;">
|
<div class="progress" style="height: 3px; margin-bottom: 2px;">
|
||||||
<div class="progress-bar progress-bar-danger" role="progressbar" style="width: <?php echo $value['progress']['percent'] ?>%;" aria-valuenow="<?php echo $value['progress']['percent'] ?>" aria-valuemin="0" aria-valuemax="100"></div>
|
<div class="progress-bar progress-bar-danger" role="progressbar" style="width: <?php echo $value['progress']['percent'] ?>%;" aria-valuenow="<?php echo $value['progress']['percent'] ?>" aria-valuemin="0" aria-valuemax="100"></div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -109,7 +111,7 @@ if (!empty($videoSerie)) {
|
||||||
if (empty($advancedCustom->doNotDisplayViews)) {
|
if (empty($advancedCustom->doNotDisplayViews)) {
|
||||||
?>
|
?>
|
||||||
<div>
|
<div>
|
||||||
<strong class=""><?php echo number_format($value['views_count'], 0); ?></strong> <?php echo __("Views"); ?>
|
<strong class=""><?php echo empty($value['views_count'])?0:number_format($value['views_count'], 0); ?></strong> <?php echo __("Views"); ?>
|
||||||
</div>
|
</div>
|
||||||
<?php
|
<?php
|
||||||
} ?>
|
} ?>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
header('Content-Type: application/json');
|
header('Content-Type: application/json');
|
||||||
$cachedFile = '../videos/cache/version.cache';
|
$cachedFile = '../videos/cache/version'.(empty($_GET['version'])?1:0).'.cache';
|
||||||
|
|
||||||
if (empty($_GET['modified']) && file_exists($cachedFile)) {
|
if (empty($_GET['modified']) && file_exists($cachedFile)) {
|
||||||
$content = file_get_contents($cachedFile);
|
$content = file_get_contents($cachedFile);
|
||||||
|
|
|
@ -2169,6 +2169,7 @@ function addGetParam(_url, _key, _value) {
|
||||||
}
|
}
|
||||||
_url += sep + param;
|
_url += sep + param;
|
||||||
_url = removeDuplicatedGetParam(_url);
|
_url = removeDuplicatedGetParam(_url);
|
||||||
|
_url = _url.replace("#?", "?");
|
||||||
return _url;
|
return _url;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -390,7 +390,8 @@ print AVideoPlugin::updateUserFormJS();
|
||||||
"status": $('#status').is(':checked') ? 'a' : 'i',
|
"status": $('#status').is(':checked') ? 'a' : 'i',
|
||||||
"isEmailVerified": $('#isEmailVerified').is(':checked'),
|
"isEmailVerified": $('#isEmailVerified').is(':checked'),
|
||||||
"userGroups": selectedUserGroups,
|
"userGroups": selectedUserGroups,
|
||||||
"do_not_login": 1
|
"do_not_login": 1,
|
||||||
|
"securityToken": '<?php echo getToken(3600); ?>'
|
||||||
},
|
},
|
||||||
type: 'post',
|
type: 'post',
|
||||||
success: function (response) {
|
success: function (response) {
|
||||||
|
|
|
@ -177,7 +177,7 @@ if (!empty($evideo)) {
|
||||||
|
|
||||||
$modeYouTubeTimeLog['Code part 2'] = microtime(true) - $modeYouTubeTime;
|
$modeYouTubeTimeLog['Code part 2'] = microtime(true) - $modeYouTubeTime;
|
||||||
$modeYouTubeTime = microtime(true);
|
$modeYouTubeTime = microtime(true);
|
||||||
if (!empty($video)) {
|
if (!empty($video) && !empty($video['users_id'])) {
|
||||||
$name = User::getNameIdentificationById($video['users_id']);
|
$name = User::getNameIdentificationById($video['users_id']);
|
||||||
$name = "<a href='" . User::getChannelLink($video['users_id']) . "' class='btn btn-xs btn-default'>{$name} " . User::getEmailVerifiedIcon($video['users_id']) . "</a>";
|
$name = "<a href='" . User::getChannelLink($video['users_id']) . "' class='btn btn-xs btn-default'>{$name} " . User::getEmailVerifiedIcon($video['users_id']) . "</a>";
|
||||||
$subscribe = Subscribe::getButton($video['users_id']);
|
$subscribe = Subscribe::getButton($video['users_id']);
|
||||||
|
@ -241,7 +241,7 @@ if (!empty($evideo)) {
|
||||||
}
|
}
|
||||||
TimeLogEnd($timeLogNameMY, __LINE__, $TimeLogLimitMY);
|
TimeLogEnd($timeLogNameMY, __LINE__, $TimeLogLimitMY);
|
||||||
|
|
||||||
if (empty($_GET['videoName']) && !empty($video)) {
|
if (empty($_GET['videoName']) && !empty($video) && !empty($video['clean_title'])) {
|
||||||
$_GET['videoName'] = $video['clean_title'];
|
$_GET['videoName'] = $video['clean_title'];
|
||||||
}
|
}
|
||||||
if(!empty($video)){
|
if(!empty($video)){
|
||||||
|
@ -352,7 +352,6 @@ TimeLogEnd($timeLogNameMY, __LINE__, $TimeLogLimitMY);
|
||||||
if (empty($video['type'])) {
|
if (empty($video['type'])) {
|
||||||
$video['type'] = "video";
|
$video['type'] = "video";
|
||||||
}
|
}
|
||||||
$img_portrait = ($video['rotation'] === "90" || $video['rotation'] === "270") ? "img-portrait" : "";
|
|
||||||
|
|
||||||
TimeLogEnd($timeLogNameMY, __LINE__, $TimeLogLimitMY);
|
TimeLogEnd($timeLogNameMY, __LINE__, $TimeLogLimitMY);
|
||||||
require "{$global['systemRootPath']}view/modeYoutubeBundle.php";
|
require "{$global['systemRootPath']}view/modeYoutubeBundle.php";
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue