1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-03 17:59:55 +02:00

Merge origin/master

This commit is contained in:
Daniel 2021-07-30 08:41:31 -03:00
commit d3357dda15
46 changed files with 927 additions and 480 deletions

View file

@ -59,7 +59,7 @@ $ogURL = Video::getLinkToVideo($videos_id);
<meta property="og:description" content="<?php echo $description; ?>" />
<meta property="og:url" content="<?php echo $ogURL; ?>" />
<meta property="og:type" content="video.other" />
<link rel=”canonical” href=<?php echo $ogURL; ?>” />
<link rel="canonical" href="<?php echo $ogURL; ?>" />
<?php
$source = Video::getHigestResolution($video['filename']);

View file

@ -67,7 +67,7 @@ if(!empty($metaDescription)){
<meta property="og:title" content="<?php echo $title; ?>" />
<meta property="og:description" content="<?php echo $description; ?>" />
<meta property="og:url" content="<?php echo $url; ?>" />
<link rel=”canonical” href=<?php echo $url; ?>” />
<link rel="canonical" href="<?php echo $url; ?>" />
<?php
if (!empty($advancedCustom->twitter_summary_large_image)) {

View file

@ -1677,7 +1677,7 @@ function im_resizeV3($file_src, $file_dest, $wd, $hd) {
}
function im_resize_gif($file_src, $file_dest, $max_width, $max_height) {
if(class_exists('Imagick')){
if (class_exists('Imagick')) {
$imagick = new Imagick($file_src);
$format = $imagick->getImageFormat();
@ -1692,7 +1692,7 @@ function im_resize_gif($file_src, $file_dest, $max_width, $max_height) {
$imagick->clear();
$imagick->destroy();
}else{
} else {
copy($file_src, $file_dest);
}
}
@ -2157,7 +2157,7 @@ function combineFiles($filesArray, $extension = "js") {
$str = "";
$fileName = "";
foreach ($filesArray as $value) {
$fileName .= $value;
$fileName .= $value.filectime($global['systemRootPath'] . $value).filemtime($global['systemRootPath'] . $value);
}
if ($advancedCustom != false) {
$minifyEnabled = $advancedCustom->EnableMinifyJS;
@ -2543,6 +2543,10 @@ function isMobile($userAgent = null, $httpHeaders = null) {
return $detect->isMobile($userAgent, $httpHeaders);
}
function isChannelPage(){
return strpos($_SERVER["SCRIPT_NAME"], 'view/channel.php') !== false;
}
function isAVideoMobileApp($user_agent = "") {
if (empty($user_agent)) {
$user_agent = @$_SERVER['HTTP_USER_AGENT'];
@ -6966,3 +6970,36 @@ function mysqlCommit() {
$global['mysqli']->commit();
$global['mysqli']->autocommit(true);
}
function number_format_short($n, $precision = 1) {
if ($n < 900) {
// 0 - 900
$n_format = number_format($n, $precision);
$suffix = '';
} else if ($n < 900000) {
// 0.9k-850k
$n_format = number_format($n / 1000, $precision);
$suffix = 'K';
} else if ($n < 900000000) {
// 0.9m-850m
$n_format = number_format($n / 1000000, $precision);
$suffix = 'M';
} else if ($n < 900000000000) {
// 0.9b-850b
$n_format = number_format($n / 1000000000, $precision);
$suffix = 'B';
} else {
// 0.9t+
$n_format = number_format($n / 1000000000000, $precision);
$suffix = 'T';
}
// Remove unecessary zeroes after decimal. "1.0" -> "1"; "1.00" -> "1"
// Intentionally does not affect partials, eg "1.50" -> "1.50"
if ($precision > 0) {
$dotzero = '.' . str_repeat('0', $precision);
$n_format = str_replace($dotzero, '', $n_format);
}
return $n_format . $suffix;
}

View file

@ -10,7 +10,7 @@ if (empty($advancedCustom->disableHTMLDescription)) {
?>
<script>
tinymce.init({
language: "<?php echo $_SESSION['language']; ?>",
language: "<?php echo ($_SESSION['language']=='en_US')?'us':$_SESSION['language']; ?>",
selector: '#<?php echo $id; ?>', // change this value according to your HTML
plugins: 'code print preview fullpage searchreplace autolink directionality visualblocks visualchars fullscreen image link media codesample table charmap hr pagebreak nonbreaking anchor toc insertdatetime advlist lists wordcount imagetools textpattern help ',
//toolbar: 'fullscreen | formatselect | bold italic strikethrough forecolor backcolor permanentpen formatpainter | link image media pageembed | alignleft aligncenter alignright alignjustify | numlist bullist outdent indent | removeformat | addcomment',

View file

@ -4444,7 +4444,7 @@ if (!class_exists('Video')) {
if (empty($advancedCustom->doNotDisplayViews)) {
if (AVideoPlugin::isEnabledByName('LiveUsers')) {
$viewsHTML = '<div class="text-muted pull-right" style="display:flex;font-size: 1.2em;">' . getLiveUsersLabelVideo($value['id'], $value['views_count']) . '</div>';
$viewsHTML = '<div class="text-muted pull-right" style="display:flex;">' . getLiveUsersLabelVideo($value['id'], $value['views_count']) . '</div>';
} else {
$viewsHTML = '<div class="text-muted pull-right"><i class="fas fa-eye"></i> ' . number_format($value['views_count'], 0) . '</strong></div>';
}

View file

@ -60,6 +60,7 @@ $count = $obj->getViews_count();
$obj2 = new stdClass();
$obj2->status = !empty($resp);
$obj2->count = $count;
$obj2->countHTML = number_format_short($count);
$obj2->resp = $resp;
echo json_encode($obj2);

View file

@ -35,7 +35,7 @@ foreach ($items as $item) {
<a class="h6 evideo" >
<h2>...</h2>
</a>
<div class="text-muted galeryDetails" style="overflow: hidden;">
<div class="galeryDetails" style="overflow: hidden;">
<div>
<i class="fa fa-eye"></i>
<span itemprop="interactionCount">

View file

@ -52,7 +52,7 @@ if (is_object($obj) && empty($obj->error)) {
$youtubeTitle = $video->title;
$youtubeThumbs = $video->thumbnails;
?>
<div class="col-lg-<?php echo 12 / $objGallery->screenColsLarge; ?> col-md-<?php echo 12 / $objGallery->screenColsMedium; ?> col-sm-<?php echo 12 / $objGallery->screenColsSmall; ?> col-xs-<?php echo 12 / $objGallery->screenColsXSmall; ?> galleryVideo thumbsImage fixPadding" style="min-height: 175px;" itemscope itemtype="http://schema.org/VideoObject">
<div class="col-lg-<?php echo 12 / $objGallery->screenColsLarge; ?> col-md-<?php echo 12 / $objGallery->screenColsMedium; ?> col-sm-<?php echo 12 / $objGallery->screenColsSmall; ?> col-xs-<?php echo 12 / $objGallery->screenColsXSmall; ?> galleryVideo thumbsImage fixPadding" style="min-height: 175px;">
<a class="evideo" href="<?php echo $youtubeEmbedLink; ?>" title="<?php echo $youtubeTitle; ?>">
<div class="aspectRatio16_9">
<img src="<?php echo $youtubeThumbs; ?>" alt="<?php echo $youtubeTitle; ?>" class="thumbsJPG img img-responsive" />
@ -61,7 +61,7 @@ if (is_object($obj) && empty($obj->error)) {
<a class="h6 evideo" href="<?php echo $youtubeEmbedLink; ?>" title="<?php echo $youtubeTitle; ?>">
<h2><?php echo $youtubeTitle; ?></h2>
</a>
<div class="text-muted galeryDetails" style="overflow: hidden;">
<div class="galeryDetails" style="overflow: hidden;">
<?php
if (empty($advancedCustom->doNotDisplayViews)) {
?>
@ -78,7 +78,7 @@ if (is_object($obj) && empty($obj->error)) {
</div>
<?php if (!empty($video->trailer1)) { ?>
<div>
<span onclick="showTrailer('<?php echo parseVideos($video->trailer1, 1); ?>'); return false;" class="text-primary cursorPointer" >
<span onclick="showTrailer('<?php echo parseVideos($video->trailer1, 1); ?>'); return false;" class="cursorPointer" >
<i class="fa fa-video"></i> <?php echo __("Trailer"); ?>
</span>
</div>

View file

@ -182,7 +182,7 @@ function createGallerySection($videos, $crc = "", $get = array(), $ignoreAds = f
$isserieClass = "isserie";
}
?>
<div class=" <?php echo $colsClass; ?> galleryVideo thumbsImage fixPadding" style="z-index: <?php echo $zindex--; ?>; min-height: 175px;" itemscope itemtype="http://schema.org/VideoObject">
<div class=" <?php echo $colsClass; ?> galleryVideo thumbsImage fixPadding" style="z-index: <?php echo $zindex--; ?>; min-height: 175px;">
<a class="galleryLink <?php echo $isserieClass; ?>" videos_id="<?php echo $value['id']; ?>"
href="<?php echo Video::getLink($value['id'], $value['clean_title'], false, $getCN); ?>"
embed="<?php echo Video::getLink($value['id'], $value['clean_title'], true, $getCN); ?>" title="<?php echo $value['title']; ?>">
@ -277,10 +277,10 @@ function createGallerySection($videos, $crc = "", $get = array(), $ignoreAds = f
<a class="h6 galleryLink <?php echo $isserieClass; ?>" videos_id="<?php echo $value['id']; ?>"
href="<?php echo Video::getLink($value['id'], $value['clean_title'], false, $getCN); ?>"
embed="<?php echo Video::getLink($value['id'], $value['clean_title'], true, $getCN); ?>" title="<?php echo $value['title']; ?>">
<h2><?php echo $value['title']; ?></h2>
<strong class="title"><?php echo $value['title']; ?></strong>
</a>
<div class="text-muted galeryDetails" style="overflow: hidden;">
<div class="galeryDetails" style="overflow: hidden;">
<div class="galleryTags">
<!-- category tags -->
<?php
@ -330,8 +330,8 @@ function createGallerySection($videos, $crc = "", $get = array(), $ignoreAds = f
<?php echo humanTiming(strtotime($value['videoCreation'])), " ", __('ago'); ?>
</div>
<div>
<a href="<?php echo User::getChannelLink($value['users_id']); ?>">
<i class="fa fa-user"></i>
<a class="text-muted" href="<?php echo User::getChannelLink($value['users_id']); ?>">
<?php echo $name; ?>
</a>
</div>
@ -344,7 +344,7 @@ function createGallerySection($videos, $crc = "", $get = array(), $ignoreAds = f
$titleAlert = str_replace(array('"', "'"), array('``', "`"), $value['title']);
?>
<div>
<a href="#" onclick='avideoAlert("<?php echo $titleAlert; ?>", "<div style=\"max-height: 300px; overflow-y: scroll;overflow-x: hidden;\" id=\"videoDescriptionAlertContent<?php echo $duid; ?>\" ></div>", "");$("#videoDescriptionAlertContent<?php echo $duid; ?>").html($("#videoDescription<?php echo $duid; ?>").html());return false;' class="text-primary" data-toggle="tooltip" title="<?php echo __("Description"); ?>"><i class="far fa-file-alt"></i> <span class="hidden-sm hidden-xs"><?php echo __("Description"); ?></span></a>
<a href="#" onclick='avideoAlert("<?php echo $titleAlert; ?>", "<div style=\"max-height: 300px; overflow-y: scroll;overflow-x: hidden;\" id=\"videoDescriptionAlertContent<?php echo $duid; ?>\" ></div>", "");$("#videoDescriptionAlertContent<?php echo $duid; ?>").html($("#videoDescription<?php echo $duid; ?>").html());return false;' data-toggle="tooltip" title="<?php echo __("Description"); ?>"><i class="far fa-file-alt"></i> <span class="hidden-sm hidden-xs"><?php echo __("Description"); ?></span></a>
<div id="videoDescription<?php echo $duid; ?>" style="display: none;"><?php echo $desc; ?></div>
</div>
<?php
@ -353,7 +353,7 @@ function createGallerySection($videos, $crc = "", $get = array(), $ignoreAds = f
?>
<?php if (Video::canEdit($value['id'])) { ?>
<div>
<a href="#" onclick="avideoModalIframe('<?php echo $global['webSiteRootURL']; ?>mvideos?video_id=<?php echo $value['id']; ?>');return false;" class="text-primary" data-toggle="tooltip" title="<?php echo __("Edit Video"); ?>">
<a href="#" onclick="avideoModalIframe('<?php echo $global['webSiteRootURL']; ?>mvideos?video_id=<?php echo $value['id']; ?>');return false;" data-toggle="tooltip" title="<?php echo __("Edit Video"); ?>">
<i class="fa fa-edit"></i> <span class="hidden-sm hidden-xs"><?php echo __("Edit Video"); ?></span>
</a>
</div>
@ -361,7 +361,7 @@ function createGallerySection($videos, $crc = "", $get = array(), $ignoreAds = f
?>
<?php if (!empty($value['trailer1'])) { ?>
<div>
<span onclick="showTrailer('<?php echo parseVideos($value['trailer1'], 1); ?>'); return false;" class="text-primary cursorPointer" >
<span onclick="showTrailer('<?php echo parseVideos($value['trailer1'], 1); ?>'); return false;" class="cursorPointer" >
<i class="fa fa-video"></i> <?php echo __("Trailer"); ?>
</span>
</div>
@ -513,10 +513,10 @@ function createGalleryLiveSection($videos) {
<a class="h6 galleryLink" videos_id="<?php echo $video['title']; ?>"
href="<?php echo $video['href']; ?>"
embed="<?php echo $video['link']; ?>" title="<?php echo $video['title']; ?>">
<h2><?php echo $video['title'] ?></h2>
<strong class="title"><?php echo $video['title'] ?></strong>
</a>
<div class="text-muted galeryDetails" style="overflow: hidden;">
<div class="galeryDetails" style="overflow: hidden;">
<div class="galleryTags">
<?php if (empty($_GET['catName']) && !empty($obj->showCategoryTag)) { ?>
<a class="label label-default" href="<?php echo $global['webSiteRootURL']; ?>cat/<?php echo $video['clean_category']; ?>">
@ -533,7 +533,7 @@ function createGalleryLiveSection($videos) {
</div>
<div>
<i class="fa fa-user"></i>
<a class="text-muted" href="<?php echo User::getChannelLink($video['users_id']); ?>">
<a href="<?php echo User::getChannelLink($video['users_id']); ?>">
<?php echo $name; ?>
</a>
</div>

View file

@ -9,7 +9,7 @@
font-size: 0.9em;
border-radius: 5px;
}
.gallery h2,
.gallery .title,
.videosDetails .title {
font-size: 1em;
margin: 0;
@ -74,14 +74,17 @@ h3.galleryTitle{
border-bottom: solid 1px #EEE;
}
.galeryDetails{
font-size: smaller;
}
.galeryDetails div{
float: left;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
padding-right: 5px;
font-size: 0.7em;
margin: 1px;
margin: 2px 0;
}
.firstRow .galeryDetails div{
@ -205,5 +208,5 @@ a.h6{
font-size: 0.9em;
}
.galleryTags{
margin: 1px;
margin: 0 !important;
}

View file

@ -162,17 +162,21 @@ if ($obj->BigVideo && empty($_GET['showOnly'])) {
title="<?php echo $videoRow['title']; ?>">
<strong><?php echo $videoRow['title']; ?></strong>
</a>
<div class="mainAreaDescriptionContainer">
<p class="mainAreaDescription" itemprop="description"><?php
if (strpos($videoRow['description'], '<br') !== false || strpos($videoRow['description'], '<p') !== false) {
echo $videoRow['description'];
} else {
echo nl2br(textToLink(htmlentities($videoRow['description'])));
}
?></p>
<div class="descriptionArea">
<div class="descriptionAreaPreContent">
<div class="descriptionAreaContent">
<?php
echo Video::htmlDescription($videoRow['description']);
?>
</div>
<div class="text-muted galeryDetails">
<div>
</div>
<button onclick="$(this).closest('.descriptionArea').toggleClass('expanded');" class="btn btn-xs btn-default descriptionAreaShowMoreBtn" style="display: none; ">
<span class="showMore"><i class="fas fa-caret-down"></i> <?php echo __("Show More"); ?></span>
<span class="showLess"><i class="fas fa-caret-up"></i> <?php echo __("Show Less"); ?></span>
</button>
</div>
<div class="galeryDetails">
<div class="galleryTags">
<?php if (empty($_GET['catName'])) { ?>
<a class="label label-default" href="<?php echo Video::getLink($videoRow['id'], $videoRow['clean_title'], false, $get); ?>">
<?php
@ -220,19 +224,19 @@ if ($obj->BigVideo && empty($_GET['showOnly'])) {
<?php echo humanTiming(strtotime($videoRow['videoCreation'])), " ", __('ago'); ?>
</div>
<div>
<a href="<?php echo User::getChannelLink($videoRow['users_id']); ?>">
<i class="fa fa-user"></i>
<a class="text-muted" href="<?php echo User::getChannelLink($videoRow['users_id']); ?>">
<?php echo $name; ?>
</a>
</div>
<?php if (Video::canEdit($videoRow['id'])) { ?>
<div>
<a href="#" onclick="avideoModalIframe('<?php echo $global['webSiteRootURL']; ?>mvideos?video_id=<?php echo $videoRow['id']; ?>');return false;" class="text-primary"><i class="fa fa-edit"></i> <?php echo __("Edit Video"); ?></a>
<a href="#" onclick="avideoModalIframe('<?php echo $global['webSiteRootURL']; ?>mvideos?video_id=<?php echo $videoRow['id']; ?>');return false;"><i class="fa fa-edit"></i> <?php echo __("Edit Video"); ?></a>
</div>
<?php } ?>
<?php if (!empty($videoRow['trailer1'])) { ?>
<div>
<span onclick="showTrailer('<?php echo parseVideos($videoRow['trailer1'], 1); ?>'); return false;" class="text-primary cursorPointer" >
<span onclick="showTrailer('<?php echo parseVideos($videoRow['trailer1'], 1); ?>'); return false;" class="cursorPointer" >
<i class="fa fa-video"></i> <?php echo __("Trailer"); ?>
</span>
</div>

View file

@ -1,6 +1,7 @@
<?php
$isFirstPage = 1;
include $global['systemRootPath'] . 'plugin/Gallery/view/topLogic.php';
$leaderBoardTop = getAdsLeaderBoardTop();
?>
<!DOCTYPE html>
<html lang="<?php echo $_SESSION['language']; ?>">
@ -14,16 +15,22 @@ include $global['systemRootPath'] . 'plugin/Gallery/view/topLogic.php';
<body class="<?php echo $global['bodyClass']; ?>">
<?php include $global['systemRootPath'] . 'view/include/navbar.php'; ?>
<div class="container-fluid gallery">
<div class="row text-center" style="padding: 10px;">
<?php echo getAdsLeaderBoardTop(); ?>
</div>
<div class="col-lg-10 col-lg-offset-1 list-group-item addWidthOnMenuOpen">
<?php
if(!empty($leaderBoardTop)){
echo '<div class="row text-center" style="padding: 10px;">'.$leaderBoardTop.'</div>';
}
?>
<div class="col-lg-10 col-lg-offset-1 addWidthOnMenuOpen">
<div class="panel panel-default">
<div class="panel-body">
<?php
include $global['systemRootPath'] . 'view/include/categoryTop.php';
include $global['systemRootPath'] . 'plugin/Gallery/view/mainArea.php';
?>
</div>
</div>
</div>
</div>
<?php
include $global['systemRootPath'] . 'plugin/Gallery/view/footer.php';
?>

View file

@ -187,8 +187,8 @@ class Live extends PluginAbstract {
self::addDataObjectHelper('doNotShowOfflineLiveOnCategoryList', 'Do not show offline lives on site category list', 'We will not show the live thumbs on the main Gallery page if it is offline');
$obj->limitLiveOnVideosList = 12;
self::addDataObjectHelper('limitLiveOnVideosList', 'Videos List Limit', 'This will limit the maximum of videos that you will see in the Videos page');
//$obj->doNotShowGoLiveButton = false;
//self::addDataObjectHelper('doNotShowGoLiveButton', 'Hide Top Button', 'This will hide the "Go Live" button on the top menu bar');
$obj->doNotShowGoLiveButton = false;
self::addDataObjectHelper('doNotShowGoLiveButton', 'Hide Top Go live Button', 'This will hide the "Go Live" button on the top menu bar');
$obj->doNotProcessNotifications = false;
self::addDataObjectHelper('doNotProcessNotifications', 'Do not show notifications', 'Do not show the notification on the top bar');
$obj->useLiveServers = false;
@ -487,7 +487,7 @@ class Live extends PluginAbstract {
if (!self::userCanRecordLive(User::getId())) {
return '<!-- User Cannot record -->';
}
return '<!-- SendRecordedToEncoder::getSaveDVRButton -->'.SendRecordedToEncoder::getSaveDVRButton($key, $live_servers_id, $class);
return '<!-- SendRecordedToEncoder::getSaveDVRButton -->' . SendRecordedToEncoder::getSaveDVRButton($key, $live_servers_id, $class);
break;
default:
return '';
@ -1291,9 +1291,14 @@ class Live extends PluginAbstract {
$title = $row['title'];
$u = new User($row['users_id']);
$hiddenName = preg_replace('/^(.{5})/', '*****', $value->name);
//_error_log('Live::isLiveFromKey:_getStats '. json_encode($_SERVER));
if (!self::canSeeLiveFromLiveKey($value->name)) {
$obj->hidden_applications[] = "{$row['channelName']} ($hiddenName} is a private live";
$obj->hidden_applications[] = array(
"key" => $value->name,
"name" => $row['channelName'],
"user" => $row['channelName'],
"title" => "{$row['channelName']} ($hiddenName} is a private live",
);
if (!User::isAdmin()) {
continue;
} else {
@ -1301,7 +1306,12 @@ class Live extends PluginAbstract {
}
} else
if (empty($row) || empty($row['public'])) {
$obj->hidden_applications[] = "{$row['channelName']} ($hiddenName} " . __("is set to not be listed");
$obj->hidden_applications[] = array(
"key" => $value->name,
"name" => $row['channelName'],
"user" => $row['channelName'],
"title" => "{$row['channelName']} ($hiddenName} " . __("is set to not be listed")
);
if (!User::isAdmin()) {
continue;
} else {
@ -1309,7 +1319,12 @@ class Live extends PluginAbstract {
}
} else
if ($u->getStatus() !== 'a') {
$obj->hidden_applications[] = "{$row['channelName']} {$hiddenName} " . __("the user is inactive");
$obj->hidden_applications[] = array(
"key" => $value->name,
"name" => $row['channelName'],
"user" => $row['channelName'],
"title" => "{$row['channelName']} {$hiddenName} " . __("the user is inactive"),
);
if (!User::isAdmin()) {
continue;
} else {
@ -1351,12 +1366,61 @@ class Live extends PluginAbstract {
$title .= " ({$live_index})";
}
// this variable is to keep it compatible for Mobile app
// this variable is to keep it compatible for Mobile app
$UserPhoto = $photo;
$key = LiveTransmition::keyNameFix($value->name);
$link = Live::getLinkToLiveFromChannelNameAndLiveServer($u->getChannelName(), $live_servers_id, $live_index);
$m3u8 = self::getM3U8File($key);
$liveUsers = AVideoPlugin::isEnabledByName('LiveUsers');
//$filename = $global['systemRootPath'] . 'plugin/LiveLinks/view/menuItem.html';
$filenameExtra = $global['systemRootPath'] . 'plugin/LiveLinks/view/extraItem.html';
$filenameExtraVideoPage = $global['systemRootPath'] . 'plugin/LiveLinks/view/extraItemVideoPage.html';
$filename = $filenameListItem = $global['systemRootPath'] . 'plugin/LiveLinks/view/videoListItem.html';
$search = array(
'_unique_id_',
'_user_photo_',
'_title_',
'_user_identification_',
'_description_',
'_link_',
'_imgJPG_',
'_imgGIF_',
'_class_',
'_total_on_live_links_id_',
'liveLink',
'LiveLink'
);
$content = file_get_contents($filename);
$contentExtra = file_get_contents($filenameExtra);
$contentExtraVideoPage = file_get_contents($filenameExtraVideoPage);
$contentListem = file_get_contents($filenameListItem);
$uid = "live_{$live_servers_id}_{$value->name}";
$replace = array(
$uid,
$UserPhoto,
$title,
$user,
str_replace('"', "", ''),
$link,
'<img src="' . getCDN() . 'view/img/loading-gif.png" data-src="' . $poster . '" class="thumbsJPG img-responsive" height="130">',
empty($obj->disableGifThumbs) ? ('<img src="' . getCDN() . 'view/img/loading-gif.png" data-src="' . $p->getLivePosterImage($row['users_id'], $live_servers_id, $playlists_id_live, $live_index, 'webp') . '" style="position: absolute; top: 0px; height: 0px; width: 0px; display: none;" class="thumbsGIF img-responsive" height="130">') : "",
"col-lg-2 col-md-4 col-sm-4 col-xs-6",
($liveUsers ? getLiveUsersLabelLive($value->name, $live_servers_id) : ''),
'liveVideo',
'LiveVideo'
);
$newContent = str_replace($search, $replace, $content);
$newContentExtra = str_replace($search, $replace, $contentExtra);
$newContentExtraVideoPage = str_replace($search, $replace, $contentExtraVideoPage);
$newContentVideoListItem = str_replace($search, $replace, $contentListem);
$obj->applications[] = array(
"html" => $newContent,
"htmlExtra" => $newContentExtra,
"htmlExtraVideoPage" => $newContentExtraVideoPage,
"htmlExtraVideoListItem" => $newContentVideoListItem,
"live_index" => $live_index,
"live_cleanKey" => $parameters['cleanKey'],
"key" => $value->name,
@ -1374,13 +1438,12 @@ class Live extends PluginAbstract {
'link' => addQueryStringParameter($link, 'embed', 1),
'href' => $link,
'playlists_id_live' => $playlists_id_live,
'live_index' => $live_index,
'm3u8' => $m3u8,
'isURL200' => isURL200($m3u8),
'users_id' => $row['users_id'],
'live_servers_id' => $live_servers_id,
'categories_id' => intval($row['categories_id']),
'className' => "live_{$live_servers_id}_{$value->name}"
'className' => $uid
);
if ($value->name === $obj->name) {
$obj->error = property_exists($value, 'publishing') ? false : true;
@ -1400,6 +1463,14 @@ class Live extends PluginAbstract {
return $obj;
}
static function byPass() {
if (preg_match('/socket_notification/', $_SERVER['SCRIPT_FILENAME'])) {
return true;
}
return false;
}
static function getLiveParametersFromKey($key) {
$key = preg_replace('/[^a-z0-9_-]/i', '', $key);
$obj = AVideoPlugin::getObjectData('Live');
@ -1539,13 +1610,16 @@ class Live extends PluginAbstract {
//_error_log('getStats execute getStats: ' . ($force_recreate?'force_recreate':'DO NOT force_recreate'));
$json = self::getStats($force_recreate);
_error_log('Live::isKeyLiveInStats:self::getStats ' . json_encode($json));
$_isLiveFromKey[$index] = false;
if (!empty($json)) {
_error_log("Live::isLiveFromKey {$key} JSON was not empty");
//_error_log("Live::isLiveFromKey {$key} JSON was not empty");
if (!is_array($json)) {
$json = array($json);
}
foreach ($json as $item) {
$namesFound = array();
foreach ($json as $ki => $item) {
//_error_log("Live::isLiveFromKey json [$ki] " . json_encode($item));
$applications = array();
if (empty($item->applications) && is_array($item)) {
$applications = $item;
@ -1553,11 +1627,13 @@ class Live extends PluginAbstract {
$applications = $item->applications;
}
foreach ($applications as $value) {
foreach ($applications as $k => $value) {
$value = object_to_array($value);
//_error_log("Live::isLiveFromKey applications [$k] ". json_encode($value));
if (!is_array($value) || empty($value) || empty($value['key'])) {
continue;
}
$namesFound[] = "({$value['key']})";
if (preg_match("/{$key}.*/", $value['key'])) {
if (empty($live_servers_id)) {
$_isLiveFromKey[$index] = true;
@ -1580,6 +1656,7 @@ class Live extends PluginAbstract {
if (!is_array($value) || empty($value) || empty($value['key'])) {
continue;
}
$namesFound[] = "({$value['key']})";
if (preg_match("/{$key}.*/", $value['key'])) {
if (empty($live_servers_id)) {
$_isLiveFromKey[$index] = true;
@ -1596,6 +1673,7 @@ class Live extends PluginAbstract {
}
}
}
_error_log("Live::isLiveFromKey namesFound " . json_encode($namesFound));
}
if (empty($_isLiveFromKey[$index])) {
_error_log("Live::isLiveFromKey is NOT online [{$key}]");
@ -1898,7 +1976,7 @@ class Live extends PluginAbstract {
unset($_isLiveAndIsReadyFromKey);
}
public static function getReverseRestreamObject($m3u8, $users_id, $live_servers_id=-1) {
public static function getReverseRestreamObject($m3u8, $users_id, $live_servers_id = -1) {
if (!isValidURL($m3u8)) {
return false;
}
@ -1936,10 +2014,10 @@ class Live extends PluginAbstract {
return $obj;
}
public static function reverseRestream($m3u8, $users_id, $live_servers_id=-1) {
public static function reverseRestream($m3u8, $users_id, $live_servers_id = -1) {
_error_log("Live:reverseRestream start");
$obj = self::getReverseRestreamObject($m3u8, $users_id, $live_servers_id);
_error_log("Live:reverseRestream obj ". _json_encode($obj));
_error_log("Live:reverseRestream obj " . _json_encode($obj));
return self::sendRestream($obj);
}
@ -1978,16 +2056,16 @@ class Live extends PluginAbstract {
);
$output = curl_exec($ch);
curl_close($ch);
if(empty($output)){
_error_log('Live:sendRestream ERROR '.curl_error($ch));
if (empty($output)) {
_error_log('Live:sendRestream ERROR ' . curl_error($ch));
return false;
}
$json = _json_decode($output);
if(empty($output)){
_error_log('Live:sendRestream JSON ERROR '.$output);
if (empty($output)) {
_error_log('Live:sendRestream JSON ERROR ' . $output);
return false;
}
_error_log('Live:sendRestream complete '.$output);
_error_log('Live:sendRestream complete ' . $output);
return $json;
} catch (Exception $exc) {
_error_log("Live:sendRestream " . $exc->getTraceAsString());
@ -2022,7 +2100,7 @@ class Live extends PluginAbstract {
public function getUploadMenuButton() {
global $global;
$obj = $this->getDataObject();
if (!empty($obj->doNotShowGoLiveButton) || !User::canStream()) {
if (!empty(!User::canStream())) {
return '';
}
$buttonTitle = $this->getButtonTitle();

View file

@ -1,5 +1,5 @@
<li>
<a href="<?php echo $global['webSiteRootURL']; ?>plugin/Live" data-toggle="tooltip" title="<?php echo __("Broadcast a Live Stream"); ?>" data-placement="left" >
<a href="<?php echo $global['webSiteRootURL']; ?>plugin/Live" data-toggle="tooltip" title="<?php echo __($buttonTitle); ?>" data-placement="left" >
<i class="fa fa-circle faa-flash animated" style="color: red;" ></i> <?php echo $buttonTitle; ?>
</a>
</li>

View file

@ -51,6 +51,7 @@ function url_get_contents($url, $timeout = 0) {
if (ini_get('allow_url_fopen')) {
try {
$tmp = file_get_contents($url, false, $context);
_log('file_get_contents:: '.htmlentities($tmp));
if (empty($tmp)) {
_log('file_get_contents fail return an empty content');
return false;
@ -76,7 +77,7 @@ function url_get_contents($url, $timeout = 0) {
}
$output = curl_exec($ch);
curl_close($ch);
_log('curl_init:: '.htmlentities($output));
if (empty($output)) {
_log('curl_init fail to download');
return false;
@ -105,6 +106,7 @@ function url_get_contents($url, $timeout = 0) {
$filename = $tmpDir . md5($url);
if (wget($url, $filename)) {
$result = file_get_contents($filename);
_log('wget:: '.htmlentities($result));
unlink($filename);
if (!empty($result)) {
_log('wget works ');

View file

@ -14,6 +14,7 @@ $obj = AVideoPlugin::getDataObject("Live");
background-color: rgba(255,0,0,0.7);
}
#availableLiveStream{
min-width: 300px;
max-width: 400px;
overflow: hidden;
max-height: 75vh;
@ -34,7 +35,9 @@ if (empty($obj->doNotShowGoLiveButton) && User::canStream()) {
<?php
}
?>
<li class="dropdown">
<li class="dropdown" onclick="setTimeout(function () {
lazyImage();
}, 500);">
<a href="#" class="faa-parent animated-hover btn btn-default navbar-btn" data-toggle="dropdown">
<span class="fas fa-bell faa-ring"></span>
<span class="badge onlineApplications" style=" background: rgba(255,0,0,1); color: #FFF;">0</span>
@ -55,33 +58,34 @@ if (empty($obj->doNotShowGoLiveButton) && User::canStream()) {
</div>
</a>
</li>
<div class="col-lg-12 col-sm-12 col-xs-12 bottom-border hidden extraVideosModel liveVideo">
<a href="" class="h6 videoLink">
<div class="col-lg-5 col-sm-5 col-xs-5 nopadding thumbsImage" style="min-height: 70px; position:relative;" >
<a href="" class="videoLink" class="videoLink galleryLink " >
<div class="aspectRatio16_9" style="min-height: 70px;" >
<img src="<?php echo getCDN(); ?>videos/userPhoto/logo.png" class="thumbsJPG img-responsive" height="130" itemprop="thumbnailUrl" alt="Logo" />
<span itemprop="uploadDate" content="<?php echo date("Y-m-d h:i:s"); ?>" />
<img src="" style="position: absolute; top: 0; display: none;" class="thumbsGIF img-responsive" height="130" />
<span class="label label-danger liveNow faa-flash faa-slow animated"><?php echo __("LIVE NOW"); ?></span>
</div>
<div class="col-lg-7 col-sm-7 col-xs-7 videosDetails">
<div class="text-uppercase row"><strong itemprop="name" class="title liveTitle"><?php echo __("Title"); ?></strong></div>
<div class="details row" itemprop="description">
<div class="pull-left">
</a>
<a class="h6 galleryLink " href="_link_" title="_title_" >
<strong class="title liveTitle"><?php echo __("Title"); ?></strong>
</a>
<div class="galeryDetails" style="overflow: hidden;">
<div>
<img src="" class="photoImg img img-circle img-responsive" style="max-width: 20px;">
</div>
<div style="margin-left: 25px;">
<div class="liveUser"><?php echo __("User"); ?></div>
</div>
</div>
<div class="clearfix"></div>
<div class="galleryTags">
<?php
if (AVideoPlugin::isEnabledByName("LiveUsers") && method_exists("LiveUsers", "getLabels")) {
echo LiveUsers::getLabels('extraVideosModelOnLineLabels');
}
?>
</div>
</a>
</div>
</div>
<script>
var loadedExtraVideos = [];
/* Use this funtion to display live videos dynamic on pages*/
@ -374,8 +378,8 @@ if (!empty($obj->playLiveInFullScreenOnIframe)) {
}, 200);
}
if(application.users && typeof application.users.views !== 'undefined'){
$('.views_on_total_on_live_'+application.users.transmition_key+'_'+application.users.live_servers_id).text(application.users.views);
if (application.users && typeof application.users.views !== 'undefined') {
$('.views_on_total_on_live_' + application.users.transmition_key + '_' + application.users.live_servers_id).text(application.users.views);
}
}
@ -407,6 +411,7 @@ if (!empty($obj->playLiveInFullScreenOnIframe)) {
console.log('socketLiveOFFCallback', json);
processLiveStats(json.stats);
var selector = '.live_' + json.live_servers_id + "_" + json.key;
selector += ', .liveVideo_live_' + json.live_servers_id + "_" + json.key;
//console.log('socketLiveOFFCallback 1', selector);
$(selector).slideUp();
if (typeof onlineLabelOffline == 'function') {
@ -420,19 +425,21 @@ if (!empty($obj->playLiveInFullScreenOnIframe)) {
//console.log('socketLiveOFFCallback 3', selector);
onlineLabelOffline(selector);
}
setTimeout(function(){hideExtraVideosIfEmpty();},500);
setTimeout(function () {
hideExtraVideosIfEmpty();
}, 500);
}
function hideExtraVideosIfEmpty() {
$('.extraVideos').each(function (index, currentElement) {
var somethingIsVisible = false;
$(this).children('div').each(function (index2, currentElement2) {
if($(this).is(":visible")){
if ($(this).is(":visible")) {
somethingIsVisible = true;
return false;
}
});
if(!somethingIsVisible){
if (!somethingIsVisible) {
$('#liveVideos').slideUp();
}
});

View file

@ -2,6 +2,18 @@
window.addEventListener('message', event => {
if (event.data.startLiveRestream) {
startLiveRestream(event.data.m3u8);
}else
if (event.data.webRTCModalConfig) {
console.log('event.data.webRTCModalConfig', event.data.webRTCModalConfig, typeof webRTCModalConfigShow);
if(event.data.webRTCModalConfig==1){
if(typeof webRTCModalConfigShow =='function'){
webRTCModalConfigShow();
}
}else{
if(typeof webRTCModalConfigHide =='function'){
webRTCModalConfigHide();
}
}
}
});

View file

@ -2,7 +2,7 @@
$isWebRTC = 1;
require_once '../../videos/configuration.php';
if(!User::canStream()){
if (!User::canStream()) {
forbiddenPage('You cannot stream');
}
@ -14,10 +14,15 @@ $iframeURL = addQueryStringParameter($iframeURL, 'userHash', Live::getUserHash(U
$chatURL = '';
$chat = AVideoPlugin::loadPluginIfEnabled('Chat2');
if(!empty($chat)){
Chat2::getChatRoomLink(User::getId(), 1, 1, 1, true);
if (!empty($chat)) {
$chatURL = Chat2::getChatRoomLink(User::getId(), 1, 1, 1, true, 1);
if(!empty($_REQUEST['user'])){
$chatURL = addQueryStringParameter($chatURL, 'user', $_REQUEST['user']);
}
if(!empty($_REQUEST['pass'])){
$chatURL = addQueryStringParameter($chatURL, 'pass', $_REQUEST['pass']);
}
}
?>
<!DOCTYPE html>
<html lang="<?php echo $_SESSION['language']; ?>">
@ -43,15 +48,21 @@ if(!empty($chat)){
}
iframe{
width: 100vw;
height: 100vh;
height: calc(100vh - 45px);
}
#chat2Iframe{
position: absolute;
top: 0;
left: 0;
width: 100vw;
height: 100vh;
/* pointer-events: none; */
}
#controls{
position: absolute;
bottom: 5px;
width: 100%;
}
#controls .col{
padding: 0 5px;
}
</style>
<script>
@ -64,10 +75,19 @@ if(!empty($chat)){
</head>
<body>
<iframe frameBorder="0" src="<?php echo $iframeURL; ?>" style="width: 100%; height: 100%;" allowusermedia allow="feature_name allow_list;feature_name allow_list;camera *;microphone *"></iframe>
<iframe frameBorder="0" id="chat2Iframe" src="http://192.168.1.4/YouPHPTube/plugin/Chat2/?room_users_id=1&live_transmitions_history_id=1724&iframe=1&noFade=1&bubblesOnly=1"
style="width: 100%; height: 100%;" ></iframe>
<iframe frameBorder="0"
src="<?php echo $iframeURL; ?>"
allowusermedia allow="feature_name allow_list;feature_name allow_list;camera *;microphone *"></iframe>
<?php
if(!empty($chatURL)){
?>
<iframe frameBorder="0"
id="chat2Iframe"
src="<?php echo $chatURL; ?>"
></iframe>
<?php
}
?>
<div style="z-index: 999; position: absolute; top:5px; left: 5px; opacity: 0.8; filter: alpha(opacity=80);" class="liveEmbed">
<?php
$streamName = $uuid;
@ -79,14 +99,61 @@ if(!empty($chat)){
<script src="<?php echo getCDN(); ?>view/js/js-cookie/js.cookie.js" type="text/javascript"></script>
<script src="<?php echo getCDN(); ?>view/js/jquery-toast/jquery.toast.min.js" type="text/javascript"></script>
<script src="<?php echo getCDN(); ?>view/js/seetalert/sweetalert.min.js" type="text/javascript"></script>
<?php
require_once $global['systemRootPath'] . 'plugin/AVideoPlugin.php';
?>
<!-- getFooterCode start -->
<?php
echo AVideoPlugin::getFooterCode();
?>
<!-- getFooterCode end -->
<div class="" id="controls">
<div class="col col-xs-8" id="webRTCDisconnect" style="display: none;" >
<button class="btn btn-danger btn-block" onclick="webRTCDisconnect();" data-toggle="tooltip" title="<?php echo __("Stop"); ?>">
<i class="fas fa-stop"></i> <?php echo __("Stop"); ?>
</button>
</div>
<div class="col col-xs-8" id="webRTCConnect" style="display: none;" >
<button class="btn btn-success btn-block" onclick="webRTCConnect();" data-toggle="tooltip" title="<?php echo __("Start Live Now"); ?>">
<i class="fas fa-circle"></i> <?php echo __("Go Live"); ?>
</button>
</div>
<div class="col col-xs-4">
<button class="btn btn-primary btn-block" style="" onclick="webRTCConfiguration();" data-toggle="tooltip" data-placement="bottom" title="<?php echo __("Configuration"); ?>">
<i class="fas fa-cog"></i> <span class="hidden-sm hidden-xs"><?php echo __("Configuration"); ?></span>
</button>
</div>
</div>
<script src="<?php echo getCDN(); ?>plugin/Live/webRTC.js" type="text/javascript"></script>
<script>
var updateControlStatusLastState;
function updateControlStatus() {
var hasclass = $('.liveOnlineLabel').hasClass('label-danger');
if (updateControlStatusLastState === hasclass) {
return false;
}
updateControlStatusLastState = hasclass;
if (hasclass) {
$('#webRTCDisconnect').hide();
$('#webRTCConnect').show();
} else {
$('#webRTCDisconnect').show();
$('#webRTCConnect').hide();
}
}
$(document).ready(function () {
updateControlStatus();
setInterval(function () {
updateControlStatus();
}, 500);
});
function webRTCModalConfigShow(){
$('#chat2Iframe').fadeOut();
}
function webRTCModalConfigHide(){
$('#chat2Iframe').fadeIn();
}
</script>
</body>
</html>

View file

@ -121,10 +121,10 @@ class LiveLinks extends PluginAbstract {
public function getLiveApplicationArray() {
global $global;
$obj = $this->getDataObject();
$filename = $global['systemRootPath'] . 'plugin/LiveLinks/view/menuItem.html';
//$filename = $global['systemRootPath'] . 'plugin/LiveLinks/view/menuItem.html';
$filenameExtra = $global['systemRootPath'] . 'plugin/LiveLinks/view/extraItem.html';
$filenameExtraVideoPage = $global['systemRootPath'] . 'plugin/LiveLinks/view/extraItemVideoPage.html';
$filenameListItem = $global['systemRootPath'] . 'plugin/LiveLinks/view/videoListItem.html';
$filename = $filenameListItem = $global['systemRootPath'] . 'plugin/LiveLinks/view/videoListItem.html';
$row = LiveLinks::getAllActive(true, true);
//var_dump($row);exit;
$array = array();
@ -166,8 +166,8 @@ class LiveLinks extends PluginAbstract {
$name,
str_replace('"', "", $value['description']),
self::getLink($value['id']),
'<img src="' . "{$global['webSiteRootURL']}plugin/LiveLinks/getImage.php?id={$value['id']}&format=jpg" . '" class="thumbsJPG img-responsive" height="130">',
empty($obj->disableGifThumbs) ? ('<img src="' . "{$global['webSiteRootURL']}plugin/LiveLinks/getImage.php?id={$value['id']}&format=webp" . '" style="position: absolute; top: 0px; height: 0px; width: 0px; display: none;" class="thumbsGIF img-responsive" height="130">') : "",
'<img src="'. getCDN().'view/img/loading-gif.png" data-src="' . "{$global['webSiteRootURL']}plugin/LiveLinks/getImage.php?id={$value['id']}&format=jpg" . '" class="thumbsJPG img-responsive" height="130">',
empty($obj->disableGifThumbs) ? ('<img src="'. getCDN().'view/img/loading-gif.png" data-src="' . "{$global['webSiteRootURL']}plugin/LiveLinks/getImage.php?id={$value['id']}&format=webp" . '" style="position: absolute; top: 0px; height: 0px; width: 0px; display: none;" class="thumbsGIF img-responsive" height="130">') : "",
"col-lg-2 col-md-4 col-sm-4 col-xs-6",
($liveUsers ? getLiveUsersLabelLiveLinks($value['id']) : '')
);

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" >
<i class="fas fa-link"></i> <span class="hidden-md hidden-sm hidden-mdx"><?php echo $buttonTitle; ?></span>
<i class="fas fa-link"></i> <?php echo $buttonTitle; ?>
</a>
</li>

View file

@ -1,24 +1,22 @@
<div class="liveVideo _class_ fixPadding liveLink liveLink__unique_id_" id="extraItemLiveLink__unique_id_" style="z-index: 2;">
<a href="_link_" title="_title_" class="h6 videoLink">
<div class="thumbsImage aspectRatio16_9" style="min-height: 70px; position:relative;">
<a href="_link_" title="_title_" class="videoLink galleryLink " >
<div class="aspectRatio16_9">
_imgJPG_
_imgGIF_
<span class="label label-danger liveNow faa-flash faa-slow animated">LIVE NOW</span>
</div>
</a>
<a class="h6 galleryLink " href="_link_" title="_title_" >
<strong class="title">_title_</strong>
</a>
<div class="videosDetails">
<div class="text-uppercase row">
<strong itemprop="name" class="title liveTitle">_title_</strong></div>
<div class="details row" itemprop="description">
<div class="pull-left">
<div class="galeryDetails" style="overflow: hidden;">
<div>
<img src="_user_photo_" class="photoImg img img-circle img-responsive" style="max-width: 20px;">
</div>
<div style="margin-left: 25px;">
<div class="liveUser">_user_identification_</div>
</div>
</div>
</div>
<span class="label label-warning livelinksLabel" data-toggle="tooltip" title="" data-placement="bottom" style="border-radius: 0.25em;" ><i class="fas fa-external-link-alt"></i> Live Link</span>
<div class="galleryTags">
_total_on_live_links_id_
</a>
</div>
</div>
</div>

View file

@ -1,5 +1,5 @@
<div class="col-lg-12 col-sm-12 col-xs-12 bottom-border liveVideo liveLink liveLink__unique_id_" id="extraItemVideoPageLiveLink__unique_id_" >
<a href="_link_" title="_title_" class="h6 videoLink aspectRatio16_9">
<a href="_link_" title="_title_" class="videoLink aspectRatio16_9">
<div class="col-lg-5 col-sm-5 col-xs-5 nopadding thumbsImage" style="min-height: 70px; position:relative;">
_imgJPG_
_imgGIF_

View file

@ -8,21 +8,14 @@
</a>
</div>
</div>
<div class="col-lg-7 col-sm-7 col-xs-7 videosDetails" style="font-size: 0.75em;">
<div class="col-lg-7 col-sm-7 col-xs-7 videosDetails" >
<a href="_link_" title="_title_">
<div class="text-uppercase row"><strong class="title">_title_</strong></div>
</a>
<div class="details row">
<div class="text-muted pull-right" style="display:flex;font-size: 1.2em;">
<div class="label label-primary alreadyTooltip" data-toggle="tooltip" title="" data-original-title="Assistindo agora">
<i class="fa fa-eye"></i>
<b class="total_on total_on_videos_id_350 liveUsersOnline">0</b>
</div>
<div class="label label-default alreadyTooltip" data-toggle="tooltip" title="" data-original-title="Visualizações totais">
<i class="fa fa-user"></i>
<b class="views_on_total_on_videos_id_350 liveUsersViews">1</b>
</div>
<div class="text-muted pull-right" style="display:flex;">
_total_on_live_links_id_
</div>
<div class="clearfix"></div>
<div class="nopadding" style="margin-top: 5px !important;">
@ -35,8 +28,6 @@
</div>
</div>
</div>
<span class="label label-warning livelinksLabel" data-toggle="tooltip" title="" data-placement="bottom" style="border-radius: 0.25em;" ><i class="fas fa-external-link-alt"></i> Live Link</span>
_total_on_live_links_id_
</div>
</div>
</div>

View file

@ -69,6 +69,7 @@ Passcode: {password}
$obj->JWT_APP_ID = "my_jitsi_app_id";
$obj->JWT_APP_SECRET = "my_jitsi_app_secret";
$obj->hideTopButton = true;
$obj->buttonTitle = 'Meet';
self::addDataObjectHelper('hideTopButton', 'Hide Top Button', 'This will hide the button on the top menu bar');
return $obj;
}

View file

@ -1,5 +1,5 @@
<li>
<a href="<?php echo $global['webSiteRootURL']; ?>plugin/Meet" data-toggle="tooltip" title="<?php echo __('Meet'); ?>" data-placement="left" >
<i class="fas fa-comments"></i> <span class="hidden-md hidden-sm hidden-mdx"><?php echo __('Meet'); ?></span>
<a href="<?php echo $global['webSiteRootURL']; ?>plugin/Meet" data-toggle="tooltip" title="<?php echo __($buttonTitle); ?>" data-placement="left" >
<i class="fas fa-comments"></i> <?php echo __($buttonTitle); ?>
</a>
</li>

View file

@ -76,7 +76,7 @@ class MobileManager extends PluginAbstract {
$obj->disableComments = false;
$obj->approvalMode = false;
$obj->showMeet = true;
$obj->goLiveWithMeet = true;
$obj->goLiveWithMeet = false;
$obj->doNotAutoSearch = false;
$obj->playStoreApp = 'https://play.google.com/store/apps/details?id=mobile.youphptube.com';
$obj->appleStoreApp = 'https://apps.apple.com/us/app/youphptube/id1337322357';

View file

@ -47,7 +47,7 @@ class PayPalYPT_log extends ObjectYPT {
}
function setJson($json) {
if(!is_string($json)){
if (!is_string($json)) {
$json = _json_encode($json);
}
$this->json = $json;
@ -123,4 +123,33 @@ class PayPalYPT_log extends ObjectYPT {
return $row;
}
static function getAllFromUser($users_id) {
global $global;
$sql = "SELECT * FROM " . static::getTableName() . " WHERE users_id = ? ";
$sql .= self::getSqlFromPost();
$res = sqlDAL::readSql($sql, "i", array($users_id));
$fullData = sqlDAL::fetchAllAssoc($res);
sqlDAL::close($res);
$rows = array();
if ($res != false) {
foreach ($fullData as $row) {
$search = array('"get":{"json":"{', '}","success"');
$replace = array('"get":{"json":{', '},"success"');
$row['json'] = str_replace($search, $replace, $row['json']);
$rows[] = $row;
}
} else {
_error_log($sql . ' Error : (' . $global['mysqli']->errno . ') ' . $global['mysqli']->error);
}
return $rows;
}
public function save() {
global $global;
$this->json = $global['mysqli']->real_escape_string($this->json);
return parent::save();
}
}

View file

@ -406,7 +406,7 @@ class PayPalYPT extends PluginAbstract {
// Create a new billing plan
$plan = new Plan();
$plan->setName(substr(cleanString($name), 0, 126))
->setDescription(substr(cleanString($name), 0, 126))
->setDescription(substr(json_encode(User::getId()), 0, 126))
->setType('INFINITE');
$paymentDefinitionArray = array();
@ -441,7 +441,7 @@ class PayPalYPT extends PluginAbstract {
$merchantPreferences->setReturnUrl($success_url)
->setCancelUrl($cancel_url)
->setNotifyUrl($notify_url)
->setAutoBillAmount('yes')
->setAutoBillAmount('YES')
->setInitialFailAmountAction('CONTINUE')
->setMaxFailAttempts('0')
->setSetupFee(new Currency(array('value' => $total, 'currency' => $currency)));
@ -449,7 +449,7 @@ class PayPalYPT extends PluginAbstract {
$merchantPreferences->setReturnUrl($success_url)
->setCancelUrl($cancel_url)
->setNotifyUrl($notify_url)
->setAutoBillAmount('yes')
->setAutoBillAmount('YES')
->setInitialFailAmountAction('CONTINUE')
->setMaxFailAttempts('0');
}
@ -872,4 +872,9 @@ class PayPalYPT extends PluginAbstract {
return !empty($row);
}
static function getAllLogsFromUser($users_id){
$rows = PayPalYPT_log::getAllFromUser($users_id);
return $rows;
}
}

View file

@ -0,0 +1,37 @@
<?php
require_once '../../videos/configuration.php';
header('Content-Type: application/json');
$obj = new stdClass();
$obj->error = true;
$obj->msg = "";
if (!User::isLogged()) {
$obj->msg = "Only for Logged";
die(json_encode($obj));
}
if (empty($_REQUEST['agreement'])) {
$obj->msg = "Empty Agreement ID";
die(json_encode($obj));
}
if(!User::isLogged()){
$obj->msg = "Please login first";
die(json_encode($obj));
}
$plugin = AVideoPlugin::loadPluginIfEnabled("PayPalYPT");
$agreement = PayPalYPT::cancelAgreement($_REQUEST['agreement']);
if(empty($agreement)){
$obj->msg = "Agreement not found";
die(json_encode($obj));
}
$obj->error = false;
_error_log("agreementCancel: ".json_encode($agreement->getAgreementDetails()));
die(json_encode($obj));
?>

View file

@ -37,7 +37,6 @@ if (empty($_REQUEST['success'])) {
exit;
}
_error_log("PayPalIPN V2: " . json_encode($obj));
_error_log("PayPalIPN V2: POST " . json_encode($_POST));
_error_log("PayPalIPN V2: GET " . json_encode($_GET));
@ -51,8 +50,25 @@ if (!empty($_GET['token'])) {
if (!PayPalYPT::isTokenUsed($_GET['token'])) {
_error_log("PayPalIPN V2: token will be processed ");
$agreement = $paypal->execute();
$payment_amount = floatval($agreement->agreement_details->last_payment_amount->value);
$payment_currency = $agreement->agreement_details->last_payment_amount->currency;
//_error_log("PayPalIPN V2: agreement ". print_r($agreement->getAgreementDetails()->getLastPaymentAmount()->getValue(), true));
if ($agreement->getState() !== 'Active') {
$obj->msg = 'The Agreement is not active yet ';
_error_log("PayPalIPN V2: {$obj->msg} ");
die(json_encode($obj));
}
$lastPayment = $agreement->getAgreementDetails()->getLastPaymentAmount();
if (empty($lastPayment)) {
$lastPayment = $agreement->getPlan()->getMerchantPreferences()->getSetupFee();
}
if (empty($lastPayment)) {
_error_log("PayPalIPN V2: agreement " . print_r($agreement, true));
var_dump($agreement);
exit;
}
$payment_amount = floatval($lastPayment->getValue());
$payment_currency = $lastPayment->getCurrency();
//$payment_time = strtotime($agreement->agreement_details->last_payment_date);
$pp = new PayPalYPT_log(0);
@ -60,7 +76,7 @@ if (!empty($_GET['token'])) {
$pp->setAgreement_id($agreement->id);
$pp->setToken($_GET['token']);
$pp->setValue($payment_amount);
$pp->setJson(array('agreement' => $agreement, 'post' => $_POST, 'get' => $_GET));
$pp->setJson(array('post' => $_POST, 'get' => $_GET));
} else {
_error_log("PayPalIPN V2: token was already processed ");
}
@ -111,7 +127,8 @@ if (!empty($json->type)) {
if (!empty($json->Fsubscriptions_plan_id) && !empty($json->users_id)) {
$fsObj = AVideoPlugin::getDataObjectIfEnabled('FansSubscriptions');
if (!empty($fsObj) && !empty($json->users_id)) {
if (FansSubscriptions::renew($json->users_id, $json->Fsubscriptions_plan_id)) {
if ($renew = FansSubscriptions::renew($json->users_id, $json->Fsubscriptions_plan_id)) {
$redirectUri = addQueryStringParameter($redirectUri, 'msg', $renew->msg);
header('Location: ' . $redirectUri);
exit;
}

View file

@ -0,0 +1,118 @@
<?php
global $global, $config;
if (!isset($global['systemRootPath'])) {
require_once '../../videos/configuration.php';
}
if (!User::isLogged()) {
forbiddenPage();
}
$rows = PayPalYPT::getAllLogsFromUser(User::getId());
?>
<!DOCTYPE html>
<html lang="<?php echo $_SESSION['language']; ?>">
<head>
<title>Paypal subscriptions</title>
<?php
include $global['systemRootPath'] . 'view/include/head.php';
?>
</head>
<body class="<?php echo $global['bodyClass']; ?>">
<?php
include $global['systemRootPath'] . 'view/include/navbar.php';
?>
<div class="container">
<table class="display table table-bordered table-responsive table-striped table-hover table-condensed" width="100%" cellspacing="0">
<thead>
<tr>
<th>#</th>
<th><?php echo __("Type"); ?></th>
<th><?php echo __("Agreement ID"); ?></th>
<th><?php echo __("Status"); ?></th>
<th><?php echo __("Date"); ?></th>
<th></th>
</tr>
</thead>
<tbody>
<?php
foreach ($rows as $value) {
$json = json_decode($value['json']);
$value['status'] = '';
if (!empty($value['agreement_id'])) {
$agreement = PayPalYPT::getBillingAgreement($value['agreement_id']);
if (!empty($agreement)) {
$value['status'] = $agreement->getState();
}
}
?>
<tr id="tr<?php echo $value['agreement_id']; ?>">
<td><?php echo $value['id']; ?></td>
<td>
<?php echo $json->get->json->type; ?>
</td>
<td>
<?php echo $value['agreement_id']; ?>
</td>
<td>
<?php echo $value['created']; ?>
</td>
<td><?php echo $value['expiration']; ?></td>
<td><?php echo $value['expiration']; ?></td>
<td>
<?php
if ($value['status'] == 'Active') {
?>
<button class="btn btn-danger btn-xs" onclick="cancelAgreement('<?php echo $value['agreement_id']; ?>')">
<?php
echo __('Cancel Agreement');
?>
</button>
<?php
}
?>
</td>
</tr>
<?php
}
?>
</tbody>
<tfoot>
<tr>
<th>#</th>
<th><?php echo __("Type"); ?></th>
<th><?php echo __("Agreement ID"); ?></th>
<th><?php echo __("Status"); ?></th>
<th><?php echo __("Date"); ?></th>
<th></th>
</tr>
</tfoot>
</table>
</div>
<?php
include $global['systemRootPath'] . 'view/include/footer.php';
?>
<script>
$(document).ready(function () {
});
function cancelAgreement(agreement_id) {
modal.showPleaseWait();
$.ajax({
url: webSiteRootURL + 'plugin/PayPalYPT/agreementCancel.json.php',
data: {agreement: agreement_id},
type: 'post',
success: function (response) {
if (response.error) {
avideoAlertError(response.msg);
} else {
$('.tr' + agreement_id).fadeOut();
avideoToastSuccess(response.msg);
}
modal.hidePleaseWait();
}
});
}
</script>
</body>
</html>

View file

@ -87,7 +87,7 @@ class PlayLists extends PluginAbstract {
}
$obj = $this->getDataObject();
//echo "getNetflixActionButton: ".$videos_id;
$btnClass = "text-primary";
$btnClass = "";
echo '<div class="">';
include $global['systemRootPath'] . 'plugin/PlayLists/actionButton.php';
echo '</div>';

View file

@ -71,13 +71,13 @@ class PlayerSkins extends PluginAbstract {
$video = Video::getVideoFromFileName($filename, true);
$vType = Video::getIncludeType($video);
$_GET['isMediaPlaySite'] = $video['id'];
if(is_object($video['externalOptions'])){
if (is_object($video['externalOptions'])) {
if (!empty($video['externalOptions']->videoStartSeconds)) {
$video['externalOptions']->videoStartSeconds = parseDurationToSeconds($video['externalOptions']->videoStartSeconds);
} else {
$video['externalOptions']->videoStartSeconds = 0;
}
}else{
} else {
//_error_log('externalOptions Error '.$video['externalOptions'], AVideoLog::$WARNING);
$video['externalOptions'] = new stdClass();
$video['externalOptions']->videoStartSeconds = 0;
@ -175,14 +175,14 @@ class PlayerSkins extends PluginAbstract {
$col1Classes = 'col-md-2 firstC';
$col2Classes = 'col-md-8 secC';
$col3Classes = 'col-md-2 thirdC';
if($obj->playerFullHeight){
if ($obj->playerFullHeight) {
$col2Classes .= ' text-center playerFullHeight';
}
$html .= '
<div class="row main-video" id="mvideo">
<div class="'.$col1Classes.'"></div>
<div class="'.$col2Classes.'">
<div class="' . $col1Classes . '"></div>
<div class="' . $col2Classes . '">
<div id="videoContainer">
<div id="floatButtons" style="display: none;">
<p class="btn btn-outline btn-xs move">
@ -195,13 +195,13 @@ class PlayerSkins extends PluginAbstract {
</div>
<div id="main-video" class="embed-responsive embed-responsive-16by9">' . $htmlMediaTag . '</div>';
$html .= showCloseButton() . '</div></div><div class="'.$col3Classes.'"></div></div>';
$html .= showCloseButton() . '</div></div><div class="' . $col3Classes . '"></div></div>';
return $html;
}
public function getHeadCode() {
if(isWebRTC()){
if (isWebRTC()) {
return '';
}
global $global, $config, $video;
@ -219,13 +219,13 @@ class PlayerSkins extends PluginAbstract {
}
$js .= "<script>var playNextURL = '';</script>";
if (!empty($obj->skin)) {
$css .= "<link href=\"".getCDN()."plugin/PlayerSkins/skins/{$obj->skin}.css\" rel=\"stylesheet\" type=\"text/css\"/>";
$css .= "<link href=\"" . getCDN() . "plugin/PlayerSkins/skins/{$obj->skin}.css\" rel=\"stylesheet\" type=\"text/css\"/>";
}
if ($obj->showLoopButton && isVideoPlayerHasProgressBar()) {
$css .= "<link href=\"".getCDN()."plugin/PlayerSkins/loopbutton.css\" rel=\"stylesheet\" type=\"text/css\"/>";
$css .= "<link href=\"" . getCDN() . "plugin/PlayerSkins/loopbutton.css\" rel=\"stylesheet\" type=\"text/css\"/>";
}
$css .= "<link href=\"".getCDN()."plugin/PlayerSkins/player.css?" . filectime("{$global['systemRootPath']}plugin/PlayerSkins/player.css") . "\" rel=\"stylesheet\" type=\"text/css\"/>";
$css .= "<script src=\"".getCDN()."plugin/PlayerSkins/player.js?" . filectime("{$global['systemRootPath']}plugin/PlayerSkins/player.js") . "\"></script>";
$css .= "<link href=\"" . getCDN() . "plugin/PlayerSkins/player.css?" . filectime("{$global['systemRootPath']}plugin/PlayerSkins/player.css") . "\" rel=\"stylesheet\" type=\"text/css\"/>";
$css .= "<script src=\"" . getCDN() . "plugin/PlayerSkins/player.js?" . filectime("{$global['systemRootPath']}plugin/PlayerSkins/player.js") . "\"></script>";
if ($obj->showLogoOnEmbed && isEmbed() || $obj->showLogo) {
$logo = "{$global['webSiteRootURL']}" . $config->getLogo(true);
$css .= "<style>"
@ -252,23 +252,23 @@ class PlayerSkins extends PluginAbstract {
}
if ($obj->showShareSocial && CustomizeUser::canShareVideosFromVideo(@$video['id'])) {
$css .= "<link href=\"".getCDN()."plugin/PlayerSkins/shareButton.css\" rel=\"stylesheet\" type=\"text/css\"/>";
$css .= "<link href=\"" . getCDN() . "plugin/PlayerSkins/shareButton.css\" rel=\"stylesheet\" type=\"text/css\"/>";
}
if ($obj->showShareAutoplay && isVideoPlayerHasProgressBar()) {
$css .= "<link href=\"".getCDN()."plugin/PlayerSkins/autoplayButton.css\" rel=\"stylesheet\" type=\"text/css\"/>";
$css .= "<link href=\"" . getCDN() . "plugin/PlayerSkins/autoplayButton.css\" rel=\"stylesheet\" type=\"text/css\"/>";
}
}
$url = urlencode(getSelfURI());
$oembed = '<link href="' .getCDN() . 'oembed/?format=json&url=' . $url . '" rel="alternate" type="application/json+oembed" />';
$oembed .= '<link href="' .getCDN() . 'oembed/?format=xml&url=' . $url . '" rel="alternate" type="application/xml+oembed" />';
$oembed = '<link href="' . getCDN() . 'oembed/?format=json&url=' . $url . '" rel="alternate" type="application/json+oembed" />';
$oembed .= '<link href="' . getCDN() . 'oembed/?format=xml&url=' . $url . '" rel="alternate" type="application/xml+oembed" />';
return $js . $css . $oembed;
}
public function getFooterCode() {
if(isWebRTC()){
if (isWebRTC()) {
return '';
}
global $global, $config, $getStartPlayerJSWasRequested, $video, $url, $title;
@ -308,7 +308,7 @@ class PlayerSkins extends PluginAbstract {
}
}
if (!empty($getStartPlayerJSWasRequested) || isVideo()) {
$js .= "<script src=\"".getCDN()."view/js/videojs-persistvolume/videojs.persistvolume.js\"></script>";
$js .= "<script src=\"" . getCDN() . "view/js/videojs-persistvolume/videojs.persistvolume.js\"></script>";
$js .= "<script>" . self::getStartPlayerJSCode() . "</script>";
}
@ -359,12 +359,12 @@ class PlayerSkins extends PluginAbstract {
return '/* getStartPlayerJS $prepareStartPlayerJS_onPlayerReady = "' . count($prepareStartPlayerJS_onPlayerReady) . '", $prepareStartPlayerJS_getDataSetup = "' . count($prepareStartPlayerJS_getDataSetup) . '" */';
}
static function addOnPlayerReady($onPlayerReady){
static function addOnPlayerReady($onPlayerReady) {
return self::getStartPlayerJS($onPlayerReady);
}
static function getStartPlayerJSCode($noReadyFunction = false, $currentTime = 0) {
if(isWebRTC()){
if (isWebRTC()) {
return '';
}
global $config, $global, $prepareStartPlayerJS_onPlayerReady, $prepareStartPlayerJS_getDataSetup, $IMAADTag;
@ -374,14 +374,14 @@ class PlayerSkins extends PluginAbstract {
$currentTime = self::getCurrentTime();
}
if(!empty($global['doNotLoadPlayer'])){
if (!empty($global['doNotLoadPlayer'])) {
return '';
}
if(empty($prepareStartPlayerJS_onPlayerReady)){
if (empty($prepareStartPlayerJS_onPlayerReady)) {
$prepareStartPlayerJS_onPlayerReady = array();
}
if(empty($prepareStartPlayerJS_getDataSetup)){
if (empty($prepareStartPlayerJS_getDataSetup)) {
$prepareStartPlayerJS_getDataSetup = array();
}
@ -464,22 +464,29 @@ class PlayerSkins extends PluginAbstract {
}
static private function getCurrentTime() {
global $video;
$currentTime = 0;
if (isset($_GET['t'])) {
$currentTime = intval($_GET['t']);
} else if (!empty($video['progress']) && !empty($video['progress']['lastVideoTime'])) {
} else {
$videos_id = getVideos_id();
if (!empty($videos_id)) {
$video = Video::getVideoLight($videos_id);
$progress = Video::getVideoPogressPercent($videos_id);
if (!empty($progress) && !empty($progress['lastVideoTime'])) {
$currentTime = intval($video['progress']['lastVideoTime']);
$maxCurrentTime = parseDurationToSeconds($video['duration']);
if ($maxCurrentTime <= $currentTime + 5) {
if (!empty($video['externalOptions']) && !empty($video['externalOptions']->videoStartSeconds)) {
$currentTime = intval($video['externalOptions']->videoStartSeconds);
} else if (!empty($video['externalOptions'])) {
$json = _json_decode($video['externalOptions']);
if (!empty($json->videoStartSeconds)) {
$currentTime = intval(parseDurationToSeconds($json->videoStartSeconds));
} else {
$currentTime = 0;
}
}
} else if (!empty($video['externalOptions']) && !empty($video['externalOptions']->videoStartSeconds)) {
$currentTime = intval($video['externalOptions']->videoStartSeconds);
$maxCurrentTime = parseDurationToSeconds($video['duration']);
if ($maxCurrentTime <= $currentTime + 5) {
$currentTime = 0;
}
}
}
return $currentTime;
}

View file

@ -15,7 +15,7 @@ foreach ($menu as $key => $value) {
foreach ($menuItems as $key2 => $value2) {
?>
<div>
<a href="<?php echo $value2['finalURL']; ?>" <?php echo $value2['target']; ?> class="text-primary">
<a href="<?php echo $value2['finalURL']; ?>" <?php echo $value2['target']; ?>>
<?php
if (!empty($value2['icon'])) {
?>
@ -41,7 +41,7 @@ foreach ($menu as $key => $value) {
}
?>
<div>
<a href="<?php echo $url; ?>" <?php echo $value2['target']; ?> class="text-primary">
<a href="<?php echo $url; ?>" <?php echo $value2['target']; ?>>
<?php
if (!empty($value2['icon'])) {
?>
@ -68,7 +68,7 @@ if (User::isLogged()) {
}
?>
<div>
<a href="<?php echo $url; ?>" <?php echo $value2['target']; ?> class="text-primary">
<a href="<?php echo $url; ?>" <?php echo $value2['target']; ?>>
<?php
if (!empty($value2['icon'])) {
?>
@ -95,7 +95,7 @@ if (User::isLogged()) {
}
?>
<div>
<a href="<?php echo $url; ?>" <?php echo $value2['target']; ?> class="text-primary">
<a href="<?php echo $url; ?>" <?php echo $value2['target']; ?>>
<?php
if (!empty($value2['icon'])) {
?>
@ -125,7 +125,7 @@ if (!User::canWatchVideo($videos_id)) {
}
?>
<div>
<a href="<?php echo $url; ?>" <?php echo $value2['target']; ?> class="text-primary">
<a href="<?php echo $url; ?>" <?php echo $value2['target']; ?>>
<?php
if (!empty($value2['icon'])) {
?>

View file

@ -30,7 +30,7 @@ $balance = $plugin->getBalance(User::getId());
<li class="dropdown-submenu">
<a tabindex="-1" href="<?php echo $global['webSiteRootURL']; ?>plugin/YPTWallet/view/manualAddFunds.php">
<i class="fa fa-plus" aria-hidden="true"></i>
<?php echo $obj->manualAddFundsMenuTitle; ?>
<?php echo __($obj->manualAddFundsMenuTitle); ?>
</a>
</li>
<?php
@ -40,7 +40,7 @@ $balance = $plugin->getBalance(User::getId());
<li class="dropdown-submenu">
<a tabindex="-1" href="<?php echo $global['webSiteRootURL']; ?>plugin/YPTWallet/view/manualWithdrawFunds.php">
<i class="far fa-money-bill-alt" aria-hidden="true"></i>
<?php echo $obj->manualWithdrawFundsMenuTitle; ?>
<?php echo __($obj->manualWithdrawFundsMenuTitle); ?>
<?php
if ($obj->enableAutoWithdrawFundsPagePaypal) {
@ -80,7 +80,7 @@ $balance = $plugin->getBalance(User::getId());
if (User::isAdmin()) {
$total = WalletLog::getTotalFromWallet(0,true,'pending');
?>
<li class="dropdown-header">Admin Menu</li>
<li class="dropdown-header"><?php echo __("Admin Menu"); ?></li>
<li class="dropdown-submenu">
<a tabindex="-1" href="<?php echo $global['webSiteRootURL']; ?>plugin/YPTWallet/view/adminManageWallets.php">
<i class="fa fa-users" aria-hidden="true"></i>

View file

@ -45,7 +45,7 @@ TimeLogStart($timeLog3);
$cssClass = "posterPortrait";
}
?>
<div class="carousel-cell " itemscope itemtype="http://schema.org/VideoObject">
<div class="carousel-cell" >
<div class="tile">
<div class="slide thumbsImage" crc="<?php echo $uid; ?>"
videos_id="<?php echo $value['id']; ?>"

View file

@ -50,7 +50,7 @@ if (showThis($sectionName)) {
$youtubeTitle = $video->title;
$youtubeThumbs = $video->thumbnails;
?>
<div class="col-lg-<?php echo 12 / $objGallery->screenColsLarge; ?> col-md-<?php echo 12 / $objGallery->screenColsMedium; ?> col-sm-<?php echo 12 / $objGallery->screenColsSmall; ?> col-xs-<?php echo 12 / $objGallery->screenColsXSmall; ?> galleryVideo thumbsImage fixPadding" style="z-index: <?php echo $zindex--; ?>; min-height: 175px;" itemscope itemtype="http://schema.org/VideoObject">
<div class="col-lg-<?php echo 12 / $objGallery->screenColsLarge; ?> col-md-<?php echo 12 / $objGallery->screenColsMedium; ?> col-sm-<?php echo 12 / $objGallery->screenColsSmall; ?> col-xs-<?php echo 12 / $objGallery->screenColsXSmall; ?> galleryVideo thumbsImage fixPadding" style="z-index: <?php echo $zindex--; ?>; min-height: 175px;">
<a class="evideo" href="<?php echo $youtubeEmbedLink; ?>" title="<?php echo $youtubeTitle; ?>">
<div class="aspectRatio16_9">
<img src="<?php echo $youtubeThumbs; ?>" alt="<?php echo $youtubeTitle; ?>" class="thumbsJPG img img-responsive" />

View file

@ -36,6 +36,7 @@ unset($_POST['current']);
$get = array('channelName' => $_GET['channelName']);
$palyListsObj = AVideoPlugin::getObjectDataIfEnabled('PlayLists');
TimeLogEnd($timeLog, __LINE__);
$obj = AVideoPlugin::getObjectData("YouPHPFlix2");
?>
<style>
@ -69,6 +70,11 @@ TimeLogEnd($timeLog, __LINE__);
#aboutArea.expanded .showLess{
display: block;
}
#channelHome{
background-color: rgb(<?php echo $obj->backgroundRGB; ?>);
position: relative;
overflow: hidden;
}
</style>
<!-- <?php var_dump($uploadedTotalVideos, $user_id, !isToHidePrivateVideos()); ?> -->
<div class="clearfix"></div>
@ -166,7 +172,7 @@ TimeLogEnd($timeLog, __LINE__);
}
if ($advancedCustomUser->showChannelProgramsTab && !empty($palyListsObj)) {
$totalPrograms = PlayList::getAllFromUserLight($user_id, true, false, 0, true);
if($totalPrograms){
if ($totalPrograms) {
?>
<li class="nav-item <?php echo $active; ?>" id="channelPlayListsLi">
<a class="nav-link " href="#channelPlayLists" data-toggle="tab" aria-expanded="true">
@ -189,7 +195,7 @@ TimeLogEnd($timeLog, __LINE__);
$obj = AVideoPlugin::getObjectData("YouPHPFlix2");
?>
<style>#bigVideo{top: 0 !important;}</style>
<div class="tab-pane <?php echo $active; ?>" id="channelHome" style="min-height: 800px; background-color: rgb(<?php echo $obj->backgroundRGB; ?>);position: relative; overflow: hidden;">
<div class="tab-pane <?php echo $active; ?>" id="channelHome" >
<?php
$obj->BigVideo = true;
$obj->PlayList = false;
@ -276,10 +282,10 @@ TimeLogEnd($timeLog, __LINE__);
<div class="panel panel-default">
<div class="panel-heading text-right">
<?php
if($isMyChannel){
if ($isMyChannel) {
?>
<a class="btn btn-default btn-xs " href="<?php echo $global['webSiteRootURL']; ?>plugin/PlayLists/managerPlaylists.php">
<i class="fas fa-edit"></i> <?php echo __('Organize') . ' ' .$palyListsObj->name; ?>
<i class="fas fa-edit"></i> <?php echo __('Organize') . ' ' . $palyListsObj->name; ?>
</a>
<?php
}

View file

@ -47,8 +47,8 @@ unset($_POST['current']);
<?php
if (empty($playlists)) {
if($current==1){
echo "<div class='alert alert-warning'><i class=\"fas fa-exclamation-triangle\"></i> ".__('Sorry you do not have anything available')."</div>";
if ($current == 1) {
echo "<div class='alert alert-warning'><i class=\"fas fa-exclamation-triangle\"></i> " . __('Sorry you do not have anything available') . "</div>";
}
die("</div>");
@ -213,10 +213,11 @@ unset($_POST['current']);
<img src="<?php echo $poster; ?>" alt="<?php echo $serie['title']; ?>" class="img img-responsive" style="max-height: 200px;" />
</div>
<div>
<a class="hrefLink" href="<?php echo Video::getLink($serie['id'], $serie['clean_title']); ?>" title="<?php echo $serie['title']; ?>">
<h2><?php echo $serie['title']; ?></h2>
<a class="h6 galleryLink hrefLink" href="<?php echo Video::getLink($serie['id'], $serie['clean_title']); ?>" title="<?php echo $serie['title']; ?>">
<strong class="title"><?php echo $serie['title']; ?></strong>
</a>
<small class="text-muted galeryDetails">
<small class="galeryDetails">
<div class="galleryTags">
<a class="label label-default" href="<?php echo Video::getLink($serie['id'], $category->getClean_name(), false, $get); ?>">
<?php
if (!empty($category->getIconClass())) {
@ -237,6 +238,7 @@ unset($_POST['current']);
}
}
?>
</div>
<i class="far fa-clock"></i>
<?php
echo humanTiming(strtotime($serie['created'])), " ", __('ago');
@ -341,10 +343,10 @@ unset($_POST['current']);
}
?>
</a>
<a class="hrefLink" href="<?php echo $episodeLink; ?>" title="<?php echo $value['title']; ?>">
<h2><?php echo $value['title']; ?></h2>
<a class="h6 galleryLink hrefLink" href="<?php echo $episodeLink; ?>" title="<?php echo $value['title']; ?>">
<strong class="title"><?php echo $value['title']; ?></strong>
</a>
<div class="text-muted galeryDetails" style="min-height: 60px;">
<div class="galeryDetails" style="min-height: 60px;">
<div>
<?php
$value['tags'] = Video::getTags($value['id']);
@ -386,7 +388,7 @@ unset($_POST['current']);
if (Video::canEdit($value['id'])) {
?>
<div>
<a href="<?php echo $global['webSiteRootURL']; ?>mvideos?video_id=<?php echo $value['id']; ?>" class="text-primary"><i class="fa fa-edit"></i> <?php echo __("Edit Video"); ?></a>
<a href="<?php echo $global['webSiteRootURL']; ?>mvideos?video_id=<?php echo $value['id']; ?>"><i class="fa fa-edit"></i> <?php echo __("Edit Video"); ?></a>
</div>
@ -413,7 +415,7 @@ unset($_POST['current']);
<?php
}
if(PlayLists::showTVFeatures()){
if (PlayLists::showTVFeatures()) {
?>
<div class="panel-footer">
<?php
@ -427,14 +429,14 @@ unset($_POST['current']);
?>
</div>
<?php
}
if (!empty($videosP) && empty($countSuccess)) {
}
if (!empty($videosP) && empty($countSuccess)) {
header("Location: {$global['webSiteRootURL']}view/channelPlaylistItems.php?current=" . (count($playlists) ? $_POST['current'] + 1 : $_POST['current']) . "&channelName={$_GET['channelName']}");
exit;
}
TimeLogEnd($timeLog2, __LINE__);
$_GET['channelName'] = $channelName;
?>
}
TimeLogEnd($timeLog2, __LINE__);
$_GET['channelName'] = $channelName;
?>
<script>
$(function () {
@ -581,14 +583,14 @@ $_GET['channelName'] = $channelName;
</script>
<!--
channelPlaylist
<?php
$timesC[__LINE__] = microtime(true) - $startC;
$startC = microtime(true);
foreach ($timesC as $key => $value) {
<?php
$timesC[__LINE__] = microtime(true) - $startC;
$startC = microtime(true);
foreach ($timesC as $key => $value) {
echo "Line: {$key} -> {$value}\n";
}
$_POST['current'] = $current;
?>
}
$_POST['current'] = $current;
?>
-->
</div>
<p class="pagination">

View file

@ -106,7 +106,7 @@ $playListsObj = AVideoPlugin::getObjectData("PlayLists");
<div class="panel panel-default program" playListId="<?php echo $program['id']; ?>">
<div class="panel-heading">
<strong style="font-size: 1.1em;" class="playlistName"><?php echo $program['name']; ?> </strong>
<strong class="playlistName"><?php echo $program['name']; ?> </strong>
<?php
if (!empty($videosArrayId)) {
@ -259,11 +259,11 @@ $playListsObj = AVideoPlugin::getObjectData("PlayLists");
}
?>
</a>
<a class="hrefLink" href="<?php echo $episodeLink; ?>" title="<?php echo $value['title']; ?>">
<h2><?php echo $value['title']; ?></h2>
<a class="h6 galleryLink hrefLink" href="<?php echo $episodeLink; ?>" title="<?php echo $value['title']; ?>">
<strong class="title"><?php echo $value['title']; ?></strong>
</a>
<div class="text-muted galeryDetails" style="min-height: 60px;">
<div>
<div class="galeryDetails" style="min-height: 60px;">
<div class="galleryTags">
<?php
$value['tags'] = Video::getTags($value['id']);
foreach ($value['tags'] as $value2) {
@ -307,7 +307,7 @@ $playListsObj = AVideoPlugin::getObjectData("PlayLists");
if (Video::canEdit($value['id'])) {
?>
<div>
<a href="<?php echo $global['webSiteRootURL']; ?>mvideos?video_id=<?php echo $value['id']; ?>" class="text-primary"><i class="fa fa-edit"></i> <?php echo __("Edit Video"); ?></a>
<a href="<?php echo $global['webSiteRootURL']; ?>mvideos?video_id=<?php echo $value['id']; ?>"><i class="fa fa-edit"></i> <?php echo __("Edit Video"); ?></a>
</div>
@ -323,7 +323,7 @@ $playListsObj = AVideoPlugin::getObjectData("PlayLists");
</span>
</div>
<div>
<span class="text-primary" playlist_id="<?php echo $program['id']; ?>" video_id="<?php echo $value['id']; ?>">
<span playlist_id="<?php echo $program['id']; ?>" video_id="<?php echo $value['id']; ?>">
<i class="fas fa-sort-numeric-down"></i> <?php echo __("Sort"); ?>
<input type="number" step="1" class="video_order" value="<?php echo intval($program['videos'][$count - 1]['video_order']); ?>" style="max-width: 50px;">
<button class="btn btn-sm btn-xs sortNow"><i class="fas fa-check-square"></i></button>

View file

@ -37,10 +37,6 @@ time.duration{
color: rgba(255, 255, 255, 0.3)!important;
font-size: 50px;
}
.videoLink div.details,
.videoLink div.details div {
font-size: 0.9em;
}
.gallery:hover .glyphicon-play-circle,
.videoLink:hover .glyphicon-play-circle {
color: rgba(255, 255, 255, 0.6)!important;
@ -153,7 +149,7 @@ footer ul.list-inline li {
}
@media (max-width: 767px) {
.navbar-form, #modeYoutubeBottomContent, .principalContainer,
.nopaddingOnSmall,.container-fluid, #yptRightBar{
.nopaddingOnSmall,.container-fluid,.container, #yptRightBar{
padding: 0;
}
.panel-body, .tabbable-panel {
@ -889,6 +885,7 @@ img.blur{
.videoListItem{
overflow: hidden;
font-size: smaller;
}
.extraVideos:empty{
display: none;
@ -1173,3 +1170,37 @@ li.dropdown-submenu > ul > li > a{
a:hover{
text-decoration: none;
}
.descriptionArea .descriptionAreaPreContent{
max-height: 200px;
overflow: hidden;
transition: max-height 0.25s ease-out;
overflow: hidden;
}
.descriptionAreaPreContent{
margin-bottom: 10px;
}
.descriptionArea.expanded .descriptionAreaPreContent{
max-height: 1500px;
overflow: auto;
transition: max-height 0.25s ease-in;
}
.descriptionAreaShowMoreBtn{
margin-top: -10px;
}
.descriptionArea .showMore{
display: block;
}
.descriptionArea .showLess{
display: none;
}
.descriptionArea.expanded .showMore{
display: none;
}
.descriptionArea.expanded .showLess{
display: block;
}
.infoDetails{
display: flex;
margin: 4px 0;
}

View file

@ -351,7 +351,7 @@ function subscribe(email, user_id) {
'user_id': user_id
},
success: function (response) {
var totalElement = $('.notificationButton' + user_id+' .badge');
var totalElement = $('.notificationButton' + user_id + ' .badge');
if (response.subscribe == "i") {
$('.notificationButton' + user_id).removeClass("subscribed");
totalElement.text(parseInt(totalElement.first().text()) - 1);
@ -367,7 +367,7 @@ function subscribe(email, user_id) {
}
function toogleNotify(user_id) {
email = $('#subscribeEmail'+user_id).val();
email = $('#subscribeEmail' + user_id).val();
subscribeNotify(email, user_id);
}
function subscribeNotify(email, user_id) {
@ -443,7 +443,7 @@ function _addView(videos_id, currentTime) {
'currentTime': currentTime
},
success: function (response) {
$('.view-count' + videos_id).text(response.count);
$('.view-count' + videos_id).text(response.countHTML);
}
});
}
@ -699,7 +699,7 @@ function showMuteTooltip() {
}
function playerPlayIfAutoPlay(currentTime) {
if(isWebRTC()){
if (isWebRTC()) {
return false;
}
if (isAutoplayEnabled()) {
@ -1114,13 +1114,13 @@ function avideoModalIframeRemove() {
}
function avideoResponse(response) {
if(response.error){
if(!response.msg){
if (response.error) {
if (!response.msg) {
response.msg = 'Error';
}
avideoAlertError(response.msg);
}else{
if(!response.msg){
} else {
if (!response.msg) {
response.msg = 'Success';
}
avideoToastSuccess(response.msg);
@ -1212,7 +1212,21 @@ function tabsCategoryDocumentHeightChanged() {
return false;
}
function checkDescriptionArea(){
$(".descriptionArea").each(function (index) {
if ($(this).height() < $(this).find('.descriptionAreaContent').height()) {
$(this).find('.descriptionAreaShowMoreBtn').show();
}
});
}
$(document).ready(function () {
checkDescriptionArea();
setInterval(function(){// check for the carousel
checkDescriptionArea();
},3000);
Cookies.set('timezone', Intl.DateTimeFormat().resolvedOptions().timeZone, {
path: '/',
expires: 365

View file

@ -129,6 +129,11 @@ if (!empty($evideo)) {
$_GET['catName'] = "";
}
if (empty($video) && !empty($_REQUEST['v'])) {
$video = Video::getVideo($_REQUEST['v'], "viewable", false, false, false, true);
//var_dump('Line: '.__LINE__, $_REQUEST['v'], $video);exit;
}
if (empty($video)) {
$video = Video::getVideo("", "viewable", false, false, true, true);
}
@ -333,38 +338,6 @@ if (!empty($video['users_id']) && User::hasBlockedUser($video['users_id'])) {
$modeYouTubeTimeLog['After head'] = microtime(true) - $modeYouTubeTime;
$modeYouTubeTime = microtime(true);
?>
<style>
#descriptionArea #descriptionAreaPreContent{
max-height: 200px;
overflow: hidden;
transition: max-height 0.25s ease-out;
overflow: hidden;
}
#descriptionAreaPreContent{
margin-bottom: 30px;
}
#descriptionArea.expanded #descriptionAreaPreContent{
max-height: 1500px;
overflow: auto;
transition: max-height 0.25s ease-in;
}
#descriptionAreaShowMoreBtn{
position: absolute;
bottom: 0;
}
#descriptionArea .showMore{
display: block;
}
#descriptionArea .showLess{
display: none;
}
#descriptionArea.expanded .showMore{
display: none;
}
#descriptionArea.expanded .showLess{
display: block;
}
</style>
</head>
<body class="<?php echo $global['bodyClass']; ?>">

View file

@ -94,7 +94,7 @@ if (User::hasBlockedUser($video['users_id'])) {
<?php
if (Video::showYoutubeModeOptions() && empty($advancedCustom->doNotDisplayViews)) {
?>
<span class="watch-view-count pull-right text-muted" itemprop="interactionCount"><span class="view-count<?php echo $video['id']; ?>"><?php echo number_format($video['views_count'], 0); ?></span> <?php echo __("Views"); ?></span>
<span class="watch-view-count pull-right text-muted" itemprop="interactionCount"><span class="view-count<?php echo $video['id']; ?>"><?php echo number_format_short($video['views_count']); ?></span> <?php echo __("Views"); ?></span>
<?php
}
?>
@ -280,15 +280,15 @@ if ($video['type'] !== 'notfound' && CustomizeUser::canShareVideosFromVideo($vid
if ($video['type'] !== 'notfound' && $video['type'] !== 'article') {
?>
<div class="col-xs-4 col-sm-2 col-lg-2 text-right"><strong><?php echo __("Description"); ?>:</strong></div>
<div class="col-xs-8 col-sm-10 col-lg-10" itemprop="description" id="descriptionArea">
<div id="descriptionAreaPreContent">
<div id="descriptionAreaContent">
<div class="col-xs-8 col-sm-10 col-lg-10 descriptionArea" itemprop="description">
<div class="descriptionAreaPreContent">
<div class="descriptionAreaContent">
<?php
echo Video::htmlDescription($video['description']);
?>
</div>
</div>
<button onclick="$('#descriptionArea').toggleClass('expanded');" class="btn btn-xs btn-default" id="descriptionAreaShowMoreBtn" style="display: none; ">
<button onclick="$(this).closest('.descriptionArea').toggleClass('expanded');" class="btn btn-xs btn-default descriptionAreaShowMoreBtn" style="display: none; ">
<span class="showMore"><i class="fas fa-caret-down"></i> <?php echo __("Show More"); ?></span>
<span class="showLess"><i class="fas fa-caret-up"></i> <?php echo __("Show Less"); ?></span>
</button>
@ -302,9 +302,6 @@ if ($video['type'] !== 'notfound' && CustomizeUser::canShareVideosFromVideo($vid
</div>
<script>
$(document).ready(function () {
if ($('#descriptionArea').height() < $('#descriptionAreaContent').height()) {
$('#descriptionAreaShowMoreBtn').show();
}
<?php
if (empty($advancedCustom->showShareMenuOpenByDefault)) {
?>

View file

@ -46,14 +46,15 @@ $metaDescription = __("Trending");
<?php include $global['systemRootPath'] . 'view/include/navbar.php'; ?>
<div class="container">
<div class="panel panel-default">
<div class="panel-body">
<div class="row results gallery">
<?php
//var_dump($rows);
foreach ($videos as $key => $value) {
?>
<div class="col-lg-12 searchResult thumbsImage mb-2" style="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']);
@ -75,10 +76,10 @@ $metaDescription = __("Trending");
</a>
<div class=" col-sm-8 col-md-8 col-lg-8">
<a class="h6 galleryLink col-lg-12" style="font-size: 1.5em;" videos_id="<?php echo $value['id']; ?>" href="<?php echo Video::getLink($value['id'], $value['clean_title']); ?>" title="<?php echo $value['title']; ?>">
<h2><?php echo $value['title']; ?></h2>
<strong><?php echo $value['title']; ?></strong>
</a>
<div class="text-muted galeryDetails col-lg-12" style="overflow: hidden;">
<div class="galeryDetails col-lg-12" style="overflow: hidden;">
<div>
<?php if (empty($_GET['catName'])) { ?>
<a class="label label-default" href="<?php echo $global['webSiteRootURL']; ?>cat/<?php echo $value['clean_category']; ?>/">
@ -110,7 +111,7 @@ $metaDescription = __("Trending");
<div>
<i class="fa fa-eye"></i>
<span itemprop="interactionCount">
<?php echo number_format($value['views_count'], 0); ?> <?php echo __("Views"); ?>
<?php echo number_format_short($value['views_count']); ?> <?php echo __("Views"); ?>
</span>
</div>
<?php } ?>
@ -119,8 +120,8 @@ $metaDescription = __("Trending");
<?php echo humanTiming(strtotime($value['videoCreation'])), " ", __('ago'); ?>
</div>
<div>
<a href="<?php echo User::getChannelLink($value['users_id']); ?>">
<i class="fa fa-user"></i>
<a class="text-muted" href="<?php echo User::getChannelLink($value['users_id']); ?>">
<?php echo User::getNameIdentificationById($value['users_id']); ?>
</a>
<?php if ((!empty($value['description'])) && !empty($obj->Description)) { ?>
@ -129,7 +130,7 @@ $metaDescription = __("Trending");
</div>
<?php if (Video::canEdit($value['id'])) { ?>
<div>
<a href="<?php echo $global['webSiteRootURL']; ?>mvideos?video_id=<?php echo $value['id']; ?>" class="text-primary">
<a href="<?php echo $global['webSiteRootURL']; ?>mvideos?video_id=<?php echo $value['id']; ?>">
<i class="fa fa-edit"></i> <?php echo __("Edit Video"); ?>
</a>
</div>
@ -195,13 +196,15 @@ $metaDescription = __("Trending");
}
?>
</div>
</div>
</div>
<!-- status elements -->
<div class="scroller-status">
<div class="infinite-scroll-request loader-ellips text-center">
<img src="img/loading.gif" alt=""/>
</div>
<p class="infinite-scroll-last text-center text-muted"><?php echo __('End of content')?></p>
<p class="infinite-scroll-error text-center text-muted"><?php echo __('No more pages to load')?></p>
<p class="infinite-scroll-last text-center text-muted"><?php echo __('End of content') ?></p>
<p class="infinite-scroll-error text-center text-muted"><?php echo __('No more pages to load') ?></p>
</div>
<?php
if ($_REQUEST['current'] + 1 <= $pages) {

View file

@ -13,7 +13,7 @@
style="width: {progress}%;" aria-valuenow="{progress}" aria-valuemin="0" aria-valuemax="100"></div>
</div>
</div>
<div class="col-lg-7 col-sm-7 col-xs-7 videosDetails" style="font-size: 0.75em;">
<div class="col-lg-7 col-sm-7 col-xs-7 videosDetails">
<a href="{link}" title="{title}" >
<div class="text-uppercase row"><strong class="title">{title}</strong></div>
</a>