]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
utility for getting avatar or default avatar
authorEvan Prodromou <evan@prodromou.name>
Mon, 14 Jul 2008 03:44:43 +0000 (23:44 -0400)
committerEvan Prodromou <evan@prodromou.name>
Mon, 14 Jul 2008 03:44:43 +0000 (23:44 -0400)
darcs-hash:20080714034443-84dde-f443b04e6733b22709d746a700c0ba032d7afb60.gz

lib/util.php

index b6ff34fb7cc1dde3a7faf4832d9226cfe88adee9..9d66c1ca13ac33005a7dd3a55bd2ea822d81bb64 100644 (file)
@@ -1269,3 +1269,13 @@ function common_markup_to_html($c) {
        $c = preg_replace('/%%(\w+).(\w+)%%/e', 'common_config(\'\\1\', \'\\2\')', $c);
        return Markdown($c);
 }
+
+function common_profile_avatar_url($profile, $size=AVATAR_PROFILE_SIZE) {
+       $avatar = $profile->getAvatar($size);
+       if ($avatar) {
+               return common_avatar_display_url($avatar);
+       } else {
+               return common_default_avatar($size);
+       }
+}
+       
\ No newline at end of file