Featured Apps

master
Squidly271 2023-04-07 08:42:39 -04:00
parent 054ae54aef
commit 27332d44b6
3 changed files with 20 additions and 5 deletions

View File

@ -2,7 +2,7 @@
106b521c1feebda4d7b3f558cc016cda ./CA_notices.page 106b521c1feebda4d7b3f558cc016cda ./CA_notices.page
eb1f0ee4148747c0473e73e4e973994f ./ca_settings.page eb1f0ee4148747c0473e73e4e973994f ./ca_settings.page
e8d29607ec792ddf9f6832b10ee70fdc ./default.cfg e8d29607ec792ddf9f6832b10ee70fdc ./default.cfg
37bc72a31f11e4bd134d5a2d46b988b4 ./include/exec.php bf6756054e7847268961df8bcbefd1bc ./include/exec.php
6a2cd1927d391aff2345233a514d7a87 ./include/helpers.php 6a2cd1927d391aff2345233a514d7a87 ./include/helpers.php
8e053d6cd83fbe2202c13b692beabb4f ./include/paths.php 8e053d6cd83fbe2202c13b692beabb4f ./include/paths.php
532fffdf939594c143e679da02bd841e ./javascript/libraries.js 532fffdf939594c143e679da02bd841e ./javascript/libraries.js

View File

@ -593,18 +593,33 @@ function appOfDay($file) {
} }
break; break;
case "featured": case "featured":
$sortOrder['sortBy'] = "Name"; $containers = getAllInfo();
$sortOrder['sortDir'] = "Up"; $sortOrder['sortBy'] = "Featured";
$sortOrder['sortDir'] = "Down";
usort($file,"mySort"); usort($file,"mySort");
foreach($file as $template) { foreach($file as $template) {
if ( ! isset($template['Featured'] ) ) if ( ! isset($template['Featured'] ) )
continue; break;
if ( ! checkRandomApp($template) ) if ( ! checkRandomApp($template) )
continue; continue;
// Don't show it if the plugin is installed // Don't show it if the plugin is installed
if ( $template['PluginURL'] && is_file("/var/log/plugins/".basename($template['PluginURL'])) ) if ( $template['PluginURL'] && is_file("/var/log/plugins/".basename($template['PluginURL'])) )
continue; continue;
// Don't show it if the container is installed
if ( ! $template['PluginURL'] ) {
if ( $caSettings['dockerRunning'] ) {
$selected = false;
foreach ($containers as $testDocker) {
if ( ($template['Repository'] == $testDocker['Image'] ) || ($template['Repository'].":latest" == $testDocker['Image']) || (str_replace(":latest","",$template['Repository']) == $testDocker['Image']) ) {
$selected = true;
break;
}
}
}
if ( $selected )
continue;
}
$appOfDay[] = $template['ID']; $appOfDay[] = $template['ID'];
if ( count($appOfDay) == $max ) break; if ( count($appOfDay) == $max ) break;
} }