diff options
author | Andreas Gohr <gohr@cosmocode.de> | 2009-10-07 15:36:14 +0200 |
---|---|---|
committer | Andreas Gohr <gohr@cosmocode.de> | 2009-10-07 15:36:14 +0200 |
commit | f22635779b10fe3735a11bc1af5c88653e580534 (patch) | |
tree | 03322ac39a0a7a644340b45417125ea4c8275b51 /inc/media.php | |
parent | c57e365ef97272cc08601374e4de2f5bcd614335 (diff) | |
download | rpg-f22635779b10fe3735a11bc1af5c88653e580534.tar.gz rpg-f22635779b10fe3735a11bc1af5c88653e580534.tar.bz2 |
New dformat() function for fuzzy date support
Ignore-this: 7193cd788fee2c05a9068bf6edd5dc17
It is now possible to use the %f placeholder in $conf['dformat']
to add a fuzzy age string.
Template developers and plugin authors should replace their strftime +
$conf['dformat'] calls with calls to the new dformat() function.
Example:
%Y/%m/%d %H:%M (%f) produces dates like this:
2009/09/16 10:36 (3 weeks ago)
darcs-hash:20091007133614-6e07b-677108d1b43928ef8fd886813e43514507b5e073.gz
Diffstat (limited to 'inc/media.php')
-rw-r--r-- | inc/media.php | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/inc/media.php b/inc/media.php index 4ad7047b2..2a45b6d80 100644 --- a/inc/media.php +++ b/inc/media.php @@ -404,7 +404,7 @@ function media_notify($id,$file,$mime){ $ip = clientIP(); $text = rawLocale('uploadmail'); - $text = str_replace('@DATE@',strftime($conf['dformat']),$text); + $text = str_replace('@DATE@',dformat(),$text); $text = str_replace('@BROWSER@',$_SERVER['HTTP_USER_AGENT'],$text); $text = str_replace('@IPADDRESS@',$ip,$text); $text = str_replace('@HOSTNAME@',gethostsbyaddrs($ip),$text); @@ -570,7 +570,7 @@ function media_printfile($item,$auth,$jump,$display_namespace=false){ $info .= (int) $item['meta']->getField('File.Height'); $info .= ' '; } - $info .= '<i>'.strftime($conf['dformat'],$item['mtime']).'</i>'; + $info .= '<i>'.dformat($item['mtime']).'</i>'; $info .= ' '; $info .= filesize_h($item['size']); |