diff --git a/objects/functions.php b/objects/functions.php index e20f8e7a82..eda006ca7a 100644 --- a/objects/functions.php +++ b/objects/functions.php @@ -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); diff --git a/objects/video.php b/objects/video.php index e3b4119aa1..71eb8f7eea 100644 --- a/objects/video.php +++ b/objects/video.php @@ -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; } diff --git a/objects/youPHPTubeEncoder.json.php b/objects/youPHPTubeEncoder.json.php index 4a7c9adfbb..58cdd911c6 100644 --- a/objects/youPHPTubeEncoder.json.php +++ b/objects/youPHPTubeEncoder.json.php @@ -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{ diff --git a/plugin/Gallery/style.css b/plugin/Gallery/style.css index 880c0ef51e..efdd7d74ec 100644 --- a/plugin/Gallery/style.css +++ b/plugin/Gallery/style.css @@ -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; + 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{ diff --git a/plugin/Gallery/view/modeGallery.php b/plugin/Gallery/view/modeGallery.php index 3942bc2f78..2d55ee6c21 100644 --- a/plugin/Gallery/view/modeGallery.php +++ b/plugin/Gallery/view/modeGallery.php @@ -97,6 +97,7 @@ $totalPages = ceil($total / $_POST['rowCount']);
@@ -110,13 +111,14 @@ $totalPages = ceil($total / $_POST['rowCount']); $poster = $images->poster; ?>
- <?php echo $video['title']; ?> + <?php echo $video['title']; ?> + + + +
- - -
@@ -125,39 +127,39 @@ $totalPages = ceil($total / $_POST['rowCount']);

- -
-
- label === __("Group")) { - ?> - text; ?> - +
+ label === __("Group")) { + ?> + text; ?> + -
-
- - - - -
-
- - -
-
- - -
+ } + ?>
+
+ + + + +
+
+ + +
+
+ + +
+
@@ -186,13 +188,13 @@ $totalPages = ceil($total / $_POST['rowCount']); $poster = $images->thumbsJpg; ?>
- <?php echo $value['title']; ?> + <?php echo $value['title']; ?> + + +
- - - @@ -253,7 +255,12 @@ $totalPages = ceil($total / $_POST['rowCount']); page: , maxVisible: 10 }).on('page', function (event, num) { - + window.location.replace("" + num); }); }); @@ -283,19 +290,20 @@ $totalPages = ceil($total / $_POST['rowCount']); ?>
- thumbsGif; - $poster = $images->thumbsJpg; - ?> + thumbsGif; + $poster = $images->thumbsJpg; + ?>
- <?php echo $value['title']; ?> + <?php echo $value['title']; ?> + + + +
- - -
@@ -336,12 +344,31 @@ $totalPages = ceil($total / $_POST['rowCount']);
- + - +
+ + + + +
+
+ + +
+
+ + echo $name; + ?> +
+ + +
@@ -364,19 +391,20 @@ $totalPages = ceil($total / $_POST['rowCount']); ?>
- thumbsGif; - $poster = $images->thumbsJpg; - ?> + thumbsGif; + $poster = $images->thumbsJpg; + ?>
- <?php echo $value['title']; ?> + <?php echo $value['title']; ?> + + + +
- - -
@@ -417,11 +445,31 @@ $totalPages = ceil($total / $_POST['rowCount']);
+
- +
+ + + + +
+
+ + +
+
+ + echo $name; + ?> +
+ + + ! . - +
- + diff --git a/view/channel.php b/view/channel.php index 6c0572730f..b1e22c6b52 100644 --- a/view/channel.php +++ b/view/channel.php @@ -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; ?> -
  • +
  • <?php echo $value['title']; ?> @@ -221,7 +221,7 @@ $playlists = PlayList::getAllFromUser($user_id, $publicOnly); $imgGif = $images->thumbsGif; $poster = $images->thumbsJpg; ?> -
    +
    <?php echo $value['title']; ?> diff --git a/view/js/script.js b/view/js/script.js index 4b06ffec8b..951739e683 100644 --- a/view/js/script.js +++ b/view/js/script.js @@ -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(); }); diff --git a/view/mini-upload-form/upload.php b/view/mini-upload-form/upload.php index c89198f98c..2145ab5b52 100644 --- a/view/mini-upload-form/upload.php +++ b/view/mini-upload-form/upload.php @@ -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 { diff --git a/view/xsendfile.php b/view/xsendfile.php index dc89a03b41..d42acb4ea3 100644 --- a/view/xsendfile.php +++ b/view/xsendfile.php @@ -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'])){