1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-03 01:39:24 +02:00
This commit is contained in:
Daniel Neto 2023-09-05 10:24:36 -03:00
parent 26c66746d3
commit 7799d0f38c
14 changed files with 31 additions and 12 deletions

1
.gitignore vendored
View file

@ -69,6 +69,7 @@
/plugin/FansSubscriptions/
/plugin/MessageOfTheDay/
/plugin/InteractiveVideo/
/plugin/AI/
getPaidPlugisList.php
/videos/
*.zip

View file

@ -8,6 +8,8 @@ class ImagesPlaceHolders
public static $RETURN_URL = 2;
public static $RETURN_ARRAY = 3;
static $placeholders = [
'animationLandscape' => 'view/img/placeholders/animationLandscape.webp',
'animationPortrait' => 'view/img/placeholders/animationPortrait.webp',
'imageIcon' => 'view/img/placeholders/image.png',
'imageLandscape' => 'view/img/placeholders/imageLandscape.png',
'imagePortrait' => 'view/img/placeholders/imagePortrait.png',
@ -31,7 +33,7 @@ class ImagesPlaceHolders
'zipPortrait' => 'view/img/placeholders/zipPortrait.png',
'videoPlaceholder' => 'view/img/video-placeholder-gray.png',
'videoPlaceholderPortrait' => 'view/img/video-placeholder-gray-portrait.png',
'videoNotFoundPoster' => 'view/img/this-video-is-not-available.jpg'
'videoNotFoundPoster' => 'view/img/videoNotFound.png'
];
static function getComponent($type, $return = 0)
@ -263,4 +265,12 @@ class ImagesPlaceHolders
{
return self::getComponent('videoNotFoundPoster', $return);
}
static function getVideoAnimationLandscape($return = 0)
{
return self::getComponent('animationLandscape', $return);
}
static function getVideoAnimationPortrait($return = 0)
{
return self::getComponent('animationPortrait', $return);
}
}

View file

@ -324,6 +324,10 @@ class Cache extends PluginAbstract {
}
public static function _getCache($name, $ignoreMetadata = false) {
global $cache_setCacheToSaveAtTheEnd;
if(!empty($cache_setCacheToSaveAtTheEnd[$name])){
return $cache_setCacheToSaveAtTheEnd[$name];
}
$metadata = self::getCacheMetaData();
return CachesInDB::_getCache($name, $metadata['domain'], $metadata['ishttps'], $metadata['user_location'], $metadata['loggedType'], $ignoreMetadata);
}
@ -333,7 +337,7 @@ class Cache extends PluginAbstract {
if(!isset($cache_setCacheToSaveAtTheEnd)){
$cache_setCacheToSaveAtTheEnd = array();
}
$cache_setCacheToSaveAtTheEnd[] = array('name'=>$name, 'value'=>$value);
$cache_setCacheToSaveAtTheEnd[$name] = $value;
//$metadata = self::getCacheMetaData();
//return CachesInDB::_setCache($name, $value, $metadata['domain'], $metadata['ishttps'], $metadata['user_location'], $metadata['loggedType']);
}
@ -342,9 +346,9 @@ class Cache extends PluginAbstract {
global $cache_setCacheToSaveAtTheEnd;
if(!empty($cache_setCacheToSaveAtTheEnd)){
$metadata = self::getCacheMetaData();
mysqlBeginTransaction();
//mysqlBeginTransaction();
CachesInDB::setBulkCache($cache_setCacheToSaveAtTheEnd, $metadata);
mysqlCommit();
//mysqlCommit();
}
}

View file

@ -195,9 +195,9 @@ class CachesInDB extends ObjectYPT
$formats = [];
$values = [];
foreach ($cacheArray as $cache) {
$name = self::hashName($cache['name']);
$content = !is_string($cache['value']) ? _json_encode($cache['value']) : $cache['value'];
foreach ($cacheArray as $name => $cache) {
$name = self::hashName($name);
$content = !is_string($cache) ? _json_encode($cache) : $cache;
if (empty($content)) continue;
$formats[] = "sssssss";

View file

@ -10,7 +10,9 @@ if ($obj->BigVideo && empty($_GET['showOnly'])) {
if (empty($video)) {
?>
<center>
<img src="<?php echo getURL('view/img/this-video-is-not-available.jpg'); ?>">
<img
src="<?php echo ImagesPlaceHolders::getVideoNotFoundPoster(ImagesPlaceHolders::$RETURN_URL); ?>"
class="img img-responsive ImagesPlaceHoldersDefaultImage">
</center>
<?php
} else {

View file

@ -66,7 +66,9 @@ TimeLogStart($timeLog3);
iframe="<?php echo $global['webSiteRootURL']; ?>videoEmbed/<?php echo $value['clean_title']; ?>"
ajaxLoad="<?php echo $ajaxLoad; ?>">
<div class="tile__media ">
<img alt="<?php echo $value['title']; ?>" src="<?php echo ImagesPlaceHolders::getImageLandscape(ImagesPlaceHolders::$RETURN_URL); ?>" class="tile__img <?php echo $cssClass; ?> thumbsJPG img img-responsive carousel-cell-image" data-flickity-lazyload="<?php echo $img; ?>" />
<img alt="<?php echo $value['title']; ?>"
src="<?php echo ImagesPlaceHolders::getImageLandscape(ImagesPlaceHolders::$RETURN_URL); ?>"
class="tile__img <?php echo $cssClass; ?> thumbsJPG img img-responsive carousel-cell-image" data-flickity-lazyload="<?php echo $img; ?>" />
<?php if (!empty($imgGif)) { ?>
<img style="position: absolute; top: 0; display: none;" src="<?php echo ImagesPlaceHolders::getImageLandscape(ImagesPlaceHolders::$RETURN_URL); ?>" alt="<?php echo $value['title']; ?>" id="tile__img thumbsGIF<?php echo $value['id']; ?>" class="thumbsGIF img-responsive img carousel-cell-image" data-flickity-lazyload="<?php echo $imgGif; ?>" />
<?php } ?>

Binary file not shown.

After

Width:  |  Height:  |  Size: 223 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 117 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

BIN
view/img/videoNotFound.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 238 KiB

View file

@ -13,8 +13,8 @@
<video id="mainVideo" style="display: none; height: 0;width: 0;" ></video>
<center>
<img src="<?php
echo getURL('view/img/this-video-is-not-available.jpg');
?>" class="img img-responsive" style="max-height: 600px;" >
echo ImagesPlaceHolders::getVideoNotFoundPoster(ImagesPlaceHolders::$RETURN_URL);
?>" class="img img-responsive ImagesPlaceHoldersDefaultImage" style="max-height: 600px;" >
</center>
</div>
</div>

View file

@ -4,7 +4,7 @@ if (!isset($global['systemRootPath'])) {
}
header('HTTP/1.0 404 Not Found', true, 404);
$img = getURL('view/img/this-video-is-not-available.jpg');
$img = ImagesPlaceHolders::getVideoNotFoundPoster(ImagesPlaceHolders::$RETURN_URL);
$poster = $img;
$imgw = 1280;
$imgh = 720;