mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-06 12:00:06 +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 $global;
|
||||
|
||||
|
||||
if (!User::isLogged() && !$allowOfflineUser) {
|
||||
_error_log('Video::save permission denied to save');
|
||||
return false;
|
||||
|
@ -1928,6 +1930,22 @@ if (!class_exists('Video')) {
|
|||
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)
|
||||
{
|
||||
if (empty($row)) {
|
||||
|
@ -2034,6 +2052,8 @@ if (!class_exists('Video')) {
|
|||
TimeLogEnd($timeLogName, __LINE__, $TimeLogLimit);
|
||||
$row['identification'] = User::getNameIdentificationById(!empty($row['users_id_company']) ? $row['users_id_company'] : $row['users_id']);
|
||||
$row['userHasAgeToWatchVideo'] = self::userHasAgeToWatchVideo($row);
|
||||
$row['hasPPV'] = self::hasPPV($row['id']);
|
||||
$row['hasSubscription'] = self::hasSubscription($row['id']);
|
||||
if (empty($row['externalOptions'])) {
|
||||
$row['externalOptions'] = json_encode(['videoStartSeconds' => '00:00:00']);
|
||||
}
|
||||
|
|
|
@ -690,11 +690,19 @@ Disallow: *action=tagsearch*
|
|||
}
|
||||
|
||||
public static function saveVideosAddNew($post, $videos_id) {
|
||||
if(isset($post['doNotShowAdsOnThisChannel'])){
|
||||
self::setDoNotShowAdsOnChannel($videos_id, !_empty($post['doNotShowAdsOnThisChannel']));
|
||||
}
|
||||
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) {
|
||||
if (!Permissions::canAdminVideos()) {
|
||||
|
|
|
@ -535,11 +535,13 @@ class Live extends PluginAbstract
|
|||
$newContentExtraVideoPage = str_replace($search, $replace, $global['getLiveApplicationModelArray']['contentExtraVideoPage']);
|
||||
$newContentVideoListItem = str_replace($search, $replace, $global['getLiveApplicationModelArray']['contentListem']);
|
||||
|
||||
$hasPPVLive = false;
|
||||
if(AVideoPlugin::isEnabledByName('PayPerViewLive')){
|
||||
$plans = PayPerViewLive::getAllPlansFromUser($users_id);
|
||||
$hasPPVLive = !empty($plans);
|
||||
}
|
||||
$array = [
|
||||
"html" => $newContent,
|
||||
"htmlExtra" => $newContentExtra,
|
||||
"htmlExtraVideoPage" => $newContentExtraVideoPage,
|
||||
"htmlExtraVideoListItem" => $newContentVideoListItem,
|
||||
"hasPPVLive" => $hasPPVLive,
|
||||
"type" => $type,
|
||||
"photo" => $UserPhoto,
|
||||
"UserPhoto" => $UserPhoto,
|
||||
|
@ -556,6 +558,10 @@ class Live extends PluginAbstract
|
|||
'comingsoon' => $comingsoon,
|
||||
'description' => $description,
|
||||
'timezone' => date_default_timezone_get(),
|
||||
"html" => $newContent,
|
||||
"htmlExtra" => $newContentExtra,
|
||||
"htmlExtraVideoPage" => $newContentExtraVideoPage,
|
||||
"htmlExtraVideoListItem" => $newContentVideoListItem,
|
||||
];
|
||||
|
||||
$_getLiveApplicationModelArray[$uid] = $array;
|
||||
|
|
|
@ -621,6 +621,7 @@ $wwbnIndexPlugin = AVideoPlugin::isEnabledByName('WWBNIndex');
|
|||
jsonToForm(row.data_object, row.data_object_helper, row.data_object_info);
|
||||
$('#inputData').val(json);
|
||||
$('#pluginsFormModal').modal();
|
||||
$('#is_advanced').prop('checked', false);
|
||||
});
|
||||
grid.find(".command-sql").on("click", function(e) {
|
||||
var row_index = $(this).closest('tr').index();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue