Skip to content

Commit

Permalink
You can change the views count for embed videos now
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Neto committed May 23, 2024
1 parent 0956281 commit 31381ee
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 26 deletions.
5 changes: 4 additions & 1 deletion objects/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -5415,9 +5415,12 @@ function getStatsNotifications($force_recreate = false, $listItIfIsAdminOrOwner

TimeLogEnd($timeName, __LINE__);
foreach ($json['applications'] as $key => $value) {
if (!Live::isApplicationListed(@$value['key'], $listItIfIsAdminOrOwner)) {
$isListed = Live::isApplicationListed(@$value['key'], $listItIfIsAdminOrOwner);
if (!$isListed) {
$json['hidden_applications'][] = $value;
unset($json['applications'][$key]);
}else{
$json['applications'][$key]['isListed'] = $isListed;
}
}
TimeLogEnd($timeName, __LINE__);
Expand Down
14 changes: 7 additions & 7 deletions plugin/Live/Live.php
Original file line number Diff line number Diff line change
Expand Up @@ -2562,21 +2562,21 @@ static function getTitleFromKey($key, $title = '')
public static function isApplicationListed($key, $listItIfIsAdminOrOwner = true)
{
global $_isApplicationListed;
if (!isset($_isApplicationListed)) {
$_isApplicationListed = array();
}
if (empty($key)) {
return __LINE__;
$_isApplicationListed[$key] = __LINE__;
}
if ($listItIfIsAdminOrOwner && User::isAdmin()) {
return __LINE__;
}
if (!isset($_isApplicationListed)) {
$_isApplicationListed = array();
$_isApplicationListed[$key] = __LINE__;
}
if (!isset($_isApplicationListed[$key])) {
$row = LiveTransmition::keyExists($key);
if (empty($row) || empty($row['users_id'])) {
$_isApplicationListed[$key] = __LINE__;
} else if (!empty($row['scheduled'])) {
$_isApplicationListed[$key] = __LINE__;
//} else if (!empty($row['scheduled'])) {
// $_isApplicationListed[$key] = __LINE__;
} else if (!empty($row['public'])) {
$_isApplicationListed[$key] = __LINE__;
} else if ($listItIfIsAdminOrOwner && User::getId() == $row['users_id']) {
Expand Down
4 changes: 2 additions & 2 deletions plugin/SocialMediaPublisher/SocialMediaPublisher.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ class SocialMediaPublisher extends PluginAbstract
self::SOCIAL_TYPE_LINKEDIN['name'] => self::SOCIAL_TYPE_LINKEDIN,
);

const RESTREAMER_URL = 'https://restream.ypt.me/';
//const RESTREAMER_URL = 'http://localhost:81/Restreamer/';
//const RESTREAMER_URL = 'https://restream.ypt.me/';
const RESTREAMER_URL = 'http://localhost:81/Restreamer/';

public function getTags()
{
Expand Down
33 changes: 17 additions & 16 deletions view/managerVideos_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@
<label for="madeForKids" class="label-primary"></label>
</div>
</div>
<div class="col-md-5">
<div class="col-md-4">
<label class="control-label" for="inputRrating">
<?php echo __("R Rating"); ?>
</label>
Expand All @@ -283,11 +283,26 @@
?>
</select>
</div>
<div class="col-md-5">
<div class="col-md-4">
<?php
include $global['systemRootPath'] . 'view/managerVideos_owner.php';
?>
</div>

<div class="col-md-2">
<?php
if (Permissions::canAdminVideos()) {
?>
<div>
<label class="control-label" for="views_count"><?php echo __("Video Views"); ?></label>
<input type="number" step="1" id="views_count" class="form-control externalOptions">
</div>
<?php
} else {
?><input type="hidden" id="views_count" value="-1"><?php
}
?>
</div>
</div>

<hr>
Expand Down Expand Up @@ -332,20 +347,6 @@
<input type="text" id="videoSkipIntroSecond" class="form-control externalOptions" placeholder="00:00:00" value="00:00:00" required>
</div>
</div>
<div class="col-md-6">
<?php
if (Permissions::canAdminVideos()) {
?>
<div>
<label class="control-label" for="videoStartSecond"><?php echo __("Video Views"); ?></label>
<input type="number" step="1" id="views_count" class="form-control externalOptions">
</div>
<?php
} else {
?><input type="hidden" id="views_count" value="-1"><?php
}
?>
</div>

</div>

Expand Down

0 comments on commit 31381ee

Please sign in to comment.