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 <github@rdwebdesign.com.br>
  • Loading branch information
rdwebdesign committed Jul 20, 2022
1 parent e79a1d1 commit 9e1e99a
Show file tree
Hide file tree
Showing 5 changed files with 482 additions and 491 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 9e1e99a

Please sign in to comment.