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

Creating a plugin for replace configurations->adsense

This commit is contained in:
daniel 2019-08-30 16:18:21 -03:00
parent c3dc469ccc
commit f5be6d3579
16 changed files with 342 additions and 237 deletions

View file

@ -1973,3 +1973,47 @@ function ddosProtection() {
return true;
}
function getAdsLeaderBoardTop(){
$ad = YouPHPTubePlugin::getObjectDataIfEnabled('ADs');
if(!empty($ad)){
if(isMobile()){
return $ad->leaderBoardTopMobile->value;
}else{
return $ad->leaderBoardTop->value;
}
}
}
function getAdsLeaderBoardMiddle(){
$ad = YouPHPTubePlugin::getObjectDataIfEnabled('ADs');
if(!empty($ad)){
if(isMobile()){
return $ad->leaderBoardMiddleMobile->value;
}else{
return $ad->leaderBoardMiddle->value;
}
}
}
function getAdsLeaderBoardFooter(){
$ad = YouPHPTubePlugin::getObjectDataIfEnabled('ADs');
if(!empty($ad)){
if(isMobile()){
return $ad->leaderBoardFooterMobile->value;
}else{
return $ad->leaderBoardFooter->value;
}
}
}
function getAdsSideRectangle(){
$ad = YouPHPTubePlugin::getObjectDataIfEnabled('ADs');
if(!empty($ad)){
if(isMobile()){
return $ad->sideRectangle->value;
}else{
return $ad->sideRectangle->value;
}
}
}

77
plugin/ADs/ADs.php Normal file
View file

@ -0,0 +1,77 @@
<?php
require_once $global['systemRootPath'] . 'plugin/Plugin.abstract.php';
class ADs extends PluginAbstract {
public function getDescription() {
$txt = "Handle the ads system, like Adsense or similar";
//$help = "<br><small><a href='https://github.com/DanielnetoDotCom/YouPHPTube/wiki/AD_Overlay-Plugin' target='__blank'><i class='fas fa-question-circle'></i> Help</a></small>";
$help = "";
return $txt . $help;
}
public function getName() {
return "ADs";
}
public function getUUID() {
return "ADs73225-3807-4167-ba81-0509dd280e06";
}
public function getPluginVersion() {
return "1.0";
}
public function getEmptyDataObject() {
global $global,$config;
$obj = new stdClass();
$adsense = $config->getAdsense();
$o = new stdClass();
$o->type = "textarea";
$o->value = empty($adsense)?"<img src='{$global['webSiteRootURL']}plugin/ADs/sample728x90.jpg'>":$adsense;
$obj->leaderBoardTop = $o;
$o = new stdClass();
$o->type = "textarea";
$o->value = empty($adsense)?"<img src='{$global['webSiteRootURL']}plugin/ADs/sample728x90.jpg'>":$adsense;;
$obj->leaderBoardMiddle = $o;
/*
$o = new stdClass();
$o->type = "textarea";
$o->value = empty($adsense)?"<img src='{$global['webSiteRootURL']}plugin/ADs/sample728x90.jpg'>":$adsense;;
$obj->leaderBoardFooter = $o;
*
*/
$o = new stdClass();
$o->type = "textarea";
$o->value = empty($adsense)?"<img src='{$global['webSiteRootURL']}plugin/ADs/sample300x250.jpg'>":$adsense;;
$obj->sideRectangle = $o;
$o = new stdClass();
$o->type = "textarea";
$o->value = empty($adsense)?"<img src='{$global['webSiteRootURL']}plugin/ADs/sample300x250.jpg'>":$adsense;;
$obj->leaderBoardTopMobile = $o;
$o = new stdClass();
$o->type = "textarea";
$o->value = empty($adsense)?"<img src='{$global['webSiteRootURL']}plugin/ADs/sample300x250.jpg'>":$adsense;;
$obj->leaderBoardMiddleMobile = $o;
/*
$o = new stdClass();
$o->type = "textarea";
$o->value = empty($adsense)?"<img src='{$global['webSiteRootURL']}plugin/ADs/sample300x250.jpg'>":$adsense;;
$obj->leaderBoardFooterMobile = $o;
*
*/
return $obj;
}
public function getTags() {
return array('free');
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

BIN
plugin/ADs/sample728x90.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

View file

@ -54,8 +54,6 @@ class CustomizeAdvanced extends PluginAbstract {
$obj->doNotUseXsendFile = false;
$obj->makeVideosInactiveAfterEncode = false;
$obj->usePermalinks = false;
$obj->showAdsenseBannerOnTop = false;
$obj->showAdsenseBannerOnLeft = true;
$obj->disableAnimatedGif = false;
$obj->removeBrowserChannelLinkFromMenu = false;
$obj->EnableWavesurfer = false;

View file

@ -42,7 +42,7 @@ if(!isset($global['systemRootPath'])){
<div data-spy="affix" style="margin-right: 10vw;" >
<div class="list-group-item ">
<?php
echo $config->getAdsense();
echo getAdsSideRectangle();
?>
</div>
</div>

View file

@ -72,7 +72,6 @@ class Gallery extends PluginAbstract {
$obj->screenColsMedium = 3;
$obj->screenColsSmall = 2;
$obj->screenColsXSmall = 1;
$obj->showTopBannerOnMobile = false;
return $obj;
}

View file

@ -10,7 +10,7 @@ function showThis($who) {
return false;
}
function createGallery($title, $sort, $rowCount, $getName, $mostWord, $lessWord, $orderString, $defaultSort = "ASC", $ignoreGroup=false) {
function createGallery($title, $sort, $rowCount, $getName, $mostWord, $lessWord, $orderString, $defaultSort = "ASC", $ignoreGroup = false) {
if (!showThis($getName)) {
return "";
}
@ -141,7 +141,7 @@ function createGallerySection($videos, $crc = "", $get = array()) {
$startG = microtime(true);
$images = Video::getImageFromFilename($value['filename'], $value['type']);
@$timesG[__LINE__] += microtime(true) - $startG;
if(!is_object($images)){
if (!is_object($images)) {
$images = new stdClass();
$images->thumbsGif = "";
$images->poster = "{$global['webSiteRootURL']}view/img/notfound.jpg";
@ -164,12 +164,12 @@ function createGallerySection($videos, $crc = "", $get = array()) {
?>
</div>
<?php
if($value['type']!=='pdf' && $value['type']!=='article'){
if ($value['type'] !== 'pdf' && $value['type'] !== 'article') {
?>
<span class="duration"><?php echo Video::getCleanDuration($value['duration']); ?></span>
<div class="progress" style="height: 3px; margin-bottom: 2px;">
<div class="progress-bar progress-bar-danger" role="progressbar" style="width: <?php echo $value['progress']['percent'] ?>%;" aria-valuenow="<?php echo $value['progress']['percent'] ?>" aria-valuemin="0" aria-valuemax="100"></div>
</div>
<span class="duration"><?php echo Video::getCleanDuration($value['duration']); ?></span>
<div class="progress" style="height: 3px; margin-bottom: 2px;">
<div class="progress-bar progress-bar-danger" role="progressbar" style="width: <?php echo $value['progress']['percent'] ?>%;" aria-valuenow="<?php echo $value['progress']['percent'] ?>" aria-valuemin="0" aria-valuemax="100"></div>
</div>
<?php
}
?>
@ -291,8 +291,12 @@ function createGallerySection($videos, $crc = "", $get = array()) {
?>
</div>
<?php } ?>
<?php
}
?>
<div class="row text-center" style="padding: 10px;">
<?php echo getAdsLeaderBoardMiddle(); ?>
</div>
<!--
createGallerySection
<?php

View file

@ -80,15 +80,9 @@ $contentSearchFound = false;
<body class="<?php echo $global['bodyClass']; ?>">
<?php include $global['systemRootPath'] . 'view/include/navbar.php'; ?>
<div class="container-fluid gallery" itemscope itemtype="http://schema.org/VideoObject">
<?php
if (!empty($obj->showTopBannerOnMobile) || !isMobile()) {
?>
<div class="row text-center" style="padding: 10px;">
<?php echo $config->getAdsense(); ?>
</div>
<?php
}
?>
<div class="row text-center" style="padding: 10px;">
<?php echo getAdsLeaderBoardTop(); ?>
</div>
<div class="col-sm-10 col-sm-offset-1 list-group-item">
<div class="row mainArea">

View file

@ -76,7 +76,7 @@ $liveDO = YouPHPTubePlugin::getObjectData("Live");
</div>
<div class="col-md-3">
<?php
echo $config->getAdsense();
echo getAdsSideRectangle();
?>
</div>
</div>

View file

@ -77,7 +77,7 @@ if(!empty($objSecure)){
<div class="container">
<div class="col-md-9 col-sm-9 col-xs-9" style="margin: 0; padding: 0;" id="embedVideo-content">
<?php
echo $config->getAdsense();
echo getAdsLeaderBoardTop();
?>
<div class="embed-responsive embed-responsive-16by9" >
<video poster="<?php echo $global['webSiteRootURL']; ?>plugin/Live/view/OnAir.jpg" controls autoplay="autoplay"
@ -106,7 +106,7 @@ if(!empty($objSecure)){
</div>
<?php
echo $config->getAdsense();
echo getAdsLeaderBoardFooter();
?>
</div>
<div class="col-md-3 col-sm-3 col-xs-3" style="margin: 0; padding: 0;">

View file

@ -87,7 +87,7 @@ if(!empty($_GET['embed'])){
</div>
<div class="col-md-3">
<?php
echo $config->getAdsense();
echo getAdsSideRectangle();
?>
</div>
</div>

View file

@ -17,10 +17,10 @@ $playList = PlayList::getVideosFromPlaylist($_GET['playlists_id']);
$playListData = array();
$videoStartSeconds = array();
foreach ($playList as $value) {
if($value['type'] === 'embed'){
if ($value['type'] === 'embed') {
$sources[0]['type'] = 'video';
$sources[0]['url'] = $value["videoLink"];
}else{
} else {
$sources = getVideosURL($value['filename']);
}
$images = Video::getImageFromFilename($value['filename'], $value['type']);
@ -99,7 +99,7 @@ foreach ($playList as $value) {
<div class="col-lg-12 col-sm-12 col-xs-12">
<center style="margin:5px;">
<?php
echo $config->getAdsense();
echo getAdsLeaderBoardTop();
?>
</center>
</div>
@ -158,15 +158,9 @@ foreach ($playList as $value) {
<div class="col-sm-8 col-md-8" id="modeYoutubeBottomContent">
</div>
<div class="col-sm-2 col-md-2 bgWhite list-group-item rightBar">
<?php
if (!empty($advancedCustom->showAdsenseBannerOnLeft)) {
?>
<div class="col-lg-12 col-sm-12 col-xs-12">
<?php echo $config->getAdsense(); ?>
</div>
<?php
}
?>
<div class="col-lg-12 col-sm-12 col-xs-12">
<?php echo getAdsSideRectangle(); ?>
</div>
<input type="search" id="playListSearch" class="form-control" placeholder=" <?php echo __("Search"); ?>"/>
<select class="form-control" id="embededSortBy" >
<option value="default"> <?php echo __("Default"); ?></option>

View file

@ -82,7 +82,7 @@ $contentSearchFound = false;
<?php include $global['systemRootPath'] . 'view/include/navbar.php'; ?>
<div class="container YouTube" itemscope itemtype="http://schema.org/VideoObject">
<div class="row text-center" style="padding: 10px;">
<?php echo $config->getAdsense(); ?>
<?php echo getAdsLeaderBoardTop(); ?>
</div>
<div class="">

View file

@ -519,9 +519,10 @@ if (User::isAdmin()) {
<div class="form-group">
<label class="col-md-2"><?php echo __("Google Ad Sense"); ?></label>
<div class="col-md-10">
<textarea id="adsense" class="form-control" type="text" rows="20" ><?php echo $config->getAdsense(); ?></textarea>
<small>For Google AdSense code: <a href='https://www.google.com/adsense' target="_blank">https://www.google.com/adsense</a></small><br>
<small>Leave blank for native code</small>
<input type="hidden" value="" id="adsense"/>
<div class="alert alert-info">
Google AD Sense and any other Ads provider are moved to the <a href='<?php echo $global['webSiteRootURL']; ?>plugins'>ADs plugin </a>
</div>
</div>
</div>

View file

@ -177,7 +177,7 @@ if (!empty($video)) {
$data = getimgsize($source['path']);
$imgw = $data[0];
$imgh = $data[1];
}else{
} else {
$img = $images->poster;
}
} else {
@ -246,24 +246,22 @@ YouPHPTubePlugin::getModeYouTube($v['id']);
$video['type'] = "video";
}
$img_portrait = ($video['rotation'] === "90" || $video['rotation'] === "270") ? "img-portrait" : "";
if (!empty($advancedCustom->showAdsenseBannerOnTop)) {
?>
<style>
.compress {
top: 100px !important;
}
</style>
<div class="row">
<div class="col-lg-12 col-sm-12 col-xs-12">
<center style="margin:5px;">
<?php
echo $config->getAdsense();
?>
</center>
</div>
?>
<style>
.compress {
top: 100px !important;
}
</style>
<div class="row">
<div class="col-lg-12 col-sm-12 col-xs-12">
<center style="margin:5px;">
<?php
echo getAdsLeaderBoardTop();
?>
</center>
</div>
<?php
}
</div>
<?php
$vType = $video['type'];
if ($vType == "linkVideo") {
$vType = "video";
@ -274,179 +272,175 @@ YouPHPTubePlugin::getModeYouTube($v['id']);
}
require "{$global['systemRootPath']}view/include/{$vType}.php";
?>
<div class="row" id="modeYoutubeBottom">
<div class="col-sm-1 col-md-1"></div>
<div class="col-sm-6 col-md-6" id="modeYoutubeBottomContent">
<?php
require "{$global['systemRootPath']}view/modeYoutubeBottom.php";
?>
</div>
<div class="col-sm-4 col-md-4 bgWhite list-group-item rightBar">
<?php
if (!empty($advancedCustom->showAdsenseBannerOnLeft)) {
?>
<div class="col-lg-12 col-sm-12 col-xs-12">
<?php echo $config->getAdsense(); ?>
</div>
<?php
}
if (!empty($playlist_id)) {
include $global['systemRootPath'] . 'view/include/playlist.php';
?>
<script>
$(document).ready(function () {
Cookies.set('autoplay', true, {
path: '/',
expires: 365
});
});
</script>
<?php } else if (empty($autoPlayVideo)) {
?>
<div class="col-lg-12 col-sm-12 col-xs-12 autoplay text-muted" >
<strong><?php echo __("Autoplay ended"); ?></strong>
<span class="pull-right">
<span><?php echo __("Autoplay"); ?></span>
<span>
<i class="fa fa-info-circle" data-toggle="tooltip" data-placement="bottom" title="<?php echo __("When autoplay is enabled, a suggested video will automatically play next."); ?>"></i>
</span>
<div class="material-switch pull-right">
<input type="checkbox" class="saveCookie" name="autoplay" id="autoplay">
<label for="autoplay" class="label-primary"></label>
</div>
</span>
</div>
<?php } else if (!empty($autoPlayVideo)) { ?>
<div class="row">
<div class="col-lg-12 col-sm-12 col-xs-12 autoplay text-muted">
<strong><?php echo __("Up Next"); ?></strong>
<span class="pull-right">
<span><?php echo __("Autoplay"); ?></span>
<span>
<i class="fa fa-info-circle" data-toggle="tooltip" data-placement="bottom" title="<?php echo __("When autoplay is enabled, a suggested video will automatically play next."); ?>"></i>
</span>
<div class="material-switch pull-right">
<input type="checkbox" class="saveCookie" name="autoplay" id="autoplay">
<label for="autoplay" class="label-primary"></label>
</div>
</span>
</div>
</div>
<div class="col-lg-12 col-sm-12 col-xs-12 bottom-border autoPlayVideo" id="autoPlayVideoDiv" itemscope itemtype="http://schema.org/VideoObject" >
<a href="<?php echo Video::getLink($autoPlayVideo['id'], $autoPlayVideo['clean_title'], "", $get); ?>" title="<?php echo str_replace('"', '', $autoPlayVideo['title']); ?>" class="videoLink h6">
<div class="col-lg-5 col-sm-5 col-xs-5 nopadding thumbsImage">
<?php
$imgGif = "";
if (file_exists("{$global['systemRootPath']}videos/{$autoPlayVideo['filename']}.gif")) {
$imgGif = "{$global['webSiteRootURL']}videos/{$autoPlayVideo['filename']}.gif";
}
if ($autoPlayVideo['type'] === "pdf") {
$img = "{$global['webSiteRootURL']}videos/{$autoPlayVideo['filename']}.png";
$img_portrait = ($autoPlayVideo['rotation'] === "90" || $autoPlayVideo['rotation'] === "270") ? "img-portrait" : "";
} else if (($autoPlayVideo['type'] !== "audio") && ($autoPlayVideo['type'] !== "linkAudio")) {
$img = "{$global['webSiteRootURL']}videos/{$autoPlayVideo['filename']}.jpg";
$img_portrait = ($autoPlayVideo['rotation'] === "90" || $autoPlayVideo['rotation'] === "270") ? "img-portrait" : "";
} else {
$img = "{$global['webSiteRootURL']}view/img/audio_wave.jpg";
$img_portrait = "";
}
?>
<img src="<?php echo $img; ?>" alt="<?php echo str_replace('"', '', $autoPlayVideo['title']); ?>" class="img-responsive <?php echo $img_portrait; ?> rotate<?php echo $autoPlayVideo['rotation']; ?>" height="130" itemprop="thumbnail" />
<?php if (!empty($imgGif)) { ?>
<img src="<?php echo $imgGif; ?>" style="position: absolute; top: 0; display: none;" alt="<?php echo str_replace('"', '', $autoPlayVideo['title']); ?>" id="thumbsGIF<?php echo $autoPlayVideo['id']; ?>" class="thumbsGIF img-responsive <?php echo $img_portrait; ?> rotate<?php echo $autoPlayVideo['rotation']; ?>" height="130" />
<?php } ?>
<meta itemprop="thumbnailUrl" content="<?php echo $img; ?>" />
<meta itemprop="contentURL" content="<?php echo Video::getLink($autoPlayVideo['id'], $autoPlayVideo['clean_title']); ?>" />
<meta itemprop="embedURL" content="<?php echo Video::getLink($autoPlayVideo['id'], $autoPlayVideo['clean_title'], true); ?>" />
<meta itemprop="uploadDate" content="<?php echo $autoPlayVideo['created']; ?>" />
<time class="duration" itemprop="duration" datetime="<?php echo Video::getItemPropDuration($autoPlayVideo['duration']); ?>"><?php echo Video::getCleanDuration($autoPlayVideo['duration']); ?></time>
</div>
<div class="col-lg-7 col-sm-7 col-xs-7 videosDetails">
<div class="text-uppercase row"><strong itemprop="name" class="title"><?php echo $autoPlayVideo['title']; ?></strong></div>
<div class="details row text-muted" itemprop="description">
<div>
<strong><?php echo __("Category"); ?>: </strong>
<span class="<?php echo $autoPlayVideo['iconClass']; ?>"></span>
<?php echo $autoPlayVideo['category']; ?>
</div>
<?php
if (empty($advancedCustom->doNotDisplayViews)) {
?>
<div>
<strong class=""><?php echo number_format($autoPlayVideo['views_count'], 0); ?></strong>
<?php echo __("Views"); ?>
</div>
<?php
}
?>
<div><?php echo $autoPlayVideo['creator']; ?></div>
<div class="row" id="modeYoutubeBottom">
<div class="col-sm-1 col-md-1"></div>
<div class="col-sm-6 col-md-6" id="modeYoutubeBottomContent">
<?php
require "{$global['systemRootPath']}view/modeYoutubeBottom.php";
?>
</div>
<div class="col-sm-4 col-md-4 bgWhite list-group-item rightBar">
<div class="col-lg-12 col-sm-12 col-xs-12 text-center">
<?php echo getAdsSideRectangle(); ?>
</div>
<div class="row">
<?php
if (!empty($autoPlayVideo['tags'])) {
foreach ($autoPlayVideo['tags'] as $autoPlayVideo2) {
if ($autoPlayVideo2->label === __("Group")) {
?>
<span class="label label-<?php echo $autoPlayVideo2->type; ?>"><?php echo $autoPlayVideo2->text; ?></span>
<?php
if (!empty($playlist_id)) {
include $global['systemRootPath'] . 'view/include/playlist.php';
?>
<script>
$(document).ready(function () {
Cookies.set('autoplay', true, {
path: '/',
expires: 365
});
});
</script>
<?php } else if (empty($autoPlayVideo)) {
?>
<div class="col-lg-12 col-sm-12 col-xs-12 autoplay text-muted" >
<strong><?php echo __("Autoplay ended"); ?></strong>
<span class="pull-right">
<span><?php echo __("Autoplay"); ?></span>
<span>
<i class="fa fa-info-circle" data-toggle="tooltip" data-placement="bottom" title="<?php echo __("When autoplay is enabled, a suggested video will automatically play next."); ?>"></i>
</span>
<div class="material-switch pull-right">
<input type="checkbox" class="saveCookie" name="autoplay" id="autoplay">
<label for="autoplay" class="label-primary"></label>
</div>
</span>
</div>
<?php } else if (!empty($autoPlayVideo)) { ?>
<div class="row">
<div class="col-lg-12 col-sm-12 col-xs-12 autoplay text-muted">
<strong><?php echo __("Up Next"); ?></strong>
<span class="pull-right">
<span><?php echo __("Autoplay"); ?></span>
<span>
<i class="fa fa-info-circle" data-toggle="tooltip" data-placement="bottom" title="<?php echo __("When autoplay is enabled, a suggested video will automatically play next."); ?>"></i>
</span>
<div class="material-switch pull-right">
<input type="checkbox" class="saveCookie" name="autoplay" id="autoplay">
<label for="autoplay" class="label-primary"></label>
</div>
</span>
</div>
</div>
<div class="col-lg-12 col-sm-12 col-xs-12 bottom-border autoPlayVideo" id="autoPlayVideoDiv" itemscope itemtype="http://schema.org/VideoObject" >
<a href="<?php echo Video::getLink($autoPlayVideo['id'], $autoPlayVideo['clean_title'], "", $get); ?>" title="<?php echo str_replace('"', '', $autoPlayVideo['title']); ?>" class="videoLink h6">
<div class="col-lg-5 col-sm-5 col-xs-5 nopadding thumbsImage">
<?php
}
$imgGif = "";
if (file_exists("{$global['systemRootPath']}videos/{$autoPlayVideo['filename']}.gif")) {
$imgGif = "{$global['webSiteRootURL']}videos/{$autoPlayVideo['filename']}.gif";
}
if ($autoPlayVideo['type'] === "pdf") {
$img = "{$global['webSiteRootURL']}videos/{$autoPlayVideo['filename']}.png";
$img_portrait = ($autoPlayVideo['rotation'] === "90" || $autoPlayVideo['rotation'] === "270") ? "img-portrait" : "";
} else if (($autoPlayVideo['type'] !== "audio") && ($autoPlayVideo['type'] !== "linkAudio")) {
$img = "{$global['webSiteRootURL']}videos/{$autoPlayVideo['filename']}.jpg";
$img_portrait = ($autoPlayVideo['rotation'] === "90" || $autoPlayVideo['rotation'] === "270") ? "img-portrait" : "";
} else {
$img = "{$global['webSiteRootURL']}view/img/audio_wave.jpg";
$img_portrait = "";
}
?>
<img src="<?php echo $img; ?>" alt="<?php echo str_replace('"', '', $autoPlayVideo['title']); ?>" class="img-responsive <?php echo $img_portrait; ?> rotate<?php echo $autoPlayVideo['rotation']; ?>" height="130" itemprop="thumbnail" />
<?php if (!empty($imgGif)) { ?>
<img src="<?php echo $imgGif; ?>" style="position: absolute; top: 0; display: none;" alt="<?php echo str_replace('"', '', $autoPlayVideo['title']); ?>" id="thumbsGIF<?php echo $autoPlayVideo['id']; ?>" class="thumbsGIF img-responsive <?php echo $img_portrait; ?> rotate<?php echo $autoPlayVideo['rotation']; ?>" height="130" />
<?php } ?>
<meta itemprop="thumbnailUrl" content="<?php echo $img; ?>" />
<meta itemprop="contentURL" content="<?php echo Video::getLink($autoPlayVideo['id'], $autoPlayVideo['clean_title']); ?>" />
<meta itemprop="embedURL" content="<?php echo Video::getLink($autoPlayVideo['id'], $autoPlayVideo['clean_title'], true); ?>" />
<meta itemprop="uploadDate" content="<?php echo $autoPlayVideo['created']; ?>" />
<time class="duration" itemprop="duration" datetime="<?php echo Video::getItemPropDuration($autoPlayVideo['duration']); ?>"><?php echo Video::getCleanDuration($autoPlayVideo['duration']); ?></time>
</div>
<div class="col-lg-7 col-sm-7 col-xs-7 videosDetails">
<div class="text-uppercase row"><strong itemprop="name" class="title"><?php echo $autoPlayVideo['title']; ?></strong></div>
<div class="details row text-muted" itemprop="description">
<div>
<strong><?php echo __("Category"); ?>: </strong>
<span class="<?php echo $autoPlayVideo['iconClass']; ?>"></span>
<?php echo $autoPlayVideo['category']; ?>
</div>
<?php
if (empty($advancedCustom->doNotDisplayViews)) {
?>
<div>
<strong class=""><?php echo number_format($autoPlayVideo['views_count'], 0); ?></strong>
<?php echo __("Views"); ?>
</div>
<?php
}
?>
<div><?php echo $autoPlayVideo['creator']; ?></div>
</div>
<div class="row">
<?php
if (!empty($autoPlayVideo['tags'])) {
foreach ($autoPlayVideo['tags'] as $autoPlayVideo2) {
if ($autoPlayVideo2->label === __("Group")) {
?>
<span class="label label-<?php echo $autoPlayVideo2->type; ?>"><?php echo $autoPlayVideo2->text; ?></span>
<?php
}
}
}
?>
</div>
</div>
</a>
</div>
<?php } ?>
<div class="col-lg-12 col-sm-12 col-xs-12 extraVideos nopadding"></div>
<!-- videos List -->
<div id="videosList">
<?php include $global['systemRootPath'] . 'view/videosList.php'; ?>
</div>
<!-- End of videos List -->
<script>
var fading = false;
var autoPlaySources = <?php echo json_encode($autoPlaySources); ?>;
var autoPlayURL = '<?php echo $autoPlayURL; ?>';
var autoPlayPoster = '<?php echo $autoPlayPoster; ?>';
var autoPlayThumbsSprit = '<?php echo $autoPlayThumbsSprit; ?>';
function showAutoPlayVideoDiv() {
var auto = $("#autoplay").prop('checked');
if (!auto) {
$('#autoPlayVideoDiv').slideUp();
} else {
$('#autoPlayVideoDiv').slideDown();
}
}
?>
</div>
$(document).ready(function () {
$("input.saveCookie").each(function () {
var mycookie = Cookies.get($(this).attr('name'));
if (mycookie && mycookie == "true") {
$(this).prop('checked', mycookie);
}
});
$("input.saveCookie").change(function () {
var auto = $(this).prop('checked');
Cookies.set($(this).attr("name"), auto, {
path: '/',
expires: 365
});
});
$("#autoplay").change(function () {
showAutoPlayVideoDiv();
});
showAutoPlayVideoDiv();
});
</script>
</div>
</a>
</div>
<?php } ?>
<div class="col-lg-12 col-sm-12 col-xs-12 extraVideos nopadding"></div>
<!-- videos List -->
<div id="videosList">
<?php include $global['systemRootPath'] . 'view/videosList.php'; ?>
</div>
<!-- End of videos List -->
<div class="col-sm-1 col-md-1"></div>
</div>
<script>
var fading = false;
var autoPlaySources = <?php echo json_encode($autoPlaySources); ?>;
var autoPlayURL = '<?php echo $autoPlayURL; ?>';
var autoPlayPoster = '<?php echo $autoPlayPoster; ?>';
var autoPlayThumbsSprit = '<?php echo $autoPlayThumbsSprit; ?>';
function showAutoPlayVideoDiv() {
var auto = $("#autoplay").prop('checked');
if (!auto) {
$('#autoPlayVideoDiv').slideUp();
} else {
$('#autoPlayVideoDiv').slideDown();
}
}
$(document).ready(function () {
$("input.saveCookie").each(function () {
var mycookie = Cookies.get($(this).attr('name'));
if (mycookie && mycookie == "true") {
$(this).prop('checked', mycookie);
}
});
$("input.saveCookie").change(function () {
var auto = $(this).prop('checked');
Cookies.set($(this).attr("name"), auto, {
path: '/',
expires: 365
});
});
$("#autoplay").change(function () {
showAutoPlayVideoDiv();
});
showAutoPlayVideoDiv();
});
</script>
</div>
<div class="col-sm-1 col-md-1"></div>
</div>
<?php
} else {
?>
@ -457,13 +451,13 @@ YouPHPTubePlugin::getModeYouTube($v['id']);
<div class="alert alert-warning">
<span class="glyphicon glyphicon-facetime-video"></span> <strong><?php echo __("Attention"); ?>!</strong> <?php echo empty($advancedCustom->videoNotFoundText->value) ? __("We have not found any videos or audios to show") : $advancedCustom->videoNotFoundText->value; ?>.
</div>
<?php } ?>
<?php } ?>
</div>
<script src="<?php echo $global['webSiteRootURL']; ?>view/js/jquery-ui/jquery-ui.min.js" type="text/javascript"></script>
<script>
/*** Handle jQuery plugin naming conflict between jQuery UI and Bootstrap ***/
$.widget.bridge('uibutton', $.ui.button);
$.widget.bridge('uitooltip', $.ui.tooltip);
/*** Handle jQuery plugin naming conflict between jQuery UI and Bootstrap ***/
$.widget.bridge('uibutton', $.ui.button);
$.widget.bridge('uitooltip', $.ui.tooltip);
</script>
<?php
$videoJSArray = array("view/js/video.js/video.js");
@ -492,14 +486,14 @@ YouPHPTubePlugin::getModeYouTube($v['id']);
?>
<script src="<?php echo $jsURL; ?>" type="text/javascript"></script>
<script>
var fading = false;
var autoPlaySources = <?php echo json_encode($autoPlaySources); ?>;
var autoPlayURL = '<?php echo $autoPlayURL; ?>';
var autoPlayPoster = '<?php echo $autoPlayPoster; ?>';
var autoPlayThumbsSprit = '<?php echo $autoPlayThumbsSprit; ?>';
var fading = false;
var autoPlaySources = <?php echo json_encode($autoPlaySources); ?>;
var autoPlayURL = '<?php echo $autoPlayURL; ?>';
var autoPlayPoster = '<?php echo $autoPlayPoster; ?>';
var autoPlayThumbsSprit = '<?php echo $autoPlayThumbsSprit; ?>';
$(document).ready(function () {
});
$(document).ready(function () {
});
</script>
</body>
</html>