mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-06 03:50:04 +02:00
This commit is contained in:
parent
7d6a592d73
commit
1e61a87c3c
4 changed files with 43 additions and 8 deletions
|
@ -441,6 +441,8 @@ if (!class_exists('Video')) {
|
||||||
{
|
{
|
||||||
global $advancedCustom;
|
global $advancedCustom;
|
||||||
global $global;
|
global $global;
|
||||||
|
|
||||||
|
|
||||||
if (!User::isLogged() && !$allowOfflineUser) {
|
if (!User::isLogged() && !$allowOfflineUser) {
|
||||||
_error_log('Video::save permission denied to save');
|
_error_log('Video::save permission denied to save');
|
||||||
return false;
|
return false;
|
||||||
|
@ -1928,6 +1930,22 @@ if (!class_exists('Video')) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static function hasPPV($videos_id){
|
||||||
|
if(AVideoPlugin::isEnabledByName('PayPerView')){
|
||||||
|
$plans = PayPerView::getAllPlansFromVideo($videos_id);
|
||||||
|
return !empty($plans);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
static function hasSubscription($videos_id){
|
||||||
|
if(AVideoPlugin::isEnabledByName('Subscription')){
|
||||||
|
return Subscription::isVideoOnSubscription($videos_id);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
static function getInfo($row, $getStatistcs = false)
|
static function getInfo($row, $getStatistcs = false)
|
||||||
{
|
{
|
||||||
if (empty($row)) {
|
if (empty($row)) {
|
||||||
|
@ -2034,6 +2052,8 @@ if (!class_exists('Video')) {
|
||||||
TimeLogEnd($timeLogName, __LINE__, $TimeLogLimit);
|
TimeLogEnd($timeLogName, __LINE__, $TimeLogLimit);
|
||||||
$row['identification'] = User::getNameIdentificationById(!empty($row['users_id_company']) ? $row['users_id_company'] : $row['users_id']);
|
$row['identification'] = User::getNameIdentificationById(!empty($row['users_id_company']) ? $row['users_id_company'] : $row['users_id']);
|
||||||
$row['userHasAgeToWatchVideo'] = self::userHasAgeToWatchVideo($row);
|
$row['userHasAgeToWatchVideo'] = self::userHasAgeToWatchVideo($row);
|
||||||
|
$row['hasPPV'] = self::hasPPV($row['id']);
|
||||||
|
$row['hasSubscription'] = self::hasSubscription($row['id']);
|
||||||
if (empty($row['externalOptions'])) {
|
if (empty($row['externalOptions'])) {
|
||||||
$row['externalOptions'] = json_encode(['videoStartSeconds' => '00:00:00']);
|
$row['externalOptions'] = json_encode(['videoStartSeconds' => '00:00:00']);
|
||||||
}
|
}
|
||||||
|
|
|
@ -690,10 +690,18 @@ Disallow: *action=tagsearch*
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function saveVideosAddNew($post, $videos_id) {
|
public static function saveVideosAddNew($post, $videos_id) {
|
||||||
self::setDoNotShowAdsOnChannel($videos_id, !_empty($post['doNotShowAdsOnThisChannel']));
|
if(isset($post['doNotShowAdsOnThisChannel'])){
|
||||||
self::setDoNotShowAds($videos_id, !_empty($post['doNotShowAdsOnThisVideo']));
|
self::setDoNotShowAdsOnChannel($videos_id, !_empty($post['doNotShowAdsOnThisChannel']));
|
||||||
self::setRedirectVideo($videos_id, @$post['redirectVideoCode'], @$post['redirectVideoURL']);
|
}
|
||||||
self::setShortSummaryAndMetaDescriptionVideo($videos_id,@$post['ShortSummary'], @$post['MetaDescription']);
|
if(isset($post['doNotShowAdsOnThisVideo'])){
|
||||||
|
self::setDoNotShowAds($videos_id, !_empty($post['doNotShowAdsOnThisVideo']));
|
||||||
|
}
|
||||||
|
if(isset($post['redirectVideoCode'])){
|
||||||
|
self::setRedirectVideo($videos_id, @$post['redirectVideoCode'], @$post['redirectVideoURL']);
|
||||||
|
}
|
||||||
|
if(isset($post['ShortSummary'])){
|
||||||
|
self::setShortSummaryAndMetaDescriptionVideo($videos_id,@$post['ShortSummary'], @$post['MetaDescription']);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function setDoNotShowAds($videos_id, $doNotShowAdsOnThisVideo) {
|
public static function setDoNotShowAds($videos_id, $doNotShowAdsOnThisVideo) {
|
||||||
|
|
|
@ -535,11 +535,13 @@ class Live extends PluginAbstract
|
||||||
$newContentExtraVideoPage = str_replace($search, $replace, $global['getLiveApplicationModelArray']['contentExtraVideoPage']);
|
$newContentExtraVideoPage = str_replace($search, $replace, $global['getLiveApplicationModelArray']['contentExtraVideoPage']);
|
||||||
$newContentVideoListItem = str_replace($search, $replace, $global['getLiveApplicationModelArray']['contentListem']);
|
$newContentVideoListItem = str_replace($search, $replace, $global['getLiveApplicationModelArray']['contentListem']);
|
||||||
|
|
||||||
|
$hasPPVLive = false;
|
||||||
|
if(AVideoPlugin::isEnabledByName('PayPerViewLive')){
|
||||||
|
$plans = PayPerViewLive::getAllPlansFromUser($users_id);
|
||||||
|
$hasPPVLive = !empty($plans);
|
||||||
|
}
|
||||||
$array = [
|
$array = [
|
||||||
"html" => $newContent,
|
"hasPPVLive" => $hasPPVLive,
|
||||||
"htmlExtra" => $newContentExtra,
|
|
||||||
"htmlExtraVideoPage" => $newContentExtraVideoPage,
|
|
||||||
"htmlExtraVideoListItem" => $newContentVideoListItem,
|
|
||||||
"type" => $type,
|
"type" => $type,
|
||||||
"photo" => $UserPhoto,
|
"photo" => $UserPhoto,
|
||||||
"UserPhoto" => $UserPhoto,
|
"UserPhoto" => $UserPhoto,
|
||||||
|
@ -556,6 +558,10 @@ class Live extends PluginAbstract
|
||||||
'comingsoon' => $comingsoon,
|
'comingsoon' => $comingsoon,
|
||||||
'description' => $description,
|
'description' => $description,
|
||||||
'timezone' => date_default_timezone_get(),
|
'timezone' => date_default_timezone_get(),
|
||||||
|
"html" => $newContent,
|
||||||
|
"htmlExtra" => $newContentExtra,
|
||||||
|
"htmlExtraVideoPage" => $newContentExtraVideoPage,
|
||||||
|
"htmlExtraVideoListItem" => $newContentVideoListItem,
|
||||||
];
|
];
|
||||||
|
|
||||||
$_getLiveApplicationModelArray[$uid] = $array;
|
$_getLiveApplicationModelArray[$uid] = $array;
|
||||||
|
|
|
@ -621,6 +621,7 @@ $wwbnIndexPlugin = AVideoPlugin::isEnabledByName('WWBNIndex');
|
||||||
jsonToForm(row.data_object, row.data_object_helper, row.data_object_info);
|
jsonToForm(row.data_object, row.data_object_helper, row.data_object_info);
|
||||||
$('#inputData').val(json);
|
$('#inputData').val(json);
|
||||||
$('#pluginsFormModal').modal();
|
$('#pluginsFormModal').modal();
|
||||||
|
$('#is_advanced').prop('checked', false);
|
||||||
});
|
});
|
||||||
grid.find(".command-sql").on("click", function(e) {
|
grid.find(".command-sql").on("click", function(e) {
|
||||||
var row_index = $(this).closest('tr').index();
|
var row_index = $(this).closest('tr').index();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue