mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-13 13:11:31 +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";
|
return number_format($size_bytes,0,"","")." Bytes";
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
function getReadableDate($timestamp) {
|
function getReadableDate($timestamp) { /* {{{ */
|
||||||
return date("Y-m-d", $timestamp);
|
return date("Y-m-d", $timestamp);
|
||||||
}
|
} /* }}} */
|
||||||
|
|
||||||
function getLongReadableDate($timestamp) {
|
function getLongReadableDate($timestamp) { /* {{{ */
|
||||||
return date("Y-m-d H:i:s", $timestamp);
|
return date("Y-m-d H:i:s", $timestamp);
|
||||||
}
|
} /* }}} */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Converts a date/time string into a 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
|
* @param $date string date in form Y-m-d H:i:s
|
||||||
* @return integer/boolean unix timestamp or false in case of an error
|
* @return integer/boolean unix timestamp or false in case of an error
|
||||||
*/
|
*/
|
||||||
function makeTsFromLongDate($date) { /* }}} */
|
function makeTsFromLongDate($date) { /* {{{ */
|
||||||
$tmp = explode(' ', $date);
|
$tmp = explode(' ', $date);
|
||||||
if(count($tmp) != 2)
|
if(count($tmp) != 2)
|
||||||
return false;
|
return false;
|
||||||
|
@ -52,16 +52,16 @@ function makeTsFromLongDate($date) { /* }}} */
|
||||||
return $ts;
|
return $ts;
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
function getReadableDuration($secs) {
|
function getReadableDuration($secs) { /* {{{ */
|
||||||
$s = "";
|
$s = "";
|
||||||
foreach ( getReadableDurationArray($secs) as $k => $v ) {
|
foreach ( getReadableDurationArray($secs) as $k => $v ) {
|
||||||
if ( $v ) $s .= $v." ".($v==1? substr($k,0,-1) : $k).", ";
|
if ( $v ) $s .= $v." ".($v==1? substr($k,0,-1) : $k).", ";
|
||||||
}
|
}
|
||||||
|
|
||||||
return substr($s, 0, -2);
|
return substr($s, 0, -2);
|
||||||
}
|
} /* }}} */
|
||||||
|
|
||||||
function getReadableDurationArray($secs) {
|
function getReadableDurationArray($secs) { /* {{{ */
|
||||||
$units = array(
|
$units = array(
|
||||||
getMLText("weeks") => 7*24*3600,
|
getMLText("weeks") => 7*24*3600,
|
||||||
getMLText("days") => 24*3600,
|
getMLText("days") => 24*3600,
|
||||||
|
@ -77,7 +77,7 @@ function getReadableDurationArray($secs) {
|
||||||
}
|
}
|
||||||
|
|
||||||
return $units;
|
return $units;
|
||||||
}
|
} /* }}} */
|
||||||
|
|
||||||
//
|
//
|
||||||
// The original string sanitizer, kept for reference.
|
// The original string sanitizer, kept for reference.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user