diff options
Diffstat (limited to 'includes/footer.php')
-rw-r--r-- | includes/footer.php | 33 |
1 files changed, 3 insertions, 30 deletions
diff --git a/includes/footer.php b/includes/footer.php index 4592b8e..720881a 100644 --- a/includes/footer.php +++ b/includes/footer.php @@ -1,35 +1,6 @@ <?php -if (!function_exists("timeAgo")) { - function timeAgo($time): string { - if (!is_numeric($time)) { - $time = strtotime($time); - } - - $periods = ["second", "minute", "hour", "day", "week", "month", "year", "age"]; - $lengths = array("60", "60", "24", "7", "4.35", "12", "100"); - - $now = time(); - - $difference = $now - $time; - if ($difference <= 10 && $difference >= 0) { - return $tense = "now"; - } elseif ($difference > 0) { - $tense = "ago"; - } else { - $tense = "later"; - } - - for ($j = 0; $difference >= $lengths[$j] && $j < count($lengths)-1; $j++) { - $difference /= $lengths[$j]; - } - - $difference = round($difference); - - $period = $periods[$j] . ($difference >1 ? "s" :''); - return "{$difference} {$period} {$tense}"; - } -} +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/functions.php"; ?> @@ -58,5 +29,7 @@ if (!function_exists("timeAgo")) { }) </script> +<?php require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/search.php"; ?> + </body> </html>
\ No newline at end of file |