diff options
author | Evan Prodromou <evan@prodromou.name> | 2008-11-20 15:40:22 -0500 |
---|---|---|
committer | Evan Prodromou <evan@prodromou.name> | 2008-11-20 15:40:22 -0500 |
commit | 297f13aed3f66bcab250c8c5d70b8549e10b2a9b (patch) | |
tree | 06d91773431375ce7f2643bab7f639ca6a86ceef /lib | |
parent | 168693b103c17f0e98f2e02854d7290f59f0cfb5 (diff) |
float subscribe button right in profile list
darcs-hash:20081120204022-84dde-c238f7b51e43e81ce267ec65112f006f928676bf.gz
Diffstat (limited to 'lib')
-rw-r--r-- | lib/profilelist.php | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/lib/profilelist.php b/lib/profilelist.php index b8f52fd8f..ec96c2916 100644 --- a/lib/profilelist.php +++ b/lib/profilelist.php @@ -55,6 +55,18 @@ class ProfileList { common_element_start('li', array('class' => 'profile_single', 'id' => 'profile-' . $this->profile->id)); + + $user = common_current_user(); + if ($user) { + # XXX: special-case for user looking at own + # subscriptions page + if ($user->isSubscribed($this->profile)) { + common_unsubscribe_form($profile); + } else { + common_subscribe_form($profile); + } + } + $avatar = $this->profile->getAvatar(AVATAR_STREAM_SIZE); common_element_start('a', array('href' => $this->profile->profileurl)); common_element('img', array('src' => ($avatar) ? common_avatar_display_url($avatar) : common_default_avatar(AVATAR_STREAM_SIZE), @@ -96,15 +108,6 @@ class ProfileList { common_element_end('p'); } - $user = common_current_user(); - if ($user) { - if ($user->isSubscribed($this->profile)) { - common_unsubscribe_form($profile); - } else { - common_subscribe_form($profile); - } - } - common_element_end('li'); } |