Skip to content

Commit

Permalink
Simplify header.php
Browse files Browse the repository at this point in the history
- move some functions to `func.php`
- move sidebar to its own file `sidebar.php`
- fix indentation
- LCARS CSS: hide menu headers when logged off
- LCARS CSS: invert hover and active menu colors

Signed-off-by: RD WebDesign <[email protected]>
  • Loading branch information
rdwebdesign committed Jul 20, 2022
1 parent e79a1d1 commit 79187b1
Show file tree
Hide file tree
Showing 5 changed files with 483 additions and 492 deletions.
24 changes: 24 additions & 0 deletions scripts/pi-hole/php/func.php
Original file line number Diff line number Diff line change
Expand Up @@ -595,4 +595,28 @@ function convertUnicodeToIDNA($IDNA) {

return $IDNA;
}

// Return PID of FTL (used in settings.php)
function pidofFTL() {
return shell_exec("pidof pihole-FTL");
}

// Get FTL process information (used in settings.php)
function get_FTL_data($FTLpid, $arg) {
return trim(exec("ps -p " . $FTLpid . " -o " . $arg));
}

// Convert seconds into readable time (used in settings.php)
function convertseconds($argument) {
$seconds = round($argument);
if ($seconds < 60) {
return sprintf('%ds', $seconds);
} elseif ($seconds < 3600) {
return sprintf('%dm %ds', ($seconds / 60), ($seconds % 60));
} elseif ($seconds < 86400) {
return sprintf('%dh %dm %ds', ($seconds / 3600 % 24), ($seconds / 60 % 60), ($seconds % 60));
} else {
return sprintf('%dd %dh %dm %ds', ($seconds / 86400), ($seconds / 3600 % 24), ($seconds / 60 % 60), ($seconds % 60));
}
}
?>
Loading

0 comments on commit 79187b1

Please sign in to comment.