This repository has been archived by the owner on Sep 30, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
generic.php
140 lines (88 loc) · 3.16 KB
/
generic.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
<?php
ob_start();
if($gogo == false){
echo '<head>
<link rel="stylesheet" href="https://timehub.hubza.co.uk/main.css" type="text/css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.14.0/js/all.min.js"
integrity="sha512-YSdqvJoZr83hj76AIVdOcvLWYMWzy6sJyIMic2aQz5kh2bPTd9dzY3NtdeEAzPp/PhgZqr4aJObB3ym/vsItMg=="
crossorigin="anonymous"></script>
<link href="https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap" rel="stylesheet">
<link rel="apple-touch-icon" sizes="180x180" href="e">
<link rel="icon" sizes="32x32" href="e">
<link rel="manifest" href="/site.webmanifest">
<meta name="msapplication-TileColor" content="#3d49ec">
<meta name="theme-color" content="#3d49ec">
<meta property="og:image" content="e">
<meta name="viewport" content="width=device-width, initial-scale=0.5">
</head>
';
}
function navbar(){
include("navbar.php");
}
function time_elapsed_string($timestamp, $full = false) {
date_default_timezone_set("GMT");
$time_ago = strtotime($timestamp);
$current_time = time();
$current_time += 7200;
$time_difference = $current_time - $time_ago;
$seconds = $time_difference;
$minutes = round($seconds / 60); // value 60 is seconds
$hours = round($seconds / 3600); //value 3600 is 60 minutes * 60 sec
$days = round($seconds / 86400); //86400 = 24 * 60 * 60;
$weeks = round($seconds / 604800); // 7*24*60*60;
$months = round($seconds / 2629440); //((365+365+365+365+366)/5/12)*24*60*60
$years = round($seconds / 31553280); //(365+365+365+365+366)/5 * 24 * 60 * 60
// echo "<br>Minutes: ". $minutes;
// echo "<br>Hours: ". $hours;
// echo "<br>Days: ". $days;
// echo "<br>Weeks: ". $weeks;
// echo "<br>Months: ". $months;
// echo "<br>Years: ". $years;
// echo "<br>Time: " . $current_time;
// echo "<br>Sent Time: " . $timestamp;
// echo "<br>Parsed Time: " . $time_ago;
if ($seconds <= 60){
return "just now";
} else if ($minutes <= 60){
if ($minutes == 1){
return "one minute ago";
} else {
return "$minutes minutes ago";
}
} else if ($hours <= 24){
if ($hours == 1){
return "an hour ago";
} else {
return "$hours hrs ago";
}
} else if ($days <= 7){
if ($days == 1){
return "yesterday";
} else {
return "$days days ago";
}
} else if ($weeks <= 4.3){
if ($weeks == 1){
return "a week ago";
} else {
return "$weeks weeks ago";
}
} else if ($months <= 12){
if ($months == 1){
return "a month ago";
} else {
return "$months months ago";
}
} else {
if ($years == 1){
return "one year ago";
} else {
return "$years years ago";
}
}
}
$path = $_SERVER['DOCUMENT_ROOT'];
$path .= "/error.php";
//include_once($path);
//throw new Exception('pause for maintenance');