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

Reverting for some fixes

This commit is contained in:
daniel 2018-03-14 12:57:12 -03:00
parent 6368c975fa
commit 4d98ca30a6
3 changed files with 63 additions and 242 deletions

View file

@ -101,3 +101,25 @@ h3.galleryTitle{
.fixPadding{ .fixPadding{
padding: 0 5px; padding: 0 5px;
} }
.popover {
left: 5px !important;
color: inherit !important;
}
.popover-content {
height: 160px !important;
}
.popover-content, .popover-content>div{
font-size: 1.3em !important;
white-space: normal !important;
width: auto;
color: inherit !important;
}
.popover-content>div{
overflow-y: auto;
height: 140px;
}
.aligned-row{
overflow: visible !important;
}

View file

@ -11,8 +11,6 @@ require_once '../videos/configuration.php';
require_once $global['systemRootPath'] . 'objects/user.php'; require_once $global['systemRootPath'] . 'objects/user.php';
require_once $global['systemRootPath'] . 'objects/functions.php'; require_once $global['systemRootPath'] . 'objects/functions.php';
$obj = YouPHPTubePlugin::getObjectData("Gallery");
if (!empty($_GET['type'])) { if (!empty($_GET['type'])) {
if ($_GET['type'] == 'audio') { if ($_GET['type'] == 'audio') {
$_SESSION['type'] = 'audio'; $_SESSION['type'] = 'audio';
@ -56,37 +54,13 @@ $totalPages = ceil($total / $_POST['rowCount']);
<?php <?php
include $global['systemRootPath'] . 'view/include/head.php'; include $global['systemRootPath'] . 'view/include/head.php';
?> ?>
<style>
.popover {
left: 5px !important;
color: inherit !important;
}
.popover-content {
height: 160px !important;
}
.popover-content, .popover-content>div{
font-size: 1.3em !important;
white-space: normal !important;
width: auto;
color: inherit !important;
}
.popover-content>div{
overflow-y: auto;
height: 140px;
}
.aligned-row{
overflow: visible !important;
}
</style>
</head> </head>
<body> <body>
<?php <?php
include 'include/navbar.php'; include 'include/navbar.php';
?> ?>
<div class="text-center" style="padding: 10px;"> <div class="row text-center" style="padding: 10px;">
<?php <?php
echo $config->getAdsense(); echo $config->getAdsense();
?> ?>
@ -99,12 +73,7 @@ $totalPages = ceil($total / $_POST['rowCount']);
$name = User::getNameIdentificationById($video['users_id']); $name = User::getNameIdentificationById($video['users_id']);
$img_portrait = ($video['rotation'] === "90" || $video['rotation'] === "270") ? "img-portrait" : ""; $img_portrait = ($video['rotation'] === "90" || $video['rotation'] === "270") ? "img-portrait" : "";
?> ?>
<?php if(!$obj->BigVideo) { ?>
<h1 style="text-align: center;"><?php echo $video['category']; ?></h1>
<?php } ?>
<div class="row mainArea"> <div class="row mainArea">
<?php if($obj->BigVideo) { ?>
<div class="clear clearfix firstRow"> <div class="clear clearfix firstRow">
<div class="row thumbsImage"> <div class="row thumbsImage">
<div class="col-sm-6"> <div class="col-sm-6">
@ -131,7 +100,7 @@ $totalPages = ceil($total / $_POST['rowCount']);
<a href="<?php echo $global['webSiteRootURL']; ?>video/<?php echo $video['clean_title']; ?>" title="<?php echo $video['title']; ?>"> <a href="<?php echo $global['webSiteRootURL']; ?>video/<?php echo $video['clean_title']; ?>" title="<?php echo $video['title']; ?>">
<h1><?php echo $video['title']; ?></h1> <h1><?php echo $video['title']; ?></h1>
</a> </a>
<h4 itemprop="description" style="max-height: 300px; overflow: auto;"><?php echo str_replace('"','&quot;',nl2br(textToLink($video['description']))); ?></h4> <h4 itemprop="description"><?php echo nl2br(textToLink($video['description'])); ?></h4>
<div class="text-muted galeryDetails"> <div class="text-muted galeryDetails">
<div> <div>
@ -169,129 +138,13 @@ $totalPages = ceil($total / $_POST['rowCount']);
</div> </div>
</div> </div>
<?php } if($obj->SortByName) { ?>
<div class="clear clearfix">
<h3 class="galleryTitle">
<i class="glyphicon glyphicon-eye-open"></i> <?php echo __("Sort by name"); if(!empty($_GET['page'])){ echo " (Page ".$_GET['page'].")"; } ?>
</h3>
<div class="row">
<?php
$countCols = 0;
unset($_POST['sort']);
$_POST['sort']['title'] = "ASC";
$_POST['current'] = $_GET['page'];
$_POST['rowCount'] = 12;
$videos = Video::getAllVideos();
foreach ($videos as $value) {
$name = User::getNameIdentificationById($value['users_id']);
// make a row each 6 cols
if ($countCols % 6 === 0) {
echo '</div><div class="row aligned-row ">';
}
$countCols++;
?>
<div class="col-lg-2 col-md-4 col-sm-4 col-xs-6 galleryVideo thumbsImage fixPadding">
<a href="<?php echo $global['webSiteRootURL']; ?>cat/<?php echo $value['clean_category']; ?>/video/<?php echo $value['clean_title']; ?>" title="<?php echo $value['title']; ?>" >
<?php
$images = Video::getImageFromFilename($value['filename'], $value['type']);
$imgGif = $images->thumbsGif;
$poster = $images->thumbsJpg;
?>
<div class="aspectRatio16_9">
<img src="<?php echo $poster; ?>" alt="<?php echo $value['title']; ?>" class="thumbsJPG img img-responsive <?php echo $img_portrait; ?> rotate<?php echo $value['rotation']; ?>" id="thumbsJPG<?php echo $value['id']; ?>" />
<?php
if (!empty($imgGif)) {
?>
<img src="<?php echo $imgGif; ?>" style="position: absolute; top: 0; display: none;" alt="<?php echo $value['title']; ?>" id="thumbsGIF<?php echo $value['id']; ?>" class="thumbsGIF img-responsive <?php echo $img_portrait; ?> rotate<?php echo $value['rotation']; ?>" height="130" />
<?php } ?>
</div>
<span class="duration"><?php echo Video::getCleanDuration($value['duration']); ?></span>
</a>
<a href="<?php echo $global['webSiteRootURL']; ?>video/<?php echo $value['clean_title']; ?>" title="<?php echo $value['title']; ?>">
<h2><?php echo $value['title']; ?></h2>
</a>
<div class="text-muted galeryDetails">
<div>
<?php
$value['tags'] = Video::getTags($value['id']);
foreach ($value['tags'] as $value2) {
if ($value2->label === __("Group")) {
?>
<span class="label label-<?php echo $value2->type; ?>"><?php echo $value2->text; ?></span>
<?php
}
}
?>
</div>
<div>
<i class="fa fa-eye"></i>
<span itemprop="interactionCount">
<?php echo number_format($value['views_count'], 0); ?> <?php echo __("Views"); ?>
</span>
</div>
<div>
<i class="fa fa-clock-o"></i>
<?php
echo humanTiming(strtotime($value['videoCreation'])), " ", __('ago');
?>
</div>
<div class="userName">
<i class="fa fa-user"></i>
<?php
echo $name;
if((!empty($value['description']))&&($obj->Description)){
?>
<button type="button" class="btn btn-xs" data-trigger="focus" data-toggle="popover" data-placement="top" data-html="true" title="<?php echo $value['title']; ?>" data-content="<div><?php echo str_replace('"','&quot;',nl2br(textToLink($value['description']))); ?></div>">Description</button>
<?php } ?>
</div>
</div>
<div>
<i class="fa fa-eye"></i>
<span itemprop="interactionCount">
<?php echo number_format($value['views_count'], 0); ?> <?php echo __("Views"); ?>
</span>
</div>
<div>
<i class="fa fa-clock-o"></i>
<?php
echo humanTiming(strtotime($value['videoCreation'])), " ", __('ago');
?>
</div>
<div class="userName">
<i class="fa fa-user"></i>
<?php
echo $name;
?>
</div>
</div>
<?php
}
?>
</div>
<div class="row">
<ul class="pages">
</ul>
</div>
</div>
<?php } ?>
<div class="clear clearfix"> <div class="clear clearfix">
<h3 class="galleryTitle"> <h3 class="galleryTitle">
<i class="glyphicon glyphicon-sort-by-attributes"></i> <?php echo __("Date Added (newest)"); if(!empty($_GET['page'])){ echo " (Page ".$_GET['page'].")"; } ?> <i class="glyphicon glyphicon-sort-by-attributes"></i> <?php echo __("Date Added (newest)"); ?>
</h3> </h3>
<div class="row"> <div class="row">
<?php <?php
$countCols = 0; $countCols = 0;
unset($_POST['sort']);
$_POST['sort']['created'] = 'desc';
$videos = Video::getAllVideos();
foreach ($videos as $value) { foreach ($videos as $value) {
$img_portrait = ($value['rotation'] === "90" || $value['rotation'] === "270") ? "img-portrait" : ""; $img_portrait = ($value['rotation'] === "90" || $value['rotation'] === "270") ? "img-portrait" : "";
$name = User::getNameIdentificationById($value['users_id']); $name = User::getNameIdentificationById($value['users_id']);
@ -350,10 +203,7 @@ $totalPages = ceil($total / $_POST['rowCount']);
<i class="fa fa-user"></i> <i class="fa fa-user"></i>
<?php <?php
echo $name; echo $name;
if((!empty($value['description']))&&($obj->Description)){
?> ?>
<button type="button" class="btn btn-xs" data-toggle="popover" data-trigger="focus" data-placement="top" data-html="true" title="<?php echo $value['title']; ?>" data-content="<div><?php echo str_replace('"','&quot;',nl2br(textToLink($value['description']))); ?></div>">Description</button>
<?php } ?>
</div> </div>
</div> </div>
</div> </div>
@ -362,7 +212,7 @@ $totalPages = ceil($total / $_POST['rowCount']);
?> ?>
</div> </div>
</div> </div>
</div>
<div class="row"> <div class="row">
<ul class="pages"> <ul class="pages">
@ -377,7 +227,7 @@ $totalPages = ceil($total / $_POST['rowCount']);
maxVisible: 10 maxVisible: 10
}).on('page', function (event, num) { }).on('page', function (event, num) {
<?php $url = ''; <?php $url = '';
if (strpos($_SERVER['REQUEST_URI'], "/cat/") === false) { if (strpos($_SERVER['REQUEST_URI'], "cat") === false) {
$url = $global['webSiteRootURL'] . "page/"; $url = $global['webSiteRootURL'] . "page/";
} else { } else {
$url = $global['webSiteRootURL'] . "cat/" . $video['clean_category'] . "/page/"; $url = $global['webSiteRootURL'] . "cat/" . $video['clean_category'] . "/page/";
@ -391,14 +241,14 @@ $totalPages = ceil($total / $_POST['rowCount']);
<div class="clear clearfix"> <div class="clear clearfix">
<h3 class="galleryTitle"> <h3 class="galleryTitle">
<i class="glyphicon glyphicon-eye-open"></i> <?php echo __("Most Watched"); if(!empty($_GET['page'])){ echo " (Page ".$_GET['page'].")"; } ?> <i class="glyphicon glyphicon-eye-open"></i> <?php echo __("Most Watched"); ?>
</h3> </h3>
<div class="row"> <div class="row">
<?php <?php
$countCols = 0; $countCols = 0;
unset($_POST['sort']); unset($_POST['sort']);
$_POST['sort']['views_count'] = "DESC"; $_POST['sort']['views_count'] = "DESC";
$_POST['current'] = $_GET['page']; $_POST['current'] = 1;
$_POST['rowCount'] = 12; $_POST['rowCount'] = 12;
$videos = Video::getAllVideos(); $videos = Video::getAllVideos();
foreach ($videos as $value) { foreach ($videos as $value) {
@ -430,42 +280,19 @@ $totalPages = ceil($total / $_POST['rowCount']);
<a href="<?php echo $global['webSiteRootURL']; ?>video/<?php echo $value['clean_title']; ?>" title="<?php echo $value['title']; ?>"> <a href="<?php echo $global['webSiteRootURL']; ?>video/<?php echo $value['clean_title']; ?>" title="<?php echo $value['title']; ?>">
<h2><?php echo $value['title']; ?></h2> <h2><?php echo $value['title']; ?></h2>
</a> </a>
<div class="text-muted galeryDetails"> <div class="text-muted galeryDetails">
<div> <div>
<?php <?php
$value['tags'] = Video::getTags($value['id']); $value['tags'] = Video::getTags($value['id']);
foreach ($value['tags'] as $value2) { foreach ($value['tags'] as $value2) {
if ($value2->label === __("Group")) { if ($value2->label === __("Group")) {
?> ?>
<span class="label label-<?php echo $value2->type; ?>"><?php echo $value2->text; ?></span> <span class="label label-<?php echo $value2->type; ?>"><?php echo $value2->text; ?></span>
<?php <?php
} }
} }
?> ?>
</div>
<div>
<i class="fa fa-eye"></i>
<span itemprop="interactionCount">
<?php echo number_format($value['views_count'], 0); ?> <?php echo __("Views"); ?>
</span>
</div>
<div>
<i class="fa fa-clock-o"></i>
<?php
echo humanTiming(strtotime($value['videoCreation'])), " ", __('ago');
?>
</div>
<div class="userName">
<i class="fa fa-user"></i>
<?php
echo $name;
if((!empty($value['description']))&&($obj->Description)){
?>
<button type="button" class="btn btn-xs" data-trigger="focus" data-toggle="popover" data-placement="top" data-html="true" title="<?php echo $value['title']; ?>" data-content="<div><?php echo str_replace('"','&quot;',nl2br(textToLink($value['description']))); ?></div>">Description</button>
<?php } ?>
</div>
</div> </div>
<div> <div>
<i class="fa fa-eye"></i> <i class="fa fa-eye"></i>
@ -486,26 +313,21 @@ $totalPages = ceil($total / $_POST['rowCount']);
?> ?>
</div> </div>
</div> </div>
</div>
<?php <?php
} }
?> ?>
</div> </div>
<div class="row">
<ul class="pages">
</ul>
</div>
</div> </div>
<div class="clear clearfix"> <div class="clear clearfix">
<h3 class="galleryTitle"> <h3 class="galleryTitle">
<i class="glyphicon glyphicon-thumbs-up"></i> <?php echo __("Most Popular"); if(!empty($_GET['page'])){ echo " (Page ".$_GET['page'].")"; } ?> <i class="glyphicon glyphicon-thumbs-up"></i> <?php echo __("Most Popular"); ?>
</h3> </h3>
<div class="row"> <div class="row">
<?php <?php
$countCols = 0; $countCols = 0;
unset($_POST['sort']); unset($_POST['sort']);
$_POST['sort']['likes'] = "DESC"; $_POST['sort']['likes'] = "DESC";
$_POST['current'] = $_GET['page'];
$videos = Video::getAllVideos(); $videos = Video::getAllVideos();
foreach ($videos as $value) { foreach ($videos as $value) {
$name = User::getNameIdentificationById($value['users_id']); $name = User::getNameIdentificationById($value['users_id']);
@ -536,42 +358,19 @@ $totalPages = ceil($total / $_POST['rowCount']);
<a href="<?php echo $global['webSiteRootURL']; ?>video/<?php echo $value['clean_title']; ?>" title="<?php echo $value['title']; ?>"> <a href="<?php echo $global['webSiteRootURL']; ?>video/<?php echo $value['clean_title']; ?>" title="<?php echo $value['title']; ?>">
<h2><?php echo $value['title']; ?></h2> <h2><?php echo $value['title']; ?></h2>
</a> </a>
<div class="text-muted galeryDetails">
<div>
<?php
$value['tags'] = Video::getTags($value['id']);
foreach ($value['tags'] as $value2) {
if ($value2->label === __("Group")) {
?>
<span class="label label-<?php echo $value2->type; ?>"><?php echo $value2->text; ?></span>
<?php
}
}
?>
</div>
<div>
<i class="fa fa-eye"></i>
<span itemprop="interactionCount">
<?php echo number_format($value['views_count'], 0); ?> <?php echo __("Views"); ?>
</span>
</div>
<div>
<i class="fa fa-clock-o"></i>
<?php
echo humanTiming(strtotime($value['videoCreation'])), " ", __('ago');
?>
</div>
<div class="userName">
<i class="fa fa-user"></i>
<?php
echo $name;
if((!empty($value['description']))&&($obj->Description)){
?>
<button type="button" class="btn btn-xs" data-trigger="focus" data-toggle="popover" data-placement="top" data-html="true" title="<?php echo $value['title']; ?>" data-content="<div><?php echo str_replace('"','&quot;',nl2br(textToLink($value['description']))); ?></div>">Description</button>
<?php } ?>
</div>
<div class="text-muted galeryDetails">
<div>
<?php
$value['tags'] = Video::getTags($value['id']);
foreach ($value['tags'] as $value2) {
if ($value2->label === __("Group")) {
?>
<span class="label label-<?php echo $value2->type; ?>"><?php echo $value2->text; ?></span>
<?php
}
}
?>
</div> </div>
<div> <div>
<i class="fa fa-eye"></i> <i class="fa fa-eye"></i>
@ -590,13 +389,13 @@ $totalPages = ceil($total / $_POST['rowCount']);
<?php <?php
echo $name; echo $name;
?> ?>
</div>
</div> </div>
</div> </div>
<?php <?php
} }
?> ?>
</div></div> </div>
</div> </div>
<?php <?php
} else { } else {
@ -620,4 +419,4 @@ include 'include/footer.php';
</html> </html>
<?php <?php
include $global['systemRootPath'] . 'objects/include_end.php'; include $global['systemRootPath'] . 'objects/include_end.php';
?> ?>

View file

@ -56,8 +56,8 @@ $(document).ready(function () {
$(".thumbsImage").on("mouseenter", function () { $(".thumbsImage").on("mouseenter", function () {
gifId = $(this).find(".thumbsGIF").attr('id'); gifId = $(this).find(".thumbsGIF").attr('id');
id = gifId.replace('thumbsGIF',''); id = gifId.replace('thumbsGIF','');
//$(this).find(".thumbsGIF").height($(this).find(".aspectRatio16_9").height()); $(this).find(".thumbsGIF").height($(this).find(".thumbsJPG").height());
//(this).find(".thumbsGIF").width($(this).find(".aspectRatio16_9").width()); $(this).find(".thumbsGIF").width($(this).find(".thumbsJPG").width());
/* /*
try { try {
@ -251,8 +251,8 @@ function closeFloatVideo() {
function mouseEffect(){ function mouseEffect(){
$(".thumbsImage").on("mouseenter", function () { $(".thumbsImage").on("mouseenter", function () {
//$(this).find(".thumbsGIF").height($(this).find(".aspectRatio16_9").height()); $(this).find(".thumbsGIF").height($(this).find(".thumbsJPG").height());
//$(this).find(".thumbsGIF").width($(this).find(".aspectRatio16_9").width()); $(this).find(".thumbsGIF").width($(this).find(".thumbsJPG").width());
$(this).find(".thumbsGIF").stop(true, true).fadeIn(); $(this).find(".thumbsGIF").stop(true, true).fadeIn();
}); });