X-Git-Url: https://git.p6c8.net/jirafeau_mojo42.git/blobdiff_plain/1203cc4e9094fa86f7978c9da56f454d4c21ca32..6d2f72029699314db90926f57861154ae76d3852:/lib/functions.php diff --git a/lib/functions.php b/lib/functions.php index 34c7df8..5800190 100644 --- a/lib/functions.php +++ b/lib/functions.php @@ -20,7 +20,7 @@ */ /** - * Transform a string in a path by seperating each letters by a '/'. + * Transform a string in a path by separating each letters by a '/'. * @return path finishing with a '/' */ function s2p($s) @@ -28,7 +28,7 @@ function s2p($s) $block_size = 8; $p = ''; for ($i = 0; $i < strlen($s); $i++) { - $p .= $s{$i}; + $p .= $s[$i]; if (($i + 1) % $block_size == 0) { $p .= '/'; } @@ -68,16 +68,16 @@ function base_16_to_64($num) # Convert long hex string to bin. $size = strlen($num); for ($i = 0; $i < $size; $i++) { - $b .= $hex2bin{hexdec($num{$i})}; + $b .= $hex2bin[hexdec($num[$i])]; } # Convert long bin to base 64. $size *= 4; for ($i = $size - 6; $i >= 0; $i -= 6) { - $o = $m{bindec(substr($b, $i, 6))} . $o; + $o = $m[bindec(substr($b, $i, 6))] . $o; } # Some few bits remaining ? if ($i < 0 && $i > -6) { - $o = $m{bindec(substr($b, 0, $i + 6))} . $o; + $o = $m[bindec(substr($b, 0, $i + 6))] . $o; } return $o; } @@ -142,6 +142,11 @@ function jirafeau_fatal_error($errorText, $cfg = array()) exit; } +function jirafeau_non_fatal_error($errorText) +{ + echo '
' . $errorText . '
' . t('FILENAME') . ' | '; - echo '' . t('TYPE') . ' | '; - echo '' . t('SIZE') . ' | '; - echo '' . t('EXPIRE') . ' | '; - echo '' . t('ONETIME') . ' | '; - echo '' . t('UPLOAD_DATE') . ' | '; - echo '' . t('ORIGIN') . ' | '; + echo ''; echo ' | ' . t('ACTION') . ' | '; echo '
---|---|---|---|---|---|---|---|---|
' . '' . jirafeau_escape($l['file_name']) . ''; - echo ' | '; - echo '' . jirafeau_escape($l['mime_type']) . ' | '; - echo '' . jirafeau_human_size($l['file_size']) . ' | '; - echo '' . ($l['time'] == -1 ? 'â' : jirafeau_get_datetimefield($l['time'])) . ' | '; - echo '';
- if ($l['onetime'] == 'O') {
- echo 'Y';
- } else {
- echo 'N';
+ t('DL_PAGE') . '">' . jirafeau_escape($l['file_name']) . ' '; + echo t('TYPE') . ': ' . jirafeau_escape($l['mime_type']) . ' '; + echo t('SIZE') . ': ' . jirafeau_human_size($l['file_size']) . ' '; + echo t('EXPIRE') . ': ' . ($l['time'] == -1 ? 'â' : jirafeau_get_datetimefield($l['time'])) . ' '; + echo t('ONETIME') . ': ' . ($l['onetime'] == 'O' ? 'Yes' : 'No') . ' '; + echo t('UPLOAD_DATE') . ': ' . jirafeau_get_datetimefield($l['upload_date']) . ' '; + if (strlen($l['ip']) > 0) { + echo t('ORIGIN') . ': ' . $l['ip'] . ' '; } - echo ' | ';
- echo '' . jirafeau_get_datetimefield($l['upload_date']) . ' | '; - echo '' . $l['ip'] . ' | '; - echo '' . - ' | '; + echo ' |