mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-03 01:39:24 +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:
parent
093764f044
commit
db715b0bae
4 changed files with 23 additions and 14 deletions
|
@ -99,7 +99,7 @@ abstract class ObjectYPT implements ObjectInterface
|
|||
{
|
||||
global $global;
|
||||
if (!static::isTableInstalled()) {
|
||||
return false;
|
||||
return array();
|
||||
}
|
||||
$sql = "SELECT * FROM " . static::getTableName() . " WHERE 1=1 ";
|
||||
|
||||
|
|
|
@ -313,6 +313,11 @@ class sqlDAL
|
|||
return false;
|
||||
}
|
||||
|
||||
if($refreshCache){
|
||||
$random = uniqid();
|
||||
$preparedStatement .= " /* {$random} */ ";
|
||||
}
|
||||
|
||||
$wasSTMTError = false;
|
||||
// need to add dechex because some times it return an negative value and make it fails on javascript playlists
|
||||
$crc = (md5($preparedStatement . implode($values)));
|
||||
|
|
|
@ -318,7 +318,7 @@ function getChannelTabClass($isTabButton, $isVideoTab = false)
|
|||
<?php
|
||||
}
|
||||
if ($showChannelVideosTab) {
|
||||
echo PHP_EOL.'<!-- showChannelVideosTab -->'.PHP_EOL;
|
||||
echo PHP_EOL . '<!-- showChannelVideosTab -->' . PHP_EOL;
|
||||
?>
|
||||
<li class="nav-item <?php echo getChannelTabClass(true, true); ?>">
|
||||
<a class="nav-link " href="#channelVideos" data-toggle="tab" aria-expanded="false">
|
||||
|
@ -326,15 +326,15 @@ function getChannelTabClass($isTabButton, $isVideoTab = false)
|
|||
</a>
|
||||
</li>
|
||||
<?php
|
||||
}else{
|
||||
if(!$advancedCustomUser->showChannelVideosTab){
|
||||
echo PHP_EOL.'<!-- NOT showChannelVideosTab -->'.PHP_EOL;
|
||||
} else {
|
||||
if (!$advancedCustomUser->showChannelVideosTab) {
|
||||
echo PHP_EOL . '<!-- NOT showChannelVideosTab -->' . PHP_EOL;
|
||||
}
|
||||
if(!$ownerCanUplaodVideos){
|
||||
echo PHP_EOL.'<!-- NOT ownerCanUplaodVideos -->'.PHP_EOL;
|
||||
if (!$ownerCanUplaodVideos) {
|
||||
echo PHP_EOL . '<!-- NOT ownerCanUplaodVideos -->' . PHP_EOL;
|
||||
}
|
||||
if(empty($uploadedVideos)){
|
||||
echo PHP_EOL.'<!-- empty uploadedVideos -->'.PHP_EOL;
|
||||
if (empty($uploadedVideos)) {
|
||||
echo PHP_EOL . '<!-- empty uploadedVideos -->' . PHP_EOL;
|
||||
}
|
||||
}
|
||||
if (!empty($uploadedTotalArticles)) {
|
||||
|
@ -353,15 +353,15 @@ function getChannelTabClass($isTabButton, $isVideoTab = false)
|
|||
<i class="fas fa-file-audio"></i> <span class="labelUpperCase"><?php echo __('Audio'); ?></span> <span class="badge"><?php echo $uploadedTotalAudio; ?></span>
|
||||
</a>
|
||||
</li>
|
||||
<?php
|
||||
<?php
|
||||
}
|
||||
if (!empty($uploadedTotalImages)) {
|
||||
?>
|
||||
<li class="nav-item <?php echo getChannelTabClass(true, false); ?>">
|
||||
<a class="nav-link " href="#channelImages" data-toggle="tab" aria-expanded="false">
|
||||
<i class="fa-solid fa-images"></i>
|
||||
<span class="labelUpperCase"><?php echo __("Images"); ?></span>
|
||||
<span class="badge"><?php echo $uploadedTotalImages; ?></span>
|
||||
<i class="fa-solid fa-images"></i>
|
||||
<span class="labelUpperCase"><?php echo __("Images"); ?></span>
|
||||
<span class="badge"><?php echo $uploadedTotalImages; ?></span>
|
||||
</a>
|
||||
</li>
|
||||
<?php
|
||||
|
@ -458,7 +458,7 @@ function getChannelTabClass($isTabButton, $isVideoTab = false)
|
|||
$obj->BigVideo = true;
|
||||
$obj->Description = false;
|
||||
include $global['systemRootPath'] . 'plugin/Gallery/view/BigVideo.php';
|
||||
if(empty($suggestedOrPinnedFound)){
|
||||
if (empty($suggestedOrPinnedFound)) {
|
||||
unset($uploadedVideos[0]);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -52,6 +52,10 @@ try {
|
|||
} else {
|
||||
tryToPlayMuted(currentTime);
|
||||
}
|
||||
} else if (e.data.avideoModalIframeFull) {
|
||||
avideoModalIframeFull(e.data.avideoModalIframeFull);
|
||||
} else if (e.data.avideoModalIframe) {
|
||||
avideoModalIframe(e.data.avideoModalIframe);
|
||||
} else {
|
||||
//console.log('eventer messageEvent', e.data);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue