Permalink
Browse files

Only NEMS 1.5+ can use new backgrounds

  • Loading branch information...
NEMS Linux
NEMS Linux committed Jan 13, 2019
1 parent 1081979 commit 51f450ae639f4f0fac87ed51c4a0fc8c28380ee2
Showing with 20 additions and 14 deletions.
  1. +20 −14 inc/wallpaper.php
@@ -6,25 +6,31 @@
8 = user uploaded
*/
$nemsver = shell_exec('/usr/local/bin/nems-info nemsver');
// defaults
$background=6;
$backgroundBlur=1; // 1 = disabled, 2 = slight, 3 = medium, 4 = heavy
$conftmp = file('/usr/local/share/nems/nems.conf');
if (is_array($conftmp) && count($conftmp) > 0) {
foreach ($conftmp as $line) {
$tmp = explode('=',$line);
if (trim($tmp[0]) == 'background') {
$background=trim($tmp[1]);
} elseif (trim($tmp[0]) == 'backgroundBlur') {
$backgroundBlur=trim($tmp[1]);
} elseif (trim($tmp[0]) == 'backgroundColor') {
$backgroundColor=trim($tmp[1]);
} elseif (trim($tmp[0]) == 'backgroundImage') {
$backgroundImage=trim($tmp[1]);
$background=5;
// only allow >= NEMS 1.5 to change these defaults
if ($nemsver >= 1.5) {
$background=6;
$conftmp = file('/usr/local/share/nems/nems.conf');
if (is_array($conftmp) && count($conftmp) > 0) {
foreach ($conftmp as $line) {
$tmp = explode('=',$line);
if (trim($tmp[0]) == 'background') {
$background=trim($tmp[1]);
} elseif (trim($tmp[0]) == 'backgroundBlur') {
$backgroundBlur=trim($tmp[1]);
} elseif (trim($tmp[0]) == 'backgroundColor') {
$backgroundColor=trim($tmp[1]);
} elseif (trim($tmp[0]) == 'backgroundImage') {
$backgroundImage=trim($tmp[1]);
}
}
}
}
// default image within nems-www
$defaultimg = '/img/wallpaper/server_room_dark.jpg';
// Set the default background element to replace

0 comments on commit 51f450a

Please sign in to comment.