mirror of
https://github.com/Squidly271/community.applications.git
synced 2025-06-03 14:52:13 +08:00
Prevent duplicate apps from being selected in app of the day
This commit is contained in:
parent
8fbbea15c2
commit
190d1bc1d1
archive
source/community.applications/usr/local/emhttp/plugins/community.applications/include
Binary file not shown.
@ -805,6 +805,7 @@ function appOfDay($file) {
|
|||||||
$app[$ii] = $randomApp;
|
$app[$ii] = $randomApp;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
$app = array_values(array_unique($app));
|
||||||
writeJsonFile($communityPaths['appOfTheDay'],$app);
|
writeJsonFile($communityPaths['appOfTheDay'],$app);
|
||||||
return $app;
|
return $app;
|
||||||
}
|
}
|
||||||
@ -1072,7 +1073,11 @@ case 'get_content':
|
|||||||
$displayApplications = array();
|
$displayApplications = array();
|
||||||
if ( count($file) > 200) {
|
if ( count($file) > 200) {
|
||||||
$appsOfDay = appOfDay($file);
|
$appsOfDay = appOfDay($file);
|
||||||
|
$displayApplications['community'] = array();
|
||||||
for ($i=0;$i<$communitySettings['maxDetailColumns'];$i++) {
|
for ($i=0;$i<$communitySettings['maxDetailColumns'];$i++) {
|
||||||
|
if ( ! $appsOfDay[$i]) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
$displayApplications['community'][] = $file[$appsOfDay[$i]];
|
$displayApplications['community'][] = $file[$appsOfDay[$i]];
|
||||||
}
|
}
|
||||||
writeJsonFile($communityPaths['community-templates-displayed'],$displayApplications);
|
writeJsonFile($communityPaths['community-templates-displayed'],$displayApplications);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user