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
eb1f0ee4148747c0473e73e4e973994f ./ca_settings.page
e8d29607ec792ddf9f6832b10ee70fdc ./default.cfg
37bc72a31f11e4bd134d5a2d46b988b4 ./include/exec.php
bf6756054e7847268961df8bcbefd1bc ./include/exec.php
6a2cd1927d391aff2345233a514d7a87 ./include/helpers.php
8e053d6cd83fbe2202c13b692beabb4f ./include/paths.php
532fffdf939594c143e679da02bd841e ./javascript/libraries.js

View File

@ -593,18 +593,33 @@ function appOfDay($file) {
}
break;
case "featured":
$sortOrder['sortBy'] = "Name";
$sortOrder['sortDir'] = "Up";
$containers = getAllInfo();
$sortOrder['sortBy'] = "Featured";
$sortOrder['sortDir'] = "Down";
usort($file,"mySort");
foreach($file as $template) {
if ( ! isset($template['Featured'] ) )
continue;
break;
if ( ! checkRandomApp($template) )
continue;
// Don't show it if the plugin is installed
if ( $template['PluginURL'] && is_file("/var/log/plugins/".basename($template['PluginURL'])) )
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'];
if ( count($appOfDay) == $max ) break;
}