1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-06 03:50:04 +02:00

Refactor return value in ObjectYPT to an empty array for better handling of uninstalled tables; add cache refresh identifier in sqlDAL; improve code formatting and readability in channelBody and script.js

This commit is contained in:
Daniel Neto 2025-05-03 12:20:57 -03:00
parent 093764f044
commit db715b0bae
4 changed files with 23 additions and 14 deletions

View file

@ -99,7 +99,7 @@ abstract class ObjectYPT implements ObjectInterface
{ {
global $global; global $global;
if (!static::isTableInstalled()) { if (!static::isTableInstalled()) {
return false; return array();
} }
$sql = "SELECT * FROM " . static::getTableName() . " WHERE 1=1 "; $sql = "SELECT * FROM " . static::getTableName() . " WHERE 1=1 ";

View file

@ -313,6 +313,11 @@ class sqlDAL
return false; return false;
} }
if($refreshCache){
$random = uniqid();
$preparedStatement .= " /* {$random} */ ";
}
$wasSTMTError = false; $wasSTMTError = false;
// need to add dechex because some times it return an negative value and make it fails on javascript playlists // need to add dechex because some times it return an negative value and make it fails on javascript playlists
$crc = (md5($preparedStatement . implode($values))); $crc = (md5($preparedStatement . implode($values)));

View file

@ -318,7 +318,7 @@ function getChannelTabClass($isTabButton, $isVideoTab = false)
<?php <?php
} }
if ($showChannelVideosTab) { if ($showChannelVideosTab) {
echo PHP_EOL.'<!-- showChannelVideosTab -->'.PHP_EOL; echo PHP_EOL . '<!-- showChannelVideosTab -->' . PHP_EOL;
?> ?>
<li class="nav-item <?php echo getChannelTabClass(true, true); ?>"> <li class="nav-item <?php echo getChannelTabClass(true, true); ?>">
<a class="nav-link " href="#channelVideos" data-toggle="tab" aria-expanded="false"> <a class="nav-link " href="#channelVideos" data-toggle="tab" aria-expanded="false">
@ -326,15 +326,15 @@ function getChannelTabClass($isTabButton, $isVideoTab = false)
</a> </a>
</li> </li>
<?php <?php
}else{ } else {
if(!$advancedCustomUser->showChannelVideosTab){ if (!$advancedCustomUser->showChannelVideosTab) {
echo PHP_EOL.'<!-- NOT showChannelVideosTab -->'.PHP_EOL; echo PHP_EOL . '<!-- NOT showChannelVideosTab -->' . PHP_EOL;
} }
if(!$ownerCanUplaodVideos){ if (!$ownerCanUplaodVideos) {
echo PHP_EOL.'<!-- NOT ownerCanUplaodVideos -->'.PHP_EOL; echo PHP_EOL . '<!-- NOT ownerCanUplaodVideos -->' . PHP_EOL;
} }
if(empty($uploadedVideos)){ if (empty($uploadedVideos)) {
echo PHP_EOL.'<!-- empty uploadedVideos -->'.PHP_EOL; echo PHP_EOL . '<!-- empty uploadedVideos -->' . PHP_EOL;
} }
} }
if (!empty($uploadedTotalArticles)) { if (!empty($uploadedTotalArticles)) {
@ -458,7 +458,7 @@ function getChannelTabClass($isTabButton, $isVideoTab = false)
$obj->BigVideo = true; $obj->BigVideo = true;
$obj->Description = false; $obj->Description = false;
include $global['systemRootPath'] . 'plugin/Gallery/view/BigVideo.php'; include $global['systemRootPath'] . 'plugin/Gallery/view/BigVideo.php';
if(empty($suggestedOrPinnedFound)){ if (empty($suggestedOrPinnedFound)) {
unset($uploadedVideos[0]); unset($uploadedVideos[0]);
} }
} }

View file

@ -52,6 +52,10 @@ try {
} else { } else {
tryToPlayMuted(currentTime); tryToPlayMuted(currentTime);
} }
} else if (e.data.avideoModalIframeFull) {
avideoModalIframeFull(e.data.avideoModalIframeFull);
} else if (e.data.avideoModalIframe) {
avideoModalIframe(e.data.avideoModalIframe);
} else { } else {
//console.log('eventer messageEvent', e.data); //console.log('eventer messageEvent', e.data);
} }