1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-05 19:42:38 +02:00

resolve merge

This commit is contained in:
Vinzenz Hersche 2018-03-09 21:37:04 +01:00
commit 1ed361e9a4
9 changed files with 179 additions and 89 deletions

View file

@ -605,6 +605,9 @@ function getimgsize($file_src) {
}
function im_resize($file_src, $file_dest, $wd, $hd) {
if(empty($file_dest)){
return false;
}
if (!file_exists($file_src)){
error_log("im_resize: Source not found: {$file_src}");
return false;
@ -622,6 +625,10 @@ function im_resize($file_src, $file_dest, $wd, $hd) {
$format = 'jpeg';
}
$destformat = strtolower(substr($file_dest, -4));
if(empty($destformat)){
error_log("destformat not found {$file_dest}");
$destformat = ".jpg";
}
$icfunc = "imagecreatefrom" . $format;
if (!function_exists($icfunc)){
error_log("im_resize: Function does not exists: {$icfunc}");
@ -670,7 +677,7 @@ function im_resize($file_src, $file_dest, $wd, $hd) {
}
imagecopyresampled($dest, $src, 0, 0, ($ws - $wc) / 2, ($hs - $hc) / 2, $wd, $hd, $wc, $hc);
$saved = false;
if (!isset($q))
$q = 100;
if ($destformat == '.png')
@ -678,7 +685,7 @@ function im_resize($file_src, $file_dest, $wd, $hd) {
if ($destformat == '.jpg')
$saved = imagejpeg($dest, $file_dest, $q);
if (!$saved)
my_error_log('saving failed');
error_log('saving failed');
imagedestroy($dest);
imagedestroy($src);

View file

@ -1231,6 +1231,13 @@ class Video {
}
}
}
if(!file_exists($source['path'])){
if($type!="_thumbs.jpg"){
return array('path'=>false, 'url'=>false);
}
}
//ObjectYPT::setCache($name, $source);
return $source;
}
@ -1277,6 +1284,9 @@ class Video {
} else {
$obj->thumbsJpg = "{$global['webSiteRootURL']}view/img/audio_wave.jpg";
}
if(empty($obj->thumbsJpg)){
$obj->thumbsJpg = $obj->poster;
}
//ObjectYPT::setCache($name, $obj);
return $obj;
}

View file

@ -44,7 +44,7 @@ $video->setDuration($_POST['duration']);
$video->setDescription($_POST['description']);
$advancedCustom = YouPHPTubePlugin::getObjectDataIfEnabled("CustomizeAdvanced");
if(empty($obj->makeVideosInactiveAfterEncode)){
if(empty($advancedCustom->makeVideosInactiveAfterEncode)){
// set active
$video->setStatus('a');
}else{

View file

@ -45,15 +45,28 @@ h3.galleryTitle{
}
.aspectRatio16_9 {
display: block;
width: 100%;
height: 56.25%; /* 16:9 Aspect Ratio */
height: 0;
padding-bottom: 56.25%;
overflow: hidden;
background-image: url(../../view/img/video-placeholder.png);
background-size: cover;
}
.aspectRatio16_9 img{
text-indent:-9999px;
height: 82px;
width: 100%;
display: block;
margin-left: auto;
margin-right: auto;
}
.thumbsGIF{
text-indent:-9999px;
width: 100%;
margin-left: auto;
margin-right: auto;
}
.firstRow{

View file

@ -97,6 +97,7 @@ $totalPages = ceil($total / $_POST['rowCount']);
<?php
if (!empty($videos)) {
$name = User::getNameIdentificationById($video['users_id']);
$img_portrait = ($video['rotation'] === "90" || $video['rotation'] === "270") ? "img-portrait" : "";
?>
<div class="row mainArea">
<div class="clear clearfix firstRow">
@ -110,13 +111,14 @@ $totalPages = ceil($total / $_POST['rowCount']);
$poster = $images->poster;
?>
<div class="aspectRatio16_9">
<img src="<?php echo $poster; ?>" alt="<?php echo $video['title']; ?>" class="thumbsJPG img img-responsive " />
</div>
<img src="<?php echo $poster; ?>" alt="<?php echo $video['title']; ?>" class="thumbsJPG img img-responsive " style="height: auto; width: 100%;" id="thumbsJPG<?php echo $video['id']; ?>" />
<?php
if (!empty($imgGif)) {
?>
<img src="<?php echo $imgGif; ?>" style="position: absolute; top: 0; display: none;" alt="<?php echo $video['title']; ?>" id="thumbsGIF<?php echo $video['id']; ?>" class="thumbsGIF img-responsive <?php echo $img_portrait; ?> rotate<?php echo $video['rotation']; ?>" height="130" />
<img src="<?php echo $imgGif; ?>" style="position: absolute; top: 0; display: none;" alt="<?php echo $video['title']; ?>" id="thumbsGIF<?php echo $video['id']; ?>" class="thumbsGIF img-responsive <?php echo @$img_portrait; ?> rotate<?php echo $video['rotation']; ?>" height="130" />
<?php } ?>
</div>
<span class="duration"><?php echo Video::getCleanDuration($video['duration']); ?></span>
</a>
</div>
@ -186,13 +188,13 @@ $totalPages = ceil($total / $_POST['rowCount']);
$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']; ?>" />
</div>
<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']; ?>">
@ -253,7 +255,12 @@ $totalPages = ceil($total / $_POST['rowCount']);
page: <?php echo $_GET['page']; ?>,
maxVisible: 10
}).on('page', function (event, num) {
<?php $url = ''; if(strpos($_SERVER['REQUEST_URI'],"cat")===false){ $url = $global['webSiteRootURL']."page/"; } else { $url = $global['webSiteRootURL']."cat/".$video['clean_category']."/page/"; } ?>
<?php $url = '';
if (strpos($_SERVER['REQUEST_URI'], "cat") === false) {
$url = $global['webSiteRootURL'] . "page/";
} else {
$url = $global['webSiteRootURL'] . "cat/" . $video['clean_category'] . "/page/";
} ?>
window.location.replace("<?php echo $url; ?>" + num);
});
});
@ -289,13 +296,14 @@ $totalPages = ceil($total / $_POST['rowCount']);
$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']; ?>" />
</div>
<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']; ?>">
@ -338,6 +346,25 @@ $totalPages = ceil($total / $_POST['rowCount']);
</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>
</div>
<?php
}
@ -370,13 +397,14 @@ $totalPages = ceil($total / $_POST['rowCount']);
$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']; ?>" />
</div>
<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']; ?>">
@ -417,6 +445,26 @@ $totalPages = ceil($total / $_POST['rowCount']);
<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 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>
</div>
<?php
@ -430,16 +478,16 @@ $totalPages = ceil($total / $_POST['rowCount']);
<div class="alert alert-warning">
<span class="glyphicon glyphicon-facetime-video"></span> <strong><?php echo __("Warning"); ?>!</strong> <?php echo __("We have not found any videos or audios to show"); ?>.
</div>
<?php } ?>
<?php } ?>
</div>
<div class="col-xs-12 col-sm-1 col-md-1 col-lg-1"></div>
</div>
<?php
include 'include/footer.php';
?>
<?php
include 'include/footer.php';
?>
</body>

View file

@ -21,7 +21,7 @@ if (User::isLogged() && $user_id == User::getId()) {
}
$user = new User($user_id);
$uploadedVideos = Video::getAllVideos("viewable", $user_id);
$uploadedVideos = Video::getAllVideos("a", $user_id);
$publicOnly = true;
if (User::isLogged() && $user_id == User::getId()) {
$publicOnly = false;
@ -79,7 +79,7 @@ $playlists = PlayList::getAllFromUser($user_id, $publicOnly);
if (empty($videosArrayId)) {
continue;
}
$videos = Video::getAllVideos("viewable", false, false, $videosArrayId);
$videos = Video::getAllVideos("a", false, false, $videosArrayId);
$videos = PlayList::sortVideos($videos, $videosArrayId);
?>
@ -134,7 +134,7 @@ $playlists = PlayList::getAllFromUser($user_id, $publicOnly);
$imgGif = $images->thumbsGif;
$poster = $images->thumbsJpg;
?>
<li class="col-lg-2 col-md-3 col-sm-4 col-xs-6 galleryVideo " id="<?php echo $value['id']; ?>">
<li class="col-lg-2 col-md-4 col-sm-4 col-xs-6 galleryVideo " id="<?php echo $value['id']; ?>">
<a class="aspectRatio16_9" href="<?php echo $global['webSiteRootURL']; ?>video/<?php echo $value['clean_title']; ?>" title="<?php echo $value['title']; ?>" style="padding: 0; margin: 0;" >
<img src="<?php echo $poster; ?>" alt="<?php echo $value['title']; ?>" class="img img-responsive <?php echo $img_portrait; ?> rotate<?php echo $value['rotation']; ?>" />
<span class="duration"><?php echo Video::getCleanDuration($value['duration']); ?></span>
@ -221,7 +221,7 @@ $playlists = PlayList::getAllFromUser($user_id, $publicOnly);
$imgGif = $images->thumbsGif;
$poster = $images->thumbsJpg;
?>
<div class="col-lg-2 col-md-3 col-sm-4 col-xs-6 galleryVideo ">
<div class="col-lg-2 col-md-4 col-sm-4 col-xs-6 galleryVideo ">
<a class="aspectRatio16_9" href="<?php echo $global['webSiteRootURL']; ?>video/<?php echo $value['clean_title']; ?>" title="<?php echo $value['title']; ?>" >
<img src="<?php echo $poster; ?>" alt="<?php echo $value['title']; ?>" class="img img-responsive <?php echo $img_portrait; ?> rotate<?php echo $value['rotation']; ?>" />
<span class="duration"><?php echo Video::getCleanDuration($value['duration']); ?></span>

View file

@ -54,8 +54,20 @@ $(document).ready(function () {
$('[data-toggle="tooltip"]').tooltip();
$(".thumbsImage").on("mouseenter", function () {
gifId = $(this).find(".thumbsGIF").attr('id');
id = gifId.replace('thumbsGIF','');
$(this).find(".thumbsGIF").height($(this).find(".thumbsJPG").height());
$(this).find(".thumbsGIF").width($(this).find(".thumbsJPG").width());
/*
try {
l1 = $('#thumbsJPG'+id).offset().left;
l2 = $('#thumbsJPG'+id).closest('.thumbsImage').offset().left;
left = l1-l2;
$(this).find(".thumbsGIF").css({"left": left});
} catch (e) {}
*/
$(this).find(".thumbsGIF").stop(true, true).fadeIn();
});

View file

@ -31,7 +31,7 @@ if (isset($_FILES['upl']) && $_FILES['upl']['error'] == 0) {
$video->setDuration($duration);
$video->setType("video");
$advancedCustom = YouPHPTubePlugin::getObjectDataIfEnabled("CustomizeAdvanced");
if (empty($obj->makeVideosInactiveAfterEncode)) {
if (empty($advancedCustom->makeVideosInactiveAfterEncode)) {
// set active
$video->setStatus('a');
} else {

View file

@ -26,7 +26,7 @@ if(!empty($_GET['download'])){
}
YouPHPTubePlugin::xsendfilePreVideoPlay();
$advancedCustom = YouPHPTubePlugin::getObjectDataIfEnabled("CustomizeAdvanced");
if(!empty($advancedCustom->doNotUseXsendFile)){
if(empty($advancedCustom->doNotUseXsendFile)){
header("X-Sendfile: {$path}");
}
if(empty($_GET['download'])){