X-Git-Url: https://git.p6c8.net/jirafeau.git/blobdiff_plain/cd09b476cbbfa8f90f0f86e67da5414d21c8ad10..3963e2bb1b0140a7912dad1e3314a46e49b1ee12:/lib/functions.php
diff --git a/lib/functions.php b/lib/functions.php
index bac444b..7d15e1b 100644
--- a/lib/functions.php
+++ b/lib/functions.php
@@ -120,6 +120,21 @@ function jirafeau_human_size($octets)
return round($o, 1) . $u[$p];
}
+// Convert UTC timestamp to a datetime field
+function jirafeau_get_datetimefield($timestamp)
+{
+ $content = ''
+ . strftime('%Y-%m-%d %H:%M', $timestamp) . ' (GMT)';
+ return $content;
+}
+
+function jirafeau_fatal_error($errorText, $cfg = array())
+{
+ echo '
';
+ require(JIRAFEAU_ROOT . 'lib/template/footer.php');
+ exit;
+}
+
function jirafeau_clean_rm_link($link)
{
$p = s2p("$link");
@@ -599,8 +614,7 @@ function jirafeau_admin_list($name, $file_hash, $link_hash)
echo '';
echo '' . $l['mime_type'] . ' | ';
echo '' . jirafeau_human_size($l['file_size']) . ' | ';
- echo '' . ($l['time'] == -1 ? '' : strftime('%c', $l['time'])) .
- ' | ';
+ echo '' . ($l['time'] == -1 ? 'â' : jirafeau_get_datetimefield($l['time'])) . ' | ';
echo '';
if ($l['onetime'] == 'O') {
echo 'Y';
@@ -608,7 +622,7 @@ function jirafeau_admin_list($name, $file_hash, $link_hash)
echo 'N';
}
echo ' | ';
- echo '' . strftime('%c', $l['upload_date']) . ' | ';
+ echo '' . jirafeau_get_datetimefield($l['upload_date']) . ' | ';
echo '' . $l['ip'] . ' | ';
echo '' .
' |