mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-03 09:49:28 +02:00
Fixes regarding the encoder process, do not process more then once.
This commit is contained in:
parent
352105fb77
commit
f7dd239f7a
35 changed files with 631 additions and 478 deletions
|
@ -62,7 +62,7 @@ if (!empty($confirm) && strtolower($confirm) === 'y') {
|
|||
$count++;
|
||||
$title = "Video recovered: ".date("Y-m-d H:i:s", filectime($value[1]));
|
||||
$video = new Video($title, $value[0]);
|
||||
$video->setStatus('a');
|
||||
$video->setStatus(Video::$statusActive);
|
||||
$video->setUsers_id(1);
|
||||
if($video->save(false, true)){
|
||||
echo "{$count}/{$total} {$title} created\n";
|
||||
|
|
|
@ -49,15 +49,20 @@ abstract class ObjectYPT implements ObjectInterface {
|
|||
global $advancedCustom;
|
||||
$row = self::getNowFromDB();
|
||||
$dt = new DateTime($row['my_date_field']);
|
||||
if(!empty($_COOKIE['timezone'])){
|
||||
$timezone = $_COOKIE['timezone'];
|
||||
}else{
|
||||
$timeZOnesOptions = object_to_array($advancedCustom->timeZone->type);
|
||||
if (empty($timeZOnesOptions[$advancedCustom->timeZone->value])) {
|
||||
$timezone = $timeZOnesOptions[$advancedCustom->timeZone->value];
|
||||
}
|
||||
if (empty($timezone)) {
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
$objDate = new DateTimeZone($timeZOnesOptions[$advancedCustom->timeZone->value]);
|
||||
$objDate = new DateTimeZone($timezone);
|
||||
if (is_object($objDate)) {
|
||||
$dt->setTimezone($objDate);
|
||||
date_default_timezone_set($timeZOnesOptions[$advancedCustom->timeZone->value]);
|
||||
date_default_timezone_set($timezone);
|
||||
return $dt;
|
||||
}
|
||||
return false;
|
||||
|
|
|
@ -69,29 +69,8 @@ if(!empty($_REQUEST['duration'])){
|
|||
}
|
||||
}
|
||||
|
||||
$status = $video->getStatus();
|
||||
// if encoder requested a status
|
||||
if (!empty($_POST['overrideStatus'])) {
|
||||
$video->setStatus($_POST['overrideStatus']);
|
||||
} else { // encoder did not provide a status
|
||||
// if status is not unlisted
|
||||
if ($status !== 'u' && $status !== 'a') {
|
||||
if (empty($advancedCustom->makeVideosInactiveAfterEncode)) {
|
||||
// set active or active+encoding
|
||||
if (!empty($_POST['keepEncoding'])) {
|
||||
$video->setStatus('k');
|
||||
} else {
|
||||
$video->setStatus('a');
|
||||
}
|
||||
$status = $video->setAutoStatus();
|
||||
|
||||
} elseif (empty($advancedCustom->makeVideosUnlistedAfterEncode)) {
|
||||
// set active
|
||||
$video->setStatus('u');
|
||||
} else {
|
||||
$video->setStatus('i');
|
||||
}
|
||||
}
|
||||
}
|
||||
$video->setVideoDownloadedLink($_POST['videoDownloadedLink']);
|
||||
_error_log("aVideoEncoder.json: Encoder receiving post " . json_encode($_POST));
|
||||
//_error_log(print_r($_POST, true));
|
||||
|
@ -159,7 +138,7 @@ if (!empty($_FILES['video']['tmp_name'])) {
|
|||
decideMoveUploadedToVideos($_FILES['video']['tmp_name'], $filename);
|
||||
} else {
|
||||
// set encoding
|
||||
$video->setStatus('e');
|
||||
$video->setStatus(Video::$statusEncoding);
|
||||
}
|
||||
if (!empty($_FILES['image']['tmp_name']) && !file_exists("{$destination_local}.jpg")) {
|
||||
if (!move_uploaded_file($_FILES['image']['tmp_name'], "{$destination_local}.jpg")) {
|
||||
|
|
|
@ -39,31 +39,15 @@ Video::clearCache($_POST['videos_id']);
|
|||
$video = new Video("", "", $_POST['videos_id']);
|
||||
$obj->video_id = $_POST['videos_id'];
|
||||
|
||||
if(empty($_POST['fail'])){
|
||||
// if encoder requested a status
|
||||
if (!empty($_POST['overrideStatus'])) {
|
||||
$video->setStatus($_POST['overrideStatus']);
|
||||
} else { // encoder did not provide a status
|
||||
$status = $video->getStatus();
|
||||
// if status is not unlisted
|
||||
if($status!=='u' && $status !== 'a'){
|
||||
if(empty($advancedCustom->makeVideosInactiveAfterEncode)){
|
||||
// set active
|
||||
$video->setStatus('a');
|
||||
}else if(empty($advancedCustom->makeVideosUnlistedAfterEncode)){
|
||||
// set active
|
||||
$video->setStatus('u');
|
||||
}else{
|
||||
$video->setStatus('i');
|
||||
}
|
||||
}
|
||||
}
|
||||
}else{
|
||||
$video->setStatus('i');
|
||||
}
|
||||
|
||||
$video->setAutoStatus(Video::$statusActive);
|
||||
|
||||
$video_id = $video->save();
|
||||
if(empty($_POST['fail'])){
|
||||
AVideoPlugin::afterNewVideo($_POST['videos_id']);
|
||||
|
||||
$video = new Video("", "", $video_id);
|
||||
|
||||
if($video->getStatus() === Video::$statusActive){
|
||||
AVideoPlugin::afterNewVideo($video_id);
|
||||
}
|
||||
$obj->error = false;
|
||||
$obj->video_id = $video_id;
|
||||
|
|
|
@ -85,7 +85,7 @@ if (isset($_FILES['upl']) && $_FILES['upl']['error'] == 0) {
|
|||
} else {
|
||||
$video->setType("video");
|
||||
}
|
||||
$video->setStatus('e');
|
||||
$video->setStatus(Video::$statusEncoding);
|
||||
|
||||
/*
|
||||
* set visibility for private videos
|
||||
|
|
|
@ -10,5 +10,6 @@ $obj->_serverTime = time();
|
|||
$obj->_serverDBTime = getDatabaseTime();
|
||||
$obj->_serverTimeString = date('Y-m-d H:i:s');
|
||||
$obj->_serverDBTimeString = date('Y-m-d H:i:s', getDatabaseTime());
|
||||
$obj->_serverTimezone = date_default_timezone_get();
|
||||
|
||||
die(json_encode($obj));
|
|
@ -2367,4 +2367,29 @@ if (typeof gtag !== \"function\") {
|
|||
return sqlDAL::writeSql($sql, "si", array($string, $users_id));
|
||||
}
|
||||
|
||||
static function userGroupsMatch($user_groups, $users_id=0){
|
||||
if(empty($users_id)){
|
||||
$users_id = User::getId();
|
||||
}
|
||||
if(empty($user_groups)){
|
||||
return true;
|
||||
}
|
||||
if(empty($users_id)){
|
||||
return false;
|
||||
}
|
||||
if(!is_array($user_groups)){
|
||||
$user_groups = array($user_groups);
|
||||
}
|
||||
$user_users_groups = UserGroups::getUserGroups($users_id);
|
||||
if(empty($user_users_groups)){
|
||||
return false;
|
||||
}
|
||||
foreach ($user_users_groups as $value) {
|
||||
if(in_array($value['id'], $user_groups)){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -58,18 +58,23 @@ if (!class_exists('Video')) {
|
|||
private $filesize;
|
||||
private $live_transmitions_history_id;
|
||||
public static $statusDesc = array(
|
||||
'a' => 'active',
|
||||
'k' => 'active and encoding',
|
||||
'i' => 'inactive',
|
||||
'e' => 'encoding',
|
||||
'x' => 'encoding error',
|
||||
'd' => 'downloading',
|
||||
'xmp4' => 'encoding mp4 error',
|
||||
'xwebm' => 'encoding webm error',
|
||||
'xmp3' => 'encoding mp3 error',
|
||||
'xogg' => 'encoding ogg error',
|
||||
'ximg' => 'get image error',
|
||||
't' => 'transfering');
|
||||
'a' => 'Active',
|
||||
'k' => 'Active and Encoding',
|
||||
'i' => 'Inactive',
|
||||
'e' => 'Encoding',
|
||||
'x' => 'Encoding Error',
|
||||
'd' => 'Downloading',
|
||||
't' => 'Transfering',
|
||||
'u' => 'Unlisted');
|
||||
public static $statusActive = 'a';
|
||||
public static $statusActiveAndEncoding = 'k';
|
||||
public static $statusInactive = 'i';
|
||||
public static $statusEncoding = 'e';
|
||||
public static $statusEncodingError = 'x';
|
||||
public static $statusDownloading = 'd';
|
||||
public static $statusTranfering = 't';
|
||||
public static $statusUnlisted = 'u';
|
||||
|
||||
public static $rratingOptions = array('', 'g', 'pg', 'pg-13', 'r', 'nc-17', 'ma');
|
||||
//ver 3.4
|
||||
private $youtubeId;
|
||||
|
@ -337,12 +342,18 @@ if (!class_exists('Video')) {
|
|||
. " trailer1 = '{$this->trailer1}', trailer2 = '{$this->trailer2}', trailer3 = '{$this->trailer3}', rate = '{$this->rate}', can_download = '{$this->can_download}', can_share = '{$this->can_share}', only_for_paid = '{$this->only_for_paid}', rrating = '{$this->rrating}', externalOptions = '{$this->externalOptions}', sites_id = {$this->sites_id}, serie_playlists_id = {$this->serie_playlists_id} ,live_transmitions_history_id = {$this->live_transmitions_history_id} , video_password = '{$this->video_password}', "
|
||||
. " encoderURL = '{$this->encoderURL}', filepath = '{$this->filepath}' , filesize = '{$this->filesize}' , modified = now()"
|
||||
. " WHERE id = {$this->id}";
|
||||
|
||||
$saved = sqlDAL::writeSql($sql);
|
||||
if($saved){
|
||||
$insert_row = $this->id;
|
||||
}
|
||||
} else {
|
||||
$sql = "INSERT INTO videos "
|
||||
. "(title,clean_title, filename, users_id, categories_id, status, description, duration,type,videoDownloadedLink, next_videos_id, created, modified, videoLink, can_download, can_share, only_for_paid, rrating, externalOptions, sites_id, serie_playlists_id,live_transmitions_history_id, video_password, encoderURL, filepath , filesize) values "
|
||||
. "('{$this->title}','{$this->clean_title}', '{$this->filename}', {$this->users_id},{$this->categories_id}, '{$this->status}', '{$this->description}', '{$this->duration}', '{$this->type}', '{$this->videoDownloadedLink}', {$this->next_videos_id},now(), now(), '{$this->videoLink}', '{$this->can_download}', '{$this->can_share}','{$this->only_for_paid}', '{$this->rrating}', '$this->externalOptions', {$this->sites_id}, {$this->serie_playlists_id},{$this->live_transmitions_history_id}, '{$this->video_password}', '{$this->encoderURL}', '{$this->filepath}', '{$this->filesize}')";
|
||||
}
|
||||
|
||||
$insert_row = sqlDAL::writeSql($sql);
|
||||
}
|
||||
if ($insert_row) {
|
||||
_error_log("Video::save ({$this->title}) Saved id = {$insert_row} ");
|
||||
Category::clearCacheCount();
|
||||
|
@ -381,141 +392,6 @@ if (!class_exists('Video')) {
|
|||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
static function autosetCategoryType($catId) {
|
||||
global $global, $config;
|
||||
if ($config->currentVersionLowerThen('5.01')) {
|
||||
return false;
|
||||
}
|
||||
$sql = "SELECT * FROM `category_type_cache` WHERE categoryId = ?";
|
||||
|
||||
$res = sqlDAL::readSql($sql, "i", array($catId));
|
||||
$catTypeCache = sqlDAL::fetchAssoc($res);
|
||||
sqlDAL::close($res);
|
||||
|
||||
$videoFound = false;
|
||||
$audioFound = false;
|
||||
if ($catTypeCache) {
|
||||
// 3 means auto
|
||||
if ($catTypeCache['manualSet'] == "0") {
|
||||
// start incremental search and save
|
||||
$sql = "SELECT * FROM `videos` WHERE categories_id = ?";
|
||||
$res = sqlDAL::readSql($sql, "i", array($catId));
|
||||
$fullResult = sqlDAL::fetchAllAssoc($res);
|
||||
sqlDAL::close($res);
|
||||
if ($res != false) {
|
||||
foreach ($fullResult as $row) {
|
||||
|
||||
if ($row['type'] == "audio") {
|
||||
// echo "found audio";
|
||||
$audioFound = true;
|
||||
} else if ($row['type'] == "video") {
|
||||
//echo "found video";
|
||||
$videoFound = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (($videoFound == false) || ($audioFound == false)) {
|
||||
$sql = "SELECT * FROM `categories` WHERE parentId = ?";
|
||||
$res = sqlDAL::readSql($sql, "i", array($catId));
|
||||
$fullResult = sqlDAL::fetchAllAssoc($res);
|
||||
sqlDAL::close($res);
|
||||
if ($res != false) {
|
||||
//$tmpVid = $res->fetch_assoc();
|
||||
foreach ($fullResult as $row) {
|
||||
$sql = "SELECT type,categories_id FROM `videos` WHERE categories_id = ?;";
|
||||
$res = sqlDAL::readSql($sql, "i", array($row['parentId']));
|
||||
$fullResult2 = sqlDAL::fetchAllAssoc($res);
|
||||
sqlDAL::close($res);
|
||||
foreach ($fullResult2 as $row) {
|
||||
if ($row['type'] == "audio") {
|
||||
// echo "found audio";
|
||||
$audioFound = true;
|
||||
} else if ($row['type'] == "video") {
|
||||
//echo "found video";
|
||||
$videoFound = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$sql = "UPDATE `category_type_cache` SET `type` = '";
|
||||
if (($videoFound) && ($audioFound)) {
|
||||
$sql .= "0";
|
||||
} else if ($audioFound) {
|
||||
$sql .= "1";
|
||||
} else if ($videoFound) {
|
||||
$sql .= "2";
|
||||
} else {
|
||||
$sql .= "0";
|
||||
}
|
||||
$sql .= "' WHERE `category_type_cache`.`categoryId` = ?;";
|
||||
sqlDAL::writeSql($sql, "i", array($catId));
|
||||
}
|
||||
} else {
|
||||
// start incremental search and save - and a lot of this redundant stuff in a method..
|
||||
$sql = "SELECT type,categories_id FROM `videos` WHERE categories_id = ?;";
|
||||
$res = sqlDAL::readSql($sql, "i", array($catId));
|
||||
$fullResult2 = sqlDAL::fetchAllAssoc($res);
|
||||
sqlDAL::close($res);
|
||||
if ($res != false) {
|
||||
foreach ($fullResult2 as $row) {
|
||||
if ($row['type'] == "audio") {
|
||||
$audioFound = true;
|
||||
} else if ($row['type'] == "video") {
|
||||
$videoFound = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (($videoFound == false) || ($audioFound == false)) {
|
||||
$sql = "SELECT parentId FROM `categories` WHERE parentId = ?;";
|
||||
$res = sqlDAL::readSql($sql, "i", array($catId));
|
||||
$fullResult2 = sqlDAL::fetchAllAssoc($res);
|
||||
sqlDAL::close($res);
|
||||
if ($res != false) {
|
||||
foreach ($fullResult2 as $cat) {
|
||||
$sql = "SELECT type,categories_id FROM `videos` WHERE categories_id = ?;";
|
||||
$res = sqlDAL::readSql($sql, "i", array($cat['parentId']));
|
||||
$fullResult2 = sqlDAL::fetchAllAssoc($res);
|
||||
sqlDAL::close($res);
|
||||
if ($res != false) {
|
||||
foreach ($fullResult2 as $row) {
|
||||
if ($row['type'] == "audio") {
|
||||
$audioFound = true;
|
||||
} else if ($row['type'] == "video") {
|
||||
$videoFound = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$sql = "SELECT * FROM `category_type_cache` WHERE categoryId = ?";
|
||||
$res = sqlDAL::readSql($sql, "i", array($catId));
|
||||
$exist = sqlDAL::fetchAssoc($res);
|
||||
sqlDAL::close($res);
|
||||
$sqlType = 99;
|
||||
if (($videoFound) && ($audioFound)) {
|
||||
$sqlType = 0;
|
||||
} else if ($audioFound) {
|
||||
$sqlType = 1;
|
||||
} else if ($videoFound) {
|
||||
$sqlType = 2;
|
||||
}
|
||||
$values = array();
|
||||
if (empty($exist)) {
|
||||
$sql = "INSERT INTO `category_type_cache` (`categoryId`, `type`) VALUES (?, ?);";
|
||||
$values = array($catId, $sqlType);
|
||||
} else {
|
||||
$sql = "UPDATE `category_type_cache` SET `type` = ? WHERE `category_type_cache`.`categoryId` = ?;";
|
||||
$values = array($sqlType, $catId);
|
||||
}
|
||||
sqlDAL::writeSql($sql, "ii", $values);
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
// i would like to simplify the big part of the method above in this method, but won't work as i want.
|
||||
public static function internalAutoset($catId, $videoFound, $audioFound) {
|
||||
global $config;
|
||||
|
@ -596,6 +472,12 @@ if (!class_exists('Video')) {
|
|||
public function setStatus($status) {
|
||||
if (!empty($this->id)) {
|
||||
global $global;
|
||||
|
||||
if(empty(Video::$statusDesc[$status])){
|
||||
_error_log("Video::setStatus({$status}) NOT found ", AVideoLog::$WARNING);
|
||||
return false;
|
||||
}
|
||||
_error_log("Video::setStatus({$status}) ".json_encode(debug_backtrace()), AVideoLog::$WARNING);
|
||||
$sql = "UPDATE videos SET status = ?, modified = now() WHERE id = ? ";
|
||||
$res = sqlDAL::writeSql($sql, 'si', array($status, $this->id));
|
||||
if ($global['mysqli']->errno != 0) {
|
||||
|
@ -605,6 +487,37 @@ if (!class_exists('Video')) {
|
|||
}
|
||||
AVideoPlugin::onVideoSetStatus($this->id, $this->status, $status);
|
||||
$this->status = $status;
|
||||
return $status;
|
||||
}
|
||||
|
||||
public function setAutoStatus($default = 'a') {
|
||||
global $advancedCustom;
|
||||
if (empty($advancedCustom)) {
|
||||
$advancedCustom = AVideoPlugin::getDataObject('CustomizeAdvanced');
|
||||
}
|
||||
|
||||
if (!empty($_POST['fail'])) {
|
||||
return $this->setStatus(Video::$statusEncodingError);
|
||||
} else {
|
||||
if (!empty($_REQUEST['overrideStatus'])) {
|
||||
return $this->setStatus($_REQUEST['overrideStatus']);
|
||||
} else { // encoder did not provide a status
|
||||
if (!empty($_REQUEST['keepEncoding'])) {
|
||||
return $this->setStatus(Video::$statusActiveAndEncoding);
|
||||
} else{
|
||||
if($this->getTitle() !== "Video automatically booked"){
|
||||
if (!empty($advancedCustom->makeVideosInactiveAfterEncode)) {
|
||||
return $this->setStatus(Video::$statusInactive);
|
||||
} elseif (!empty($advancedCustom->makeVideosUnlistedAfterEncode)) {
|
||||
return $this->setStatus(Video::$statusUnlisted);
|
||||
}
|
||||
}else{
|
||||
return $this->setStatus(Video::$statusInactive);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return $this->setStatus($default);
|
||||
}
|
||||
|
||||
public function setType($type, $force = true) {
|
||||
|
@ -1633,12 +1546,8 @@ if (!class_exists('Video')) {
|
|||
x = encoding error
|
||||
d = downloading
|
||||
u = unlisted
|
||||
xmp4 = encoding mp4 error
|
||||
xwebm = encoding webm error
|
||||
xmp3 = encoding mp3 error
|
||||
xogg = encoding ogg error
|
||||
*/
|
||||
$viewable = array('a', 'k', 'xmp4', 'xwebm', 'xmp3', 'xogg');
|
||||
$viewable = array('a', 'k');
|
||||
if ($showUnlisted) {
|
||||
$viewable[] = "u";
|
||||
} elseif (!empty($_GET['videoName'])) {
|
||||
|
@ -2280,64 +2189,33 @@ if (!class_exists('Video')) {
|
|||
x = encoding error
|
||||
d = downloading
|
||||
u = unlisted
|
||||
xmp4 = encoding mp4 error
|
||||
xwebm = encoding webm error
|
||||
xmp3 = encoding mp3 error
|
||||
xogg = encoding ogg error
|
||||
ximg = get image error
|
||||
*/
|
||||
if (empty($type) || $type === "status") {
|
||||
$objTag = new stdClass();
|
||||
$objTag->label = __("Status");
|
||||
switch ($video->getStatus()) {
|
||||
case 'a':
|
||||
$status = $video->getStatus();
|
||||
$objTag->text = __(Video::$statusDesc[$status]);
|
||||
switch ($status) {
|
||||
case Video::$statusActive:
|
||||
$objTag->type = "success";
|
||||
$objTag->text = __("Active");
|
||||
break;
|
||||
case 'k':
|
||||
case Video::$statusActiveAndEncoding:
|
||||
$objTag->type = "success";
|
||||
$objTag->text = __("Active and encoding");
|
||||
break;
|
||||
case 'i':
|
||||
case Video::$statusInactive:
|
||||
$objTag->type = "warning";
|
||||
$objTag->text = __("Inactive");
|
||||
break;
|
||||
case 'e':
|
||||
case Video::$statusEncoding:
|
||||
$objTag->type = "info";
|
||||
$objTag->text = __("Encoding");
|
||||
break;
|
||||
case 'd':
|
||||
case Video::$statusDownloading:
|
||||
$objTag->type = "info";
|
||||
$objTag->text = __("Downloading");
|
||||
break;
|
||||
case 'u':
|
||||
case Video::$statusUnlisted:
|
||||
$objTag->type = "info";
|
||||
$objTag->text = __("Unlisted");
|
||||
break;
|
||||
case 'xmp4':
|
||||
$objTag->type = "danger";
|
||||
$objTag->text = __("Encoding mp4 error");
|
||||
break;
|
||||
case 'xwebm':
|
||||
$objTag->type = "danger";
|
||||
$objTag->text = __("Encoding xwebm error");
|
||||
break;
|
||||
case 'xmp3':
|
||||
$objTag->type = "danger";
|
||||
$objTag->text = __("Encoding xmp3 error");
|
||||
break;
|
||||
case 'xogg':
|
||||
$objTag->type = "danger";
|
||||
$objTag->text = __("Encoding xogg error");
|
||||
break;
|
||||
case 'ximg':
|
||||
$objTag->type = "danger";
|
||||
$objTag->text = __("Get imgage error");
|
||||
break;
|
||||
|
||||
default:
|
||||
$objTag->type = "danger";
|
||||
$objTag->text = __("Status not found");
|
||||
break;
|
||||
}
|
||||
$objTag->text = $objTag->text;
|
||||
|
@ -3972,6 +3850,12 @@ if (!class_exists('Video')) {
|
|||
$this->setExternalOptions(json_encode($externalOptions));
|
||||
}
|
||||
|
||||
public function setVideoEmbedWhitelist($embedWhitelist) {
|
||||
$externalOptions = _json_decode($this->getExternalOptions());
|
||||
$externalOptions->embedWhitelist = $embedWhitelist;
|
||||
$this->setExternalOptions(json_encode($externalOptions));
|
||||
}
|
||||
|
||||
public function getSerie_playlists_id() {
|
||||
return $this->serie_playlists_id;
|
||||
}
|
||||
|
|
|
@ -1 +1 @@
|
|||
<a href="plugin/ADs/editor.php" class="btn btn-primary btn-sm btn-xs btn-block"><i class="fas fa-edit"></i> Edit</a>
|
||||
<button onclick="avideoModalIframe(webSiteRootURL +'plugin/ADs/editor.php');" class="btn btn-primary btn-sm btn-xs btn-block"><i class="fas fa-edit"></i> Edit</button>
|
|
@ -52,7 +52,7 @@ $reflector = new ReflectionClass('API');
|
|||
return strcasecmp($matchesA[2], $matchesB[2]);
|
||||
});
|
||||
?>
|
||||
<div class="container">
|
||||
<div class="container-fluid">
|
||||
<ul class="list-group">
|
||||
<li class="list-group-item">
|
||||
<details>
|
||||
|
|
|
@ -1 +1 @@
|
|||
<a href="plugin/API/info.php" class="btn btn-primary btn-sm btn-xs btn-block"><i class="fas fa-info-circle"></i> Info</a>
|
||||
<button onclick="avideoModalIframeLarge(webSiteRootURL +'plugin/API/info.php');" class="btn btn-primary btn-sm btn-xs btn-block"><i class="fas fa-info-circle"></i> Info</button>
|
|
@ -683,6 +683,30 @@ class AVideoPlugin {
|
|||
}
|
||||
}
|
||||
|
||||
public function getModeLive($key) {
|
||||
$plugins = Plugin::getAllEnabled();
|
||||
foreach ($plugins as $value) {
|
||||
self::YPTstart();
|
||||
$p = static::loadPlugin($value['dirName']);
|
||||
if (is_object($p)) {
|
||||
$p->getModeLive($key);
|
||||
}
|
||||
self::YPTend("{$value['dirName']}::" . __FUNCTION__);
|
||||
}
|
||||
}
|
||||
|
||||
public function getModeLiveLink($liveLink_id) {
|
||||
$plugins = Plugin::getAllEnabled();
|
||||
foreach ($plugins as $value) {
|
||||
self::YPTstart();
|
||||
$p = static::loadPlugin($value['dirName']);
|
||||
if (is_object($p)) {
|
||||
$p->getModeLiveLink($liveLink_id);
|
||||
}
|
||||
self::YPTend("{$value['dirName']}::" . __FUNCTION__);
|
||||
}
|
||||
}
|
||||
|
||||
public static function getModeYouTubeLive($users_id) {
|
||||
$plugins = Plugin::getAllEnabled();
|
||||
foreach ($plugins as $value) {
|
||||
|
|
|
@ -42,7 +42,7 @@ class BulkEmbed extends PluginAbstract {
|
|||
|
||||
public function getPluginMenu() {
|
||||
global $global;
|
||||
$menu = '<a href="' . $global['webSiteRootURL'] . 'plugin/BulkEmbed/search.php" class="btn btn-primary btn-xs btn-block" target="_blank">Search</a>';
|
||||
$menu = '<button onclick="avideoModalIframe(webSiteRootURL +\'plugin/BulkEmbed/search.php\');" class="btn btn-primary btn-xs btn-block" target="_blank">Search</button>';
|
||||
return $menu;
|
||||
}
|
||||
|
||||
|
|
|
@ -576,7 +576,7 @@ function createGalleryLiveSection($videos) {
|
|||
<?php
|
||||
if (!empty($video['galleryCallback'])) {
|
||||
$video['galleryCallback'] = addcslashes($video['galleryCallback'], '"');
|
||||
echo '<script>$(document).ready(function () {eval("' . $video['galleryCallback'] . '")});</script>';
|
||||
echo '<!-- galleryCallback --><script>$(document).ready(function () {eval("' . $video['galleryCallback'] . '")});</script>';
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -5,10 +5,12 @@ $obj = AVideoPlugin::getDataObject("Live");
|
|||
.liveVideo{
|
||||
position: relative;
|
||||
}
|
||||
.liveVideo .liveNow{
|
||||
.liveVideo .liveNow, .liveVideo .liveFuture{
|
||||
position: absolute;
|
||||
bottom: 5px;
|
||||
right: 5px;
|
||||
}
|
||||
.liveVideo .liveNow{
|
||||
background-color: rgba(255,0,0,0.7);
|
||||
}
|
||||
#availableLiveStream{
|
||||
|
@ -349,7 +351,7 @@ if (isVideo()) {
|
|||
}
|
||||
$('#liveVideos').slideDown();
|
||||
if (callback) {
|
||||
eval("try {console.log('processApplication application.callback');$liveLi = " + callback + ";} catch (e) {console.log('processApplication application.callback error',e.message);}");
|
||||
eval("try {console.log('processApplication application.callback '+callback);$liveLi = " + callback + ";} catch (e) {console.log('processApplication application.callback error',e.message);}");
|
||||
}
|
||||
} else {
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@ class LiveLinks extends PluginAbstract {
|
|||
}
|
||||
|
||||
public function getPluginVersion() {
|
||||
return "3.2";
|
||||
return "4.0";
|
||||
}
|
||||
|
||||
public function canAddLinks() {
|
||||
|
@ -68,10 +68,25 @@ class LiveLinks extends PluginAbstract {
|
|||
include $global['systemRootPath'] . 'plugin/LiveLinks/view/menuRight.php';
|
||||
}
|
||||
|
||||
static function getAllActive() {
|
||||
static function getAllActive($future = false, $activeOnly = true, $notStarted = false) {
|
||||
global $global;
|
||||
_mysql_connect();
|
||||
$sql = "SELECT * FROM LiveLinks WHERE status='a' AND start_date <= now() AND end_date >= now() ORDER BY start_date ";
|
||||
$sql = "SELECT * FROM LiveLinks WHERE 1=1 ";
|
||||
|
||||
if (!empty($future)) {
|
||||
$sql .= " AND end_date >= now() ";
|
||||
}
|
||||
|
||||
if (!empty($activeOnly)) {
|
||||
$sql .= " AND status='a' ";
|
||||
}
|
||||
|
||||
if (!empty($notStarted)) {
|
||||
$sql .= " AND start_date >= now() ";
|
||||
}
|
||||
|
||||
$sql .= " ORDER BY start_date ";
|
||||
//echo $sql;//exit;
|
||||
$res = $global['mysqli']->query($sql);
|
||||
$rows = array();
|
||||
if ($res) {
|
||||
|
@ -105,7 +120,8 @@ class LiveLinks extends PluginAbstract {
|
|||
$filenameExtra = $global['systemRootPath'] . 'plugin/LiveLinks/view/extraItem.html';
|
||||
$filenameExtraVideoPage = $global['systemRootPath'] . 'plugin/LiveLinks/view/extraItemVideoPage.html';
|
||||
$filenameListItem = $global['systemRootPath'] . 'plugin/LiveLinks/view/videoListItem.html';
|
||||
$row = LiveLinks::getAllActive();
|
||||
$row = LiveLinks::getAllActive(true, true);
|
||||
//var_dump($row);exit;
|
||||
$array = array();
|
||||
$search = array(
|
||||
'_unique_id_',
|
||||
|
@ -155,6 +171,17 @@ class LiveLinks extends PluginAbstract {
|
|||
$newContentExtra = str_replace($search, $replace, $contentExtra);
|
||||
$newContentExtraVideoPage = str_replace($search, $replace, $contentExtraVideoPage);
|
||||
$newContentVideoListItem = str_replace($search, $replace, $contentListem);
|
||||
|
||||
$callback = '';
|
||||
$galleryCallback = '';
|
||||
if(strtotime($value['start_date']) > time()){
|
||||
$callback = "liveLinkApps(\$('.liveLink_{$value['id']}'), 'liveLink_{$value['id']}', '{$value['start_date']}')";
|
||||
$galleryCallback = 'var liveLinkItemSelector = \'.liveLink_' . $value['id'] . ' .liveNow\'; '
|
||||
. '$(liveLinkItemSelector).attr(\'class\', \'liveNow label label-primary\');'
|
||||
. '$(liveLinkItemSelector).text(\'' . $value['start_date'] . '\');'
|
||||
. 'startTimerToDate(\'' . $value['start_date'] . '\', liveLinkItemSelector, true);';
|
||||
}
|
||||
|
||||
$array[] = array(
|
||||
"type" => "LiveLink",
|
||||
"html" => $newContent,
|
||||
|
@ -171,7 +198,9 @@ class LiveLinks extends PluginAbstract {
|
|||
"link" => self::getLinkToLiveFromId($value['id'], true),
|
||||
"href" => self::getLinkToLiveFromId($value['id']),
|
||||
"categories_id" => intval($value['categories_id']),
|
||||
"className" => 'liveLink_' . $value['id']
|
||||
"className" => 'liveLink_' . $value['id'],
|
||||
"callback" => $callback,
|
||||
"galleryCallback" => $galleryCallback,
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -365,7 +394,7 @@ class LiveLinks extends PluginAbstract {
|
|||
if (empty($otherInfo)) {
|
||||
$otherInfo = array();
|
||||
$otherInfo['category'] = xss_esc_back($row['category']);
|
||||
$otherInfo['groups'] = UserGroups::getVideoGroups($row['id']);
|
||||
//$otherInfo['groups'] = UserGroups::getVideoGroups($row['id']);
|
||||
//$otherInfo['title'] = UTF8encode($row['title']);
|
||||
$otherInfo['description'] = UTF8encode($row['description']);
|
||||
$otherInfo['descriptionHTML'] = Video::htmlDescription($otherInfo['description']);
|
||||
|
@ -402,4 +431,34 @@ class LiveLinks extends PluginAbstract {
|
|||
return $socketObj;
|
||||
}
|
||||
|
||||
public function getFooterCode() {
|
||||
$obj = $this->getDataObject();
|
||||
global $global;
|
||||
|
||||
include $global['systemRootPath'] . 'plugin/LiveLinks/view/footer.php';
|
||||
return '<!-- LiveLinks Footer Code -->';
|
||||
}
|
||||
|
||||
static function userCanWatch($users_id, $livelinks_id) {
|
||||
if(empty($users_id) || empty($livelinks_id)){
|
||||
return false;
|
||||
}
|
||||
|
||||
if(User::isAdmin()){
|
||||
return true;
|
||||
}
|
||||
|
||||
$livelinks = new LiveLinksTable($livelinks_id);
|
||||
if($livelinks->getUsers_id()==$users_id){
|
||||
return true;
|
||||
}
|
||||
|
||||
$user_groups_ids = LiveLinksTable::getUserGorupsIds($livelinks_id);
|
||||
if(empty($user_groups_ids)){
|
||||
return true;
|
||||
}
|
||||
|
||||
return LiveLinksTable::userGroupsMatch($livelinks_id, $users_id);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -134,6 +134,7 @@ class LiveLinksTable extends ObjectYPT {
|
|||
$rows = array();
|
||||
if ($res != false) {
|
||||
foreach ($fullData as $row) {
|
||||
$row['user_groups'] = self::getUserGorups($row['id']);
|
||||
$rows[] = $row;
|
||||
}
|
||||
} else {
|
||||
|
@ -142,6 +143,15 @@ class LiveLinksTable extends ObjectYPT {
|
|||
return $rows;
|
||||
}
|
||||
|
||||
public function userGroupsMatch($livelinks_id, $users_id=0){
|
||||
$user_groups = self::getUserGorups($livelinks_id);
|
||||
$user_groups_ids = array();
|
||||
foreach ($user_groups as $value) {
|
||||
$user_groups_ids[] = $value['id'];
|
||||
}
|
||||
return User::userGroupsMatch($user_groups_ids, $users_id);
|
||||
}
|
||||
|
||||
public function delete(){
|
||||
global $global;
|
||||
if(!User::isLogged()){
|
||||
|
@ -163,4 +173,67 @@ class LiveLinksTable extends ObjectYPT {
|
|||
return false;
|
||||
}
|
||||
|
||||
public function deleteAllUserGorups(){
|
||||
global $global;
|
||||
if (!empty($this->id)) {
|
||||
$sql = "DELETE FROM livelinks_has_users_groups ";
|
||||
$sql .= " WHERE livelinks_id = ?";
|
||||
|
||||
$global['lastQuery'] = $sql;
|
||||
//_error_log("Delete Query: ".$sql);
|
||||
return sqlDAL::writeSql($sql, "i", array($this->id));
|
||||
}
|
||||
_error_log("Id for table " . static::getTableName() . " not defined for deletion", AVideoLog::$ERROR);
|
||||
return false;
|
||||
}
|
||||
|
||||
public function addUserGorups($usergroups_ids){
|
||||
global $global;
|
||||
|
||||
if(empty($usergroups_ids)){
|
||||
return false;
|
||||
}
|
||||
|
||||
if(!is_array($usergroups_ids)){
|
||||
$usergroups_ids = array($usergroups_ids);
|
||||
}
|
||||
foreach ($usergroups_ids as $value) {
|
||||
$sql = "INSERT INTO `livelinks_has_users_groups` (`livelinks_id`, `users_groups_id`, `created`, `modified`) VALUES (?, ?, now(), now());";
|
||||
sqlDAL::writeSql($sql, "ii", array($this->id, $value));
|
||||
}
|
||||
|
||||
_error_log("Id for table " . static::getTableName() . " not defined for deletion", AVideoLog::$ERROR);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
static function getUserGorups($livelinks_id){
|
||||
if(!self::isTableInstalled("livelinks_has_users_groups") || empty($livelinks_id)){
|
||||
return array();
|
||||
}
|
||||
$sql = "SELECT g.* FROM livelinks_has_users_groups ll LEFT JOIN users_groups g ON users_groups_id = g.id WHERE livelinks_id = ? ";
|
||||
$sql .= self::getSqlFromPost();
|
||||
$res = sqlDAL::readSql($sql, 'i', array($livelinks_id));
|
||||
$fullData = sqlDAL::fetchAllAssoc($res);
|
||||
sqlDAL::close($res);
|
||||
$rows = array();
|
||||
if ($res != false) {
|
||||
foreach ($fullData as $row) {
|
||||
$rows[] = $row;
|
||||
}
|
||||
} else {
|
||||
die($sql . '\nError : (' . $global['mysqli']->errno . ') ' . $global['mysqli']->error);
|
||||
}
|
||||
return $rows;
|
||||
}
|
||||
|
||||
static function getUserGorupsIds($livelinks_id){
|
||||
$groups = self::getUserGorups($livelinks_id);
|
||||
$rows = array();
|
||||
foreach ($groups as $value) {
|
||||
$rows[] = $value['id'];
|
||||
}
|
||||
return $rows;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -37,6 +37,26 @@ CREATE TABLE IF NOT EXISTS `LiveLinks` (
|
|||
ON UPDATE CASCADE)
|
||||
ENGINE = InnoDB;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `livelinks_has_users_groups` (
|
||||
`id` INT NOT NULL AUTO_INCREMENT,
|
||||
`livelinks_id` INT(11) NOT NULL,
|
||||
`users_groups_id` INT(11) NOT NULL,
|
||||
`created` DATETIME NULL,
|
||||
`modified` DATETIME NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
INDEX `fk_livelinks_has_users_groups_users_groups1_idx` (`users_groups_id` ASC),
|
||||
INDEX `fk_livelinks_has_users_groups_livelinks1_idx` (`livelinks_id` ASC),
|
||||
CONSTRAINT `fk_livelinks_has_users_groups_livelinks1`
|
||||
FOREIGN KEY (`livelinks_id`)
|
||||
REFERENCES `livelinks` (`id`)
|
||||
ON DELETE CASCADE
|
||||
ON UPDATE CASCADE,
|
||||
CONSTRAINT `fk_livelinks_has_users_groups_users_groups1`
|
||||
FOREIGN KEY (`users_groups_id`)
|
||||
REFERENCES `users_groups` (`id`)
|
||||
ON DELETE CASCADE
|
||||
ON UPDATE CASCADE)
|
||||
ENGINE = InnoDB;
|
||||
|
||||
SET SQL_MODE=@OLD_SQL_MODE;
|
||||
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
|
||||
|
|
20
plugin/LiveLinks/install/updateV4.0.sql
Normal file
20
plugin/LiveLinks/install/updateV4.0.sql
Normal file
|
@ -0,0 +1,20 @@
|
|||
CREATE TABLE IF NOT EXISTS `livelinks_has_users_groups` (
|
||||
`id` INT NOT NULL AUTO_INCREMENT,
|
||||
`livelinks_id` INT(11) NOT NULL,
|
||||
`users_groups_id` INT(11) NOT NULL,
|
||||
`created` DATETIME NULL,
|
||||
`modified` DATETIME NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
INDEX `fk_livelinks_has_users_groups_users_groups1_idx` (`users_groups_id` ASC),
|
||||
INDEX `fk_livelinks_has_users_groups_livelinks1_idx` (`livelinks_id` ASC),
|
||||
CONSTRAINT `fk_livelinks_has_users_groups_livelinks1`
|
||||
FOREIGN KEY (`livelinks_id`)
|
||||
REFERENCES `livelinks` (`id`)
|
||||
ON DELETE CASCADE
|
||||
ON UPDATE CASCADE,
|
||||
CONSTRAINT `fk_livelinks_has_users_groups_users_groups1`
|
||||
FOREIGN KEY (`users_groups_id`)
|
||||
REFERENCES `users_groups` (`id`)
|
||||
ON DELETE CASCADE
|
||||
ON UPDATE CASCADE)
|
||||
ENGINE = InnoDB;
|
|
@ -31,6 +31,15 @@ $t['title'] = $liveLink->getTitle();
|
|||
$t['link'] = $liveLink->getLink();
|
||||
$t['description'] = $liveLink->getDescription();
|
||||
|
||||
AVideoPlugin::getModeLiveLink($liveLink->getId());
|
||||
$toTime = strtotime($liveLink->getStart_date());
|
||||
if ($toTime > time()) {
|
||||
$message = "<strong>{$t['title']}</strong><br>{$t['description']}";
|
||||
$image = User::getPhoto($t['users_id']);
|
||||
$bgImage = LiveLinks::getImage($t['id']);
|
||||
countDownPage($toTime, $message, $image, $bgImage);
|
||||
}
|
||||
|
||||
$u = new User($t['users_id']);
|
||||
$user_id = $u->getBdId();
|
||||
$subscribe = Subscribe::getButton($user_id);
|
||||
|
|
|
@ -24,7 +24,10 @@ $o->setStatus($_POST['status']);
|
|||
$o->setTitle($_POST['title']);
|
||||
$o->setType($_POST['type']);
|
||||
|
||||
if($o->save()){
|
||||
if($id = $o->save()){
|
||||
$o = new LiveLinksTable($id);
|
||||
$o->deleteAllUserGorups();
|
||||
$o->addUserGorups($_POST['userGroups']);
|
||||
$obj->error = false;
|
||||
}
|
||||
echo json_encode($obj);
|
||||
|
|
18
plugin/LiveLinks/view/footer.php
Normal file
18
plugin/LiveLinks/view/footer.php
Normal file
|
@ -0,0 +1,18 @@
|
|||
<script>
|
||||
var liveLinkAppsCalled = {};
|
||||
function liveLinkApps($liveLi, className, live_starts) {
|
||||
if(new Date(live_starts).getTime()<new Date().getTime()){
|
||||
return false;
|
||||
}
|
||||
if(typeof liveLinkAppsCalled[className] !== 'undefined'){ // do not call it twice
|
||||
//return false;
|
||||
}
|
||||
console.log('liveLinkApps', $liveLi, className, live_starts, $liveLi.find('.liveNow'));
|
||||
liveLinkAppsCalled[className] = live_starts;
|
||||
$liveLi.find('.liveNow').html("<?php echo __('Starts in'); ?> <span class='Timer_"+className+"'>"+live_starts+"<span>");
|
||||
$liveLi.find('.liveNow').attr("class", 'label label-primary liveFuture');
|
||||
console.log('liveLinkApps', '.'+className+' '+live_starts);
|
||||
startTimerToDate(live_starts, '.Timer_'+className, false);
|
||||
return $liveLi;
|
||||
}
|
||||
</script>
|
|
@ -3,12 +3,23 @@
|
|||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<i class="fas fa-link"></i> <?php echo __("Add an external Live Link"); ?>
|
||||
<span id="serverTime" class="pull-right"></span>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div class="row">
|
||||
<div class="col-sm-4">
|
||||
<form id="liveLinksForm">
|
||||
|
||||
<div class="tabbable-line">
|
||||
<ul class="nav nav-tabs">
|
||||
<li class="active" >
|
||||
<a data-toggle="tab" href="#tabStreamMetaData"><i class="fas fa-key"></i> <?php echo __("Meta Data"); ?></a>
|
||||
</li>
|
||||
<li class="" >
|
||||
<a data-toggle="tab" href="#tabUserGroups"><i class="fas fa-users"></i> <?php echo __("User Groups"); ?></a>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
<div id="tabStreamMetaData" class="tab-pane fade in active">
|
||||
<div class="row">
|
||||
<input type="hidden" name="linkId" id="linkId" value="" >
|
||||
<div class="form-group col-sm-12">
|
||||
|
@ -52,6 +63,29 @@
|
|||
<option value="i"><?php echo __("Inactive"); ?></option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="tabUserGroups" class="tab-pane fade">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading"><?php echo __("Groups That Can See This Stream"); ?><br><small><?php echo __("Uncheck all to make it public"); ?></small></div>
|
||||
<div class="panel-body" style="max-height: 450px; overflow-y: auto;">
|
||||
<?php
|
||||
$ug = UserGroups::getAllUsersGroups();
|
||||
foreach ($ug as $value) {
|
||||
?>
|
||||
<div class="form-group">
|
||||
<span class="fa fa-users"></span> <?php echo $value['group_name']; ?>
|
||||
<div class="material-switch pull-right">
|
||||
<input id="group<?php echo $value['id']; ?>" name="userGroups[]" type="checkbox" value="<?php echo $value['id']; ?>" class="userGroups" <?php echo (in_array($value['id'], $groups) ? "checked" : "") ?>/>
|
||||
<label for="group<?php echo $value['id']; ?>" class="label-success"></label>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group col-sm-12">
|
||||
<div class="btn-group pull-right">
|
||||
<span class="btn btn-success" id="newLiveLink"><i class="fas fa-plus"></i> <?php echo __("New"); ?></span>
|
||||
|
@ -59,6 +93,7 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="col-sm-8">
|
||||
|
@ -105,16 +140,8 @@
|
|||
</div>
|
||||
<script type="text/javascript" src="<?php echo getCDN(); ?>view/css/DataTables/datatables.min.js"></script>
|
||||
<script src="<?php echo getCDN(); ?>js/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js" type="text/javascript"></script>
|
||||
<?php $today = getdate(); ?>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function () {
|
||||
|
||||
var d = new Date(<?php echo $today['year'] . "," . $today['mon'] . "," . $today['mday'] . "," . $today['hours'] . "," . $today['minutes'] . "," . $today['seconds']; ?>);
|
||||
setInterval(function () {
|
||||
d.setSeconds(d.getSeconds() + 1);
|
||||
$('#serverTime').text((d.getHours() + ':' + d.getMinutes() + ':' + d.getSeconds()));
|
||||
}, 1000);
|
||||
|
||||
var tableLinks = $('#exampleLinks').DataTable({
|
||||
"ajax": "<?php echo $global['webSiteRootURL']; ?>plugin/LiveLinks/view/liveLinks.json.php",
|
||||
"columns": [
|
||||
|
@ -211,6 +238,10 @@
|
|||
$('select[name="categories_id"]').val(data.categories_id);
|
||||
$('select[name="categories_id"]').trigger('change');
|
||||
$('#linkStatus').val(data.status);
|
||||
$(".userGroups").prop("checked", false);
|
||||
for (const index in data.user_groups) {
|
||||
$("#group" + data.user_groups[index].id).prop("checked", true);
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
|
@ -1,3 +1,11 @@
|
|||
<?php
|
||||
require_once '../../videos/configuration.php';
|
||||
|
||||
if(empty($obj)){
|
||||
$obj = AVideoPlugin::getDataObject('MaintenanceMode');
|
||||
}
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
|
@ -12,7 +20,7 @@
|
|||
<!--===============================================================================================-->
|
||||
<link rel="stylesheet" type="text/css" href="<?php echo getCDN(); ?>plugin/MaintenanceMode/vendor/animate/animate.css">
|
||||
<!--===============================================================================================-->
|
||||
<link rel="stylesheet" type="text/css" href="<?php echo getCDN(); ?>plugin/MaintenanceModevendor/select2/select2.min.css">
|
||||
<link rel="stylesheet" type="text/css" href="<?php echo getCDN(); ?>plugin/MaintenanceMode/vendor/select2/select2.min.css">
|
||||
<!--===============================================================================================-->
|
||||
<link rel="stylesheet" type="text/css" href="<?php echo getCDN(); ?>plugin/MaintenanceMode/css/util.css">
|
||||
<link rel="stylesheet" type="text/css" href="<?php echo getCDN(); ?>plugin/MaintenanceMode/css/main.css">
|
||||
|
@ -114,8 +122,8 @@
|
|||
|
||||
<!--===============================================================================================-->
|
||||
<script src="<?php echo getCDN(); ?>view/js/jquery-3.5.1.min.js" type="text/javascript"></script>
|
||||
<!--===============================================================================================-->
|
||||
<script src="<?php echo getCDN(); ?>plugin/MaintenanceMode/vendor/bootstrap/js/popper.js"></script>
|
||||
<!--===============================================================================================
|
||||
<script src="<?php echo getCDN(); ?>plugin/MaintenanceMode/vendor/bootstrap/js/popper.js"></script>-->
|
||||
<script src="<?php echo getCDN(); ?>view/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
|
||||
<!--===============================================================================================-->
|
||||
<script src="<?php echo getCDN(); ?>view/js/select2/select2.min.js"></script>
|
||||
|
|
|
@ -20,7 +20,8 @@
|
|||
var obj = $(this);
|
||||
var timeNow = new Date();
|
||||
|
||||
var tZ = options.timeZone; console.log(tZ);
|
||||
var tZ = options.timeZone;
|
||||
console.log(tZ);
|
||||
var endYear = options.endtimeYear;
|
||||
var endMonth = options.endtimeMonth;
|
||||
var endDate = options.endtimeDate;
|
||||
|
@ -30,8 +31,7 @@
|
|||
|
||||
if (tZ == "") {
|
||||
var deadline = new Date(endYear, endMonth - 1, endDate, endHours, endMinutes, endSeconds);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
var deadline = moment.tz([endYear, endMonth - 1, endDate, endHours, endMinutes, endSeconds], tZ).format();
|
||||
}
|
||||
|
||||
|
@ -72,6 +72,7 @@
|
|||
secondsSpan.html(('0' + t.seconds).slice(-2))
|
||||
|
||||
if (t.total <= 0) {
|
||||
location.reload();
|
||||
clearInterval(timeinterval);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -171,7 +171,7 @@ Passcode: {password}
|
|||
public function getPluginMenu() {
|
||||
global $global;
|
||||
//return '<a href="plugin/Meet/View/editor.php" class="btn btn-primary btn-sm btn-xs btn-block"><i class="fa fa-edit"></i> Edit</a>';
|
||||
return '<a href="'.$global['webSiteRootURL'].'plugin/Meet/checkServers.php" class="btn btn-primary btn-sm btn-xs btn-block"><i class="fas fa-network-wired"></i> Check Servers</a>';
|
||||
return '<button onclick="avideoModalIframe(webSiteRootURL +\'plugin/Meet/checkServers.php\');" class="btn btn-primary btn-sm btn-xs btn-block"><i class="fas fa-network-wired"></i> Check Servers</button>';
|
||||
}
|
||||
|
||||
static function getMeetServerStatus($cache = 30) {
|
||||
|
|
|
@ -89,7 +89,7 @@ if (isset($_FILES['upl']) && $_FILES['upl']['error'] == 0) {
|
|||
$video->setCan_share($_REQUEST['can_share']);
|
||||
}
|
||||
|
||||
$video->setStatus('e');
|
||||
$video->setStatus(Video::$statusEncoding);
|
||||
|
||||
if (!move_uploaded_file($_FILES['upl']['tmp_name'], Video::getStoragePath()."original_" . $filename)) {
|
||||
$object->msg = "Error on move_uploaded_file(" . $_FILES['upl']['tmp_name'] . ", " . Video::getStoragePath()."original_" . $filename . ")";
|
||||
|
|
|
@ -69,7 +69,7 @@ class Permissions extends PluginAbstract {
|
|||
|
||||
public function getPluginMenu() {
|
||||
global $global;
|
||||
return '<a href="plugin/Permissions/View/editor.php" class="btn btn-primary btn-sm btn-xs btn-block"><i class="fa fa-edit"></i> Edit</a>';
|
||||
return '<button onclick="avideoModalIframe(webSiteRootURL +\'plugin/Permissions/View/editor.php\');" class="btn btn-primary btn-sm btn-xs btn-block"><i class="fa fa-edit"></i> Edit</button>';
|
||||
}
|
||||
|
||||
static function getForm() {
|
||||
|
|
|
@ -752,7 +752,8 @@ class PlayLists extends PluginAbstract {
|
|||
|
||||
public function getPluginMenu() {
|
||||
global $global;
|
||||
return '<a href="plugin/PlayLists/View/editor.php" class="btn btn-primary btn-sm btn-xs btn-block"><i class="fa fa-edit"></i> Schedule</a>';
|
||||
return '';
|
||||
//return '<a href="plugin/PlayLists/View/editor.php" class="btn btn-primary btn-sm btn-xs btn-block"><i class="fa fa-edit"></i> Schedule</a>';
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -357,6 +357,10 @@ class PlayerSkins extends PluginAbstract {
|
|||
$currentTime = self::getCurrentTime();
|
||||
}
|
||||
|
||||
if(!empty($global['doNotLoadPlayer'])){
|
||||
return '';
|
||||
}
|
||||
|
||||
if(empty($prepareStartPlayerJS_onPlayerReady)){
|
||||
$prepareStartPlayerJS_onPlayerReady = array();
|
||||
}
|
||||
|
|
|
@ -305,6 +305,14 @@ abstract class PluginAbstract {
|
|||
return false;
|
||||
}
|
||||
|
||||
public function getModeLive($key) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public function getModeLiveLink($liveLink_id) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public function getModeYouTubeLive($users_id) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -1 +1 @@
|
|||
<a href="plugin/TopMenu/page/editor.php" class="btn btn-primary btn-sm btn-xs btn-block"><i class="fa fa-edit"></i> Create Menus</a>
|
||||
<button onclick="avideoModalIframe(webSiteRootURL +'plugin/TopMenu/page/editor.php');" class="btn btn-primary btn-sm btn-xs btn-block"><i class="fa fa-edit"></i> Create Menus</button>
|
|
@ -1 +1 @@
|
|||
<a href="plugin/VideoTags/" class="btn btn-primary btn-xs btn-block"><i class="fas fa-list-ul"></i> Create Tag Type</a>
|
||||
<button onclick="avideoModalIframe(webSiteRootURL +'plugin/VideoTags/');" class="btn btn-primary btn-xs btn-block"><i class="fas fa-list-ul"></i> Create Tag Type</button>
|
|
@ -141,6 +141,11 @@ if (isRTL()) {
|
|||
<script>
|
||||
var webSiteRootURL = '<?php echo $global['webSiteRootURL']; ?>';
|
||||
var player;
|
||||
var _serverTime = "<?php echo time(); ?>";
|
||||
var _serverDBTime = "<?php echo getDatabaseTime(); ?>";
|
||||
var _serverTimeString = "<?php echo date('Y-m-d H:i:s'); ?>";
|
||||
var _serverDBTimeString = "<?php echo date('Y-m-d H:i:s', getDatabaseTime()); ?>";
|
||||
var _serverTimezone = "<?php echo date_default_timezone_get(); ?>";
|
||||
</script>
|
||||
<?php
|
||||
if (!$config->getDisable_analytics()) {
|
||||
|
|
|
@ -46,7 +46,7 @@ if (isset($_FILES['upl']) && $_FILES['upl']['error'] == 0) {
|
|||
$video = new Video("", $filename, $videos_id);
|
||||
if ($video->getTitle() === "Video automatically booked") {
|
||||
$video->setTitle($title);
|
||||
$video->setStatus('i');
|
||||
$video->setStatus(Video::$statusInactive);
|
||||
}
|
||||
}
|
||||
//var_dump($videos_id, $_FILES['upl']['name'], $title, $video->getTitle());exit;
|
||||
|
@ -103,19 +103,8 @@ if (isset($_FILES['upl']) && $_FILES['upl']['error'] == 0) {
|
|||
}
|
||||
$video->setType("zip", true);
|
||||
}
|
||||
if (empty($advancedCustom->makeVideosInactiveAfterEncode) && $video->getTitle() !== "Video automatically booked") {
|
||||
|
||||
// set active
|
||||
|
||||
$video->setStatus('a');
|
||||
} else if (empty($advancedCustom->makeVideosUnlistedAfterEncode) && $video->getTitle() !== "Video automatically booked") {
|
||||
|
||||
// set active
|
||||
|
||||
$video->setStatus('u');
|
||||
} else {
|
||||
$video->setStatus('i');
|
||||
}
|
||||
$video->setAutoStatus(Video::$statusInactive);
|
||||
|
||||
$id = $video->save();
|
||||
if ($id) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue