mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-03 01:39:24 +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 ^audioOnly/?$ view/?type=audio [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 ^downloadNow$ objects/downloadVideo.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) {
|
||||
$clean_name = preg_replace('/\W+/', '-', strtolower(cleanString($clean_name)));
|
||||
$this->clean_name = _substr($clean_name, 0, 45);
|
||||
;
|
||||
}
|
||||
|
||||
public function setNextVideoOrder($nextVideoOrder) {
|
||||
|
@ -471,7 +470,7 @@ class Category {
|
|||
//_error_log("getAllCategories id={$row['id']} line=".__LINE__);
|
||||
$row['hierarchyAndName'] = $row['hierarchy'] . __($row['name']);
|
||||
//_error_log("getAllCategories id={$row['id']} line=".__LINE__);
|
||||
$row['description_html'] = textToLink(htmlentities($row['description']));
|
||||
$row['description_html'] = textToLink(htmlentities("{$row['description']}"));
|
||||
$category[] = $row;
|
||||
}
|
||||
|
||||
|
|
|
@ -388,6 +388,9 @@ function getRealIpAddr()
|
|||
|
||||
function cleanString($text)
|
||||
{
|
||||
if(empty($text)){
|
||||
return '';
|
||||
}
|
||||
$utf8 = [
|
||||
'/[áaâaaäą]/u' => 'a',
|
||||
'/[ÁAÂAÄĄ]/u' => 'A',
|
||||
|
@ -1674,6 +1677,9 @@ function getResolutionFromFilename($filename)
|
|||
return $getResolutionFromFilenameArray[$filename];
|
||||
}
|
||||
|
||||
if(empty($filename)){
|
||||
return 0;
|
||||
}
|
||||
if (!preg_match('/^http/i', $filename) && !file_exists($filename)) {
|
||||
return 0;
|
||||
}
|
||||
|
@ -10132,7 +10138,7 @@ function forbiddenPageIfCannotEmbed($videos_id)
|
|||
$reason[] = __('Admin block video sharing');
|
||||
}
|
||||
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');
|
||||
}
|
||||
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']));
|
||||
}
|
||||
$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']);
|
||||
}
|
||||
$row['images'] = $images;
|
||||
|
@ -729,6 +729,7 @@ class PlayList extends ObjectYPT {
|
|||
if (!empty($playlists_id)) {
|
||||
self::deleteCacheDir($playlists_id);
|
||||
}
|
||||
$this->id = $playlists_id;
|
||||
return $playlists_id;
|
||||
}
|
||||
|
||||
|
|
|
@ -10,20 +10,16 @@ if (!User::isLogged()) {
|
|||
die('{"error":"'.__("Permission denied").'"}');
|
||||
}
|
||||
|
||||
if (empty($_POST['playlist_id']) && !empty($_GET['playlist_id'])) {
|
||||
$_POST['playlist_id'] = intval($_GET['playlist_id']);
|
||||
}
|
||||
|
||||
$obj = new PlayList($_POST['playlist_id']);
|
||||
if (User::getId() !== $obj->getUsers_id()) {
|
||||
if (!PlayLists::canManagePlaylist($_REQUEST['playlist_id'])) {
|
||||
die('{"error":"'.__("Permission denied").'"}');
|
||||
}
|
||||
|
||||
$obj = new PlayList($_REQUEST['playlist_id']);
|
||||
$count = 1;
|
||||
|
||||
if (empty($_POST['list'])) {
|
||||
// get all videos from playlist
|
||||
$videosArrayId = PlayList::getVideosIdFromPlaylist($_POST['playlist_id']);
|
||||
$videosArrayId = PlayList::getVideosIdFromPlaylist($_REQUEST['playlist_id']);
|
||||
$videos = [];
|
||||
foreach ($videosArrayId as $value) {
|
||||
$videos[] = Video::getVideoLight($value);
|
||||
|
|
|
@ -341,7 +341,7 @@ if (typeof gtag !== \"function\") {
|
|||
|
||||
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(User::getId())) {
|
||||
$users_id = User::getId();
|
||||
|
@ -694,7 +694,7 @@ if (typeof gtag !== \"function\") {
|
|||
$password = ($this->password);
|
||||
$name = ($this->name);
|
||||
$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);
|
||||
$channelName = ($this->channelName);
|
||||
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) "
|
||||
. " VALUES (?,?,?,?,?,?,?,?, false, "
|
||||
. "?,?,?, 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);
|
||||
|
||||
|
@ -771,6 +773,7 @@ if (typeof gtag !== \"function\") {
|
|||
// update the user groups
|
||||
UserGroups::updateUserGroups($id, $this->userGroups);
|
||||
}
|
||||
$this->id = $id;
|
||||
return $id;
|
||||
} else {
|
||||
_error_log(' Error : (' . $global['mysqli']->errno . ') ' . $global['mysqli']->error . " $sql");
|
||||
|
@ -1188,7 +1191,7 @@ if (typeof gtag !== \"function\") {
|
|||
return !empty($_SESSION['user']['emailVerified']);
|
||||
}
|
||||
|
||||
public static function isAdmin($users_id = 0) {
|
||||
public static function isAdmin($users_id = 0) : bool {
|
||||
if (!empty($users_id)) {
|
||||
$user = new User($users_id);
|
||||
return !empty($user->getIsAdmin());
|
||||
|
|
|
@ -16,6 +16,15 @@ $obj->status = 0;
|
|||
if (!Permissions::canAdminUsers()) {
|
||||
forbiddenPage();
|
||||
}
|
||||
|
||||
if(empty($_REQUEST['securityToken'])){
|
||||
forbiddenPage('Security token is empty');
|
||||
}
|
||||
|
||||
if(!isTokenValid($_REQUEST['securityToken'])){
|
||||
forbiddenPage('Security token is invalid');
|
||||
}
|
||||
|
||||
session_write_close();
|
||||
if (!empty($advancedCustomUser->forceLoginToBeTheEmail)) {
|
||||
$_POST['email'] = $_POST['user'];
|
||||
|
@ -34,7 +43,7 @@ $user->setEmail($_POST['email']);
|
|||
$user->setName($_POST['name']);
|
||||
$user->setIsAdmin($_POST['isAdmin']);
|
||||
$user->setCanStream($_POST['canStream']);
|
||||
$user->setIs_company($_POST['is_company']);
|
||||
$user->setIs_company(@$_POST['is_company']);
|
||||
$user->setCanUpload($_POST['canUpload']);
|
||||
$user->setCanViewChart($_POST['canViewChart']);
|
||||
$user->setCanCreateMeet($_POST['canCreateMeet']);
|
||||
|
|
|
@ -54,9 +54,6 @@ class UserGroups{
|
|||
public function save()
|
||||
{
|
||||
global $global;
|
||||
if (empty($this->isAdmin)) {
|
||||
$this->isAdmin = "false";
|
||||
}
|
||||
$formats = '';
|
||||
$values = [];
|
||||
$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';
|
||||
header('Content-Type: application/json');
|
||||
|
||||
$canAdminUsers = Permissions::canAdminUsers();
|
||||
$canAdminUsers = canAdminUsers();
|
||||
if (empty($_POST['current'])) {
|
||||
$_POST['current'] = 1;
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ if (!empty($_REQUEST['users_id'])) {
|
|||
//echo __LINE__, PHP_EOL;
|
||||
$isAdmin = null;
|
||||
$isCompany = null;
|
||||
$ignoreAdmin = $advancedCustomUser->userCanChangeVideoOwner ? true : false;
|
||||
$ignoreAdmin = canSearchUsers() ? true : false;
|
||||
if (isset($_REQUEST['isAdmin'])) {
|
||||
$isAdmin = 1;
|
||||
}
|
||||
|
@ -48,8 +48,8 @@ if (!empty($_REQUEST['users_id'])) {
|
|||
$total = User::getTotalUsers($ignoreAdmin, @$_GET['status'], $isAdmin, $isCompany);
|
||||
} else {
|
||||
//echo __LINE__, PHP_EOL;
|
||||
$users = User::getAllUsersFromUsergroup($_REQUEST['user_groups_id'], $advancedCustomUser->userCanChangeVideoOwner ? true : false, ['name', 'email', 'user', 'channelName', 'about'], @$_GET['status']);
|
||||
$total = User::getTotalUsersFromUsergroup($_REQUEST['user_groups_id'], $advancedCustomUser->userCanChangeVideoOwner ? true : false, @$_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'], canSearchUsers() ? true : false, @$_GET['status']);
|
||||
}
|
||||
|
||||
//echo examineJSONError($users);exit;
|
||||
|
|
|
@ -645,9 +645,9 @@ if (!class_exists('Video')) {
|
|||
|
||||
public function setDuration($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);
|
||||
_error_log("setDuration after {$duration}");
|
||||
//_error_log("setDuration after {$duration}");
|
||||
$this->duration = $duration;
|
||||
} else {
|
||||
_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");
|
||||
$name = "_getVideoInfo_{$row['id']}";
|
||||
$OneHour = 3600;
|
||||
$cache = ObjectYPT::getCache($name, $OneHour);
|
||||
$cache = ObjectYPT::getCacheGlobal($name, $OneHour);
|
||||
if (!empty($cache)) {
|
||||
$externalOptions = $cache->externalOptions;
|
||||
$obj = object_to_array($cache);
|
||||
|
@ -1733,7 +1733,7 @@ if (!class_exists('Video')) {
|
|||
}
|
||||
TimeLogEnd($timeLogName, __LINE__, $TimeLogLimit);
|
||||
$otherInfocachename = "otherInfo{$row['id']}";
|
||||
$otherInfo = object_to_array(ObjectYPT::getCache($otherInfocachename, 600));
|
||||
$otherInfo = object_to_array(ObjectYPT::getCacheGlobal($otherInfocachename, 600));
|
||||
TimeLogEnd($timeLogName, __LINE__, $TimeLogLimit);
|
||||
if (empty($otherInfo)) {
|
||||
$otherInfo = [];
|
||||
|
@ -1743,7 +1743,7 @@ if (!class_exists('Video')) {
|
|||
//TimeLogEnd("video::otherInfo", __LINE__, 0.05);
|
||||
$otherInfo['tags'] = self::getTags($row['id']);
|
||||
//TimeLogEnd("video::otherInfo", __LINE__, 0.05);
|
||||
$cached = ObjectYPT::setCache($otherInfocachename, $otherInfo);
|
||||
$cached = ObjectYPT::setCacheGlobal($otherInfocachename, $otherInfo);
|
||||
//TimeLogEnd("video::otherInfo", __LINE__, 0.05);
|
||||
//_error_log("video::getInfo cache " . json_encode($cached));
|
||||
}
|
||||
|
@ -1786,7 +1786,7 @@ if (!class_exists('Video')) {
|
|||
//var_dump($row['userExternalOptions']);exit;
|
||||
$row = array_merge($row, AVideoPlugin::getAllVideosArray($row['id']));
|
||||
TimeLogEnd($timeLogName, __LINE__, $TimeLogLimit);
|
||||
ObjectYPT::setCache($name, $row);
|
||||
ObjectYPT::setCacheGlobal($name, $row);
|
||||
TimeLogEnd($timeLogName, __LINE__, $TimeLogLimit);
|
||||
|
||||
if (self::forceAudio()) {
|
||||
|
@ -5344,7 +5344,7 @@ if (!class_exists('Video')) {
|
|||
} else {
|
||||
if (self::userGroupAndVideoGroupMatch($users_id, $videos_id)) {
|
||||
$videosug = self::getVideoGroups($videos_id);
|
||||
$categoriessug = self::getCategoriesGroups($videos_id);
|
||||
$categoriessug = UserGroups::getCategoriesGroups($videos_id);
|
||||
$rowsUser = UserGroups::getUserGroups(User::getId());
|
||||
// what group the user needs
|
||||
}
|
||||
|
@ -5355,12 +5355,12 @@ if (!class_exists('Video')) {
|
|||
if ($p = AVideoPlugin::loadPluginIfEnabled($name)) {
|
||||
$obj = $p->getDataObject();
|
||||
if ($obj->ifExceedQuotaDoNotPlayVideos) {
|
||||
if ($this->videoOwnerExceedsQuota($videos_id)) {
|
||||
if ($p->videoOwnerExceedsQuota($videos_id)) {
|
||||
$response->canWatch = false;
|
||||
$response->why[] = 'DiskUploadQuota videoOwnerExceedsQuota and ifExceedQuotaDoNotPlayVideos';
|
||||
}
|
||||
} else {
|
||||
if ($this->videoOwnerExceedsQuota($videos_id)) {
|
||||
if ($p->videoOwnerExceedsQuota($videos_id)) {
|
||||
$response->why[] = 'DiskUploadQuota is active but the owner still have quota';
|
||||
} else {
|
||||
$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()
|
||||
{
|
||||
$name = "getHTMLMenuRight" . User::getId();
|
||||
$str = ObjectYPT::getCache($name, 3600);
|
||||
if (empty($str)) {
|
||||
$plugins = Plugin::getAllEnabled();
|
||||
$str = "";
|
||||
foreach ($plugins as $value) {
|
||||
|
@ -337,6 +340,9 @@ class AVideoPlugin
|
|||
}
|
||||
self::YPTend("{$value['dirName']}::" . __FUNCTION__);
|
||||
}
|
||||
|
||||
ObjectYPT::setCache($name, $str);
|
||||
}
|
||||
return $str;
|
||||
}
|
||||
|
||||
|
@ -1379,7 +1385,7 @@ class AVideoPlugin
|
|||
public static function compareVersion($name, $version)
|
||||
{
|
||||
$currentVersion = self::getCurrentVersion($name);
|
||||
if(empty($currentVersion)){
|
||||
if (empty($currentVersion)) {
|
||||
return -1;
|
||||
}
|
||||
return version_compare($currentVersion, $version);
|
||||
|
|
|
@ -575,7 +575,7 @@ class Layout extends PluginAbstract
|
|||
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;
|
||||
$default_users_id = intval($default_users_id);
|
||||
|
|
|
@ -95,6 +95,11 @@ if (empty($name)) {
|
|||
photoURL = ui.item.photo;
|
||||
}
|
||||
$("#user-img<?php echo $id; ?>").attr("src", photoURL);
|
||||
<?php
|
||||
if(!empty($jsFunctionForSelectCallback)){
|
||||
echo $jsFunctionForSelectCallback.';';
|
||||
}
|
||||
?>
|
||||
return false;
|
||||
}
|
||||
}).autocomplete("instance")._renderItem = function (ul, item) {
|
||||
|
|
|
@ -129,6 +129,7 @@ Passcode: {password}
|
|||
"sub" => "meet.jitsi",
|
||||
"room" => $room,
|
||||
"exp" => strtotime("+30 hours"),
|
||||
"nbf" => strtotime("-24 hours"),
|
||||
"moderator" => $isModerator,
|
||||
];
|
||||
return $jitsiPayload; // HS256
|
||||
|
|
|
@ -30,7 +30,9 @@ if (empty($obj->key) || strlen($obj->key) < 50) {
|
|||
if (empty($server)) {
|
||||
$obj->msg = "The server URL is empty";
|
||||
} 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
|
||||
if (!empty($obj->key) && $obj->length > 50) {
|
||||
$obj->error = false;
|
||||
|
|
|
@ -17,7 +17,8 @@ class MobileYPT extends PluginAbstract {
|
|||
}
|
||||
|
||||
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']);
|
||||
return $desc;
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
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()) {
|
||||
$this->name = $name;
|
||||
|
@ -12,7 +12,7 @@ class PlayListElement {
|
|||
$this->thumbnail = $playListThumbnail;
|
||||
$this->poster = $poster;
|
||||
$this->videoStartSeconds = intval($videoStartSeconds);
|
||||
$this->created = strtotime($created);
|
||||
$this->created = empty($created)?0:strtotime($created);
|
||||
$this->likes = $likes;
|
||||
$this->views = $views;
|
||||
$this->videos_id = $videos_id;
|
||||
|
@ -38,7 +38,7 @@ class PlayListElement {
|
|||
}
|
||||
|
||||
function getPlayListThumbnail() {
|
||||
return $this->playListThumbnail;
|
||||
return $this->thumbnail;
|
||||
}
|
||||
|
||||
function setName($name) {
|
||||
|
@ -133,7 +133,7 @@ class PlayListElement {
|
|||
|
||||
class playListSource {
|
||||
|
||||
public $src, $type;
|
||||
public $src, $type, $label;
|
||||
|
||||
function __construct($src, $youtube = false) {
|
||||
$this->src = $src;
|
||||
|
|
|
@ -9,6 +9,8 @@ require_once $global['systemRootPath'] . 'plugin/PlayLists/PlayListElement.php';
|
|||
|
||||
class PlayLists extends PluginAbstract {
|
||||
|
||||
const PERMISSION_CAN_MANAGE_ALL_PLAYLISTS = 0;
|
||||
|
||||
public function getTags() {
|
||||
return array(
|
||||
PluginTags::$RECOMMENDED,
|
||||
|
@ -30,6 +32,33 @@ class PlayLists extends PluginAbstract {
|
|||
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() {
|
||||
return "1.0";
|
||||
}
|
||||
|
@ -564,20 +593,6 @@ class PlayLists extends PluginAbstract {
|
|||
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) {
|
||||
if (!self::showTVFeatures()) {
|
||||
return "";
|
||||
|
@ -1002,9 +1017,10 @@ class PlayListPlayer {
|
|||
$playListData = array();
|
||||
}
|
||||
foreach ($this->videos as $key => $video) {
|
||||
|
||||
if ($video['type'] === 'embed') {
|
||||
$sources[0]['type'] = 'video';
|
||||
$sources[0]['url'] = $video["videoLink"];
|
||||
$sources[0]['url'] = @$video["videoLink"];
|
||||
} else {
|
||||
$sources = getVideosURL($video['filename']);
|
||||
}
|
||||
|
@ -1027,7 +1043,7 @@ class PlayListPlayer {
|
|||
$messagesFromPlayList[] = "videos_id={$video['videos_id']} empty playlist source ";
|
||||
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;
|
||||
}
|
||||
|
|
|
@ -9,8 +9,6 @@ $program = PlayList::getFromDbFromId($playlists_id);
|
|||
if(empty($program)){
|
||||
return;
|
||||
}
|
||||
//var_dump($playlists_id, $program);
|
||||
$isMyChannel = $program['users_id'] == User::getId();
|
||||
|
||||
$playListButtons = AVideoPlugin::getPlayListButtons($playlists_id);
|
||||
$link = PlayLists::getLink($program['id']);
|
||||
|
@ -28,7 +26,7 @@ if (empty($isASerie)) {
|
|||
<?php echo $playListButtons; ?>
|
||||
<?php
|
||||
echo PlayLists::getPlayLiveButton($program['id']);
|
||||
if ($isMyChannel) {
|
||||
if (PlayLists::canManagePlaylist($playlists_id)) {
|
||||
?>
|
||||
<script>
|
||||
$(function () {
|
||||
|
|
|
@ -7,46 +7,56 @@ require_once $global['systemRootPath'] . 'objects/user.php';
|
|||
if (!User::isLogged()) {
|
||||
gotToLoginAndComeBackHere('');
|
||||
}
|
||||
$users_id = User::getId();
|
||||
if(User::isAdmin() && !empty($_REQUEST['users_id'])){
|
||||
$users_id = $_REQUEST['users_id'];
|
||||
function getPlaylistOwnerUsersId(){
|
||||
if(!empty($_REQUEST['PlaylistOwnerUsersId'])){
|
||||
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>
|
||||
<html lang="<?php echo getLanguage(); ?>">
|
||||
<head>
|
||||
|
||||
<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{
|
||||
.playLists li {
|
||||
min-height: 45px;
|
||||
}
|
||||
.playLists .list-group{
|
||||
|
||||
.playLists .list-group {
|
||||
height: 221px;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.videoTitle.ellipsis{
|
||||
.videoTitle.ellipsis {
|
||||
width: calc(100% - 90px);
|
||||
float: left;
|
||||
}
|
||||
|
||||
.playLists .tab-content{
|
||||
.playLists .tab-content {
|
||||
min-height: 250px;
|
||||
}
|
||||
|
||||
.playLists {
|
||||
min-height: 330px;
|
||||
}
|
||||
.pl .panel-footer{
|
||||
|
||||
.pl .panel-footer {
|
||||
min-height: 42px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body class="<?php echo $global['bodyClass']; ?>">
|
||||
</head>
|
||||
|
||||
<body class="<?php echo $global['bodyClass']; ?>">
|
||||
<?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-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'); ?>">
|
||||
<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'); ?>">
|
||||
<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'); ?>">
|
||||
<?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'); ?>">
|
||||
<?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();" >
|
||||
<?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>
|
||||
<?php
|
||||
if (PlayLists::canManageAllPlaylists()) {
|
||||
?>
|
||||
<li class="pull-right">
|
||||
<?php
|
||||
if (PlayLists::canManageAllPlaylists()) {
|
||||
$autocomplete = Layout::getUserAutocomplete(getPlaylistOwnerUsersId(), 'User_playlist_owner', array(), 'updatePlaylistOwner()');
|
||||
}
|
||||
?>
|
||||
</li>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
|
@ -110,7 +132,7 @@ if(User::isAdmin() && !empty($_REQUEST['users_id'])){
|
|||
}
|
||||
$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-heading">
|
||||
<?php
|
||||
|
@ -123,17 +145,13 @@ if(User::isAdmin() && !empty($_REQUEST['users_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"
|
||||
title="<?php echo __('Delete'); ?>"
|
||||
onclick="deleteProgram(<?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); ?>');" >
|
||||
<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'); ?>" >
|
||||
<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>
|
||||
|
@ -193,13 +211,13 @@ if(User::isAdmin() && !empty($_REQUEST['users_id'])){
|
|||
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"]; ?>);" >
|
||||
<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); ?>');" >
|
||||
<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+'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>
|
||||
</button>
|
||||
</li>
|
||||
|
@ -227,19 +245,13 @@ if(User::isAdmin() && !empty($_REQUEST['users_id'])){
|
|||
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"]; ?>);" >
|
||||
<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); ?>');" >
|
||||
<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+'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>
|
||||
</button>
|
||||
</li>
|
||||
|
@ -260,7 +272,7 @@ if(User::isAdmin() && !empty($_REQUEST['users_id'])){
|
|||
<div class="panel-footer text-right">
|
||||
<?php
|
||||
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>';
|
||||
}
|
||||
|
@ -276,6 +288,15 @@ if(User::isAdmin() && !empty($_REQUEST['users_id'])){
|
|||
</div>
|
||||
</div>
|
||||
<?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)) {
|
||||
?>
|
||||
|
@ -296,11 +317,19 @@ if(User::isAdmin() && !empty($_REQUEST['users_id'])){
|
|||
include $global['systemRootPath'] . 'view/include/footer.php';
|
||||
?>
|
||||
<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) {
|
||||
$('.pl_filter').removeClass('active');
|
||||
t.addClass('active');
|
||||
|
@ -325,7 +354,7 @@ if(User::isAdmin() && !empty($_REQUEST['users_id'])){
|
|||
buttons: true,
|
||||
dangerMode: true,
|
||||
})
|
||||
.then(function (willDelete) {
|
||||
.then(function(willDelete) {
|
||||
if (willDelete) {
|
||||
addVideoToPlayList(videos_id, false, playlists_id);
|
||||
$('#videos_id_' + videos_id + '_playlists_id_' + playlists_id).fadeOut();
|
||||
|
@ -344,7 +373,7 @@ if(User::isAdmin() && !empty($_REQUEST['users_id'])){
|
|||
buttons: true,
|
||||
dangerMode: true,
|
||||
})
|
||||
.then(function (willDelete) {
|
||||
.then(function(willDelete) {
|
||||
if (willDelete) {
|
||||
modal.showPleaseWait();
|
||||
$.ajax({
|
||||
|
@ -353,7 +382,7 @@ if(User::isAdmin() && !empty($_REQUEST['users_id'])){
|
|||
"playlist_id": playlists_id
|
||||
},
|
||||
type: 'post',
|
||||
success: function (response) {
|
||||
success: function(response) {
|
||||
$('.pl' + playlists_id).fadeOut();
|
||||
modal.hidePleaseWait();
|
||||
avideoToastSuccess('<?php echo __('Deleted'); ?>');
|
||||
|
@ -396,7 +425,7 @@ if(User::isAdmin() && !empty($_REQUEST['users_id'])){
|
|||
'status': "public",
|
||||
'name': inputValue
|
||||
},
|
||||
success: function (response) {
|
||||
success: function(response) {
|
||||
if (response.status > 0) {
|
||||
location.reload();
|
||||
} else {
|
||||
|
@ -407,5 +436,6 @@ if(User::isAdmin() && !empty($_REQUEST['users_id'])){
|
|||
});
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</body>
|
||||
|
||||
</html>
|
|
@ -38,16 +38,18 @@ $playListsObj = AVideoPlugin::getObjectData("PlayLists");
|
|||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="<?php echo getLanguage(); ?>">
|
||||
<head>
|
||||
|
||||
<head>
|
||||
<title><?php echo __("Program") . $config->getPageTitleSeparator() . $config->getWebSiteTitle(); ?></title>
|
||||
<?php
|
||||
include $global['systemRootPath'] . 'view/include/head.php';
|
||||
?>
|
||||
<style>
|
||||
.galleryVideo .panel{
|
||||
.galleryVideo .panel {
|
||||
border-color: transparent;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.galleryVideo .panel .panel-body {
|
||||
padding: 5px;
|
||||
}
|
||||
|
@ -57,9 +59,9 @@ $playListsObj = AVideoPlugin::getObjectData("PlayLists");
|
|||
getOpenGraph($videos_id);
|
||||
}
|
||||
?>
|
||||
</head>
|
||||
</head>
|
||||
|
||||
<body class="<?php echo $global['bodyClass']; ?>">
|
||||
<body class="<?php echo $global['bodyClass']; ?>">
|
||||
<?php
|
||||
include $global['systemRootPath'] . 'view/include/navbar.php';
|
||||
?>
|
||||
|
@ -82,7 +84,7 @@ $playListsObj = AVideoPlugin::getObjectData("PlayLists");
|
|||
$videosP = [];
|
||||
} else {
|
||||
$videosP = Video::getAllVideos("viewable", false, true, $videosArrayId, false, true);
|
||||
}//var_dump($videosArrayId, $videosP);exit;
|
||||
} //var_dump($videosArrayId, $videosP);exit;
|
||||
@$timesC[__LINE__] += microtime(true) - $startC;
|
||||
$startC = microtime(true);
|
||||
//_error_log("channelPlaylist videosP: ".json_encode($videosP));
|
||||
|
@ -174,7 +176,7 @@ $playListsObj = AVideoPlugin::getObjectData("PlayLists");
|
|||
|
||||
<div>
|
||||
<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>
|
||||
<i class="fa fa-user"></i>
|
||||
|
@ -201,7 +203,7 @@ $playListsObj = AVideoPlugin::getObjectData("PlayLists");
|
|||
<div>
|
||||
<span playlist_id="<?php echo $program['id']; ?>" video_id="<?php echo $value['id']; ?>">
|
||||
<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>
|
||||
</span>
|
||||
</div>
|
||||
|
@ -238,7 +240,7 @@ $playListsObj = AVideoPlugin::getObjectData("PlayLists");
|
|||
}
|
||||
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 }
|
||||
?>
|
||||
</div>
|
||||
|
@ -253,12 +255,12 @@ $playListsObj = AVideoPlugin::getObjectData("PlayLists");
|
|||
?>
|
||||
|
||||
<script>
|
||||
|
||||
var timoutembed;
|
||||
|
||||
function setTextEmbedCopied() {
|
||||
clearTimeout(timoutembed);
|
||||
$("#btnEmbedText").html("<?php echo __("Copied!"); ?>");
|
||||
timoutembed = setTimeout(function () {
|
||||
timoutembed = setTimeout(function() {
|
||||
$("#btnEmbedText").html("<?php echo __("Copy embed code"); ?>");
|
||||
}, 3000);
|
||||
}
|
||||
|
@ -272,7 +274,7 @@ $playListsObj = AVideoPlugin::getObjectData("PlayLists");
|
|||
"playlist_id": playlist_id
|
||||
},
|
||||
type: 'post',
|
||||
success: function (response) {
|
||||
success: function(response) {
|
||||
//$("#channelPlaylists").load(webSiteRootURL + "view/channelPlaylist.php?channelName=" + channelName);
|
||||
modal.hidePleaseWait();
|
||||
}
|
||||
|
@ -288,17 +290,17 @@ $playListsObj = AVideoPlugin::getObjectData("PlayLists");
|
|||
return false;
|
||||
}
|
||||
if (position === 0) {
|
||||
$this.slideUp(500, function () {
|
||||
$this.slideUp(500, function() {
|
||||
$this.insertBefore($this.siblings(':eq(0)'));
|
||||
saveSortable($uiDiv, $playListId);
|
||||
}).slideDown(500);
|
||||
} else if ($list.length - 1 > position) {
|
||||
$this.slideUp(500, function () {
|
||||
$this.slideUp(500, function() {
|
||||
$this.insertBefore($this.siblings(':eq(' + position + ')'));
|
||||
saveSortable($uiDiv, $playListId);
|
||||
}).slideDown(500);
|
||||
} else {
|
||||
$this.slideUp(500, function () {
|
||||
$this.slideUp(500, function() {
|
||||
$this.insertAfter($this.siblings(':eq(' + ($list.length - 2) + ')'));
|
||||
saveSortable($uiDiv, $playListId);
|
||||
}).slideDown(500);
|
||||
|
@ -306,16 +308,16 @@ $playListsObj = AVideoPlugin::getObjectData("PlayLists");
|
|||
}
|
||||
|
||||
var currentObject;
|
||||
$(function () {
|
||||
<?php
|
||||
if (count($programs) <= 1 || !empty($palyListsObj->expandPlayListOnChannels)) {
|
||||
$(function() {
|
||||
<?php
|
||||
if (count($programs) <= 1 || !empty($palyListsObj->expandPlayListOnChannels)) {
|
||||
?>
|
||||
$('.showMoreLess').slideDown();
|
||||
$('.showMoreLessBtn').toggle();
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
$('.removeVideo').click(function () {
|
||||
}
|
||||
?>
|
||||
$('.removeVideo').click(function() {
|
||||
currentObject = this;
|
||||
|
||||
swal({
|
||||
|
@ -325,7 +327,7 @@ if (count($programs) <= 1 || !empty($palyListsObj->expandPlayListOnChannels)) {
|
|||
buttons: true,
|
||||
dangerMode: true,
|
||||
})
|
||||
.then(function (willDelete) {
|
||||
.then(function(willDelete) {
|
||||
if (willDelete) {
|
||||
|
||||
modal.showPleaseWait();
|
||||
|
@ -338,7 +340,7 @@ if (count($programs) <= 1 || !empty($palyListsObj->expandPlayListOnChannels)) {
|
|||
"video_id": video_id
|
||||
},
|
||||
type: 'post',
|
||||
success: function (response) {
|
||||
success: function(response) {
|
||||
reloadPlayLists();
|
||||
$(".playListsIds" + video_id).prop("checked", false);
|
||||
$(currentObject).closest('.galleryVideo').fadeOut();
|
||||
|
@ -350,7 +352,7 @@ if (count($programs) <= 1 || !empty($palyListsObj->expandPlayListOnChannels)) {
|
|||
|
||||
});
|
||||
|
||||
$('.deletePlaylist').click(function () {
|
||||
$('.deletePlaylist').click(function() {
|
||||
currentObject = this;
|
||||
|
||||
swal({
|
||||
|
@ -360,7 +362,7 @@ if (count($programs) <= 1 || !empty($palyListsObj->expandPlayListOnChannels)) {
|
|||
buttons: true,
|
||||
dangerMode: true,
|
||||
})
|
||||
.then(function (willDelete) {
|
||||
.then(function(willDelete) {
|
||||
if (willDelete) {
|
||||
|
||||
modal.showPleaseWait();
|
||||
|
@ -372,7 +374,7 @@ if (count($programs) <= 1 || !empty($palyListsObj->expandPlayListOnChannels)) {
|
|||
"playlist_id": playlist_id
|
||||
},
|
||||
type: 'post',
|
||||
success: function (response) {
|
||||
success: function(response) {
|
||||
$(currentObject).closest('.panel').slideUp();
|
||||
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 status = "public";
|
||||
if ($('#statusPrivate' + playlist_id).is(":visible")) {
|
||||
|
@ -407,7 +409,7 @@ if (count($programs) <= 1 || !empty($palyListsObj->expandPlayListOnChannels)) {
|
|||
"status": status
|
||||
},
|
||||
type: 'post',
|
||||
success: function (response) {
|
||||
success: function(response) {
|
||||
|
||||
modal.hidePleaseWait();
|
||||
}
|
||||
|
@ -415,7 +417,7 @@ if (count($programs) <= 1 || !empty($palyListsObj->expandPlayListOnChannels)) {
|
|||
|
||||
});
|
||||
|
||||
$('.renamePlaylist').click(function () {
|
||||
$('.renamePlaylist').click(function() {
|
||||
currentObject = this;
|
||||
swal({
|
||||
text: "<?php echo __("Change Playlist Name"); ?>!",
|
||||
|
@ -424,16 +426,16 @@ if (count($programs) <= 1 || !empty($palyListsObj->expandPlayListOnChannels)) {
|
|||
text: "<?php echo __("Confirm Playlist name"); ?>",
|
||||
closeModal: false,
|
||||
},
|
||||
}).then(function (name) {
|
||||
}).then(function(name) {
|
||||
if (!name)
|
||||
throw null;
|
||||
modal.showPleaseWait();
|
||||
var playlist_id = $(currentObject).attr('playlist_id');
|
||||
console.log(playlist_id);
|
||||
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();
|
||||
}).then(function (response) {
|
||||
}).then(function(response) {
|
||||
if (response.error) {
|
||||
avideoAlert("<?php echo __("Sorry!"); ?>", response.msg, "error");
|
||||
modal.hidePleaseWait();
|
||||
|
@ -443,7 +445,7 @@ if (count($programs) <= 1 || !empty($palyListsObj->expandPlayListOnChannels)) {
|
|||
swal.close();
|
||||
modal.hidePleaseWait();
|
||||
}
|
||||
}).catch(function (err) {
|
||||
}).catch(function(err) {
|
||||
if (err) {
|
||||
swal("Oh noes!", "The AJAX request failed!", "error");
|
||||
} else {
|
||||
|
@ -451,17 +453,16 @@ if (count($programs) <= 1 || !empty($palyListsObj->expandPlayListOnChannels)) {
|
|||
swal.close();
|
||||
}
|
||||
modal.hidePleaseWait();
|
||||
});
|
||||
;
|
||||
});;
|
||||
|
||||
});
|
||||
|
||||
$('.sortNow').click(function () {
|
||||
$('.sortNow').click(function() {
|
||||
var $val = $(this).siblings("input").val();
|
||||
sortNow(this, $val);
|
||||
});
|
||||
|
||||
$('.video_order').keypress(function (e) {
|
||||
$('.video_order').keypress(function(e) {
|
||||
if (e.which == 13) {
|
||||
sortNow(this, $(this).val());
|
||||
}
|
||||
|
@ -484,5 +485,6 @@ if (count($programs) <= 1 || !empty($palyListsObj->expandPlayListOnChannels)) {
|
|||
<?php
|
||||
include $global['systemRootPath'] . 'view/include/footer.php';
|
||||
?>
|
||||
</body>
|
||||
</body>
|
||||
|
||||
</html>
|
|
@ -26,7 +26,7 @@ if (file_exists($extraPluginFile) && AVideoPlugin::isEnabledByName("Customize"))
|
|||
|
||||
TimeLogEnd($timeLogHead, __LINE__);
|
||||
if (!empty($poster)) {
|
||||
$subTitle = str_replace(['"', "\n", "\r"], ["", "", ""], strip_tags($video['description']));
|
||||
$subTitle = str_replace(['"', "\n", "\r"], ["", "", ""], strip_tags("{$video['description']}"));
|
||||
$custom = [];
|
||||
$custom[] = $subTitle;
|
||||
if (!empty($video["category"])) {
|
||||
|
|
|
@ -53,7 +53,7 @@ if (!empty($videoSerie)) {
|
|||
</h3>
|
||||
<small>
|
||||
<?php
|
||||
echo($playlist_index + 1), "/", count($playlistVideos), " ", __("Videos");
|
||||
echo ($playlist_index + 1), "/", count($playlistVideos), " ", __("Videos");
|
||||
?>
|
||||
</small>
|
||||
</a>
|
||||
|
@ -73,25 +73,27 @@ if (!empty($videoSerie)) {
|
|||
$indicator = '<span class="fa fa-play text-danger"></span>';
|
||||
} ?>
|
||||
<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")) {
|
||||
if(empty($value['images']['poster'])){
|
||||
$img = Video::getPoster($value['videos_id']);
|
||||
}else{
|
||||
$img = $value['images']['poster'];
|
||||
$img_portrait = ($value['rotation'] === "90" || $value['rotation'] === "270") ? "img-portrait" : "";
|
||||
}
|
||||
} else {
|
||||
$img = "".getCDN()."view/img/audio_wave.jpg";
|
||||
$img_portrait = '';
|
||||
$img = "" . getCDN() . "view/img/audio_wave.jpg";
|
||||
} ?>
|
||||
<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
|
||||
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-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>
|
||||
|
@ -109,7 +111,7 @@ if (!empty($videoSerie)) {
|
|||
if (empty($advancedCustom->doNotDisplayViews)) {
|
||||
?>
|
||||
<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>
|
||||
<?php
|
||||
} ?>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
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)) {
|
||||
$content = file_get_contents($cachedFile);
|
||||
|
|
|
@ -2169,6 +2169,7 @@ function addGetParam(_url, _key, _value) {
|
|||
}
|
||||
_url += sep + param;
|
||||
_url = removeDuplicatedGetParam(_url);
|
||||
_url = _url.replace("#?", "?");
|
||||
return _url;
|
||||
}
|
||||
|
||||
|
|
|
@ -390,7 +390,8 @@ print AVideoPlugin::updateUserFormJS();
|
|||
"status": $('#status').is(':checked') ? 'a' : 'i',
|
||||
"isEmailVerified": $('#isEmailVerified').is(':checked'),
|
||||
"userGroups": selectedUserGroups,
|
||||
"do_not_login": 1
|
||||
"do_not_login": 1,
|
||||
"securityToken": '<?php echo getToken(3600); ?>'
|
||||
},
|
||||
type: 'post',
|
||||
success: function (response) {
|
||||
|
|
|
@ -177,7 +177,7 @@ if (!empty($evideo)) {
|
|||
|
||||
$modeYouTubeTimeLog['Code part 2'] = microtime(true) - $modeYouTubeTime;
|
||||
$modeYouTubeTime = microtime(true);
|
||||
if (!empty($video)) {
|
||||
if (!empty($video) && !empty($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>";
|
||||
$subscribe = Subscribe::getButton($video['users_id']);
|
||||
|
@ -241,7 +241,7 @@ if (!empty($evideo)) {
|
|||
}
|
||||
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'];
|
||||
}
|
||||
if(!empty($video)){
|
||||
|
@ -352,7 +352,6 @@ TimeLogEnd($timeLogNameMY, __LINE__, $TimeLogLimitMY);
|
|||
if (empty($video['type'])) {
|
||||
$video['type'] = "video";
|
||||
}
|
||||
$img_portrait = ($video['rotation'] === "90" || $video['rotation'] === "270") ? "img-portrait" : "";
|
||||
|
||||
TimeLogEnd($timeLogNameMY, __LINE__, $TimeLogLimitMY);
|
||||
require "{$global['systemRootPath']}view/modeYoutubeBundle.php";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue