mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-03 01:39:24 +02:00
showonFirstpage update
This commit is contained in:
parent
7ac7481d5b
commit
a6ac9edca0
12 changed files with 262 additions and 98 deletions
|
@ -4,7 +4,7 @@ if (file_exists("../videos/configuration.php")) {
|
|||
exit;
|
||||
}
|
||||
|
||||
$installationVersion = "12.8";
|
||||
$installationVersion = "12.9";
|
||||
|
||||
error_log("Installation: ".__LINE__." ". json_encode($_POST));
|
||||
header('Content-Type: application/json');
|
||||
|
|
|
@ -501,10 +501,12 @@ CREATE TABLE IF NOT EXISTS `playlists` (
|
|||
`modified` DATETIME NULL DEFAULT NULL,
|
||||
`users_id` INT(11) NOT NULL,
|
||||
`status` ENUM('public', 'private', 'unlisted', 'favorite', 'watch_later') NOT NULL DEFAULT 'public',
|
||||
`showOnTV` TINYINT NULL,
|
||||
`showOnTV` TINYINT NULL,,
|
||||
`showOnFirstPage` TINYINT(1) UNSIGNED NULL DEFAULT 0,
|
||||
PRIMARY KEY (`id`),
|
||||
INDEX `fk_playlists_users1_idx` (`users_id` ASC),
|
||||
INDEX `showOnTVindex3` (`showOnTV` ASC),
|
||||
INDEX `showonFirstpage` (`showOnFirstPage` ASC),
|
||||
CONSTRAINT `fk_playlists_users1`
|
||||
FOREIGN KEY (`users_id`)
|
||||
REFERENCES `users` (`id`)
|
||||
|
|
|
@ -11382,7 +11382,9 @@ function modifyURL($url)
|
|||
'ads_w' => 'ads.w', //player width
|
||||
'ads_h' => 'ads.h', //player height
|
||||
'app_store_url' => 'ads.app_store_url', //player height
|
||||
'ads_app_store_url' => 'ads.app_store_url', //player height
|
||||
'app_name' => 'ads.app_name', //player height
|
||||
'ads_app_name' => 'ads.app_name', //player height
|
||||
'ads_cb' => 'ads.cb',
|
||||
'ads_channel_name' => 'ads.channel_name',
|
||||
'ads_content_genre' => 'ads.content_genre',
|
||||
|
|
|
@ -16,6 +16,7 @@ class PlayList extends ObjectYPT {
|
|||
protected $users_id;
|
||||
protected $status;
|
||||
protected $showOnTV;
|
||||
protected $showOnFirstPage;
|
||||
protected $modified;
|
||||
public static $validStatus = ['public', 'private', 'unlisted', 'favorite', 'watch_later'];
|
||||
|
||||
|
@ -85,9 +86,10 @@ class PlayList extends ObjectYPT {
|
|||
}
|
||||
$videosArrayId = PlayList::getVideosIdFromPlaylist($playlists_id);
|
||||
$videosP = Video::getAllVideos("viewable", false, true, $videosArrayId, false, true);
|
||||
$videosP = PlayList::sortVideos($videosP, $videosArrayId);
|
||||
//$videosP = PlayList::sortVideos($videosP, $videosArrayId);
|
||||
foreach ($videosP as $key => $value2) {
|
||||
if (empty($videosP[$key]['type'])) {
|
||||
//echo 'unset ';var_dump($videosP[$key]);
|
||||
unset($videosP[$key]);
|
||||
continue;
|
||||
}
|
||||
|
@ -101,6 +103,8 @@ class PlayList extends ObjectYPT {
|
|||
if ($videosP[$key]['type'] !== Video::$videoTypeLinkVideo) {
|
||||
$videosP[$key]['videos'] = Video::getVideosPaths($videosP[$key]['filename'], true);
|
||||
}
|
||||
$videosP[$key]['playlists_id'] = $playlists_id;
|
||||
$videosP[$key]['playlist_index'] = $key;
|
||||
}
|
||||
|
||||
return $videosP;
|
||||
|
@ -703,25 +707,31 @@ class PlayList extends ObjectYPT {
|
|||
}
|
||||
|
||||
public static function sortVideos($videosList, $listIdOrder) {
|
||||
$list = [];
|
||||
foreach ($listIdOrder as $value) {
|
||||
$found = false;
|
||||
foreach ($videosList as $key => $value2) {
|
||||
if ($value2['id'] == $value) {
|
||||
$list[] = $value2;
|
||||
unset($videosList[$key]);
|
||||
$found = true;
|
||||
}
|
||||
usort($videosList, function($a, $b) use ($listIdOrder) {
|
||||
// Get the index of the 'id' from the $listIdOrder array
|
||||
$indexA = array_search($a['id'], $listIdOrder);
|
||||
$indexB = array_search($b['id'], $listIdOrder);
|
||||
|
||||
// If both IDs are found in $listIdOrder
|
||||
if ($indexA !== false && $indexB !== false) {
|
||||
return $indexA - $indexB; // Sort based on the order in $listIdOrder
|
||||
}
|
||||
if (!$found) {
|
||||
$v = new Video("", "", $value);
|
||||
if (empty($v->getFilename())) {
|
||||
continue;
|
||||
}
|
||||
$list[] = ['id' => $value];
|
||||
|
||||
// If $a['id'] is not found, it should come after $b
|
||||
if ($indexA === false && $indexB !== false) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return $list;
|
||||
|
||||
// If $b['id'] is not found, it should come after $a
|
||||
if ($indexB === false && $indexA !== false) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
// If neither ID is found, sort them based on their IDs
|
||||
return $a['id'] - $b['id'];
|
||||
});
|
||||
|
||||
return $videosList;
|
||||
}
|
||||
|
||||
public function save() {
|
||||
|
@ -734,6 +744,7 @@ class PlayList extends ObjectYPT {
|
|||
$this->setUsers_id($users_id);
|
||||
}
|
||||
$this->showOnTV = intval($this->showOnTV);
|
||||
$this->showOnFirstPage = intval($this->showOnFirstPage);
|
||||
$playlists_id = parent::save();
|
||||
if (!empty($playlists_id)) {
|
||||
self::deleteCacheDir($playlists_id);
|
||||
|
@ -894,6 +905,19 @@ class PlayList extends ObjectYPT {
|
|||
$this->showOnTV = intval($showOnTV);
|
||||
}
|
||||
|
||||
public function getShowOnFirstPage() {
|
||||
return intval($this->showOnFirstPage);
|
||||
}
|
||||
|
||||
public function setShowOnFirstPage($showOnFirstPage) {
|
||||
if (strtolower($showOnFirstPage) === "false") {
|
||||
$showOnFirstPage = 0;
|
||||
} elseif (strtolower($showOnFirstPage) === "true") {
|
||||
$showOnFirstPage = 1;
|
||||
}
|
||||
$this->showOnFirstPage = intval($showOnFirstPage);
|
||||
}
|
||||
|
||||
public static function getAllToShowOnTV() {
|
||||
global $global;
|
||||
if (!static::isTableInstalled()) {
|
||||
|
@ -921,6 +945,34 @@ class PlayList extends ObjectYPT {
|
|||
return $rows;
|
||||
}
|
||||
|
||||
|
||||
public static function getAllToShowOnFirstPage() {
|
||||
global $global;
|
||||
if (!static::isTableInstalled()) {
|
||||
return false;
|
||||
}
|
||||
$sql = "SELECT u.*, pl.* FROM playlists pl "
|
||||
. " LEFT JOIN users u ON users_id = u.id "
|
||||
. " WHERE showOnFirstPage=1 ";
|
||||
|
||||
//$sql .= self::getSqlFromPost();
|
||||
//echo $sql;exit;
|
||||
$res = sqlDAL::readSql($sql);
|
||||
$fullData = sqlDAL::fetchAllAssoc($res);
|
||||
sqlDAL::close($res);
|
||||
$rows = [];
|
||||
if ($res !== false) {
|
||||
foreach ($fullData as $row) {
|
||||
$row = cleanUpRowFromDatabase($row);
|
||||
$rows[] = $row;
|
||||
}
|
||||
} else {
|
||||
//die($sql . '\nError : (' . $global['mysqli']->errno . ') ' . $global['mysqli']->error);
|
||||
$rows = [];
|
||||
}
|
||||
return $rows;
|
||||
}
|
||||
|
||||
public static function showPlayListSelector($playListArray) {
|
||||
$collections = [];
|
||||
$videos = [];
|
||||
|
|
26
objects/playlistAddOnFirstPage.json.php
Normal file
26
objects/playlistAddOnFirstPage.json.php
Normal file
|
@ -0,0 +1,26 @@
|
|||
<?php
|
||||
header('Content-Type: application/json');
|
||||
global $global, $config;
|
||||
if (!isset($global['systemRootPath'])) {
|
||||
require_once '../videos/configuration.php';
|
||||
}
|
||||
require_once $global['systemRootPath'] . 'objects/user.php';
|
||||
require_once $global['systemRootPath'] . 'objects/playlist.php';
|
||||
if (!PlayLists::canManageAllPlaylists()) {
|
||||
forbiddenPage('Permission denied');
|
||||
}
|
||||
if (empty($_REQUEST['playlist_id'])) {
|
||||
forbiddenPage('playlist_id is empty');
|
||||
}
|
||||
|
||||
$obj = new stdClass();
|
||||
$obj->playlist_id = $_REQUEST['playlist_id'];
|
||||
$obj->showOnFirstPage = $_REQUEST['showOnFirstPage'];
|
||||
$obj->msg = '';
|
||||
|
||||
$pl = new PlayList($_POST['playlist_id']);
|
||||
$pl->setShowOnFirstPage($_REQUEST['showOnFirstPage']);
|
||||
$obj->saved = $pl->save();
|
||||
$obj->error = empty($obj->saved);
|
||||
|
||||
echo json_encode($obj);
|
|
@ -1651,8 +1651,11 @@ if (!class_exists('Video')) {
|
|||
$sql .= " AND v.status = '{$status}'";
|
||||
}
|
||||
*/
|
||||
|
||||
$sql .= self::getSQLByStatus($status, $showUnlisted);
|
||||
if (!empty($videosArrayId) && is_array($videosArrayId) && (is_numeric($videosArrayId[0]))) {
|
||||
$sql .= " ORDER BY FIELD(v.id, '" . implode("', '", $videosArrayId) . "') ";
|
||||
} else {
|
||||
$sql .= self::getSQLByStatus($status, $showUnlisted);
|
||||
}
|
||||
//var_dump($max_duration_in_seconds);echo $sql;exit;
|
||||
if (!empty($_REQUEST['catName'])) {
|
||||
$catName = ($_REQUEST['catName']);
|
||||
|
@ -1711,59 +1714,60 @@ if (!class_exists('Video')) {
|
|||
}
|
||||
|
||||
$sql .= AVideoPlugin::getVideoWhereClause();
|
||||
|
||||
if ($suggestedOnly) {
|
||||
$sql .= " AND v.isSuggested = 1 AND v.status = '" . self::$statusActive . "' ";
|
||||
$sql .= " ORDER BY RAND() ";
|
||||
$sort = @$_POST['sort'];
|
||||
unset($_POST['sort']);
|
||||
$sql .= BootGrid::getSqlFromPost([], empty($_POST['sort']['likes']) ? "v." : "", "", true);
|
||||
if (strpos(mb_strtolower($sql), 'limit') === false) {
|
||||
$sql .= " LIMIT 60 ";
|
||||
}
|
||||
$_POST['sort'] = $sort;
|
||||
} elseif (!isset($_POST['sort']['trending']) && !isset($_GET['sort']['trending'])) {
|
||||
if (!empty($_POST['sort']['created']) && !empty($_POST['sort']['likes'])) {
|
||||
$_POST['sort']['v.created'] = $_POST['sort']['created'];
|
||||
unset($_POST['sort']['created']);
|
||||
}
|
||||
$sort = $_POST['sort'];
|
||||
if (!empty($_POST['sort']['v.created']) || !empty($_POST['sort']['created'])) {
|
||||
$created = !empty($_POST['sort']['v.created']) ? $_POST['sort']['v.created'] : $_POST['sort']['created'];
|
||||
if (empty($videosArrayId)) {
|
||||
if ($suggestedOnly) {
|
||||
$sql .= " AND v.isSuggested = 1 AND v.status = '" . self::$statusActive . "' ";
|
||||
$sql .= " ORDER BY RAND() ";
|
||||
$sort = @$_POST['sort'];
|
||||
unset($_POST['sort']);
|
||||
$_POST['sort'] = array();
|
||||
if (strtoupper($created) === 'DESC') {
|
||||
$_POST['sort']['v.`order`'] = 'IS NOT NULL DESC';
|
||||
$_POST['sort']['`order`'] = 'ASC';
|
||||
$sql .= BootGrid::getSqlFromPost([], empty($_POST['sort']['likes']) ? "v." : "", "", true);
|
||||
if (strpos(mb_strtolower($sql), 'limit') === false) {
|
||||
$sql .= " LIMIT 60 ";
|
||||
}
|
||||
$_POST['sort'] = $sort;
|
||||
} elseif (!isset($_POST['sort']['trending']) && !isset($_GET['sort']['trending'])) {
|
||||
if (!empty($_POST['sort']['created']) && !empty($_POST['sort']['likes'])) {
|
||||
$_POST['sort']['v.created'] = $_POST['sort']['created'];
|
||||
unset($_POST['sort']['created']);
|
||||
}
|
||||
$sort = $_POST['sort'];
|
||||
if (!empty($_POST['sort']['v.created']) || !empty($_POST['sort']['created'])) {
|
||||
$created = !empty($_POST['sort']['v.created']) ? $_POST['sort']['v.created'] : $_POST['sort']['created'];
|
||||
unset($_POST['sort']);
|
||||
$_POST['sort'] = array();
|
||||
if (strtoupper($created) === 'DESC') {
|
||||
$_POST['sort']['v.`order`'] = 'IS NOT NULL DESC';
|
||||
$_POST['sort']['`order`'] = 'ASC';
|
||||
}
|
||||
|
||||
$_POST['sort']['v.created'] = $created;
|
||||
}
|
||||
//var_dump($_POST['sort']);exit;
|
||||
$sql .= BootGrid::getSqlFromPost([], empty($_POST['sort']['likes']) ? "v." : "", "", true);
|
||||
unset($_POST['sort']);
|
||||
$_POST['sort'] = $sort;
|
||||
//var_dump($sql);exit;
|
||||
} else {
|
||||
unset($_POST['sort']['trending'], $_GET['sort']['trending']);
|
||||
$rows = [];
|
||||
if (!empty($_REQUEST['current']) && $_REQUEST['current'] == 1) {
|
||||
$rows = VideoStatistic::getVideosWithMoreViews($status, $showOnlyLoggedUserVideos, $showUnlisted, $suggestedOnly);
|
||||
}
|
||||
//var_dump($_REQUEST['current'], $rows);
|
||||
$ids = [];
|
||||
foreach ($rows as $row) {
|
||||
$ids[] = $row['id'];
|
||||
}
|
||||
|
||||
$_POST['sort']['v.created'] = $created;
|
||||
}
|
||||
//var_dump($_POST['sort']);exit;
|
||||
$sql .= BootGrid::getSqlFromPost([], empty($_POST['sort']['likes']) ? "v." : "", "", true);
|
||||
unset($_POST['sort']);
|
||||
$_POST['sort'] = $sort;
|
||||
//var_dump($sql);exit;
|
||||
} else {
|
||||
unset($_POST['sort']['trending'], $_GET['sort']['trending']);
|
||||
$rows = [];
|
||||
if (!empty($_REQUEST['current']) && $_REQUEST['current'] == 1) {
|
||||
$rows = VideoStatistic::getVideosWithMoreViews($status, $showOnlyLoggedUserVideos, $showUnlisted, $suggestedOnly);
|
||||
}
|
||||
//var_dump($_REQUEST['current'], $rows);
|
||||
$ids = [];
|
||||
foreach ($rows as $row) {
|
||||
$ids[] = $row['id'];
|
||||
}
|
||||
//$daysLimit = getTrendingLimit();
|
||||
|
||||
//$daysLimit = getTrendingLimit();
|
||||
|
||||
if (!empty($ids)) {
|
||||
$sql .= " ORDER BY FIND_IN_SET(v.id, '" . implode(",", $ids) . "') DESC, likes DESC ";
|
||||
} else {
|
||||
$sql .= " ORDER BY likes DESC ";
|
||||
if (!empty($ids)) {
|
||||
$sql .= " ORDER BY FIND_IN_SET(v.id, '" . implode(",", $ids) . "') DESC, likes DESC ";
|
||||
} else {
|
||||
$sql .= " ORDER BY likes DESC ";
|
||||
}
|
||||
$sql .= ObjectYPT::getSqlLimit();
|
||||
}
|
||||
$sql .= ObjectYPT::getSqlLimit();
|
||||
}
|
||||
if (strpos(mb_strtolower($sql), 'limit') === false) {
|
||||
if (!empty($_GET['limitOnceToOne'])) {
|
||||
|
@ -1785,7 +1789,7 @@ if (!class_exists('Video')) {
|
|||
}
|
||||
}
|
||||
|
||||
//var_dump($max_duration_in_seconds);echo $sql;exit;
|
||||
//var_dump($max_duration_in_seconds);echo $sql; //exit;
|
||||
//_error_log("getAllVideos($status, $showOnlyLoggedUserVideos , $ignoreGroup , ". json_encode($videosArrayId).")" . $sql);
|
||||
|
||||
$timeLogName = TimeLogStart("video::getAllVideos");
|
||||
|
@ -3221,7 +3225,7 @@ if (!class_exists('Video')) {
|
|||
|
||||
$tags = Video::getTags($video_id);
|
||||
$_getTagsHTMLLabelArray[$video_id] = [];
|
||||
$valid_tags = [__("Paid Content"), __("Group"), __("Plugin"), __("Rating"),__("Pinned")];
|
||||
$valid_tags = [__("Paid Content"), __("Group"), __("Plugin"), __("Rating"), __("Pinned")];
|
||||
foreach ($tags as $value2) {
|
||||
if (empty($value2->label) || empty($value2->text)) {
|
||||
continue;
|
||||
|
@ -3326,7 +3330,7 @@ if (!class_exists('Video')) {
|
|||
$tags = [];
|
||||
|
||||
if (empty($type) || $type === VideoTags::$TagTypePinned) {
|
||||
if($video->getOrder()){
|
||||
if ($video->getOrder()) {
|
||||
$objTag = new stdClass();
|
||||
$objTag->label = __("Pinned");
|
||||
$objTag->type = "default";
|
||||
|
@ -6508,8 +6512,18 @@ if (!class_exists('Video')) {
|
|||
|
||||
$galleryVideoButtons .= $galleryDropDownMenu . '</div>';
|
||||
}
|
||||
$href = Video::getLink($video['id'], $video['clean_title']);
|
||||
$embed = Video::getLink($video['id'], $video['clean_title'], true);
|
||||
|
||||
if (!empty($video['playlists_id']) && isset($video['playlist_index'])) {
|
||||
if (!class_exists('PlayLists')) {
|
||||
AVideoPlugin::loadPlugin('PlayLists');
|
||||
}
|
||||
$href = PlayLists::getLink($video['playlists_id'], false, $video['playlist_index']);
|
||||
$embed = PlayLists::getLink($video['playlists_id'], true, $video['playlist_index']);
|
||||
} else {
|
||||
$href = Video::getLink($video['id'], $video['clean_title']);
|
||||
$embed = Video::getLink($video['id'], $video['clean_title'], true);
|
||||
}
|
||||
|
||||
$title = safeString($video['title']);
|
||||
$a = '<a videos_id="' . $videos_id . '"
|
||||
href="' . $href . '"
|
||||
|
|
|
@ -84,6 +84,10 @@ class Gallery extends PluginAbstract
|
|||
$obj->SuggestedRowCount = 12;
|
||||
$obj->SuggestedOrder = 1;
|
||||
|
||||
$obj->PlayLists = true;
|
||||
$obj->PlayListsRowCount = 12;
|
||||
$obj->PlayListsOrder = 2;
|
||||
|
||||
$obj->Trending = true;
|
||||
$obj->TrendingCustomTitle = "";
|
||||
$obj->TrendingRowCount = 12;
|
||||
|
|
|
@ -12,7 +12,7 @@ saveRequestVars();
|
|||
$users_id_array = VideoStatistic::getUsersIDFromChannelsWithMoreViews();
|
||||
$channels = Channel::getChannels(true, "u.id, '" . implode(",", $users_id_array) . "'");
|
||||
if (!empty($channels)) {
|
||||
?>
|
||||
?>
|
||||
<div id="channelsResults" class="clear clearfix">
|
||||
<h3 class="galleryTitle"> <i class="fas fa-user"></i> <?php echo __('Channels'); ?></h3>
|
||||
<div class="row">
|
||||
|
@ -28,7 +28,7 @@ saveRequestVars();
|
|||
?>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
<?php
|
||||
global $contentSearchFound;
|
||||
$contentSearchFound = true;
|
||||
}
|
||||
|
@ -45,7 +45,7 @@ saveRequestVars();
|
|||
if (empty($_REQUEST['catName'])) {
|
||||
$objLive = AVideoPlugin::getDataObject('Live');
|
||||
if (empty($objLive->doNotShowLiveOnVideosList)) {
|
||||
?>
|
||||
?>
|
||||
<!-- For Live Videos -->
|
||||
<div id="liveVideos" class="clear clearfix" style="display: none;">
|
||||
<h3 class="galleryTitle text-danger"> <i class="fas fa-play-circle"></i> <?php echo __("Live"); ?></h3>
|
||||
|
@ -70,21 +70,53 @@ saveRequestVars();
|
|||
|
||||
include $global['systemRootPath'] . 'plugin/Gallery/view/mainAreaCategory.php';
|
||||
} else {
|
||||
//var_dump($sections);exit;
|
||||
foreach ($sections as $value) {
|
||||
if (empty($value['active'])) {
|
||||
continue;
|
||||
}
|
||||
$countSections++;
|
||||
if(preg_match('/Channel_([0-9]+)_/', $value['name'], $matches)){
|
||||
if (preg_match('/Channel_([0-9]+)_/', $value['name'], $matches)) {
|
||||
$users_id = intval($matches[1]);
|
||||
User::getChannelPanel($users_id);
|
||||
} else
|
||||
if ($value['name'] == 'Shorts' && AVideoPlugin::isEnabledByName('Shorts')) {
|
||||
include $global['systemRootPath'].'plugin/Shorts/row.php';
|
||||
include $global['systemRootPath'] . 'plugin/Shorts/row.php';
|
||||
} else
|
||||
if ($value['name'] == 'Suggested') {
|
||||
createGallery(!empty($obj->SuggestedCustomTitle) ? $obj->SuggestedCustomTitle : __("Suggested"), 'suggested', $obj->SuggestedRowCount, 'SuggestedOrder', "", "", $orderString, "ASC", !$obj->hidePrivateVideos, "fas fa-star");
|
||||
} else
|
||||
if($value['name'] == 'PlayLists'){
|
||||
$objPl = AVideoPlugin::getDataObject('PlayLists');
|
||||
$plRows = PlayList::getAllToShowOnFirstPage();
|
||||
//var_dump(count($plRows));exit;
|
||||
if (!empty($plRows)) {
|
||||
$rowCount = getRowCount();
|
||||
setRowCount(12);
|
||||
foreach ($plRows as $pl) {
|
||||
?>
|
||||
<!-- For Playlist -->
|
||||
<div class="clear clearfix">
|
||||
<h3 class="galleryTitle">
|
||||
<a href="<?php echo "{$global['webSiteRootURL']}viewProgram/{$pl['id']}/" . urlencode($pl['name']); ?>">
|
||||
<i class="fas fa-list"></i> <?php echo __($pl['name']); ?>
|
||||
</a>
|
||||
</h3>
|
||||
<?php
|
||||
$videos = PlayList::getAllFromPlaylistsID($pl['id']);
|
||||
// need to add dechex because some times it return an negative value and make it fails on javascript playlists
|
||||
?>
|
||||
<div class="gallerySectionContent">
|
||||
<?php
|
||||
$countCols = createGallerySection($videos);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
setRowCount($rowCount);
|
||||
}
|
||||
}else
|
||||
if ($value['name'] == 'Trending') {
|
||||
createGallery(!empty($obj->TrendingCustomTitle) ? $obj->TrendingCustomTitle : __("Trending"), 'trending', $obj->TrendingRowCount, 'TrendingOrder', "zyx", "abc", $orderString, "ASC", !$obj->hidePrivateVideos, "fas fa-chart-line");
|
||||
} else
|
||||
|
@ -130,7 +162,7 @@ saveRequestVars();
|
|||
}
|
||||
}
|
||||
} else {
|
||||
echo '<!-- '.basename(__FILE__).' -->';
|
||||
echo '<!-- ' . basename(__FILE__) . ' -->';
|
||||
include $global['systemRootPath'] . 'plugin/Gallery/view/modeGalleryCategoryLive.php';
|
||||
$ob = _ob_get_clean();
|
||||
_ob_start();
|
||||
|
@ -158,10 +190,10 @@ saveRequestVars();
|
|||
<!-- <?php echo basename(__FILE__); ?> -->
|
||||
<?php echo __("We have not found any videos or audios to show"); ?>.
|
||||
</div>
|
||||
<?php
|
||||
_error_log('contentSearchFound NOT FOUND '. json_encode(debug_backtrace()));
|
||||
_error_log('contentSearchFound NOT FOUND LAST SQL '. $debugLastGetVideoSQL);
|
||||
_error_log('contentSearchFound NOT FOUND LAST TOTAL SQL '. $lastGetTotalVideos);
|
||||
<?php
|
||||
_error_log('contentSearchFound NOT FOUND ' . json_encode(debug_backtrace()));
|
||||
_error_log('contentSearchFound NOT FOUND LAST SQL ' . $debugLastGetVideoSQL);
|
||||
_error_log('contentSearchFound NOT FOUND LAST TOTAL SQL ' . $lastGetTotalVideos);
|
||||
include $global['systemRootPath'] . 'view/include/notfound.php';
|
||||
}
|
||||
?>
|
||||
|
|
|
@ -21,6 +21,8 @@ if (empty($isASerie)) {
|
|||
} else {
|
||||
$currentSerieVideos_id = $isASerie['id'];
|
||||
}
|
||||
|
||||
getSharePopupButton(0, "{$global['webSiteRootURL']}viewProgram/{$program['id']}/".urlencode($program['name']), $program['name'], 'btn-xs');
|
||||
?>
|
||||
<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>
|
||||
|
@ -72,7 +74,6 @@ if (PlayLists::canManagePlaylist($playlists_id)) {
|
|||
echo PlayLists::getShowOnTVSwitch($program['id']);
|
||||
if ($program['status'] != "favorite" && $program['status'] != "watch_later") {
|
||||
if (AVideoPlugin::isEnabledByName("PlayLists")) {
|
||||
getSharePopupButton(0, "{$global['webSiteRootURL']}viewProgram/{$program['id']}/".urlencode($program['name']), $program['name'], 'btn-xs');
|
||||
?>
|
||||
<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>
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
ALTER TABLE `configurations`
|
||||
CHANGE COLUMN `language` `language` VARCHAR(25) NOT NULL DEFAULT 'en_US';
|
||||
UPDATE configurations SET version = '12.8', modified = now() WHERE id = 1;
|
||||
ALTER TABLE `playlists`
|
||||
ADD COLUMN `showOnFirstPage` TINYINT(1) UNSIGNED NULL DEFAULT 0,
|
||||
ADD INDEX `showonFirstpage` (`showOnFirstPage` ASC);
|
||||
|
||||
UPDATE configurations SET version = '12.9', modified = now() WHERE id = 1;
|
||||
|
|
|
@ -103,7 +103,7 @@ unset($_POST['current']);
|
|||
@$timesC[__LINE__] += microtime(true) - $startC;
|
||||
$startC = microtime(true);
|
||||
//_error_log("channelPlaylist videosP: ".json_encode($videosP));
|
||||
$videosP = PlayList::sortVideos($videosP, $videosArrayId);
|
||||
//$videosP = PlayList::sortVideos($videosP, $videosArrayId);
|
||||
@$timesC[__LINE__] += microtime(true) - $startC;
|
||||
$startC = microtime(true);
|
||||
//_error_log("channelPlaylist videosP2: ".json_encode($videosP));
|
||||
|
@ -117,7 +117,8 @@ unset($_POST['current']);
|
|||
<div class="panel-heading clearfix">
|
||||
<div class="pull-left">
|
||||
<strong style="font-size: 1.1em;" class="playlistName">
|
||||
<?php echo __($playlist['name']); ?>
|
||||
<!-- <?php echo basename(__FILE__); ?> -->
|
||||
<a href="<?php echo "{$global['webSiteRootURL']}viewProgram/{$playlist['id']}/".urlencode($playlist['name']); ?>"><?php echo __($playlist['name']); ?></a>
|
||||
</strong><br>
|
||||
<small class="text-muted">
|
||||
<?php echo seconds2human(PlayList::getTotalDurationFromPlaylistInSeconds($playlist['id'])); ?>
|
||||
|
@ -131,7 +132,6 @@ unset($_POST['current']);
|
|||
<?php
|
||||
if (!empty($videosArrayId)) {
|
||||
?>
|
||||
|
||||
<div class="panel-body">
|
||||
<?php
|
||||
$serie = PlayLists::isPlayListASerie($playlist['id']);
|
||||
|
|
|
@ -27,7 +27,7 @@ if (User::isLogged() && $user_id == User::getId()) {
|
|||
$isMyChannel = true;
|
||||
}
|
||||
|
||||
$programs = PlayList::getAllFromUser(empty($_GET['program_id'])?$user_id:0, $publicOnly, false, @$_GET['program_id']);
|
||||
$programs = PlayList::getAllFromUser(empty($_GET['program_id']) ? $user_id : 0, $publicOnly, false, @$_GET['program_id']);
|
||||
if (empty($programs)) {
|
||||
$programs = PlayList::getAllFromUser($user_id, $publicOnly);
|
||||
} else {
|
||||
|
@ -89,7 +89,7 @@ $playListsObj = AVideoPlugin::getObjectData("PlayLists");
|
|||
@$timesC[__LINE__] += microtime(true) - $startC;
|
||||
$startC = microtime(true);
|
||||
//_error_log("channelPlaylist videosP: ".json_encode($videosP));
|
||||
$videosP = PlayList::sortVideos($videosP, $videosArrayId);
|
||||
//$videosP = PlayList::sortVideos($videosP, $videosArrayId);
|
||||
@$timesC[__LINE__] += microtime(true) - $startC;
|
||||
$startC = microtime(true);
|
||||
//_error_log("channelPlaylist videosP2: ".json_encode($videosP));
|
||||
|
@ -97,13 +97,19 @@ $playListsObj = AVideoPlugin::getObjectData("PlayLists");
|
|||
@$timesC[__LINE__] += microtime(true) - $startC;
|
||||
$startC = microtime(true);
|
||||
$totalVideos = count($videosP);
|
||||
|
||||
$checked = '';
|
||||
if(!empty($program['showOnFirstPage'])){
|
||||
$checked = ' checked="checked" ';
|
||||
}
|
||||
?>
|
||||
<br>
|
||||
<div class="panel panel-default program" playListId="<?php echo $program['id']; ?>">
|
||||
<div class="panel-heading clearfix">
|
||||
<div class="panel-heading clearfix" style="padding-left: 10px;">
|
||||
<span class="badge pull-right"><?php echo $totalVideos; ?> <?php echo __('Videos'); ?></span>
|
||||
<div class="pull-left">
|
||||
<strong style="font-size: 1.1em;" class="playlistName">
|
||||
<!-- <?php echo basename(__FILE__); ?> -->
|
||||
<?php echo __($program['name']); ?>
|
||||
</strong><br>
|
||||
<small class="text-muted">
|
||||
|
@ -112,6 +118,20 @@ $playListsObj = AVideoPlugin::getObjectData("PlayLists");
|
|||
</div>
|
||||
<?php
|
||||
PlayLists::getPLButtons($program['id'], false);
|
||||
if (PlayLists::canManageAllPlaylists()) {
|
||||
?>
|
||||
<br>
|
||||
<div class="pull-right" style="padding: 10px 0 0 0;">
|
||||
<label for="addOnFirstPage<?php echo $program['id']; ?>">
|
||||
<span style="margin-right: 10px;"><?php echo __('Add to first page'); ?></span>
|
||||
</label>
|
||||
<div class="material-small material-switch pull-right">
|
||||
<input <?php echo $checked; ?> name="addOnFirstPage" id="addOnFirstPage<?php echo $program['id']; ?>" class="addOnFirstPage" type="checkbox" value="<?php echo $program['id']; ?>">
|
||||
<label for="addOnFirstPage<?php echo $program['id']; ?>" class="label-success"></label>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
|
||||
|
@ -318,6 +338,15 @@ $playListsObj = AVideoPlugin::getObjectData("PlayLists");
|
|||
|
||||
var currentObject;
|
||||
$(function() {
|
||||
$('.addOnFirstPage').on('change', function() {
|
||||
url = webSiteRootURL + 'objects/playlistAddOnFirstPage.json.php';
|
||||
var playlist_id = $(this).val();
|
||||
var showOnFirstPage = $(this).prop('checked');
|
||||
avideoAjax(url, {
|
||||
playlist_id: playlist_id,
|
||||
showOnFirstPage: showOnFirstPage
|
||||
});
|
||||
});
|
||||
<?php
|
||||
if (count($programs) <= 1 || !empty($palyListsObj->expandPlayListOnChannels)) {
|
||||
?>
|
||||
|
@ -343,7 +372,7 @@ $playListsObj = AVideoPlugin::getObjectData("PlayLists");
|
|||
var playlist_id = $(currentObject).attr('playlist_id');
|
||||
var video_id = $(currentObject).attr('video_id');
|
||||
$.ajax({
|
||||
url: '<?php echo $global['webSiteRootURL']; ?>objects/playlistRemoveVideo.php',
|
||||
url: webSiteRootURL + 'objects/playlistRemoveVideo.php',
|
||||
data: {
|
||||
"playlist_id": playlist_id,
|
||||
"video_id": video_id
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue