From 6e6151c9cd3b2c4892f7a0a603e49b658809025e Mon Sep 17 00:00:00 2001 From: DL6ER Date: Mon, 4 Dec 2017 21:50:14 +0100 Subject: [PATCH 1/2] Adding branch/version display for FTL Signed-off-by: DL6ER --- scripts/pi-hole/php/footer.php | 1 + scripts/pi-hole/php/update_checker.php | 21 ++++++++++++++++++--- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/scripts/pi-hole/php/footer.php b/scripts/pi-hole/php/footer.php index d9ca6cec..4a353832 100644 --- a/scripts/pi-hole/php/footer.php +++ b/scripts/pi-hole/php/footer.php @@ -59,6 +59,7 @@ if($web_update){ ?> (Update available!) FTL Version (Update available!)
Donate if you found this useful.
diff --git a/scripts/pi-hole/php/update_checker.php b/scripts/pi-hole/php/update_checker.php index e7ab480d..9bd4ab06 100644 --- a/scripts/pi-hole/php/update_checker.php +++ b/scripts/pi-hole/php/update_checker.php @@ -42,8 +42,15 @@ else $web_current = explode("-",$versions[1])[0]; } - /********** Get Pi-hole FTL version (not a git repository) **********/ - $FTL_current = $versions[2]; + /********** Get Pi-hole FTL (not a git repository) **********/ + $FTL_branch = $branches[2]; + if($FTL_branch !== "master") { + $FTL_current = "vDev"; + $FTL_commit = $versions[2]; + } + else { + $FTL_current = explode("-",$versions[2])[0]; + } // Get data from GitHub $core_latest = $GitHubversions[0]; @@ -77,7 +84,15 @@ else // FTL version comparison // This logic allows the local core version to be newer than the upstream version // The update indicator is only shown if the upstream version is NEWER - $FTL_update = (version_compare($FTL_current, $FTL_latest) < 0); + if($FTL_current !== "vDev") + { + $FTL_update = (version_compare($FTL_current, $FTL_latest) < 0); + } + else + { + $FTL_update = false; + } + } ?> From f5f4e57454bf03c10e04c143cbe3f0bb506723da Mon Sep 17 00:00:00 2001 From: DL6ER Date: Mon, 4 Dec 2017 21:51:44 +0100 Subject: [PATCH 2/2] Also hide the long details if only the FTL branch is set Signed-off-by: DL6ER --- scripts/pi-hole/php/footer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/pi-hole/php/footer.php b/scripts/pi-hole/php/footer.php index 4a353832..43cc2041 100644 --- a/scripts/pi-hole/php/footer.php +++ b/scripts/pi-hole/php/footer.php @@ -48,7 +48,7 @@