1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-03 09:49:28 +02:00

ROKU JSON from playlists

Option for each user can select what playlist newly encoded videos will be automatically added
This commit is contained in:
DanieL 2022-09-05 17:20:10 -03:00
parent cfbfd8a322
commit 73e602261b
12 changed files with 558 additions and 455 deletions

View file

@ -39,10 +39,18 @@ $rows = ObjectYPT::getCache($cacheName, 0);
if (empty($rows)) {
// send $_GET['catName'] to be able to filter by category
$sort = @$_POST['sort'];
if(empty($_POST['sort'])){
$_POST['sort'] = array('created'=>'DESC');
if(empty($_REQUEST['program_id'])){
if(empty($_POST['sort'])){
$_POST['sort'] = array('created'=>'DESC');
}
$rows = Video::getAllVideos("viewable", $showOnlyLoggedUserVideos);
}else{
unset($_POST['sort']);
$videosArrayId = PlayList::getVideosIdFromPlaylist($_REQUEST['program_id']);
$rows = Video::getAllVideos("viewable", false, true, $videosArrayId, false, true);
$rows = PlayList::sortVideos($rows, $videosArrayId);
//var_dump($videosArrayId);foreach ($rows as $value) {var_dump($value['id']);}exit;
}
$rows = Video::getAllVideos("viewable", $showOnlyLoggedUserVideos);
$_POST['sort'] = $sort;
ObjectYPT::setCache($cacheName, $rows);
} else {
@ -56,7 +64,6 @@ if (!empty($_REQUEST['roku'])) {
include $global['systemRootPath'] . 'feed/mrss.php';
}
function feedText($text)
{
function feedText($text){
return trim(str_replace(['&&'], ['&'], str_replace(['&nbsp;','&','<','>'], [' ','&amp;','&lt;','&gt;'], (strip_tags(br2nl($text))))));
}

View file

@ -27,7 +27,7 @@ class PlayList extends ObjectYPT {
protected static function getFromDbFromName($name) {
global $global;
$sql = "SELECT * FROM " . static::getTableName() . " WHERE name = ? users_id = " . User::getId() . " LIMIT 1";
$sql = "SELECT * FROM " . static::getTableName() . " WHERE name = ? AND users_id = " . User::getId() . " LIMIT 1";
$res = sqlDAL::readSql($sql, "s", [$name]);
$data = sqlDAL::fetchAssoc($res);
sqlDAL::close($res);
@ -39,6 +39,20 @@ class PlayList extends ObjectYPT {
return $row;
}
static function getFromDbFromId($id) {
global $global;
$sql = "SELECT * FROM " . static::getTableName() . " WHERE id = ? AND users_id = " . User::getId() . " LIMIT 1";
$res = sqlDAL::readSql($sql, "i", [$id]);
$data = sqlDAL::fetchAssoc($res);
sqlDAL::close($res);
if ($res) {
$row = $data;
} else {
$row = false;
}
return $row;
}
public function loadFromName($name) {
if (!User::isLogged()) {
return false;

View file

@ -2885,7 +2885,7 @@ if (typeof gtag !== \"function\") {
}
_session_start();
$_SESSION['swapUser'] = $_SESSION['user'];
$user = self::getUserDb($users_id);
$user = self::getUserFromID($users_id);
//var_dump($users_id, $user);exit;
_error_log("swapUser {$users_id}");
$_SESSION['user'] = $user;

View file

@ -9,7 +9,6 @@ if (empty($video->getIsSuggested())) {
class="suggestBtn <?php echo $_class; ?> <?php echo $class; ?>"
onclick="toogleVideoSuggested($(this));return false;"
videos_id="<?php echo $videos_id; ?>" >
<span class="hidden-md hidden-sm hidden-xs">
<span class="unsuggestText btnText"><i class="fas fa-star"></i> <?php echo __("Unsuggest it"); ?></span>
<span class="suggestText btnText"><i class="far fa-star"></i> <?php echo __("Suggest it"); ?></span></span>
<span class="unsuggestText btnText"><i class="fas fa-star"></i> <span class="hidden-md hidden-sm hidden-xs"><?php echo __("Unsuggest it"); ?></span></span>
<span class="suggestText btnText"><i class="far fa-star"></i> <span class="hidden-md hidden-sm hidden-xs"><?php echo __("Suggest it"); ?></span></span>
</button>

View file

@ -255,7 +255,7 @@ class PlayLists extends PluginAbstract {
}
}
static function getLink($playlists_id, $embed = false, $playlist_index=null) {
static function getLink($playlists_id, $embed = false, $playlist_index = null) {
global $global;
$obj = AVideoPlugin::getObjectData("PlayLists");
if ($embed) {
@ -267,7 +267,7 @@ class PlayLists extends PluginAbstract {
$url = $global['webSiteRootURL'] . "program/" . $playlists_id;
}
}
if(isset($playlist_index)){
if (isset($playlist_index)) {
$url = addQueryStringParameter($url, 'playlist_index', $playlist_index);
}
return $url;
@ -760,4 +760,45 @@ class PlayLists extends PluginAbstract {
//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>';
}
public static function setAutoAddPlaylist($users_id, $playlists_id) {
$playlists_id = intval($playlists_id);
$user = new User($users_id);
$paramName = 'autoadd_playlist';
return $user->addExternalOptions($paramName, $playlists_id);
}
public static function getAutoAddPlaylist($users_id) {
$user = new User($users_id);
$paramName = 'autoadd_playlist';
return $user->getExternalOption($paramName);
}
public static function getPLButtons($playlists_id, $showMore = true) {
global $global;
include $global['systemRootPath'] . 'plugin/PlayLists/View/getPlaylistButtons.php';
}
public function getMyAccount($users_id) {
global $global;
include $global['systemRootPath'] . 'plugin/PlayLists/getMyAccount.php';
}
public function onNewVideo($videos_id) {
if (empty($videos_id)) {
return false;
}
$video = new Video('', '', $videos_id);
$users_id = $video->getUsers_id();
$playlists_id = PlayLists::getAutoAddPlaylist($users_id);
if (!empty($playlists_id)) {
return self::addVideo($videos_id, $playlists_id);
}
return false;
}
static public function addVideo($videos_id, $playlists_id, $add = true, $order = 0) {
$pl = new PlayList($playlists_id);
return $pl->addVideo($videos_id, $add, $order);
}
}

View file

@ -0,0 +1,150 @@
<?php
if (empty($playlists_id)) {
echo 'empty playlist id';
return '';
}
$program = PlayList::getFromDbFromId($playlists_id);
//var_dump($playlists_id, $program);
$isMyChannel = $program['users_id'] == User::getId();
$playListButtons = AVideoPlugin::getPlayListButtons($playlists_id);
$link = PlayLists::getLink($program['id']);
$isASerie = PlayLists::isPlayListASerie($program['id']);
if (empty($isASerie)) {
$currentSerieVideos_id = 0;
} else {
$currentSerieVideos_id = $isASerie['id'];
}
?>
<a href="<?php echo $link; ?>" class="btn btn-xs btn-default playAll hrefLink" data-toggle="tooltip" title="<?php echo __("Play All"); ?>" >
<span class="fa fa-play"></span> <span class="hidden-sm hidden-xs"><?php echo __("Play All"); ?></span>
</a>
<?php echo $playListButtons; ?>
<?php
echo PlayLists::getPlayLiveButton($program['id']);
if ($isMyChannel) {
?>
<script>
$(function () {
$("#sortable<?php echo $program['id']; ?>").sortable({
items: "li",
stop: function (event, ui) {
modal.showPleaseWait();
saveSortable(this, <?php echo $program['id']; ?>);
}
});
$("#sortable<?php echo $program['id']; ?>").disableSelection();
});
</script>
<div class="dropdown" style="display: inline-block;">
<button class="btn btn-default btn-xs dropdown-toggle" type="button" data-toggle="dropdown">
<i class="fas fa-sort-amount-down"></i>
<?php echo __("Auto Sort"); ?>
<span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li><a href="<?php echo $global['webSiteRootURL']; ?>objects/playlistSort.php?playlist_id=<?php echo $program['id']; ?>&sort=1"><i class="fas fa-sort-alpha-down"></i> <?php echo __("Alphabetical"); ?> A-Z</a></li>
<li><a href="<?php echo $global['webSiteRootURL']; ?>objects/playlistSort.php?playlist_id=<?php echo $program['id']; ?>&sort=2"><i class="fas fa-sort-alpha-down-alt"></i> <?php echo __("Alphabetical"); ?> Desc Z-A</a></li>
<li><a href="<?php echo $global['webSiteRootURL']; ?>objects/playlistSort.php?playlist_id=<?php echo $program['id']; ?>&sort=3"><i class="fas fa-sort-numeric-down"></i> <?php echo __("Created Date"); ?> 0-9</a></li>
<li><a href="<?php echo $global['webSiteRootURL']; ?>objects/playlistSort.php?playlist_id=<?php echo $program['id']; ?>&sort=4"><i class="fas fa-sort-numeric-down-alt"></i> <?php echo __("Created Date"); ?> Desc 9-0</a></li>
</ul>
</div>
<div class="dropdown" style="display: inline-block;">
<button class="btn btn-default btn-xs dropdown-toggle" type="button" data-toggle="dropdown">
<i class="fas fa-rss-square"></i>
<span class="hidden-xs hidden-sm"><?php echo __("Feed"); ?></span>
<span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li><a href="<?php echo $global['webSiteRootURL']; ?>feed/?program_id=<?php echo $program['id']; ?>" target="_blank">RSS</a></li>
<li><a href="<?php echo $global['webSiteRootURL']; ?>mrss/?program_id=<?php echo $program['id']; ?>" target="_blank">MRSS</a></li>
<li><a href="<?php echo $global['webSiteRootURL']; ?>roku.json?program_id=<?php echo $program['id']; ?>" target="_blank">Roku</a></li>
</ul>
</div>
<div class="pull-right btn-group" style="display: inline-flex;">
<?php
echo PlayLists::getShowOnTVSwitch($program['id']);
if ($program['status'] != "favorite" && $program['status'] != "watch_later") {
if (AVideoPlugin::isEnabledByName("PlayLists")) {
?>
<button class="btn btn-xs btn-default" onclick="copyToClipboard($('#playListEmbedCode<?php echo $program['id']; ?>').val()); setTextEmbedCopied();" data-toggle="tooltip" title="<?php echo __("Copy Embed code"); ?>" >
<span class="fa fa-copy"></span> <span id="btnEmbedText" class="hidden-sm hidden-xs"><?php echo __("Embed code"); ?></span>
</button>
<input type="hidden" id="playListEmbedCode<?php echo $program['id']; ?>" value='<?php
$code = str_replace("{embedURL}", "{$global['webSiteRootURL']}plugin/PlayLists/embed.php?playlists_id={$program['id']}", $advancedCustom->embedCodeTemplate);
echo($code);
?>'/>
<button class="btn btn-xs btn-default" onclick="copyToClipboard($('#playListEmbedGallery<?php echo $program['id']; ?>').val()); setTextGalleryCopied();" data-toggle="tooltip" title="<?php echo __("Copy Embed code"); ?>">
<span class="fa fa-copy"></span> <span id="btnEmbedGalleryText" class="hidden-sm hidden-xs"><?php echo __("Embed Gallery"); ?></span>
</button>
<input type="hidden" id="playListEmbedGallery<?php echo $program['id']; ?>" value='<?php
$code = str_replace("{embedURL}", "{$global['webSiteRootURL']}plugin/PlayLists/playerEmbed.php?playlists_id={$program['id']}", $advancedCustom->embedCodeTemplate);
echo($code);
?>'/>
<?php
}
if (User::canUpload()) {
?>
<button class="btn btn-xs btn-info seriePlaylist" playlist_id="<?php echo $program['id']; ?>" data-toggle="tooltip" title="<?php echo __('Add this playlist in your video library'); ?>" >
<i class="fas fa-film"></i> <span class="hidden-xs hidden-sm"><?php echo __("Serie"); ?></span>
</button>
<div id="seriePlaylistModal" class="modal fade" tabindex="-1" role="dialog" >
<div class="modal-dialog" role="document" style="width: 90%; margin: auto;">
<div class="modal-content">
<div class="modal-body">
<iframe style="width: 100%; height: 80vh;" src="about:blank">
</iframe>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
<script>
$(function () {
$('.seriePlaylist').click(function () {
$($('#seriePlaylistModal').find('iframe')[0]).attr('src', 'about:blank');
var playlist_id = $(this).attr('playlist_id');
$($('#seriePlaylistModal').find('iframe')[0]).attr('src', '<?php echo $global['webSiteRootURL']; ?>plugin/PlayLists/playListToSerie.php?playlist_id=' + playlist_id);
$('#seriePlaylistModal').modal();
//$('#seriePlaylistModal').modal('hide');
});
});
</script>
<?php }
?>
<button class="btn btn-xs btn-danger deletePlaylist" playlist_id="<?php echo $program['id']; ?>" data-toggle="tooltip" title="<?php echo __('Delete'); ?>" ><i class="fas fa-trash"></i> <span class="hidden-xs hidden-sm"><?php echo __("Delete"); ?></span></button>
<button class="btn btn-xs btn-primary renamePlaylist" playlist_id="<?php echo $program['id']; ?>" data-toggle="tooltip" title="<?php echo __('Rename'); ?>" ><i class="fas fa-edit"></i> <span class="hidden-xs hidden-sm"><?php echo __("Rename"); ?></span></button>
<button class="btn btn-xs btn-success" onclick="openVideoSearch(<?php echo $currentSerieVideos_id; ?>)" playlist_id="<?php echo $program['id']; ?>" data-toggle="tooltip" title="<?php echo __('Add to Program'); ?>" ><i class="fas fa-plus"></i> <span class="hidden-xs hidden-sm"><?php echo __("Add"); ?></span></button>
<button class="btn btn-xs btn-default statusPlaylist statusPlaylist<?php echo $program['id']; ?>" playlist_id="<?php echo $program['id']; ?>" style="" >
<span class="fa fa-lock" id="statusPrivate<?php echo $program['id']; ?>" style="color: red; <?php
if ($program['status'] !== 'private') {
echo ' display: none;';
}
?> " data-toggle="tooltip" title="<?php echo __('This playlist is private, click to make it public'); ?>" ></span>
<span class="fa fa-globe" id="statusPublic<?php echo $program['id']; ?>" style="color: green; <?php
if ($program['status'] !== 'public') {
echo ' display: none;';
}
?>" data-toggle="tooltip" title="<?php echo __('This playlist is public, click to make it unlisted'); ?>" ></span>
<span class="fa fa-eye-slash" id="statusUnlisted<?php echo $program['id']; ?>" style="color: gray; <?php
if ($program['status'] !== 'unlisted') {
echo ' display: none;';
}
?>" data-toggle="tooltip" title="<?php echo __('This playlist is unlisted, click to make it private'); ?>" ></span>
</button>
<?php
}
if ($showMore) {
?>
<a class="btn btn-xs btn-default" href="<?php echo $global['webSiteRootURL']; ?>viewProgram/<?php echo $program['id']; ?>/<?php echo urlencode(cleanURLName($program['name'])); ?>/" data-toggle="tooltip" title="<?php echo __("More"); ?>">
<?php echo __('More'); ?> <i class="fas fa-ellipsis-h"></i>
</a>
<?php
}
?>
</div>
<?php }
?>

View file

@ -0,0 +1,52 @@
<?php
$autoadd_playlist = PlayLists::getAutoAddPlaylist($users_id);
//var_dump($autoadd_playlist, $users_id);exit;
?>
<div class="form-group">
<label class="col-md-4 control-label">
<?php echo __("Auto add new videos on PlayList"); ?>
</label>
<div class="col-md-8 inputGroupContainer">
<div class="input-group">
<span class="input-group-addon">
<i class="fas fa-list"></i>
</span>
<select class="form-control" id="autoadd_playlist">
<option value="0"><?php echo __('Do not add'); ?></option>
<?php
$pls = PlayList::getAllFromUserLight(User::getId(), false);
foreach ($pls as $value) {
$selected = '';
if($autoadd_playlist === $value['id']){
$selected = 'selected';
}
echo "<option value=\"{$value['id']}\" {$selected}>{$value['name']}</option>";
}
?>
</select>
</div>
</div>
</div>
<script>
$(document).ready(function () {
$('#autoadd_playlist').change(function (e) {
saveAutoadd_playlist();
});
});
function saveAutoadd_playlist() {
var autoadd_playlist = $('#autoadd_playlist').val();
modal.showPleaseWait();
$.ajax({
url: webSiteRootURL + 'plugin/PlayLists/getMyAccount.save.json.php',
data: {autoadd_playlist: autoadd_playlist},
type: 'post',
success: function (response) {
avideoResponse(response);
modal.hidePleaseWait();
}
});
}
</script>

View file

@ -0,0 +1,29 @@
<?php
require_once '../../videos/configuration.php';
session_write_close();
header('Content-Type: application/json');
$obj = new stdClass();
$obj->error = true;
$obj->msg = "";
if(!User::isLogged()){
$obj->msg = "Not logged";
die(json_encode($obj));
}
if(!isset($_POST['autoadd_playlist'])){
$obj->msg = "autoadd_playlist is empty";
die(json_encode($obj));
}
$obj->autoadd_playlist = @$_POST['autoadd_playlist'];
$pp = AVideoPlugin::loadPluginIfEnabled('PlayLists');
if(empty($pp)){
$obj->msg = "Plugin not enabled";
die(json_encode($obj));
}
$response = PlayLists::setAutoAddPlaylist(User::getId(), $_POST['autoadd_playlist']);
$obj->error = empty($response);
die(json_encode($obj));

View file

@ -55,7 +55,6 @@ unset($_POST['current']);
if ($current == 1) {
echo "<div class='alert alert-warning'><i class=\"fas fa-exclamation-triangle\"></i> " . __('Sorry you do not have anything available') . "</div>";
}
die("</div>");
}
$playListsObj = AVideoPlugin::getObjectData("PlayLists");
@ -108,7 +107,6 @@ unset($_POST['current']);
$startC = microtime(true);
//_error_log("channelPlaylist videosP2: ".json_encode($videosP));
//_error_log("channelPlaylist videosArrayId: ".json_encode($videosArrayId));
$playListButtons = AVideoPlugin::getPlayListButtons($playlist['id']);
@$timesC[__LINE__] += microtime(true) - $startC;
$startC = microtime(true);
$countSuccess++;
@ -120,90 +118,9 @@ unset($_POST['current']);
<strong style="font-size: 1.1em;" class="playlistName">
<?php echo __($playlist['name']); ?> (<?php echo secondsToDuration($totalDuration); ?>)
</strong>
<?php
if (!empty($videosArrayId)) {
$link = PlayLists::getLink($playlist['id']);
?>
<a href="<?php echo $link; ?>" class="btn btn-xs btn-default playAll hrefLink" ><span class="fa fa-play"></span> <?php echo __("Play All"); ?></a><?php echo $playListButtons; ?>
<?php
}
echo PlayLists::getPlayLiveButton($playlist['id']);
PlayLists::getPLButtons($playlist['id']);
?>
<div class="pull-right btn-group" style="display: inline-flex;">
<?php
if ($isMyChannel) {
echo PlayLists::getShowOnTVSwitch($playlist['id']);
if ($playlist['status'] != "favorite" && $playlist['status'] != "watch_later") {
if (AVideoPlugin::isEnabledByName("PlayLists")) {
?>
<button class="btn btn-xs btn-default" onclick="copyToClipboard($('#playListEmbedCode<?php echo $playlist['id']; ?>').val()); setTextEmbedCopied();" ><span class="fa fa-copy"></span> <span id="btnEmbedText"><?php echo __("Copy embed code"); ?></span></button>
<input type="hidden" id="playListEmbedCode<?php echo $playlist['id']; ?>" value='<?php
$code = str_replace("{embedURL}", "{$global['webSiteRootURL']}plugin/PlayLists/embed.php?playlists_id={$playlist['id']}", $advancedCustom->embedCodeTemplate);
echo($code);
?>'/>
<button class="btn btn-xs btn-default" onclick="copyToClipboard($('#playListEmbedGallery<?php echo $playlist['id']; ?>').val()); setTextGalleryCopied();" ><span class="fa fa-copy"></span> <span id="btnEmbedGalleryText"><?php echo __("Copy embed Gallery"); ?></span></button>
<input type="hidden" id="playListEmbedGallery<?php echo $playlist['id']; ?>" value='<?php
$code = str_replace("{embedURL}", "{$global['webSiteRootURL']}plugin/PlayLists/playerEmbed.php?playlists_id={$playlist['id']}", $advancedCustom->embedCodeTemplate);
echo($code);
?>'/>
<?php
}
if (User::canUpload()) {
?>
<button class="btn btn-xs btn-info seriePlaylist" playlist_id="<?php echo $playlist['id']; ?>" ><i class="fas fa-film"></i> <?php echo __("Serie"); ?></button>
<div id="seriePlaylistModal" class="modal fade" tabindex="-1" role="dialog" >
<div class="modal-dialog" role="document" style="width: 90%; margin: auto;">
<div class="modal-content">
<div class="modal-body">
<iframe style="width: 100%; height: 80vh;" src="about:blank">
</iframe>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
<script>
$(function () {
$('.seriePlaylist').click(function () {
$($('#seriePlaylistModal').find('iframe')[0]).attr('src', 'about:blank');
var playlist_id = $(this).attr('playlist_id');
$($('#seriePlaylistModal').find('iframe')[0]).attr('src', '<?php echo $global['webSiteRootURL']; ?>plugin/PlayLists/playListToSerie.php?playlist_id=' + playlist_id);
$('#seriePlaylistModal').modal();
//$('#seriePlaylistModal').modal('hide');
});
});
</script>
<?php }
?>
<button class="btn btn-xs btn-danger deletePlaylist" playlist_id="<?php echo $playlist['id']; ?>" ><i class="fas fa-trash"></i> <?php echo __("Delete"); ?></button>
<button class="btn btn-xs btn-primary renamePlaylist" playlist_id="<?php echo $playlist['id']; ?>" ><i class="fas fa-edit"></i> <?php echo __("Rename"); ?></button>
<button class="btn btn-xs btn-default statusPlaylist statusPlaylist<?php echo $playlist['id']; ?>" playlist_id="<?php echo $playlist['id']; ?>" style="" >
<span class="fa fa-lock" id="statusPrivate<?php echo $playlist['id']; ?>" style="color: red; <?php
if ($playlist['status'] !== 'private') {
echo ' display: none;';
}
?> " ></span>
<span class="fa fa-globe" id="statusPublic<?php echo $playlist['id']; ?>" style="color: green; <?php
if ($playlist['status'] !== 'public') {
echo ' display: none;';
}
?>"></span>
<span class="fa fa-eye-slash" id="statusUnlisted<?php echo $playlist['id']; ?>" style="color: gray; <?php
if ($playlist['status'] !== 'unlisted') {
echo ' display: none;';
}
?>"></span>
</button>
<?php
}
}
?>
<a class="btn btn-xs btn-default" href="<?php echo $global['webSiteRootURL']; ?>viewProgram/<?php echo $playlist['id']; ?>/<?php echo urlencode(cleanURLName($playlist['name'])); ?>/">
<?php echo __('More'); ?> <i class="fas fa-ellipsis-h"></i>
</a>
</div>
</div>
<?php

View file

@ -91,122 +91,16 @@ $playListsObj = AVideoPlugin::getObjectData("PlayLists");
$startC = microtime(true);
//_error_log("channelPlaylist videosP2: ".json_encode($videosP));
//_error_log("channelPlaylist videosArrayId: ".json_encode($videosArrayId));
$playListButtons = AVideoPlugin::getPlayListButtons($program['id']);
@$timesC[__LINE__] += microtime(true) - $startC;
$startC = microtime(true);
$isASerie = PlayLists::isPlayListASerie($program['id']);
if (empty($isASerie)) {
$currentSerieVideos_id = 0;
} else {
$currentSerieVideos_id = $isASerie['id'];
}
?>
<br>
<div class="panel panel-default program" playListId="<?php echo $program['id']; ?>">
<div class="panel-heading">
<strong class="playlistName"><?php echo $program['name']; ?> </strong>
<?php
if (!empty($videosArrayId)) {
$link = PlayLists::getLink($program['id']);
?>
<a href="<?php echo $link; ?>" class="btn btn-xs btn-default playAll hrefLink" ><span class="fa fa-play"></span> <?php echo __("Play All"); ?></a><?php echo $playListButtons; ?>
<?php
echo PlayLists::getPlayLiveButton($program['id']);
}
if ($isMyChannel) {
?>
<script>
$(function () {
$("#sortable<?php echo $program['id']; ?>").sortable({
items: "li",
stop: function (event, ui) {
modal.showPleaseWait();
saveSortable(this, <?php echo $program['id']; ?>);
}
});
$("#sortable<?php echo $program['id']; ?>").disableSelection();
});
</script>
<div class="dropdown" style="display: inline-block;">
<button class="btn btn-default btn-xs dropdown-toggle" type="button" data-toggle="dropdown"><?php echo __("Auto Sort"); ?>
<span class="caret"></span></button>
<ul class="dropdown-menu">
<li><a href="<?php echo $global['webSiteRootURL']; ?>objects/playlistSort.php?playlist_id=<?php echo $program['id']; ?>&sort=1"><?php echo __("Alphabetical"); ?> A-Z</a></li>
<li><a href="<?php echo $global['webSiteRootURL']; ?>objects/playlistSort.php?playlist_id=<?php echo $program['id']; ?>&sort=2"><?php echo __("Alphabetical"); ?> Desc Z-A</a></li>
<li><a href="<?php echo $global['webSiteRootURL']; ?>objects/playlistSort.php?playlist_id=<?php echo $program['id']; ?>&sort=3"><?php echo __("Created Date"); ?> 0-9</a></li>
<li><a href="<?php echo $global['webSiteRootURL']; ?>objects/playlistSort.php?playlist_id=<?php echo $program['id']; ?>&sort=4"><?php echo __("Created Date"); ?> Desc 9-0</a></li>
</ul>
</div>
<div class="pull-right btn-group" style="display: inline-flex;">
<?php echo PlayLists::getShowOnTVSwitch($program['id']); ?>
<?php
if ($program['status'] != "favorite" && $program['status'] != "watch_later") {
if (AVideoPlugin::isEnabledByName("PlayLists")) {
?>
<button class="btn btn-xs btn-default" onclick="copyToClipboard($('#playListEmbedCode<?php echo $program['id']; ?>').val());setTextEmbedCopied();" data-toggle="tooltip" title="<?php echo __('Copy embed code'); ?>" >
<span class="fa fa-copy"></span>
<span id="btnEmbedText" class="hidden-xs hidden-sm"><?php echo __("Copy embed code"); ?></span></button>
<input type="hidden" id="playListEmbedCode<?php echo $program['id']; ?>" value='<iframe width="640" height="480" style="max-width: 100%;max-height: 100%;" src="<?php echo $global['webSiteRootURL']; ?>plugin/PlayLists/embed.php?playlists_id=<?php echo $program['id']; ?>" frameborder="0" <?php echo Video::$iframeAllowAttributes; ?>></iframe>'/>
<?php
}
if (User::canUpload()) {
?>
<button class="btn btn-xs btn-info seriePlaylist" playlist_id="<?php echo $program['id']; ?>" data-toggle="tooltip" title="<?php echo __('Add this playlist in your video library'); ?>" >
<i class="fas fa-film"></i> <span class="hidden-xs hidden-sm"><?php echo __("Serie"); ?></span>
</button>
<div id="seriePlaylistModal" class="modal fade" tabindex="-1" role="dialog" >
<div class="modal-dialog" role="document" style="width: 90%; margin: auto;">
<div class="modal-content">
<div class="modal-body">
<iframe style="width: 100%; height: 80vh;" src="about:blank">
</iframe>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
<script>
$(function () {
$('.seriePlaylist').click(function () {
$($('#seriePlaylistModal').find('iframe')[0]).attr('src', 'about:blank');
var playlist_id = $(this).attr('playlist_id');
$($('#seriePlaylistModal').find('iframe')[0]).attr('src', '<?php echo $global['webSiteRootURL']; ?>plugin/PlayLists/playListToSerie.php?playlist_id=' + playlist_id);
$('#seriePlaylistModal').modal();
//$('#seriePlaylistModal').modal('hide');
});
});
</script>
<?php }
?>
<button class="btn btn-xs btn-danger deletePlaylist" playlist_id="<?php echo $program['id']; ?>" data-toggle="tooltip" title="<?php echo __('Delete'); ?>" ><i class="fas fa-trash"></i> <span class="hidden-xs hidden-sm"><?php echo __("Delete"); ?></span></button>
<button class="btn btn-xs btn-primary renamePlaylist" playlist_id="<?php echo $program['id']; ?>" data-toggle="tooltip" title="<?php echo __('Rename'); ?>" ><i class="fas fa-edit"></i> <span class="hidden-xs hidden-sm"><?php echo __("Rename"); ?></span></button>
<button class="btn btn-xs btn-success" onclick="openVideoSearch(<?php echo $currentSerieVideos_id; ?>)" playlist_id="<?php echo $program['id']; ?>" data-toggle="tooltip" title="<?php echo __('Add to Program'); ?>" ><i class="fas fa-plus"></i> <span class="hidden-xs hidden-sm"><?php echo __("Add"); ?></span></button>
<button class="btn btn-xs btn-default statusPlaylist statusPlaylist<?php echo $program['id']; ?>" playlist_id="<?php echo $program['id']; ?>" style="" >
<span class="fa fa-lock" id="statusPrivate<?php echo $program['id']; ?>" style="color: red; <?php
if ($program['status'] !== 'private') {
echo ' display: none;';
}
?> " data-toggle="tooltip" title="<?php echo __('This playlist is private, click to make it public'); ?>" ></span>
<span class="fa fa-globe" id="statusPublic<?php echo $program['id']; ?>" style="color: green; <?php
if ($program['status'] !== 'public') {
echo ' display: none;';
}
?>" data-toggle="tooltip" title="<?php echo __('This playlist is public, click to make it unlisted'); ?>" ></span>
<span class="fa fa-eye-slash" id="statusUnlisted<?php echo $program['id']; ?>" style="color: gray; <?php
if ($program['status'] !== 'unlisted') {
echo ' display: none;';
}
?>" data-toggle="tooltip" title="<?php echo __('This playlist is unlisted, click to make it private'); ?>" ></span>
</button>
<?php }
?>
</div>
<?php }
PlayLists::getPLButtons($program['id'], false);
?>
</div>

View file

@ -24,11 +24,11 @@ foreach ($tags as $value) {
<?php
include $global['systemRootPath'] . 'view/include/head.php';
?>
<link href="<?php echo getCDN(); ?>node_modules/croppie/croppie.css" rel="stylesheet" type="text/css"/>
<script src="<?php echo getCDN(); ?>node_modules/croppie/croppie.min.js" type="text/javascript"></script>
<link href="<?php echo getCDN(); ?>view/js/bootstrap-fileinput/css/fileinput.min.css" rel="stylesheet" type="text/css"/>
<script src="<?php echo getCDN(); ?>view/js/bootstrap-fileinput/js/fileinput.min.js" type="text/javascript"></script>
<link href="<?php echo getCDN(); ?>view/css/bodyFadein.css" rel="stylesheet" type="text/css"/>
<link href="<?php echo getURL('node_modules/croppie/croppie.css'); ?>" rel="stylesheet" type="text/css"/>
<script src="<?php echo getURL('node_modules/croppie/croppie.min.js'); ?>" type="text/javascript"></script>
<link href="<?php echo getURL('view/js/bootstrap-fileinput/css/fileinput.min.css'); ?>" rel="stylesheet" type="text/css"/>
<script src="<?php echo getURL('view/js/bootstrap-fileinput/js/fileinput.min.js'); ?>" type="text/javascript"></script>
<link href="<?php echo getURL('view/css/bodyFadein.css'); ?>" rel="stylesheet" type="text/css"/>
</head>
<body class="<?php echo $global['bodyClass']; ?>">
@ -94,14 +94,14 @@ foreach ($tags as $value) {
?>
<script>
$(document).ready(function () {
<?php
if (!empty($_REQUEST['tab'])) {
$tab = preg_replace('/[^a-z0-9_-]/i', '', $_REQUEST['tab']);
?>
$('#userTabsPanel a[href="#<?php echo $tab; ?>"]').trigger('click');
<?php
}
?>
<?php
if (!empty($_REQUEST['tab'])) {
$tab = preg_replace('/[^a-z0-9_-]/i', '', $_REQUEST['tab']);
?>
$('#userTabsPanel a[href="#<?php echo $tab; ?>"]').trigger('click');
<?php
}
?>
});
</script>
</body>