summaryrefslogtreecommitdiff
path: root/includes/footer.php
diff options
context:
space:
mode:
authorMinteck <contact@minteck.org>2022-09-21 22:42:33 +0200
committerMinteck <contact@minteck.org>2022-09-21 22:42:33 +0200
commite95b208af90cc386a7d8d1bcab426727cf4f0121 (patch)
treeb293e0c644513fbeb6e9ad29be97fa6347a55e9f /includes/footer.php
parentb5f589c323f415bb42ea7069cb4d1a8a2233dd69 (diff)
downloadpluralconnect-e95b208af90cc386a7d8d1bcab426727cf4f0121.tar.gz
pluralconnect-e95b208af90cc386a7d8d1bcab426727cf4f0121.tar.bz2
pluralconnect-e95b208af90cc386a7d8d1bcab426727cf4f0121.zip
Update time
Diffstat (limited to 'includes/footer.php')
-rw-r--r--includes/footer.php33
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