From 56021d95721c06b618dac6272e58d22a3e87037f Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 5 Jun 2008 15:37:08 -0400 Subject: move avatar scaling and saving to Avatar and Profile Extracted the code for setting a new original avatar to the Profile class, and moved some of it to Avatar, too. This makes it easier to have the same functionality whether an avatar is set using the profile settings (for our users), or on a remote subscription. Necessitated changing the filenaming function to just take an ID. darcs-hash:20080605193708-84dde-a441cc0474951ce7f1a1da9310b5145c0b7c3070.gz --- lib/util.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/util.php') diff --git a/lib/util.php b/lib/util.php index 771a4880c..298c5c5de 100644 --- a/lib/util.php +++ b/lib/util.php @@ -403,13 +403,13 @@ function common_at_link($sender_id, $nickname) { // where should the avatar go for this user? -function common_avatar_filename($user, $extension, $size=NULL, $extra=NULL) { +function common_avatar_filename($id, $extension, $size=NULL, $extra=NULL) { global $config; if ($size) { - return $user->id . '-' . $size . (($extra) ? ('-' . $extra) : '') . $extension; + return $id . '-' . $size . (($extra) ? ('-' . $extra) : '') . $extension; } else { - return $user->id . '-original' . (($extra) ? ('-' . $extra) : '') . $extension; + return $id . '-original' . (($extra) ? ('-' . $extra) : '') . $extension; } } -- cgit v1.2.3-54-g00ecf