mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-03-12 08:55:54 +00:00
add fold marks
This commit is contained in:
parent
72d9e1a27c
commit
0369e95157
|
@ -26,13 +26,13 @@ function formatted_size($size_bytes) { /* {{{ */
|
|||
return number_format($size_bytes,0,"","")." Bytes";
|
||||
} /* }}} */
|
||||
|
||||
function getReadableDate($timestamp) {
|
||||
function getReadableDate($timestamp) { /* {{{ */
|
||||
return date("Y-m-d", $timestamp);
|
||||
}
|
||||
} /* }}} */
|
||||
|
||||
function getLongReadableDate($timestamp) {
|
||||
function getLongReadableDate($timestamp) { /* {{{ */
|
||||
return date("Y-m-d H:i:s", $timestamp);
|
||||
}
|
||||
} /* }}} */
|
||||
|
||||
/*
|
||||
* Converts a date/time string into a timestamp
|
||||
|
@ -40,7 +40,7 @@ function getLongReadableDate($timestamp) {
|
|||
* @param $date string date in form Y-m-d H:i:s
|
||||
* @return integer/boolean unix timestamp or false in case of an error
|
||||
*/
|
||||
function makeTsFromLongDate($date) { /* }}} */
|
||||
function makeTsFromLongDate($date) { /* {{{ */
|
||||
$tmp = explode(' ', $date);
|
||||
if(count($tmp) != 2)
|
||||
return false;
|
||||
|
@ -52,16 +52,16 @@ function makeTsFromLongDate($date) { /* }}} */
|
|||
return $ts;
|
||||
} /* }}} */
|
||||
|
||||
function getReadableDuration($secs) {
|
||||
function getReadableDuration($secs) { /* {{{ */
|
||||
$s = "";
|
||||
foreach ( getReadableDurationArray($secs) as $k => $v ) {
|
||||
if ( $v ) $s .= $v." ".($v==1? substr($k,0,-1) : $k).", ";
|
||||
}
|
||||
|
||||
return substr($s, 0, -2);
|
||||
}
|
||||
} /* }}} */
|
||||
|
||||
function getReadableDurationArray($secs) {
|
||||
function getReadableDurationArray($secs) { /* {{{ */
|
||||
$units = array(
|
||||
getMLText("weeks") => 7*24*3600,
|
||||
getMLText("days") => 24*3600,
|
||||
|
@ -77,7 +77,7 @@ function getReadableDurationArray($secs) {
|
|||
}
|
||||
|
||||
return $units;
|
||||
}
|
||||
} /* }}} */
|
||||
|
||||
//
|
||||
// The original string sanitizer, kept for reference.
|
||||
|
|
Loading…
Reference in New Issue
Block a user