]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
show tags that the owner added, not that the current user added
authorEvan Prodromou <evan@prodromou.name>
Fri, 21 Nov 2008 00:56:31 +0000 (19:56 -0500)
committerEvan Prodromou <evan@prodromou.name>
Fri, 21 Nov 2008 00:56:31 +0000 (19:56 -0500)
darcs-hash:20081121005631-84dde-2dbb716ef054bba7dfbdda3d0374c30718affd29.gz

lib/gallery.php
lib/profilelist.php

index 0ac9fd4efaebf3c68425d216a0959169b0cae1d0..4ba9cbd2fce6857954ede12b7a0fd97e80641453 100644 (file)
@@ -109,7 +109,7 @@ class GalleryAction extends Action {
                                          $lim);
                
                if ($display == 'list') {
-                       $profile_list = new ProfileList($other);
+                       $profile_list = new ProfileList($other, $profile);
                        $cnt = $profile_list->show_list();
                } else {
                        $cnt = $this->icon_list($other);
index 3ef01502f4c463dc367142689754c42b3af1260f..ae0acd9ced196f65c41feac4dbc0c61c4766db75 100644 (file)
@@ -26,8 +26,9 @@ class ProfileList {
 
        var $profile = NULL;
        
-       function __construct($profile) {
+       function __construct($profile, $owner=NULL) {
                $this->profile = $profile;
+               $this->owner = $owner;
        }
        
        function show_list() {
@@ -57,6 +58,7 @@ class ProfileList {
                                                                                 'id' => 'profile-' . $this->profile->id));
                
                $user = common_current_user();
+               
                if ($user && $user->id != $this->profile->id) {
                        # XXX: special-case for user looking at own
                        # subscriptions page
@@ -121,37 +123,39 @@ class ProfileList {
                        common_element_end('p');
                }
 
-               if ($user) {
+               if ($this->owner) {
                        $action = NULL;
                        
-                       if ($user->isSubscribed($this->profile)) {
+                       if ($this->owner->isSubscribed($this->profile)) {
                                $action = 'subscriptions';
                        } else if (Subscription::pkeyGet(array('subscriber' => $this->profile->id,
-                                                                                                  'subscribed' => $user->id))) {
+                                                                                                  'subscribed' => $this->owner->id))) {
                                $action = 'subscribers';
                        }
                        
                        
                        if ($action) {
-                               $tags = Profile_tag::getTags($user->id, $this->profile->id);
+                               $tags = Profile_tag::getTags($this->owner->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,
+                                                                                                                                                        array('nickname' => $this->owner->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'));
+
+                               if ($this->owner->id == $user->id) {
+                                       common_element('a', array('href' => common_local_url('tagother',
+                                                                                                                                                array('id' => $this->profile->id)),
+                                                                                         'class' => 'tagother'),
+                                                                  _('Tag'));
+                               }
                        }
                }