diff options
author | Evan Prodromou <evan@prodromou.name> | 2008-05-28 10:03:21 -0400 |
---|---|---|
committer | Evan Prodromou <evan@prodromou.name> | 2008-05-28 10:03:21 -0400 |
commit | de56ccca07e19c5163792c210ff5f6130e91d892 (patch) | |
tree | 4299ba46cabafe22ec26917372800cb309dc9c73 /lib | |
parent | 4f37f4b764068ec0e3269f19c740d494286ae37e (diff) |
add timestamp to avatar filenames to prevent overlap
darcs-hash:20080528140321-84dde-2dbeb6032e845a23bb1adde1cbc1788333b55156.gz
Diffstat (limited to 'lib')
-rw-r--r-- | lib/util.php | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/util.php b/lib/util.php index 52f25c9d3..9c288198c 100644 --- a/lib/util.php +++ b/lib/util.php @@ -349,13 +349,13 @@ function common_render_content($text) { // where should the avatar go for this user? -function common_avatar_filename($user, $extension, $size=NULL) { +function common_avatar_filename($user, $extension, $size=NULL, $extra=NULL) { global $config; if ($size) { - return $user->id . '-' . $size . $extension; + return $user->id . '-' . $size . (($extra) ? $extra : '') . $extension; } else { - return $user->id . '-original' . $extension; + return $user->id . '-original' . (($extra) ? $extra : '') . $extension; } } @@ -479,6 +479,10 @@ function common_mtrand($bytes) { return $enc; } +function common_timestamp() { + return date('YmdHisu'); +} + // XXX: set up gettext function _t($str) { |