]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
add a display url function to display URLs
authorEvan Prodromou <evan@prodromou.name>
Thu, 3 Jul 2008 17:03:47 +0000 (13:03 -0400)
committerEvan Prodromou <evan@prodromou.name>
Thu, 3 Jul 2008 17:03:47 +0000 (13:03 -0400)
darcs-hash:20080703170347-84dde-1ba2e178dd4051aa63e4073e472c73240e3d9fe8.gz

actions/showstream.php
lib/gallery.php
lib/stream.php
lib/util.php

index dcb78a4626022caea348afe8cac2ac8f84b22293..d6a460b2970d6ba06b2597de1aee3f66b049dd0e 100644 (file)
@@ -114,7 +114,7 @@ class ShowstreamAction extends StreamAction {
 
                $avatar = $profile->getAvatar(AVATAR_PROFILE_SIZE);
                common_element_start('div', array('id' => 'profile_avatar'));
-               common_element('img', array('src' => ($avatar) ? $avatar->url : common_default_avatar(AVATAR_PROFILE_SIZE),
+               common_element('img', array('src' => ($avatar) ? common_avatar_display_url($avatar) : common_default_avatar(AVATAR_PROFILE_SIZE),
                                                                        'class' => 'avatar profile',
                                                                        'width' => AVATAR_PROFILE_SIZE,
                                                                        'height' => AVATAR_PROFILE_SIZE,
@@ -227,7 +227,7 @@ class ShowstreamAction extends StreamAction {
                                                                                                'href' => $other->profileurl,
                                                                                                'class' => 'subscription'));
                                $avatar = $other->getAvatar(AVATAR_MINI_SIZE);
-                               common_element('img', array('src' => (($avatar) ? $avatar->url :  common_default_avatar(AVATAR_MINI_SIZE)),
+                               common_element('img', array('src' => (($avatar) ? common_avatar_display_url($avatar) :  common_default_avatar(AVATAR_MINI_SIZE)),
                                                                                        'width' => AVATAR_MINI_SIZE,
                                                                                        'height' => AVATAR_MINI_SIZE,
                                                                                        'class' => 'avatar mini',
index 4bc7baf5d4b730935570f1498bd2fd8f70397b78..f227c93d29fb94cb2be085c46d3fd181ea9cae8b 100644 (file)
@@ -100,7 +100,7 @@ class GalleryAction extends Action {
                        $avatar = $other->getAvatar(AVATAR_STREAM_SIZE);
                        common_element('img', 
                                                   array('src' => 
-                                                                (($avatar) ? $avatar->url : 
+                                                                (($avatar) ? common_avatar_display_url($avatar) : 
                                                                  common_default_avatar(AVATAR_STREAM_SIZE)),
                                                                 'width' => AVATAR_STREAM_SIZE,
                                                                 'height' => AVATAR_STREAM_SIZE,
index b2f57fab3efbee83ea751013b47c23f4df000d64..a37e4dfa32f9fa7ce13c6a5cfb3979704010616d 100644 (file)
@@ -60,7 +60,7 @@ class StreamAction extends Action {
                                                                                  'id' => 'notice-' . $notice->id));
                $avatar = $profile->getAvatar(AVATAR_STREAM_SIZE);
                common_element_start('a', array('href' => $profile->profileurl));
-               common_element('img', array('src' => ($avatar) ? $avatar->url : common_default_avatar(AVATAR_STREAM_SIZE),
+               common_element('img', array('src' => ($avatar) ? common_avatar_display_url($avatar) : common_default_avatar(AVATAR_STREAM_SIZE),
                                                                        'class' => 'avatar stream',
                                                                        'width' => AVATAR_STREAM_SIZE,
                                                                        'height' => AVATAR_STREAM_SIZE,
index 7b821e63513d214bb298a26c892b8b108e864673..4d1abe51a7c03ee25d6b47cbd242d45bd5a0e307 100644 (file)
@@ -625,12 +625,16 @@ function common_avatar_path($filename) {
 }
 
 function common_avatar_url($filename) {
-    $server = common_config('avatar', 'server');
-    if ($server) {
-       return 'http://'.$server.'/'.$filename;
-    } else {
        return common_path('avatar/'.$filename);
-    }
+}
+
+function common_avatar_display_url($avatar) {
+       $server = common_config('avatar', 'server');
+       if ($server) {
+               return 'http://'.$server.'/'.$avatar->filename;
+       } else {
+               return $avatar->url;
+       }
 }
 
 function common_default_avatar($size) {