1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-03 01:39:24 +02:00

Loading some pages in a iframe

This commit is contained in:
Daniel 2021-11-22 13:10:54 -03:00
parent 5a92782541
commit 244089213b
26 changed files with 712 additions and 636 deletions

3
.gitignore vendored
View file

@ -72,4 +72,5 @@
sitemap.xml
/plugin/WebRTCLiveCam/
/plugin/Wix/
/plugin/Live/standAloneFiles/WebRTCServer/configuration.php
/plugin/Live/standAloneFiles/WebRTCServer/configuration.php
/plugin/Fishr/

View file

@ -7,9 +7,10 @@ $channelListSwitch = Plugin::isEnabledByName('FirstPageChannelList');
if (empty($netflixSwitch) && empty($gallerySwitch) && empty($youtubeSwitch) && empty($channelListSwitch)) {
$defaultSwitch = true;
}
$delay = 0.5;
?>
<div class="row">
<div class="col-sm-6 col-md-3 col-lg-3">
<div class="col-sm-6 col-md-3 col-lg-3 <?php echo getCSSAnimationClassAndStyle('animate__flipInY', 'layout', $delay); ?>">
<div class="panel panel-default">
<div class="panel-heading">
Default
@ -23,7 +24,7 @@ if (empty($netflixSwitch) && empty($gallerySwitch) && empty($youtubeSwitch) && e
</div>
</div>
</div>
<div class="col-sm-6 col-md-3 col-lg-3">
<div class="col-sm-6 col-md-3 col-lg-3 <?php echo getCSSAnimationClassAndStyle('animate__flipInY', 'layout', $delay); ?>">
<div class="panel panel-default">
<div class="panel-heading">
Netflix
@ -38,7 +39,7 @@ if (empty($netflixSwitch) && empty($gallerySwitch) && empty($youtubeSwitch) && e
</div>
</div>
<div class="clearfix hidden-md hidden-lg"></div>
<div class="col-sm-6 col-md-3 col-lg-3">
<div class="col-sm-6 col-md-3 col-lg-3 <?php echo getCSSAnimationClassAndStyle('animate__flipInY', 'layout', $delay); ?>">
<div class="panel panel-default">
<div class="panel-heading">
Channel
@ -52,7 +53,7 @@ if (empty($netflixSwitch) && empty($gallerySwitch) && empty($youtubeSwitch) && e
</div>
</div>
</div>
<div class="col-sm-6 col-md-3 col-lg-3">
<div class="col-sm-6 col-md-3 col-lg-3 <?php echo getCSSAnimationClassAndStyle('animate__flipInY', 'layout', $delay); ?>">
<div class="panel panel-default">
<div class="panel-heading">
Gallery

View file

@ -1,9 +1,10 @@
<?php
$obj = AVideoPlugin::getObjectDataIfEnabled('PlayerSkins');
$dir = $global['systemRootPath'] . 'plugin/PlayerSkins/skins/';
$delay = 0.2;
?>
<div class="row">
<div class="col-xs-6">
<div class="col-xs-6 <?php echo getCSSAnimationClassAndStyle('animate__fadeInUp', 'player', $delay); ?>">
<div class="panel panel-default">
<div class="panel-heading">
Default
@ -25,7 +26,7 @@ $dir = $global['systemRootPath'] . 'plugin/PlayerSkins/skins/';
$file = basename($filename); // $file is set to "index.php"
$fileEx = basename($filename, ".css"); // $file is set to "index"
?>
<div class="col-xs-6">
<div class="col-xs-6 <?php echo getCSSAnimationClassAndStyle('animate__fadeInUp', 'player', $delay); ?>">
<div class="panel panel-default">
<div class="panel-heading">
<?php echo ucfirst($fileEx); ?>

View file

@ -1,12 +1,13 @@
<div class="row">
<?php
$savedTheme = $config->getTheme();
$delay = 0.2;
foreach (glob("{$global['systemRootPath']}view/css/custom/*.css") as $filename) {
//echo "$filename size " . filesize($filename) . "\n";
$file = basename($filename); // $file is set to "index.php"
$fileEx = basename($filename, ".css"); // $file is set to "index"
?>
<div class="col-xs-4">
<div class="col-xs-4 <?php echo getCSSAnimationClassAndStyle('animate__fadeInUp', 'themess', $delay); ?>">
<div class="panel panel-default">
<div class="panel-heading">
<?php echo ucfirst($fileEx); ?>

View file

@ -255,7 +255,7 @@ switch ($_GET['page']) {
}
}
?>
<div class="panel <?php echo $panel; ?> adminLeftMenu <?php echo getCSSAnimationClassAndStyle('animate__flipInX', 'menu'); ?>">
<div class="panel <?php echo $panel; ?> adminLeftMenu <?php echo getCSSAnimationClassAndStyle('animate__bounceInLeft', 'menu'); ?>">
<div class="panel-heading">
<h4 class="panel-title">
<a <?php echo $href; ?> >

View file

@ -248,7 +248,9 @@ class Configuration {
global $global;
$destination = Video::getStoragePath()."cache/og_200X200.jpg";
$return = self::_getFavicon(true);
convertImageToOG($return['file'], $destination);
if(file_exists($return['file'])){
convertImageToOG($return['file'], $destination);
}
return getCDN() . "videos/cache/og_200X200.jpg";
}

View file

@ -1847,7 +1847,7 @@ function convertImage($originalImage, $outputImage, $quality) {
return 0;
}
if (!is_resource($imageTmp)) {
_error_log("convertImage: could not create a resource $originalImage, $outputImage, $quality, $ext");
_error_log("convertImage: could not create a resource $originalImage, $outputImage, $quality, $ext ". json_encode(debug_backtrace()));
return 0;
}
// quality is a value from 0 (worst) to 100 (best)

View file

@ -1397,6 +1397,7 @@ if (typeof gtag !== \"function\") {
sqlDAL::close($res);
if ($res != false) {
foreach ($downloadedArray as $row) {
$row['creator'] = Video::getCreatorHTML($row['id'], '', true, true);
$row = cleanUpRowFromDatabase($row);
$user[] = self::getUserInfoFromRow($row);
}
@ -1469,6 +1470,7 @@ if (typeof gtag !== \"function\") {
sqlDAL::close($res);
if ($res != false) {
foreach ($downloadedArray as $row) {
$row['creator'] = Video::getCreatorHTML($row['id'], '', true, true);
$row = cleanUpRowFromDatabase($row);
$user[] = self::getUserInfoFromRow($row);
}

View file

@ -4736,7 +4736,7 @@ if (!class_exists('Video')) {
return false;
}
static function getCreatorHTML($users_id, $html = '', $small = false) {
static function getCreatorHTML($users_id, $html = '', $small = false, $ignoreLinks=false) {
global $global;
if ($small) {
$template = $global['systemRootPath'] . 'view/videoCreatorSmall.html';
@ -4756,9 +4756,15 @@ if (!class_exists('Video')) {
'{subscriptionButton}',
'{html}');
if($ignoreLinks){
$channelLink = '#';
}else{
$channelLink = User::getChannelLink($users_id);
}
$replace = array(
User::getPhoto($users_id),
User::getChannelLink($users_id),
$channelLink,
strip_tags($name),
User::getEmailVerifiedIcon($users_id),
Subscribe::getButton($users_id),

View file

@ -53,7 +53,7 @@ class BulkEmbed extends PluginAbstract {
return '';
}
return '<li><a href="'.$global['webSiteRootURL'].'plugin/BulkEmbed/search.php" class="faa-parent animated-hover"><span class="fa fa-link faa-burst"></span> '.__("Bulk Embed").'</a></li>';
return '<li><a href="#" onclick="avideoModalIframeFull(webSiteRootURL+\'plugin/BulkEmbed/search.php\');return false;" class="faa-parent animated-hover"><span class="fas fa-link faa-burst"></span> '.__("Bulk Embed").'</a></li>';
}

View file

@ -1,84 +0,0 @@
<?php
$config = dirname(__FILE__) . '/../../../videos/configuration.php';
require_once $config;
if (!isCommandLineInterface()) {
return die('Command Line only');
}
$isCDNEnabled = AVideoPlugin::isEnabledByName('CDN');
if (empty($isCDNEnabled)) {
return die('Plugin disabled');
}
$storages = array('https://storage.wetube.club/', 'https://storage1.wetube.club/');
ob_end_flush();
set_time_limit(300);
ini_set('max_execution_time', 300);
$global['rowCount'] = $global['limitForUnlimitedVideos'] = 999999;
$path = getVideosDir();
$total = Video::getTotalVideos("", false, true, true, false, false);
$videos = Video::getAllVideosLight("", false, true, false);
$count = 0;
$countSiteIdNotEmpty = 0;
$countStatusNotActive = 0;
$countMoved = 0;
$videosDir = getVideosDir();
$errorsFound = 0;
foreach ($videos as $value) {
$count++;
$videos_id = $value['id'];
$list = CDNStorage::getLocalFolder($videos_id);
//echo "videos_id = {$videos_id} Files found " . count($list) . PHP_EOL;
$m3u8 = false;
$enckey = false;
foreach ($list as $file) {
if (is_array($file)) {
foreach ($file as $file2) {
if (preg_match('/index.m3u8$/', $file2)) {
$m3u8 = true;
} else if (preg_match('/enc.*.key$/', $file2)) {
$enckey = true;
}
}
} else {
if (preg_match('/index.m3u8$/', $file)) {
$m3u8 = true;
} else if (preg_match('/enc.*.key$/', $file)) {
$enckey = true;
}
}
}
if ($m3u8 && !$enckey) {
$errorsFound++;
//$video = Video::getVideoLight($value);
$paths = Video::getPaths($value['filename']);
echo "[$errorsFound] Missing enc key for video {$videos_id} {$paths['path']}" . PHP_EOL;
foreach ($storages as $s) {
$url = "{$s}tools/getenckey.json.php?folder={$value['filename']}";
echo "{$url}" . PHP_EOL;
$content = file_get_contents("{$s}tools/getenckey.json.php?folder={$value['filename']}");
if(!empty($content)){
$json = json_decode($content);
if(!empty($json->pathinfo)){
file_put_contents("{$paths['path']}missingkey", time());
file_put_contents("{$paths['path']}{$json->pathinfo->basename}", base64_decode($json->content));
echo "Saved from {$s} on {$paths['path']}{$json->pathinfo->basename}" . PHP_EOL;
break;
}
}
}
}
}
echo PHP_EOL . " Done! " . PHP_EOL;
die();

View file

@ -465,7 +465,7 @@ class Layout extends PluginAbstract {
public function navBarAfter() {
global $global;
$obj = $this->getDataObject();
if(!empty($obj->categoriesTopButtons)){
if(!AVideoPlugin::isEnabledByName('YouPHPFlix2') && !empty($obj->categoriesTopButtons)){
if(!empty($obj->categoriesTopButtonsShowOnlyOnFirstPage) && !isFirstPage()){
return '';
}

View file

@ -1,5 +1,5 @@
<li>
<a href="<?php echo $global['webSiteRootURL']; ?>plugin/LiveLinks" data-toggle="tooltip" title="<?php echo __("Add an External a Live Streaming"); ?>" data-placement="left"
<a href="#" onclick="avideoModalIframeFull(webSiteRootURL+'plugin/LiveLinks');return false;" data-toggle="tooltip" title="<?php echo __("Add an External a Live Streaming"); ?>" data-placement="left"
class="faa-parent animated-hover">
<i class="fas fa-link faa-burst"></i> <?php echo $buttonTitle; ?>
</a>

View file

@ -1026,14 +1026,14 @@ li.dropdown-submenu > ul > li > a{
.swal-modal.swal-modal-iframe-large .swal-content,
.swal-modal.swal-modal-iframe-full .swal-content{
width: 100%;
height: calc(100% - 50px);
height: 100%;
}
.swal-modal.swal-modal-iframe iframe,
.swal-modal.swal-modal-iframe-small iframe,
.swal-modal.swal-modal-iframe-large iframe,
.swal-modal.swal-modal-iframe-full iframe{
width: 100%;
height: 100%;
height: calc(100% - 50px);
}
#avideoModalIframeDiv{
display: none;
@ -1064,6 +1064,9 @@ li.dropdown-submenu > ul > li > a{
max-width: 100%;
max-height: 100%;
}
.swal-modal.swal-modal-iframe-full iframe{
height: 100%;
}
.swal-modal-iframe-full #avideoModalIframeDiv{
display: block;
@ -1071,7 +1074,6 @@ li.dropdown-submenu > ul > li > a{
.swal-modal.swal-modal-iframe-large .swal-content,
.swal-modal.swal-modal-iframe-full .swal-content{
height: 100%;
padding: 0;
margin: 0;
}

View file

@ -308,7 +308,7 @@ if (!User::isLogged() && !empty($advancedCustomUser->userMustBeLoggedIn) && !emp
$("#sidebar").removeClass('animate__bounceOutLeft');
$("#sidebar").show();
$("#sidebar").addClass('animate__animated animate__bounceInLeft');
setTimeout(function(){
setTimeout(function () {
$('body').addClass('youtube');
}, 500);
youTubeMenuIsOpened = true;
@ -316,7 +316,7 @@ if (!User::isLogged() && !empty($advancedCustomUser->userMustBeLoggedIn) && !emp
function YPTSidebarClose() {
$("#sidebar").removeClass('animate__bounceInLeft');
$("#sidebar").addClass('animate__bounceOutLeft');
setTimeout(function(){
setTimeout(function () {
$('body').removeClass('youtube');
$("#sidebar").hide();
}, 500);
@ -402,12 +402,12 @@ if (!User::isLogged() && !empty($advancedCustomUser->userMustBeLoggedIn) && !emp
$user = User::getChannelOwner($_SESSION['channelName']);
?>
<li>
<a class="navbar-brand" href="<?php echo User::getChannelLinkFromChannelName($_SESSION['channelName']); ?>" >
<a class="navbar-brand" href="#" onclick="avideoModalIframeFull('<?php echo User::getChannelLinkFromChannelName($_SESSION['channelName']); ?>');return false;" >
<img src="<?php echo User::getPhoto($user['id']); ?>" alt="<?php echo User::getNameIdentificationById($user['id']); ?>"
class="img img-circle " style="height: 33px; width: 33px; margin-right: 15px;">
</a>
</li>
<?php } ?>
<?php } ?>
</ul>
</li>
@ -464,7 +464,7 @@ if (!User::isLogged() && !empty($advancedCustomUser->userMustBeLoggedIn) && !emp
if (empty($advancedCustom->doNotShowUploadMP4Button)) {
?>
<li>
<a href="<?php echo $global['webSiteRootURL']; ?>mvideos?upload=1" data-toggle="tooltip" title="<?php echo __("Upload files without encode"); ?>"
<a href="#" onclick="avideoModalIframeFull(webSiteRootURL+'mvideos?upload=1');return false;" data-toggle="tooltip" title="<?php echo __("Upload files without encode"); ?>"
data-placement="left" class="faa-parent animated-hover" >
<span class="fas fa-upload faa-bounce"></span> <?php echo empty($advancedCustom->uploadMP4ButtonLabel) ? __("Direct upload") : __($advancedCustom->uploadMP4ButtonLabel); ?>
</a>
@ -474,7 +474,7 @@ if (!User::isLogged() && !empty($advancedCustomUser->userMustBeLoggedIn) && !emp
if (empty($advancedCustom->doNotShowImportMP4Button)) {
?>
<li>
<a href="<?php echo $global['webSiteRootURL']; ?>view/import.php" data-toggle="tooltip" title="<?php echo __("Search for videos in your local disk"); ?>" data-placement="left" class="faa-parent animated-hover" >
<a href="#" onclick="avideoModalIframeFull(webSiteRootURL+'view/import.php');return false;" data-toggle="tooltip" title="<?php echo __("Search for videos in your local disk"); ?>" data-placement="left" class="faa-parent animated-hover" >
<span class="fas fa-hdd faa-ring"></span> <?php echo empty($advancedCustom->importMP4ButtonLabel) ? __("Direct Import Local Videos") : __($advancedCustom->importMP4ButtonLabel); ?>
</a>
</li>
@ -483,7 +483,7 @@ if (!User::isLogged() && !empty($advancedCustomUser->userMustBeLoggedIn) && !emp
if (empty($advancedCustom->doNotShowEmbedButton)) {
?>
<li>
<a href="<?php echo $global['webSiteRootURL']; ?>mvideos?link=1" data-toggle="tooltip" title="<?php echo __("Embed videos/files in your site"); ?>" data-placement="left" class="faa-parent animated-hover" >
<a href="#" onclick="avideoModalIframeFull(webSiteRootURL+'mvideos?link=1');return false;" data-toggle="tooltip" title="<?php echo __("Embed videos/files in your site"); ?>" data-placement="left" class="faa-parent animated-hover" >
<span class="fa fa-link faa-burst"></span> <?php echo empty($advancedCustom->embedButtonLabel) ? __("Embed a video link") : __($advancedCustom->embedButtonLabel); ?>
</a>
</li>
@ -492,7 +492,7 @@ if (!User::isLogged() && !empty($advancedCustomUser->userMustBeLoggedIn) && !emp
if (AVideoPlugin::isEnabledByName("Articles")) {
?>
<li>
<a href="<?php echo $global['webSiteRootURL']; ?>mvideos?article=1" data-toggle="tooltip" title="<?php echo __("Write an article"); ?>" data-placement="left" class="faa-parent animated-hover">
<a href="#" onclick="avideoModalIframeFull(webSiteRootURL+'mvideos?article=1');return false;" data-toggle="tooltip" title="<?php echo __("Write an article"); ?>" data-placement="left" class="faa-parent animated-hover">
<i class="far fa-newspaper faa-horizontal"></i> <?php echo __("Add Article"); ?>
</a>
</li>
@ -536,7 +536,7 @@ if (!User::isLogged() && !empty($advancedCustomUser->userMustBeLoggedIn) && !emp
<button type="button" class="btn btn-default dropdown-toggle navbar-btn pull-left" data-toggle="dropdown">
<i class="<?php echo isset($advancedCustom->uploadButtonDropdownIcon) ? $advancedCustom->uploadButtonDropdownIcon : "fas fa-video"; ?>"></i> <?php echo!empty($advancedCustom->uploadButtonDropdownText) ? __($advancedCustom->uploadButtonDropdownText) : ""; ?> <span class="caret"></span>
</button>
<?php echo '<!-- navbar line ' . __LINE__ . '-->'; ?>
<?php echo '<!-- navbar line ' . __LINE__ . '-->'; ?>
<ul class="dropdown-menu dropdown-menu-right" role="menu" id="uploadMenu">
<?php
echo $getUploadMenuButton;
@ -597,7 +597,7 @@ if (!User::isLogged() && !empty($advancedCustomUser->userMustBeLoggedIn) && !emp
} else {
?>
<li>
<a class="btn navbar-btn btn-default" href="<?php echo $global['webSiteRootURL']; ?>user" >
<a class="btn navbar-btn btn-default" <?php echo $global['webSiteRootURL']; ?>user >
<i class="fas fa-sign-in-alt"></i> <?php echo __("Sign In"); ?>
</a>
</li>
@ -630,31 +630,31 @@ if (!User::isLogged() && !empty($advancedCustomUser->userMustBeLoggedIn) && !emp
<?php
if (User::isLogged()) {
?>
<button type="button" class="btn btn-default dropdown-toggle navbar-btn pull-left btn-circle" id="rightProfileButton" style="padding:0;" onclick="toogleRightProfile();">
<button type="button" class="btn btn-default dropdown-toggle navbar-btn pull-left btn-circle" id="rightProfileButton" style="padding:0;" onclick="toogleRightProfile();">
<img src="<?php echo User::getPhoto(); ?>"
style="width: 32px; height: 32px; max-width: 32px;"
class="img img-responsive img-circle" alt="User Photo"
/>
</button>
<script>
function toogleRightProfile(){
if($('#rightProfileBtnGroup').hasClass('open')){
$('#rightProfileButton').removeClass('glowBox');
$('#rightProfileBtnGroup .dropdown-menu').removeClass('animate__bounceInRight');
$('#rightProfileBtnGroup .dropdown-menu').addClass('animate__bounceOutRight');
setTimeout(function(){
$('#rightProfileBtnGroup').removeClass('open');
$('#rightProfileButton').attr('aria-expanded', false);
},500);
}else{
$('#rightProfileButton').addClass('glowBox');
$('#rightProfileBtnGroup .dropdown-menu').removeClass('animate__bounceOutRight');
$('#rightProfileBtnGroup .dropdown-menu').addClass('animate__bounceInRight');
$('#rightProfileBtnGroup').addClass('open');
$('#rightProfileButton').attr('aria-expanded', true).focus();
function toogleRightProfile() {
if ($('#rightProfileBtnGroup').hasClass('open')) {
$('#rightProfileButton').removeClass('glowBox');
$('#rightProfileBtnGroup .dropdown-menu').removeClass('animate__bounceInRight');
$('#rightProfileBtnGroup .dropdown-menu').addClass('animate__bounceOutRight');
setTimeout(function () {
$('#rightProfileBtnGroup').removeClass('open');
$('#rightProfileButton').attr('aria-expanded', false);
}, 500);
} else {
$('#rightProfileButton').addClass('glowBox');
$('#rightProfileBtnGroup .dropdown-menu').removeClass('animate__bounceOutRight');
$('#rightProfileBtnGroup .dropdown-menu').addClass('animate__bounceInRight');
$('#rightProfileBtnGroup').addClass('open');
$('#rightProfileButton').attr('aria-expanded', true).focus();
}
}
}
</script>
<?php echo '<!-- navbar line ' . __LINE__ . '-->'; ?>
<ul class="dropdown-menu dropdown-menu-right <?php echo getCSSAnimationClassAndStyle('animate__bounceInRight', 'rightProfileButton', 0); ?>margin-right:10px;" >
@ -697,9 +697,9 @@ if (!User::isLogged() && !empty($advancedCustomUser->userMustBeLoggedIn) && !emp
?>
<li>
<a href="<?php echo $global['webSiteRootURL']; ?>user" style="border-radius: 4px 4px 0 0;">
<a href="#" onclick="avideoModalIframeFull(webSiteRootURL + 'user');return false;" style="border-radius: 4px 4px 0 0;">
<span class="fa fa-user-circle"></span>
<?php echo __("My Account"); ?>
<?php echo __("My Account"); ?>
</a>
</li>
@ -707,19 +707,20 @@ if (!User::isLogged() && !empty($advancedCustomUser->userMustBeLoggedIn) && !emp
if (User::canUpload(true)) {
?>
<li>
<a href="<?php echo $global['webSiteRootURL']; ?>mvideos">
<a href="#" onclick="avideoModalIframeFull(webSiteRootURL + 'mvideos');return false;">
<span class="glyphicon glyphicon-film"></span>
<span class="glyphicon glyphicon-headphones"></span>
<?php echo __("My videos"); ?>
<?php echo __("My videos"); ?>
</a>
</li>
<?php
}
?>
<li>
<a href="<?php echo User::getChannelLink(); ?>" >
<a href="#" onclick="avideoModalIframeFull('<?php echo User::getChannelLink(); ?>');
return false;" >
<span class="fas fa-play-circle"></span>
<?php echo __($advancedCustomUser->MyChannelLabel); ?>
<?php echo __($advancedCustomUser->MyChannelLabel); ?>
</a>
</li>
<?php
@ -728,18 +729,18 @@ if (!User::isLogged() && !empty($advancedCustomUser->userMustBeLoggedIn) && !emp
if ((($config->getAuthCanViewChart() == 0) && (User::canUpload())) || (($config->getAuthCanViewChart() == 1) && (User::canViewChart()))) {
?>
<li>
<a href="<?php echo $global['webSiteRootURL']; ?>charts">
<a href="#" onclick="avideoModalIframeFull(webSiteRootURL+'charts');return false;">
<span class="fas fa-tachometer-alt"></span>
<?php echo __("Dashboard"); ?>
<?php echo __("Dashboard"); ?>
</a>
</li>
<?php
} if (User::canUpload()) {
?>
<li>
<a href="<?php echo $global['webSiteRootURL']; ?>subscribes">
<a href="#" onclick="avideoModalIframeFull(webSiteRootURL+'subscribes');return false;">
<span class="fa fa-check"></span>
<?php echo __("My Subscribers"); ?>
<?php echo __("My Subscribers"); ?>
</a>
</li>
<?php
@ -747,9 +748,9 @@ if (!User::isLogged() && !empty($advancedCustomUser->userMustBeLoggedIn) && !emp
?>
<li>
<a href="<?php echo $global['webSiteRootURL']; ?>categories">
<a href="#" onclick="avideoModalIframeFull(webSiteRootURL+'categories');return false;">
<span class="glyphicon glyphicon-list"></span>
<?php echo __($advancedCustom->CategoryLabel); ?>
<?php echo __($advancedCustom->CategoryLabel); ?>
</a>
</li>
@ -757,9 +758,9 @@ if (!User::isLogged() && !empty($advancedCustomUser->userMustBeLoggedIn) && !emp
}
?>
<li>
<a href="<?php echo $global['webSiteRootURL']; ?>comments">
<a href="#" onclick="avideoModalIframeFull(webSiteRootURL+'comments');return false;">
<span class="fa fa-comment"></span>
<?php echo __("Comments"); ?>
<?php echo __("Comments"); ?>
</a>
</li>
<?php
@ -770,7 +771,7 @@ if (!User::isLogged() && !empty($advancedCustomUser->userMustBeLoggedIn) && !emp
<?php
} else {
?>
<a class="btn btn-default navbar-btn " href="<?php echo $global['webSiteRootURL']; ?>user" id="rightLoginButton" style="min-height:34px; padding: 6px 12px; border-width: 1px;">
<a class="btn btn-default navbar-btn " href="<?php echo $global['webSiteRootURL']; ?>user" id="rightLoginButton" style="min-height:34px; padding: 6px 12px; border-width: 1px;">
<i class="fas fa-sign-in-alt"></i>
</a>
<?php
@ -817,18 +818,18 @@ if (!User::isLogged() && !empty($advancedCustomUser->userMustBeLoggedIn) && !emp
?>
<li>
<div>
<a href="<?php echo $global['webSiteRootURL']; ?>epg" class="btn btn-primary btn-block " style="border-radius: 0 0 0 0;">
<a href="#" onclick="avideoModalIframeFull(webSiteRootURL+'epg');return false;" class="btn btn-primary btn-block " style="border-radius: 0 0 0 0;">
<i class="fas fa-stream"></i>
<?php echo __("EPG"); ?>
<?php echo __("EPG"); ?>
</a>
</div>
</li>
<li>
<div>
<a href="<?php echo $global['webSiteRootURL']; ?>tv" class="btn btn-primary btn-block " style="border-radius: 0 0 0 0;">
<a href="#" onclick="avideoModalIframeFull(webSiteRootURL+'tv');return false;" class="btn btn-primary btn-block " style="border-radius: 0 0 0 0;">
<i class="fas fa-tv"></i>
<?php echo __("TV"); ?>
<?php echo __("TV"); ?>
</a>
</div>
@ -842,7 +843,7 @@ if (!User::isLogged() && !empty($advancedCustomUser->userMustBeLoggedIn) && !emp
<div>
<a href="<?php echo $global['webSiteRootURL']; ?>trending" class="btn btn-primary btn-block " style="border-radius: 0 0 4px 4px;">
<i class="fas fa-fire"></i>
<?php echo __("Trending"); ?>
<?php echo __("Trending"); ?>
</a>
</div>
@ -908,7 +909,8 @@ if (!User::isLogged() && !empty($advancedCustomUser->userMustBeLoggedIn) && !emp
?>
<li>
<div>
<a href="<?php echo $global['webSiteRootURL']; ?>mvideos" class="btn btn-success btn-block" style="border-radius: 0;">
<a href="#" onclick="avideoModalIframeFull(webSiteRootURL + 'mvideos');
return false;" class="btn btn-success btn-block" style="border-radius: 0;">
<span class="glyphicon glyphicon-film"></span>
<span class="glyphicon glyphicon-headphones"></span>
<?php echo __("My videos"); ?>
@ -921,9 +923,10 @@ if (!User::isLogged() && !empty($advancedCustomUser->userMustBeLoggedIn) && !emp
<li>
<div>
<a href="<?php echo User::getChannelLink(); ?>" class="btn btn-danger btn-block" style="border-radius: 0;">
<a href="#" onclick="avideoModalIframeFull('<?php echo User::getChannelLink(); ?>');
return false;" class="btn btn-danger btn-block" style="border-radius: 0;">
<span class="fas fa-play-circle"></span>
<?php echo __($advancedCustomUser->MyChannelLabel); ?>
<?php echo __($advancedCustomUser->MyChannelLabel); ?>
</a>
</div>
@ -935,9 +938,10 @@ if (!User::isLogged() && !empty($advancedCustomUser->userMustBeLoggedIn) && !emp
?>
<li>
<div>
<a href="<?php echo $global['webSiteRootURL']; ?>charts" class="btn btn-default btn-block" style="border-radius: 0;">
<a href="#" onclick="avideoModalIframeFull(webSiteRootURL + 'charts');
return false;" class="btn btn-default btn-block" style="border-radius: 0;">
<span class="fas fa-tachometer-alt"></span>
<?php echo __("Dashboard"); ?>
<?php echo __("Dashboard"); ?>
</a>
</div>
</li>
@ -946,9 +950,10 @@ if (!User::isLogged() && !empty($advancedCustomUser->userMustBeLoggedIn) && !emp
?>
<li>
<div>
<a href="<?php echo $global['webSiteRootURL']; ?>subscribes" class="btn btn-default btn-block" style="border-radius: 0">
<a href="#" onclick="avideoModalIframeFull(webSiteRootURL + 'subscribes');
return false;" class="btn btn-default btn-block" style="border-radius: 0">
<span class="fa fa-check"></span>
<?php echo __("My Subscribers"); ?>
<?php echo __("My Subscribers"); ?>
</a>
</div>
</li>
@ -958,9 +963,10 @@ if (!User::isLogged() && !empty($advancedCustomUser->userMustBeLoggedIn) && !emp
<li>
<div>
<a href="<?php echo $global['webSiteRootURL']; ?>categories" class="btn btn-default btn-block" style="border-radius: 0;">
<a href="#" onclick="avideoModalIframeFull(webSiteRootURL + 'categories');
return false;" class="btn btn-default btn-block" style="border-radius: 0;">
<span class="glyphicon glyphicon-list"></span>
<?php echo __($advancedCustom->CategoryLabel); ?>
<?php echo __($advancedCustom->CategoryLabel); ?>
</a>
</div>
</li>
@ -969,9 +975,10 @@ if (!User::isLogged() && !empty($advancedCustomUser->userMustBeLoggedIn) && !emp
?>
<li>
<div>
<a href="<?php echo $global['webSiteRootURL']; ?>comments" class="btn btn-default btn-block" style="border-radius: 0 0 4px 4px;">
<a href="#" onclick="avideoModalIframeFull(webSiteRootURL + 'comments');
return false;" class="btn btn-default btn-block" style="border-radius: 0 0 4px 4px;">
<span class="fa fa-comment"></span>
<?php echo __("Comments"); ?>
<?php echo __("Comments"); ?>
</a>
</div>
</li>
@ -988,7 +995,7 @@ if (!User::isLogged() && !empty($advancedCustomUser->userMustBeLoggedIn) && !emp
<div>
<a href="<?php echo $global['webSiteRootURL']; ?>user" class="btn btn-success btn-block">
<i class="fas fa-sign-in-alt"></i>
<?php echo __("Sign In"); ?>
<?php echo __("Sign In"); ?>
</a>
</div>
</li>
@ -1004,58 +1011,65 @@ if (!User::isLogged() && !empty($advancedCustomUser->userMustBeLoggedIn) && !emp
<h2 class="text-danger"><?php echo __("Admin Menu"); ?></h2>
<ul class="nav navbar" style="margin-bottom: 10px;">
<li>
<a href="<?php echo $global['webSiteRootURL']; ?>admin/">
<a href="#" onclick="avideoModalIframeFull(webSiteRootURL + 'admin/');
return false;">
<i class="fas fa-star"></i>
<?php echo __("Admin Panel"); ?>
<?php echo __("Admin Panel"); ?>
</a>
</li>
<li>
<a href="<?php echo $global['webSiteRootURL']; ?>users">
<a href="#" onclick="avideoModalIframeFull(webSiteRootURL + 'users');
return false;">
<span class="glyphicon glyphicon-user"></span>
<?php echo __("Users"); ?>
<?php echo __("Users"); ?>
</a>
</li>
<li>
<a href="<?php echo $global['webSiteRootURL']; ?>usersGroups">
<a href="#" onclick="avideoModalIframeFull(webSiteRootURL + 'usersGroups');
return false;">
<span class="fa fa-users"></span>
<?php echo __("Users Groups"); ?>
<?php echo __("Users Groups"); ?>
</a>
</li>
<li>
<a href="<?php echo $global['webSiteRootURL']; ?>categories">
<a href="#" onclick="avideoModalIframeFull(webSiteRootURL + 'categories');
return false;">
<span class="glyphicon glyphicon-list"></span>
<?php echo __($advancedCustom->CategoryLabel); ?>
<?php echo __($advancedCustom->CategoryLabel); ?>
</a>
</li>
<li>
<a href="<?php echo $global['webSiteRootURL']; ?>update">
<a href="#" onclick="avideoModalIframeFull(webSiteRootURL + 'update');
return false;">
<span class="glyphicon glyphicon-refresh"></span>
<?php echo __("Update version"); ?>
<?php
if (!empty($updateFiles)) {
?><span class="label label-danger"><?php echo count($updateFiles); ?></span><?php
}
?>
}
?>
</a>
</li>
<li>
<a href="<?php echo $global['webSiteRootURL']; ?>siteConfigurations">
<a href="#" onclick="avideoModalIframeFull(webSiteRootURL + 'siteConfigurations');
return false;">
<span class="glyphicon glyphicon-cog"></span>
<?php echo __("Site Configurations"); ?>
<?php echo __("Site Configurations"); ?>
</a>
</li>
<!--
<li>
<a href="<?php echo $global['webSiteRootURL']; ?>locale">
<a href="#" onclick="avideoModalIframeFull(webSiteRootURL+'locale');return false;">
<span class="glyphicon glyphicon-flag"></span>
<?php echo __("Create more translations"); ?>
<?php echo __("Create more translations"); ?>
</a>
</li>
-->
<li>
<a href="<?php echo $global['webSiteRootURL']; ?>plugins">
<a href="#" onclick="avideoModalIframeFull(webSiteRootURL + 'plugins');
return false;">
<i class="fas fa-puzzle-piece"></i>
<?php echo __("Plugins"); ?>
<?php echo __("Plugins"); ?>
</a>
</li>
<li>
@ -1069,7 +1083,8 @@ if (!User::isLogged() && !empty($advancedCustomUser->userMustBeLoggedIn) && !emp
</a>
</li>
<li>
<a href="<?php echo $global['webSiteRootURL']; ?>i/log" class="">
<a href="#" onclick="avideoModalIframeFull(webSiteRootURL + 'i/log');
return false;" class="">
<i class="fas fa-clipboard-list"></i> <?php echo __("Log file"); ?>
</a>
</li>
@ -1087,7 +1102,7 @@ if (!User::isLogged() && !empty($advancedCustomUser->userMustBeLoggedIn) && !emp
$menus[] = '
?>
<li>
<a href="<?php echo $global[\'webSiteRootURL\']; ?>users">
<a href="#" onclick="avideoModalIframeFull(webSiteRootURL+\'users\');return false;">
<span class="glyphicon glyphicon-user"></span>
<?php echo __("Users"); ?>
</a>
@ -1098,7 +1113,7 @@ if (!User::isLogged() && !empty($advancedCustomUser->userMustBeLoggedIn) && !emp
if (Permissions::canAdminUserGroups()) {
$menus[] = '?>
<li>
<a href="<?php echo $global[\'webSiteRootURL\']; ?>usersGroups">
<a href="#" onclick="avideoModalIframeFull(webSiteRootURL+\'usersGroups\');return false;">
<span class="fa fa-users"></span>
<?php echo __("Users Groups"); ?>
</a>
@ -1124,7 +1139,7 @@ if (!User::isLogged() && !empty($advancedCustomUser->userMustBeLoggedIn) && !emp
if (Permissions::canSeeLogs()) {
$menus[] = ' ?>
<li>
<a href="<?php echo $global[\'webSiteRootURL\']; ?>i/log" class="">
<a href="#" onclick="avideoModalIframeFull(webSiteRootURL+\'i/log\');return false;" class="">
<i class="fas fa-clipboard-list"></i> <?php echo __("Log file"); ?>
</a>
</li>
@ -1169,19 +1184,19 @@ if (!User::isLogged() && !empty($advancedCustomUser->userMustBeLoggedIn) && !emp
<li class="nav-item <?php echo empty($_SESSION['type']) ? "active" : ""; ?>">
<a class="nav-link " href="<?php echo $global['webSiteRootURL']; ?>?type=all">
<span class="glyphicon glyphicon-star"></span>
<?php echo __("Audio and Video"); ?>
<?php echo __("Audio and Video"); ?>
</a>
</li>
<li class="nav-item <?php echo (!empty($_SESSION['type']) && $_SESSION['type'] == 'video' && empty($_GET['catName'])) ? "active" : ""; ?>">
<a class="nav-link " href="<?php echo $global['webSiteRootURL']; ?>videoOnly">
<span class="glyphicon glyphicon-facetime-video"></span>
<?php echo __("Videos"); ?>
<?php echo __("Videos"); ?>
</a>
</li>
<li class="nav-item <?php echo (!empty($_SESSION['type']) && $_SESSION['type'] == 'audio' && empty($_GET['catName'])) ? "active" : ""; ?>">
<a class="nav-link" href="<?php echo $global['webSiteRootURL']; ?>audioOnly">
<span class="glyphicon glyphicon-headphones"></span>
<?php echo __("Audio"); ?>
<?php echo __("Audio"); ?>
</a>
</li>
<?php
@ -1199,9 +1214,9 @@ if (!User::isLogged() && !empty($advancedCustomUser->userMustBeLoggedIn) && !emp
<h3 class="text-danger"><?php echo __("Channels"); ?></h3>
</li>
<li>
<a href="<?php echo $global['webSiteRootURL']; ?>channels">
<a href="#" onclick="avideoModalIframeFull(webSiteRootURL+'channels');return false;">
<i class="fa fa-search"></i>
<?php echo __("Browse Channels"); ?>
<?php echo __("Browse Channels"); ?>
</a>
</li>
@ -1214,8 +1229,8 @@ if (!User::isLogged() && !empty($advancedCustomUser->userMustBeLoggedIn) && !emp
<!-- categories -->
<li>
<h3>
<a href="<?php echo $global['webSiteRootURL']; ?>listCategories" class="text-danger">
<?php echo __($advancedCustom->CategoryLabel); ?>
<a href="#" onclick="avideoModalIframeFull(webSiteRootURL+'listCategories');return false;" class="text-danger">
<?php echo __($advancedCustom->CategoryLabel); ?>
</a>
</h3>
</li>
@ -1304,9 +1319,9 @@ if (!User::isLogged() && !empty($advancedCustomUser->userMustBeLoggedIn) && !emp
if (empty($advancedCustom->disablePlayLink)) {
?>
<li class="nav-item">
<a class="nav-link" href="<?php echo $global['webSiteRootURL']; ?>playLink">
<a class="nav-link" href="#" onclick="avideoModalIframeFull(webSiteRootURL+'playLink');return false;">
<i class="fas fa-play-circle"></i>
<?php echo __("Play a Link"); ?>
<?php echo __("Play a Link"); ?>
</a>
</li>
<?php
@ -1314,9 +1329,9 @@ if (!User::isLogged() && !empty($advancedCustomUser->userMustBeLoggedIn) && !emp
if (empty($advancedCustom->disableHelpLeftMenu)) {
?>
<li>
<a href="<?php echo $global['webSiteRootURL']; ?>help">
<a href="#" onclick="avideoModalIframeFull(webSiteRootURL+'help');return false;">
<span class="glyphicon glyphicon-question-sign"></span>
<?php echo __("Help"); ?>
<?php echo __("Help"); ?>
</a>
</li>
<?php
@ -1325,9 +1340,9 @@ if (!User::isLogged() && !empty($advancedCustomUser->userMustBeLoggedIn) && !emp
if (empty($advancedCustom->disableAboutLeftMenu)) {
?>
<li>
<a href="<?php echo $global['webSiteRootURL']; ?>about">
<a href="#" onclick="avideoModalIframeFull(webSiteRootURL+'about');return false;">
<span class="glyphicon glyphicon-info-sign"></span>
<?php echo __("About"); ?>
<?php echo __("About"); ?>
</a>
</li>
<?php
@ -1336,9 +1351,9 @@ if (!User::isLogged() && !empty($advancedCustomUser->userMustBeLoggedIn) && !emp
if (empty($advancedCustom->disableContactLeftMenu)) {
?>
<li>
<a href="<?php echo $global['webSiteRootURL']; ?>contact">
<a href="#" onclick="avideoModalIframeFull(webSiteRootURL+'contact');return false;">
<span class="glyphicon glyphicon-comment"></span>
<?php echo __("Contact"); ?>
<?php echo __("Contact"); ?>
</a>
</li>
<?php

View file

@ -1,71 +1,71 @@
<?php
if (empty($advancedCustom->openEncoderInIFrame) || !isSameDomainAsMyAVideo($config->getEncoderURL())) {
if (!empty($advancedCustom->encoderNetwork) && empty($advancedCustom->doNotShowEncoderNetwork)) {
?>
<li>
<form id="formEncoderN" method="post" action="<?php echo $advancedCustom->encoderNetwork; ?>" target="encoder" autocomplete="off">
<input type="hidden" name="webSiteRootURL" value="<?php echo $global['webSiteRootURL']; ?>" autocomplete="off" />
<input type="hidden" name="user" value="<?php echo User::getUserName(); ?>" autocomplete="off" />
<input type="hidden" name="pass" value="<?php echo User::getUserPass(); ?>" autocomplete="off" />
</form>
<a href="#" onclick="$('#formEncoderN').submit();
return false;" data-toggle="tooltip" title="<?php echo __("Choose one of our encoders to upload a file or download it from the Internet"); ?>" data-placement="left" >
<span class="fa fa-cogs"></span> <?php echo empty($advancedCustom->encoderNetworkLabel) ? __("Encoder Network") : __($advancedCustom->encoderNetworkLabel); ?>
</a>
</li>
<?php
}
if (empty($advancedCustom->doNotShowEncoderButton)) {
if (!empty($config->getEncoderURL())) {
?>
<li>
<form id="formEncoder" method="post" action="<?php echo $config->getEncoderURL(); ?>" target="encoder" autocomplete="off" >
<input type="hidden" name="webSiteRootURL" value="<?php echo $global['webSiteRootURL']; ?>" autocomplete="off" />
<input type="hidden" name="user" value="<?php echo User::getUserName(); ?>" autocomplete="off" />
<input type="hidden" name="pass" value="<?php echo User::getUserPass(); ?>" autocomplete="off" />
</form>
<a href="#" onclick="$('#formEncoder').submit();
return false;" data-toggle="tooltip" title="<?php echo __("Upload a file or download it from the Internet"); ?>" data-placement="left"
class="faa-parent animated-hover" >
<span class="fas fa-cog faa-spin"></span> <?php echo empty($advancedCustom->encoderButtonLabel) ? __("Encode video and audio") : __($advancedCustom->encoderButtonLabel); ?>
</a>
</li>
<?php
} else {
?>
<li>
<a href="<?php echo $global['webSiteRootURL']; ?>siteConfigurations" ><span class="fa fa-cogs"></span> <?php echo __("Configure an Encoder URL"); ?></a>
</li>
<?php
}
}
}else{
if (!empty($advancedCustom->encoderNetwork) && empty($advancedCustom->doNotShowEncoderNetwork)) {
?>
<li>
<a href="<?php echo $global['webSiteRootURL']; ?>i/network" data-toggle="tooltip" title="<?php echo __("Choose one of our encoders to upload a file or download it from the Internet"); ?>" data-placement="left" >
<span class="fa fa-cogs"></span> <?php echo empty($advancedCustom->encoderNetworkLabel) ? __("Encoder Network") : __($advancedCustom->encoderNetworkLabel); ?>
</a>
</li>
<?php
}
if (empty($advancedCustom->doNotShowEncoderButton)) {
if (!empty($config->getEncoderURL())) {
?>
<li>
<a href="<?php echo $global['webSiteRootURL']; ?>i/upload" data-toggle="tooltip" title="<?php echo __("Upload a file or download it from the Internet"); ?>" data-placement="left" >
<span class="fa fa-cog"></span> <?php echo empty($advancedCustom->encoderButtonLabel) ? __("Encode video and audio") : __($advancedCustom->encoderButtonLabel); ?>
</a>
</li>
<?php
} else {
?>
<li>
<a href="<?php echo $global['webSiteRootURL']; ?>siteConfigurations"><span class="fa fa-cogs"></span> <?php echo __("Configure an Encoder URL"); ?></a>
</li>
<?php
}
}
}
<?php
if (empty($advancedCustom->openEncoderInIFrame) || !isSameDomainAsMyAVideo($config->getEncoderURL())) {
if (!empty($advancedCustom->encoderNetwork) && empty($advancedCustom->doNotShowEncoderNetwork)) {
?>
<li>
<form id="formEncoderN" method="post" action="<?php echo $advancedCustom->encoderNetwork; ?>" target="encoder" autocomplete="off">
<input type="hidden" name="webSiteRootURL" value="<?php echo $global['webSiteRootURL']; ?>" autocomplete="off" />
<input type="hidden" name="user" value="<?php echo User::getUserName(); ?>" autocomplete="off" />
<input type="hidden" name="pass" value="<?php echo User::getUserPass(); ?>" autocomplete="off" />
</form>
<a href="#" onclick="$('#formEncoderN').submit();
return false;" data-toggle="tooltip" title="<?php echo __("Choose one of our encoders to upload a file or download it from the Internet"); ?>" data-placement="left" >
<span class="fa fa-cogs"></span> <?php echo empty($advancedCustom->encoderNetworkLabel) ? __("Encoder Network") : __($advancedCustom->encoderNetworkLabel); ?>
</a>
</li>
<?php
}
if (empty($advancedCustom->doNotShowEncoderButton)) {
if (!empty($config->getEncoderURL())) {
?>
<li>
<form id="formEncoder" method="post" action="<?php echo $config->getEncoderURL(); ?>" target="encoder" autocomplete="off" >
<input type="hidden" name="webSiteRootURL" value="<?php echo $global['webSiteRootURL']; ?>" autocomplete="off" />
<input type="hidden" name="user" value="<?php echo User::getUserName(); ?>" autocomplete="off" />
<input type="hidden" name="pass" value="<?php echo User::getUserPass(); ?>" autocomplete="off" />
</form>
<a href="#" onclick="$('#formEncoder').submit();
return false;" data-toggle="tooltip" title="<?php echo __("Upload a file or download it from the Internet"); ?>" data-placement="left"
class="faa-parent animated-hover" >
<span class="fas fa-cog faa-spin"></span> <?php echo empty($advancedCustom->encoderButtonLabel) ? __("Encode video and audio") : __($advancedCustom->encoderButtonLabel); ?>
</a>
</li>
<?php
} else {
?>
<li>
<a href="#" onclick="avideoModalIframeFull(webSiteRootURL+'siteConfigurations');return false;" ><span class="fa fa-cogs"></span> <?php echo __("Configure an Encoder URL"); ?></a>
</li>
<?php
}
}
}else{
if (!empty($advancedCustom->encoderNetwork) && empty($advancedCustom->doNotShowEncoderNetwork)) {
?>
<li>
<a href="#" onclick="avideoModalIframeFull(webSiteRootURL+'i/network');return false;" data-toggle="tooltip" title="<?php echo __("Choose one of our encoders to upload a file or download it from the Internet"); ?>" data-placement="left" >
<span class="fa fa-cogs"></span> <?php echo empty($advancedCustom->encoderNetworkLabel) ? __("Encoder Network") : __($advancedCustom->encoderNetworkLabel); ?>
</a>
</li>
<?php
}
if (empty($advancedCustom->doNotShowEncoderButton)) {
if (!empty($config->getEncoderURL())) {
?>
<li>
<a href="#" onclick="avideoModalIframeFull(webSiteRootURL+'i/upload');return false;" data-toggle="tooltip" title="<?php echo __("Upload a file or download it from the Internet"); ?>" data-placement="left" >
<span class="fa fa-cog"></span> <?php echo empty($advancedCustom->encoderButtonLabel) ? __("Encode video and audio") : __($advancedCustom->encoderButtonLabel); ?>
</a>
</li>
<?php
} else {
?>
<li>
<a href="#" onclick="avideoModalIframeFull(webSiteRootURL+'siteConfigurations');return false;"><span class="fa fa-cogs"></span> <?php echo __("Configure an Encoder URL"); ?></a>
</li>
<?php
}
}
}
?>

View file

@ -1259,9 +1259,22 @@ function avideoModalIframeLarge(url) {
avideoModalIframeWithClassName(url, 'swal-modal-iframe-large');
}
var avideoModalIframeFullScreenOriginalURL = false;
function avideoModalIframeFullScreen(url) {
if(!avideoModalIframeFullScreenOriginalURL){
avideoModalIframeFullScreenOriginalURL = document.location.href;
}
window.history.pushState("", "", url);
avideoModalIframeWithClassName(url, 'swal-modal-iframe-full');
}
function avideoModalIframeFullScreenClose() {
$('.swal-overlay iframe').attr('src', 'about:blank');
swal.close();
window.history.pushState("", "", avideoModalIframeFullScreenOriginalURL);
avideoModalIframeFullScreenOriginalURL = false;
}
function avideoModalIframeFull(url) {
avideoModalIframeFullScreen(url);
}
@ -1270,10 +1283,10 @@ function avideoModalIframeWithClassName(url, className) {
url = addGetParam(url, 'avideoIframe', 1);
var html = '';
html = '<div id="avideoModalIframeDiv" class="clearfix">';
html += '<button class="btn btn-default pull-left" onclick="swal.close();">';
html += '<button class="btn btn-default pull-left" onclick="avideoModalIframeFullScreenClose();">';
html += '<i class="fas fa-chevron-left"></i>';
html += '</button></div>';
html += '<iframe frameBorder="0" src="' + url + '" allow="camera *;microphone *" ></iframe>';
html += '</button><img src="'+webSiteRootURL +'videos/userPhoto/logo.png" class="img img-responsive " style="max-height:34px;"></div>';
html += '<iframe frameBorder="0" class="animate__animated animate__bounceInDown" src="' + url + '" allow="camera *;microphone *" ></iframe>';
var span = document.createElement("span");
span.innerHTML = html;
swal({

View file

@ -660,7 +660,7 @@
return false;
}
}).autocomplete("instance")._renderItem = function (ul, item) {
return $("<li>").append("<div>" + item.name + "<br>" + item.email + "<br>" + item.user + "</div>").appendTo(ul);
return $("<li>").append("<div>" + item.creator + item.email + "</div>").appendTo(ul);
};
});
</script>

View file

@ -13,6 +13,8 @@ if (!empty($_GET['evideo'])) {
$v = Video::decodeEvideo();
$evideo = $v['evideo'];
}
TimeLogEnd($timeLogNameMY, __LINE__, $TimeLogLimitMY);
$playlist_index = 0;
if (!empty($evideo)) {
$video = $v['video'];
@ -25,6 +27,7 @@ if (!empty($evideo)) {
$autoPlayPoster = '';
$autoPlayThumbsSprit = '';
} else {
TimeLogEnd($timeLogNameMY, __LINE__, $TimeLogLimitMY);
require_once $global['systemRootPath'] . 'objects/user.php';
require_once $global['systemRootPath'] . 'objects/category.php';
require_once $global['systemRootPath'] . 'objects/subscribe.php';
@ -53,6 +56,7 @@ if (!empty($evideo)) {
}
session_write_close();
TimeLogEnd($timeLogNameMY, __LINE__, $TimeLogLimitMY);
if (!empty($_GET['playlist_id'])) {
$isSerie = 1;
if (preg_match("/^[0-9]+$/", $_GET['playlist_id'])) {
@ -120,6 +124,7 @@ if (!empty($evideo)) {
$catLink = "cat/{$_GET['catName']}/";
}
TimeLogEnd($timeLogNameMY, __LINE__, $TimeLogLimitMY);
// add this because if you change the video category the video was not loading anymore
$catName = @$_GET['catName'];
@ -143,6 +148,7 @@ if (!empty($evideo)) {
$video = AVideoPlugin::getVideo();
}
TimeLogEnd($timeLogNameMY, __LINE__, $TimeLogLimitMY);
if (!empty($_GET['v']) && (empty($video) || $video['id'] != $_GET['v'])) {
$video = false;
}
@ -176,6 +182,7 @@ if (!empty($evideo)) {
//}
}
TimeLogEnd($timeLogNameMY, __LINE__, $TimeLogLimitMY);
$modeYouTubeTimeLog['Code part 1.6'] = microtime(true) - $modeYouTubeTime;
$modeYouTubeTime = microtime(true);
if (!empty($autoPlayVideo)) {
@ -183,6 +190,7 @@ if (!empty($evideo)) {
$autoPlayVideo['tags'] = Video::getTags($autoPlayVideo['id'], '<br /><small>' . humanTiming(strtotime($autoPlayVideo['videoCreation'])) . '</small>');
$autoPlayVideo['url'] = Video::getLink($autoPlayVideo['id'], $autoPlayVideo['clean_title'], false, $get);
}
TimeLogEnd($timeLogNameMY, __LINE__, $TimeLogLimitMY);
}
$modeYouTubeTimeLog['Code part 2'] = microtime(true) - $modeYouTubeTime;
$modeYouTubeTime = microtime(true);
@ -195,6 +203,7 @@ if (!empty($evideo)) {
$obj = new Video("", "", $video['id']);
}
TimeLogEnd($timeLogNameMY, __LINE__, $TimeLogLimitMY);
if (!empty($video) && $video['type'] == "video") {
$poster = "{$global['webSiteRootURL']}videos/{$video['filename']}.jpg";
} else {
@ -232,6 +241,7 @@ if (!empty($evideo)) {
} else {
$poster = "" . getCDN() . "view/img/notfound.jpg";
}
TimeLogEnd($timeLogNameMY, __LINE__, $TimeLogLimitMY);
$objSecure = AVideoPlugin::getObjectDataIfEnabled('SecureVideosDirectory');
$modeYouTubeTimeLog['Code part 3'] = microtime(true) - $modeYouTubeTime;
$modeYouTubeTime = microtime(true);
@ -246,6 +256,7 @@ if (!empty($evideo)) {
$autoPlayPoster = '';
$autoPlayThumbsSprit = "";
}
TimeLogEnd($timeLogNameMY, __LINE__, $TimeLogLimitMY);
if (empty($_GET['videoName']) && !empty($video)) {
$_GET['videoName'] = $video['clean_title'];
@ -262,6 +273,7 @@ if (!empty($evideo)) {
$modeYouTubeTimeLog['Code part 5'] = microtime(true) - $modeYouTubeTime;
$modeYouTubeTime = microtime(true);
}
TimeLogEnd($timeLogNameMY, __LINE__, $TimeLogLimitMY);
}
@ -291,8 +303,10 @@ TimeLogEnd($timeLogNameMY, __LINE__, $TimeLogLimitMY);
<link href="<?php echo getURL('node_modules/video.js/dist/video-js.min.css'); ?>" rel="stylesheet" type="text/css"/>
<link href="<?php echo getCDN(); ?>plugin/Gallery/style.css" rel="stylesheet" type="text/css"/>
<?php
TimeLogEnd($timeLogNameMY, __LINE__, $TimeLogLimitMY);
include $global['systemRootPath'] . 'view/include/head.php';
TimeLogEnd($timeLogNameMY, __LINE__, $TimeLogLimitMY);
if (!empty($_GET['v'])) {
getOpenGraph($_GET['v']);
getLdJson($_GET['v']);
@ -300,6 +314,7 @@ TimeLogEnd($timeLogNameMY, __LINE__, $TimeLogLimitMY);
getOpenGraph(0);
getLdJson(0);
}
TimeLogEnd($timeLogNameMY, __LINE__, $TimeLogLimitMY);
?>
</head>

View file

@ -1,12 +1,17 @@
<?php
$TimeLogLimitMYBR = 0.01;
$timeLogNameMYBR = TimeLogStart("modeYoutubeBottomRight.php");
if (!empty($video['users_id']) && User::hasBlockedUser($video['users_id'])) {
return false;
}
TimeLogEnd($timeLogNameMYBR, __LINE__, $TimeLogLimitMYBR);
?>
<div class="col-lg-12 col-sm-12 col-xs-12 text-center">
<?php echo getAdsSideRectangle(); ?>
</div>
<?php
TimeLogEnd($timeLogNameMYBR, __LINE__, $TimeLogLimitMYBR);
if (!empty($playlist_id)) {
include $global['systemRootPath'] . 'view/include/playlist.php';
?>
@ -48,12 +53,13 @@ if (!empty($playlist_id)) {
</div>
<?php
$style = 'margin: 10px 0; padding: 15px 5px;';
if(!PlayerSkins::isAutoplayEnabled()){
if (!PlayerSkins::isAutoplayEnabled()) {
$style .= 'display: none;';
}
echo Video::getVideosListItem($autoPlayVideo['id'], 'autoPlayVideoDiv', $style);
}
TimeLogEnd($timeLogNameMYBR, __LINE__, $TimeLogLimitMYBR);
$modeYouTubeTimeLog['After autoplay and playlist '] = microtime(true) - $modeYouTubeTime;
$modeYouTubeTime = microtime(true);
@ -65,9 +71,11 @@ $modeYouTubeTime = microtime(true);
<!--googleoff: all-->
<div id="videosList">
<?php
TimeLogEnd($timeLogNameMYBR, __LINE__, $TimeLogLimitMYBR);
if (empty($playlist_id)) {
include $global['systemRootPath'] . 'view/videosList.php';
}
TimeLogEnd($timeLogNameMYBR, __LINE__, $TimeLogLimitMYBR);
?>
</div>
<!--googleon: all-->

View file

@ -1,4 +1,6 @@
<?php
$TimeLogLimitMYB = 0.05;
$timeLogNameMYB = TimeLogStart("modeYoutubeBundle.php");
$isCompressed = AVideoPlugin::loadPluginIfEnabled('TheaterButton') && TheaterButton::isCompressed();
if (!$isCompressed) {
@ -12,82 +14,92 @@ if (!$isCompressed) {
</div>
<?php
}
if(!empty($video['id'])){
?>
<div class="row" id="modeYoutubeBottom" style="margin: 0;">
<div class="col-lg-1"></div>
<div class="col-sm-7 col-md-7 col-lg-6" id="modeYoutubeBottomContent">
<?php
if ($isCompressed) {
?>
<div class="" id="modeYoutubeTop" >
<?php
require "{$global['systemRootPath']}view/modeYoutubeTop.php";
$modeYouTubeTimeLog['After include top '] = microtime(true) - $modeYouTubeTime;
$modeYouTubeTime = microtime(true);
?>
</div>
<?php
}
?>
<?php
require "{$global['systemRootPath']}view/modeYoutubeBottom.php";
$modeYouTubeTimeLog['After include bottom '] = microtime(true) - $modeYouTubeTime;
$modeYouTubeTime = microtime(true);
?>
</div>
<div class="col-sm-5 col-md-5 col-lg-4 rightBar clearfix" id="yptRightBar" >
<div class="list-group-item clearfix">
<?php
require "{$global['systemRootPath']}view/modeYoutubeBottomRight.php";
$modeYouTubeTimeLog['After include bottom right '] = microtime(true) - $modeYouTubeTime;
$modeYouTubeTime = microtime(true);
?>
</div>
</div>
<div class="col-lg-1"></div>
</div>
<?php
}else{
require_once $global['systemRootPath'] . 'plugin/Gallery/functions.php';
TimeLogEnd($timeLogNameMYB, __LINE__, $TimeLogLimitMYB);
if (!empty($video['id'])) {
TimeLogEnd($timeLogNameMYB, __LINE__, $TimeLogLimitMYB);
?>
<div class="row" id="modeYoutubeBottom" style="margin: 0;">
<div class="col-lg-1"></div>
<div class="col-sm-7 col-md-7 col-lg-6" id="modeYoutubeBottomContent">
<?php
if ($isCompressed) {
<div class="row" id="modeYoutubeBottom" style="margin: 0;">
<div class="col-lg-1"></div>
<div class="col-sm-7 col-md-7 col-lg-6" id="modeYoutubeBottomContent">
<?php
if ($isCompressed) {
?>
<div class="" id="modeYoutubeTop" >
<?php
require "{$global['systemRootPath']}view/modeYoutubeTop.php";
$modeYouTubeTimeLog['After include top '] = microtime(true) - $modeYouTubeTime;
$modeYouTubeTime = microtime(true);
?>
</div>
<?php
}
?>
<div class="" id="modeYoutubeTop" >
<?php
require "{$global['systemRootPath']}view/modeYoutubeTop.php";
$modeYouTubeTimeLog['After include top '] = microtime(true) - $modeYouTubeTime;
$modeYouTubeTime = microtime(true);
?>
</div>
<?php
}
?>
<div class="panel panel-default">
<div class="panel-body">
<?php
getTrendingVideos(48, 3, 3, 3, 1);
$modeYouTubeTimeLog['After include bottom '] = microtime(true) - $modeYouTubeTime;
$modeYouTubeTime = microtime(true);
?>
</div>
</div>
</div>
<div class="col-sm-5 col-md-5 col-lg-4 rightBar clearfix" id="yptRightBar" >
<div class="list-group-item clearfix">
<?php
require "{$global['systemRootPath']}view/modeYoutubeBottomRight.php";
$modeYouTubeTimeLog['After include bottom right '] = microtime(true) - $modeYouTubeTime;
TimeLogEnd($timeLogNameMYB, __LINE__, $TimeLogLimitMYB);
require "{$global['systemRootPath']}view/modeYoutubeBottom.php";
$modeYouTubeTimeLog['After include bottom '] = microtime(true) - $modeYouTubeTime;
$modeYouTubeTime = microtime(true);
TimeLogEnd($timeLogNameMYB, __LINE__, $TimeLogLimitMYB);
?>
</div>
</div>
<div class="col-lg-1"></div>
</div>
<?php
<div class="col-sm-5 col-md-5 col-lg-4 rightBar clearfix" id="yptRightBar" >
<div class="list-group-item clearfix">
<?php
TimeLogEnd($timeLogNameMYB, __LINE__, $TimeLogLimitMYB);
require "{$global['systemRootPath']}view/modeYoutubeBottomRight.php";
$modeYouTubeTimeLog['After include bottom right '] = microtime(true) - $modeYouTubeTime;
$modeYouTubeTime = microtime(true);
TimeLogEnd($timeLogNameMYB, __LINE__, $TimeLogLimitMYB);
?>
</div>
</div>
<div class="col-lg-1"></div>
</div>
<?php
} else {
TimeLogEnd($timeLogNameMYB, __LINE__, $TimeLogLimitMYB);
require_once $global['systemRootPath'] . 'plugin/Gallery/functions.php';
?>
<div class="row" id="modeYoutubeBottom" style="margin: 0;">
<div class="col-lg-1"></div>
<div class="col-sm-7 col-md-7 col-lg-6" id="modeYoutubeBottomContent">
<?php
if ($isCompressed) {
?>
<div class="" id="modeYoutubeTop" >
<?php
require "{$global['systemRootPath']}view/modeYoutubeTop.php";
$modeYouTubeTimeLog['After include top '] = microtime(true) - $modeYouTubeTime;
$modeYouTubeTime = microtime(true);
?>
</div>
<?php
}
?>
<div class="panel panel-default">
<div class="panel-body">
<?php
getTrendingVideos(48, 3, 3, 3, 1);
$modeYouTubeTimeLog['After include bottom '] = microtime(true) - $modeYouTubeTime;
$modeYouTubeTime = microtime(true);
?>
</div>
</div>
</div>
<div class="col-sm-5 col-md-5 col-lg-4 rightBar clearfix" id="yptRightBar" >
<div class="list-group-item clearfix">
<?php
require "{$global['systemRootPath']}view/modeYoutubeBottomRight.php";
$modeYouTubeTimeLog['After include bottom right '] = microtime(true) - $modeYouTubeTime;
$modeYouTubeTime = microtime(true);
?>
</div>
</div>
<div class="col-lg-1"></div>
</div>
<?php
TimeLogEnd($timeLogNameMYB, __LINE__, $TimeLogLimitMYB);
}
?>

View file

@ -54,7 +54,7 @@ $metaDescription = __("Trending");
//var_dump($rows);
foreach ($videos as $key => $value) {
?>
<div class="col-lg-12 searchResult thumbsImage mb-2" style="overflow: hidden;">
<div class="col-lg-12 searchResult thumbsImage mb-2 <?php echo getCSSAnimationClassAndStyle('animate__fadeInUp', 'trending', 0.2); ?> overflow: hidden;">
<a class="galleryLink col-sm-4 col-md-4 col-lg-4" videos_id="<?php echo $value['id']; ?>" href="<?php echo Video::getLink($value['id'], $value['clean_title']); ?>" title="<?php echo $value['title']; ?>">
<?php
$images = Video::getImageFromFilename($value['filename'], $value['type']);

View file

@ -0,0 +1,38 @@
<?php
require_once '../videos/configuration.php';
header('Content-Type: application/json');
if (!empty($_REQUEST['hash'])) {
$string = decryptString($_REQUEST['hash']);
$obj = json_decode($string);
$videos_id = intval($obj->videos_id);
} else {
$videos_id = intval(@$_REQUEST['videos_id']);
if (!Video::canEdit($videos_id)) {
forbiddenPage("You cannot see this info");
}
}
if (empty($videos_id)) {
forbiddenPage("Videos ID is required");
}
$rowsCount = getRowCount();
$video = new Video('', '', $videos_id);
$filename = "{$videos_id}_".$video->getClean_title();
$rows = VideoStatistic::getAllFromVideos_id($videos_id);
//var_dump($rows);exit;
$output = fopen("php://output", 'w') or die("Can't open php://output");
$fields = array('when', 'ip', 'users', 'location_name', 'seconds_watching_video');
fputcsv($output, $fields);
foreach ($rows as $row) {
$statistic = array();
foreach ($fields as $value) {
$statistic[$value] = $row[$value];
}
//var_dump($statistic);exit;
fputcsv($output, $statistic);
}
header("Content-Type:application/csv");
header("Content-Disposition:attachment;filename={$filename}.csv");
fclose($output) or die("Can't close php://output");
?>

View file

@ -2,19 +2,25 @@
require_once '../videos/configuration.php';
header('Content-Type: application/json');
$videos_id = intval(@$_REQUEST['videos_id']);
if (!empty($_REQUEST['hash'])) {
$string = decryptString($_REQUEST['hash']);
$obj = json_decode($string);
$videos_id = intval($obj->videos_id);
} else {
$videos_id = intval(@$_REQUEST['videos_id']);
if (!Video::canEdit($videos_id)) {
forbiddenPage("You cannot see this info");
}
}
if (empty($videos_id)) {
forbiddenPage("Videos ID is required");
}
if (!Video::canEdit($videos_id)) {
forbiddenPage("You cannot see this info");
}
$rowsCount = getRowCount();
$rows = VideoStatistic::getAllFromVideos_id($videos_id);
$total = VideoStatistic::getTotalFromVideos_id($videos_id);
$totalPages = ceil($total / $_REQUEST['rowCount']);
$totalPages = ceil($total / $rowsCount);
?>
{"data": <?php echo json_encode($rows); ?>, "draw": <?php echo intval(@$_REQUEST['draw']); ?>, "recordsTotal":<?php echo $total; ?>, "recordsFiltered":<?php echo $total; ?>}

View file

@ -4,18 +4,20 @@ if (!isset($global['systemRootPath'])) {
require_once '../videos/configuration.php';
}
$videos_id = intval(@$_REQUEST['videos_id']);
if (!empty($_REQUEST['hash'])) {
$string = decryptString($_REQUEST['hash']);
$obj = json_decode($string);
$videos_id = intval($obj->videos_id);
} else {
$videos_id = intval(@$_REQUEST['videos_id']);
if (!Video::canEdit($videos_id)) {
forbiddenPage("You cannot see this info");
}
}
if (empty($videos_id)) {
forbiddenPage("Videos IF is required");
forbiddenPage("Videos ID is required");
}
if (!Video::canEdit($videos_id)) {
forbiddenPage("You cannot see this info");
}
$v = new Video('', '', $videos_id);
//var_dump($total);exit;
?>
<!DOCTYPE html>
@ -26,6 +28,19 @@ $v = new Video('', '', $videos_id);
include $global['systemRootPath'] . 'view/include/head.php';
?>
<link rel="stylesheet" type="text/css" href="<?php echo $global['webSiteRootURL']; ?>view/css/DataTables/datatables.min.css"/>
<style>
#viewInfoTitle .thumbsImage{
width: 150px;
}
#viewInfoTitle{
position: relative;
}
#buttonsGroup{
position: absolute;
right:10px;
top: 10px;
}
</style>
</head>
<body class="<?php echo $global['bodyClass']; ?>">
@ -33,14 +48,22 @@ $v = new Video('', '', $videos_id);
include $global['systemRootPath'] . 'view/include/navbar.php';
?>
<div class="container-fluid">
<br>
<div class="panel panel-default">
<div class="panel-heading">
<h1>
<?php
echo $v->getTitle();
?>
</h1>
<div class="panel-heading clearfix" id="viewInfoTitle">
<?php
echo Video::getVideosListItem($videos_id);
//echo $v->getTitle();
$obj = new stdClass();
$obj->videos_id = $videos_id;
$hash = encryptString($obj);
?>
<div class="btn-group" role="group" aria-label="Basic example" id="buttonsGroup">
<button type="button" class="btn btn-default" onclick="copyToClipboard(webSiteRootURL + 'view/videoViewsInfo.php?hash=<?php echo $hash; ?>');"><i class="fas fa-copy"></i> <?php echo __('Share link'); ?></button>
<a href="<?php echo $global['webSiteRootURL']; ?>view/videoViewsInfo.csv.php?videos_id=<?php echo $videos_id; ?>&rowCount=9999&hash=<?php echo $hash; ?>" class="btn btn-primary" >
<i class="fas fa-file-csv"></i> <?php echo __('CSV File'); ?>
</a>
</div>
</div>
<div class="panel-body">
<h3>
@ -85,28 +108,28 @@ $v = new Video('', '', $videos_id);
?>
<script type="text/javascript" src="<?php echo $global['webSiteRootURL']; ?>view/css/DataTables/datatables.min.js"></script>
<script type="text/javascript">
$(document).ready(function () {
var VideoViewsInfo = $('#VideoViewsInfo').DataTable({
"order": [[ 1, "desc" ]],
serverSide: true,
"ajax": "<?php echo $global['webSiteRootURL']; ?>view/videoViewsInfo.json.php?videos_id=<?php echo $videos_id; ?>",
"columns": [
{data: 'users_id', render: function (data, type, row) {
return row.users
}},
{data: 'when', render: function (data, type, row) {
return row.when_human
}},
{data: 'seconds_watching_video', render: function (data, type, row) {
return row.seconds_watching_video_human
}},
{orderable: false, render: function (data, type, row) {
return row.location_name
}}
],
select: true,
});
});
$(document).ready(function () {
var VideoViewsInfo = $('#VideoViewsInfo').DataTable({
"order": [[1, "desc"]],
serverSide: true,
"ajax": "<?php echo $global['webSiteRootURL']; ?>view/videoViewsInfo.json.php?videos_id=<?php echo $videos_id; ?>&hash=<?php echo @$_REQUEST['hash']; ?>",
"columns": [
{data: 'users_id', render: function (data, type, row) {
return row.users
}},
{data: 'when', render: function (data, type, row) {
return row.when_human
}},
{data: 'seconds_watching_video', render: function (data, type, row) {
return row.seconds_watching_video_human
}},
{orderable: false, render: function (data, type, row) {
return row.location_name
}}
],
select: true,
});
});
</script>
</body>
</html>

View file

@ -1,247 +1,261 @@
<?php
global $global, $config;
if (!isset($global['systemRootPath'])) {
require_once '../videos/configuration.php';
}
require_once $global['systemRootPath'] . 'objects/user.php';
require_once $global['systemRootPath'] . 'objects/functions.php';
if (isBot()) {
return;
}
require_once $global['systemRootPath'] . 'objects/video.php';
$post = $_POST;
if (!empty($_POST['video_id'])) {
$video = Video::getVideo($_POST['video_id'], "viewable");
}
$_POST = $post;
$catLink = "";
if (!empty($_GET['catName'])) {
$catLink = "cat/{$_GET['catName']}/";
}
if (empty($_GET['page'])) {
$_GET['page'] = 1;
} else {
$_GET['page'] = intval($_GET['page']);
}
$_REQUEST['current'] = $_GET['page'];
if (empty($_REQUEST['rowCount'])) {
if (!empty($_SESSION['rowCount'])) {
$_REQUEST['rowCount'] = $_SESSION['rowCount'];
} else {
$_REQUEST['rowCount'] = 10;
}
}
if ($_REQUEST['rowCount'] <= 0 || $_REQUEST['rowCount'] > 100) {
$_REQUEST['rowCount'] = 10;
}
if (empty($_POST['sort'])) {
if (!empty($_SESSION['sort'])) {
$_POST['sort'] = $_SESSION['sort'];
} else {
$_POST['sort']['created'] = 'desc';
}
}
$_SESSION['rowCount'] = $_REQUEST['rowCount'];
$_SESSION['sort'] = $_POST['sort'];
$videos = Video::getAllVideos("viewableNotUnlisted");
$total = Video::getTotalVideos("viewableNotUnlisted");
$totalPages = ceil($total / $_REQUEST['rowCount']);
$_POST = $post;
if (empty($totalPages)) {
$totalPages = 1;
}
$videoName = "";
if (!empty($video['clean_title'])) {
$videoName = $video['clean_title'];
} else if (!empty($_GET['videoName'])) {
$videoName = $_GET['videoName'];
}
$get = array();
$get = array('channelName' => @$_GET['channelName'], 'catName' => @$_GET['catName']);
if (!empty($_GET['channelName']) && empty($advancedCustomUser->hideRemoveChannelFromModeYoutube)) {
$user = User::getChannelOwner($_GET['channelName']);
//var_dump($user);exit;
?>
<div class="col-md-12" style="padding: 15px; margin: 5px 0; background-image: url(<?php echo $global['webSiteRootURL'], User::getBackgroundURLFromUserID($user['id']); ?>); background-size: cover;" >
<img src="<?php echo User::getPhoto($user['id']); ?>" class="img img-responsive img-circle" style="max-width: 60px;" alt="User Photo"/>
<div style="position: absolute; right: 5px; top: 5px;">
<button class="btn btn-default btn-xs btn-sm" onclick="loadPage(<?php echo $_GET['page']; ?>, true);"><?php echo User::getNameIdentificationById($user['id']); ?> <i class="fa fa-times"></i></button>
</div>
</div>
<?php
}
$objGallery = AVideoPlugin::getObjectData("Gallery");
if (empty($video['id'])) {
$video['id'] = 0;
}
?>
<div class="col-md-8 col-sm-12 " style="position: relative; z-index: 2;" >
<select class="form-control" id="sortBy" >
<option value="titleAZ" data-icon="glyphicon-sort-by-attributes" <?php echo (!empty($_POST['sort']['title']) && strtolower($_POST['sort']['title']) == 'asc') ? "selected='selected'" : "" ?>> <?php echo __("Title (A-Z)"); ?></option>
<option value="titleZA" data-icon="glyphicon-sort-by-attributes-alt" <?php echo (!empty($_POST['sort']['title']) && strtolower($_POST['sort']['title']) == 'desc') ? "selected='selected'" : "" ?>> <?php echo __("Title (Z-A)"); ?></option>
<option value="newest" data-icon="glyphicon-sort-by-attributes" <?php echo (empty($_POST['sort']) || (!empty($_POST['sort']['created']) && strtolower($_POST['sort']['created'])) == 'desc') ? "selected='selected'" : "" ?>> <?php echo __("Date added (newest)"); ?></option>
<option value="oldest" data-icon="glyphicon-sort-by-attributes-alt" <?php echo (!empty($_POST['sort']['created']) && strtolower($_POST['sort']['created']) == 'asc') ? "selected='selected'" : "" ?>> <?php echo __("Date added (oldest)"); ?></option>
<option value="popular" data-icon="glyphicon-thumbs-up" <?php echo (!empty($_POST['sort']['likes'])) ? "selected='selected'" : "" ?>> <?php echo __("Most popular"); ?></option>
<?php
if (empty($advancedCustom->doNotDisplayViews)) {
?>
<option value="views_count" data-icon="glyphicon-eye-open" <?php echo (!empty($_POST['sort']['views_count'])) ? "selected='selected'" : "" ?>> <?php echo __("Most watched"); ?></option>
<?php } ?>
</select>
</div>
<div class="col-md-4 col-sm-12" style="position: relative; z-index: 2;">
<select class="form-control" id="rowCount">
<?php
$jsonArray = _json_decode($advancedCustom->videosListRowCount);
foreach ($jsonArray as $item) {
if ($item == -1) {
?>
<option <?php echo (!empty($_REQUEST['rowCount']) && $_REQUEST['rowCount'] == $item) ? "selected='selected'" : "" ?>><?php echo __("All"); ?></option>
<?php
} else {
?>
<option <?php echo (!empty($_REQUEST['rowCount']) && $_REQUEST['rowCount'] == $item) ? "selected='selected'" : "" ?>><?php echo $item; ?></option>
<?php
}
}
?>
</select>
</div>
<?php
$program = AVideoPlugin::loadPluginIfEnabled('PlayLists');
foreach ($videos as $key => $value) {
if (!empty($video['id']) && $video['id'] == $value['id']) {
continue; // skip video
}
echo Video::getVideosListItem($value['id']);
}
?>
<ul class="pages">
</ul>
<div class="loader" id="pageLoader" style="display: none;"></div>
<script>
var isLoadingPage = 0;
function setBootPage() {
$('.pages').bootpag({
total: <?php echo $totalPages; ?>,
page: <?php echo $_GET['page']; ?>,
maxVisible: 10
}).on('page', function (event, num) {
loadPage(num, false);
});
}
function loadPage(num, disableChannel) {
if (isLoadingPage) {
return false;
}
isLoadingPage = 1;
$("#videosList").find('a').click(false);
$("#videosList").addClass('transparent');
console.log(num);
var page = '/page/1';
if (typeof num != 'undefined' && num != 'undefined') {
page = '/page/' + num;
}
var query = "";
<?php
if (!empty($get)) {
echo "query = \"?" . http_build_query($get) . "\";";
}
?>
if (disableChannel) {
query = "";
}
<?php
if (!empty($videoName) && !empty($video['id'])) {
?>
var url = '<?php echo $global['webSiteRootURL'], addslashes($catLink); ?>video/<?php echo addslashes($videoName); ?>' + page + query;
<?php
} else if (!empty($_GET['evideo'])) {
?>
var url = '<?php echo $global['webSiteRootURL'], addslashes($catLink); ?>evideo/<?php echo $_GET['evideo']; ?>';
<?php
} else {
?>
var url = '<?php echo $global['webSiteRootURL'], addslashes($catLink); ?>';
<?php
}
?>
var urlList = "<?php echo $global['webSiteRootURL']; ?>videosList/<?php echo addslashes($catLink); ?>video/<?php echo addslashes($videoName); ?>" + page + query;
history.pushState(null, null, url);
$('.pages').slideUp();
$('#pageLoader').fadeIn();
rowCount = $('#rowCount').val();
sortBy = $('#sortBy').val();
console.log(sortBy);
if (sortBy == 'newest') {
sortBy = {'created': 'desc'};
} else
if (sortBy == 'oldest') {
sortBy = {'created': 'asc'};
} else if (sortBy == 'views_count') {
sortBy = {'views_count': 'desc'};
} else if (sortBy == 'titleAZ') {
sortBy = {'title': 'asc'};
} else if (sortBy == 'titleZA') {
sortBy = {'title': 'desc'};
} else {
sortBy = {'likes': 'desc'};
}
$.ajax({
type: "POST",
url: urlList,
data: {
rowCount: rowCount,
sort: sortBy,
video_id: <?php echo $video['id']; ?>
}
}).done(function (result) {
$("#videosList").html(result);
setBootPage();
$("#videosList").removeClass('transparent');
});
}
$(document).ready(function () {
setBootPage();
mouseEffect();
$('#rowCount, #sortBy').change(function () {
num = $('#videosList').find('.pagination').find('li.active').attr('data-lp');
loadPage(num, false);
});
if (/Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent)) {
$('#rowCount, #sortBy').selectpicker('mobile');
} else {
$('#rowCount, #sortBy').selectpicker();
}
$('.thumbsJPG').lazy({
effect: 'fadeIn',
visibleOnly: true,
// called after an element was successfully handled
afterLoad: function (element) {
element.removeClass('blur');
element.parent().find('.thumbsGIF').lazy({
effect: 'fadeIn'
});
}
});
});
</script>
<?php
//include $global['systemRootPath'] . 'objects/include_end.php';
<?php
global $global, $config;
if (!isset($global['systemRootPath'])) {
require_once '../videos/configuration.php';
}
if (isBot()) {
return;
}
$TimeLogLimitVL = 0.01;
$timeLogNameVL = TimeLogStart("videosList.php");
$post = $_POST;
if (!empty($_POST['video_id'])) {
$video = Video::getVideo($_POST['video_id'], "viewable");
}
$_POST = $post;
TimeLogEnd($timeLogNameVL, __LINE__, $TimeLogLimitVL);
$catLink = "";
if (!empty($_GET['catName'])) {
$catLink = "cat/{$_GET['catName']}/";
}
if (empty($_GET['page'])) {
$_GET['page'] = 1;
} else {
$_GET['page'] = intval($_GET['page']);
}
$_REQUEST['current'] = $_GET['page'];
if (empty($_REQUEST['rowCount'])) {
if (!empty($_SESSION['rowCount'])) {
$_REQUEST['rowCount'] = $_SESSION['rowCount'];
} else {
$_REQUEST['rowCount'] = 10;
}
}
if ($_REQUEST['rowCount'] <= 0 || $_REQUEST['rowCount'] > 100) {
$_REQUEST['rowCount'] = 10;
}
if (empty($_POST['sort'])) {
if (!empty($_SESSION['sort'])) {
$_POST['sort'] = $_SESSION['sort'];
} else {
$_POST['sort']['created'] = 'desc';
}
}
$_SESSION['rowCount'] = $_REQUEST['rowCount'];
$_SESSION['sort'] = $_POST['sort'];
TimeLogEnd($timeLogNameVL, __LINE__, $TimeLogLimitVL);
$videos = Video::getAllVideos("viewableNotUnlisted");
$total = Video::getTotalVideos("viewableNotUnlisted");
TimeLogEnd($timeLogNameVL, __LINE__, $TimeLogLimitVL);
$totalPages = ceil($total / $_REQUEST['rowCount']);
$_POST = $post;
if (empty($totalPages)) {
$totalPages = 1;
}
$videoName = "";
if (!empty($video['clean_title'])) {
$videoName = $video['clean_title'];
} else if (!empty($_GET['videoName'])) {
$videoName = $_GET['videoName'];
}
$get = array();
$get = array('channelName' => @$_GET['channelName'], 'catName' => @$_GET['catName']);
if (!empty($_GET['channelName']) && empty($advancedCustomUser->hideRemoveChannelFromModeYoutube)) {
$user = User::getChannelOwner($_GET['channelName']);
//var_dump($user);exit;
?>
<div class="col-md-12" style="padding: 15px; margin: 5px 0; background-image: url(<?php echo $global['webSiteRootURL'], User::getBackgroundURLFromUserID($user['id']); ?>); background-size: cover;" >
<img src="<?php echo User::getPhoto($user['id']); ?>" class="img img-responsive img-circle" style="max-width: 60px;" alt="User Photo"/>
<div style="position: absolute; right: 5px; top: 5px;">
<button class="btn btn-default btn-xs btn-sm" onclick="loadPage(<?php echo $_GET['page']; ?>, true);"><?php echo User::getNameIdentificationById($user['id']); ?> <i class="fa fa-times"></i></button>
</div>
</div>
<?php
}
$objGallery = AVideoPlugin::getObjectData("Gallery");
if (empty($video['id'])) {
$video['id'] = 0;
}
TimeLogEnd($timeLogNameVL, __LINE__, $TimeLogLimitVL);
?>
<div class="col-md-8 col-sm-12 " style="position: relative; z-index: 2;" >
<select class="form-control" id="sortBy" >
<option value="titleAZ" data-icon="glyphicon-sort-by-attributes" <?php echo (!empty($_POST['sort']['title']) && strtolower($_POST['sort']['title']) == 'asc') ? "selected='selected'" : "" ?>> <?php echo __("Title (A-Z)"); ?></option>
<option value="titleZA" data-icon="glyphicon-sort-by-attributes-alt" <?php echo (!empty($_POST['sort']['title']) && strtolower($_POST['sort']['title']) == 'desc') ? "selected='selected'" : "" ?>> <?php echo __("Title (Z-A)"); ?></option>
<option value="newest" data-icon="glyphicon-sort-by-attributes" <?php echo (empty($_POST['sort']) || (!empty($_POST['sort']['created']) && strtolower($_POST['sort']['created'])) == 'desc') ? "selected='selected'" : "" ?>> <?php echo __("Date added (newest)"); ?></option>
<option value="oldest" data-icon="glyphicon-sort-by-attributes-alt" <?php echo (!empty($_POST['sort']['created']) && strtolower($_POST['sort']['created']) == 'asc') ? "selected='selected'" : "" ?>> <?php echo __("Date added (oldest)"); ?></option>
<option value="popular" data-icon="glyphicon-thumbs-up" <?php echo (!empty($_POST['sort']['likes'])) ? "selected='selected'" : "" ?>> <?php echo __("Most popular"); ?></option>
<?php
if (empty($advancedCustom->doNotDisplayViews)) {
?>
<option value="views_count" data-icon="glyphicon-eye-open" <?php echo (!empty($_POST['sort']['views_count'])) ? "selected='selected'" : "" ?>> <?php echo __("Most watched"); ?></option>
<?php } ?>
</select>
</div>
<div class="col-md-4 col-sm-12" style="position: relative; z-index: 2;">
<select class="form-control" id="rowCount">
<?php
$jsonArray = _json_decode($advancedCustom->videosListRowCount);
foreach ($jsonArray as $item) {
if ($item == -1) {
?>
<option <?php echo (!empty($_REQUEST['rowCount']) && $_REQUEST['rowCount'] == $item) ? "selected='selected'" : "" ?>><?php echo __("All"); ?></option>
<?php
} else {
?>
<option <?php echo (!empty($_REQUEST['rowCount']) && $_REQUEST['rowCount'] == $item) ? "selected='selected'" : "" ?>><?php echo $item; ?></option>
<?php
}
}
?>
</select>
</div>
<?php
TimeLogEnd($timeLogNameVL, __LINE__, $TimeLogLimitVL);
$cacheName = "videosList_" . md5(json_encode($_REQUEST));
$getVideosListItem = ObjectYPT::getSessionCache($cacheName);
//$program = AVideoPlugin::loadPluginIfEnabled('PlayLists');
if (empty($getVideosListItem)) {
$getVideosListItem = '';
foreach ($videos as $key => $value) {
if (!empty($video['id']) && $video['id'] == $value['id']) {
continue; // skip video
}
$getVideosListItem .= Video::getVideosListItem($value['id']);
}
ObjectYPT::setSessionCache($cacheName, $getVideosListItem);
}
echo $getVideosListItem;
TimeLogEnd($timeLogNameVL, __LINE__, $TimeLogLimitVL);
?>
<ul class="pages">
</ul>
<div class="loader" id="pageLoader" style="display: none;"></div>
<script>
var isLoadingPage = 0;
function setBootPage() {
$('.pages').bootpag({
total: <?php echo $totalPages; ?>,
page: <?php echo $_GET['page']; ?>,
maxVisible: 10
}).on('page', function (event, num) {
loadPage(num, false);
});
}
function loadPage(num, disableChannel) {
if (isLoadingPage) {
return false;
}
isLoadingPage = 1;
$("#videosList").find('a').click(false);
$("#videosList").addClass('transparent');
console.log(num);
var page = '/page/1';
if (typeof num != 'undefined' && num != 'undefined') {
page = '/page/' + num;
}
var query = "";
<?php
if (!empty($get)) {
echo "query = \"?" . http_build_query($get) . "\";";
}
?>
if (disableChannel) {
query = "";
}
<?php
if (!empty($videoName) && !empty($video['id'])) {
?>
var url = '<?php echo $global['webSiteRootURL'], addslashes($catLink); ?>video/<?php echo addslashes($videoName); ?>' + page + query;
<?php
} else if (!empty($_GET['evideo'])) {
?>
var url = '<?php echo $global['webSiteRootURL'], addslashes($catLink); ?>evideo/<?php echo $_GET['evideo']; ?>';
<?php
} else {
?>
var url = '<?php echo $global['webSiteRootURL'], addslashes($catLink); ?>';
<?php
}
?>
var urlList = "<?php echo $global['webSiteRootURL']; ?>videosList/<?php echo addslashes($catLink); ?>video/<?php echo addslashes($videoName); ?>" + page + query;
history.pushState(null, null, url);
$('.pages').slideUp();
$('#pageLoader').fadeIn();
rowCount = $('#rowCount').val();
sortBy = $('#sortBy').val();
console.log(sortBy);
if (sortBy == 'newest') {
sortBy = {'created': 'desc'};
} else
if (sortBy == 'oldest') {
sortBy = {'created': 'asc'};
} else if (sortBy == 'views_count') {
sortBy = {'views_count': 'desc'};
} else if (sortBy == 'titleAZ') {
sortBy = {'title': 'asc'};
} else if (sortBy == 'titleZA') {
sortBy = {'title': 'desc'};
} else {
sortBy = {'likes': 'desc'};
}
$.ajax({
type: "POST",
url: urlList,
data: {
rowCount: rowCount,
sort: sortBy,
video_id: <?php echo $video['id']; ?>
}
}).done(function (result) {
$("#videosList").html(result);
setBootPage();
$("#videosList").removeClass('transparent');
});
}
$(document).ready(function () {
setBootPage();
mouseEffect();
$('#rowCount, #sortBy').change(function () {
num = $('#videosList').find('.pagination').find('li.active').attr('data-lp');
loadPage(num, false);
});
if (/Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent)) {
$('#rowCount, #sortBy').selectpicker('mobile');
} else {
$('#rowCount, #sortBy').selectpicker();
}
$('.thumbsJPG').lazy({
effect: 'fadeIn',
visibleOnly: true,
// called after an element was successfully handled
afterLoad: function (element) {
element.removeClass('blur');
element.parent().find('.thumbsGIF').lazy({
effect: 'fadeIn'
});
}
});
});
</script>
<?php
//include $global['systemRootPath'] . 'objects/include_end.php';
?>