summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvan Prodromou <evan@prodromou.name>2008-11-20 19:43:36 -0500
committerEvan Prodromou <evan@prodromou.name>2008-11-20 19:43:36 -0500
commit491172638e5e2e652b7ab485ec03afa4b043e8ae (patch)
tree02a71cad7619f58d45588eb1804cf4213103e202
parentfe6738b6c713480cc2d1c186177770fdaa448e96 (diff)
only show tags if there's a logged-in user
darcs-hash:20081121004336-84dde-8fc36b38b9f35d9058118efebd509098f6ce8230.gz
-rw-r--r--lib/profilelist.php58
1 files changed, 29 insertions, 29 deletions
diff --git a/lib/profilelist.php b/lib/profilelist.php
index 6ecb9c923..3ef01502f 100644
--- a/lib/profilelist.php
+++ b/lib/profilelist.php
@@ -121,38 +121,38 @@ class ProfileList {
common_element_end('p');
}
- $user = common_current_user();
-
- $action = NULL;
-
- if ($user->isSubscribed($this->profile)) {
- $action = 'subscriptions';
- } else if (Subscription::pkeyGet(array('subscriber' => $this->profile->id,
- 'subscribed' => $user->id))) {
- $action = 'subscribers';
- }
-
-
- if ($action) {
- $tags = Profile_tag::getTags($user->id, $this->profile->id);
-
- if ($tags) {
- common_element_start('p', 'subtags');
+ if ($user) {
+ $action = NULL;
- foreach ($tags as $tag) {
- common_element('a', array('href' => common_local_url($action,
- array('nickname' => $user->nickname,
- 'tag' => $tag))),
- $tag);
- }
-
- common_element_end('p');
+ if ($user->isSubscribed($this->profile)) {
+ $action = 'subscriptions';
+ } else if (Subscription::pkeyGet(array('subscriber' => $this->profile->id,
+ 'subscribed' => $user->id))) {
+ $action = 'subscribers';
}
- common_element('a', array('href' => common_local_url('tagother',
- array('id' => $this->profile->id)),
- 'class' => 'tagother'),
- _('Tag'));
+
+ if ($action) {
+ $tags = Profile_tag::getTags($user->id, $this->profile->id);
+
+ if ($tags) {
+ common_element_start('p', 'subtags');
+
+ foreach ($tags as $tag) {
+ common_element('a', array('href' => common_local_url($action,
+ array('nickname' => $user->nickname,
+ 'tag' => $tag))),
+ $tag);
+ }
+
+ common_element_end('p');
+ }
+
+ common_element('a', array('href' => common_local_url('tagother',
+ array('id' => $this->profile->id)),
+ 'class' => 'tagother'),
+ _('Tag'));
+ }
}
common_element_end('li');