show tags that the owner added, not that the current user added
darcs-hash:20081121005631-84dde-2dbb716ef054bba7dfbdda3d0374c30718affd29.gz
This commit is contained in:
parent
cf54010e75
commit
e69f16d4b6
|
@ -109,7 +109,7 @@ class GalleryAction extends Action {
|
||||||
$lim);
|
$lim);
|
||||||
|
|
||||||
if ($display == 'list') {
|
if ($display == 'list') {
|
||||||
$profile_list = new ProfileList($other);
|
$profile_list = new ProfileList($other, $profile);
|
||||||
$cnt = $profile_list->show_list();
|
$cnt = $profile_list->show_list();
|
||||||
} else {
|
} else {
|
||||||
$cnt = $this->icon_list($other);
|
$cnt = $this->icon_list($other);
|
||||||
|
|
|
@ -26,8 +26,9 @@ class ProfileList {
|
||||||
|
|
||||||
var $profile = NULL;
|
var $profile = NULL;
|
||||||
|
|
||||||
function __construct($profile) {
|
function __construct($profile, $owner=NULL) {
|
||||||
$this->profile = $profile;
|
$this->profile = $profile;
|
||||||
|
$this->owner = $owner;
|
||||||
}
|
}
|
||||||
|
|
||||||
function show_list() {
|
function show_list() {
|
||||||
|
@ -57,6 +58,7 @@ class ProfileList {
|
||||||
'id' => 'profile-' . $this->profile->id));
|
'id' => 'profile-' . $this->profile->id));
|
||||||
|
|
||||||
$user = common_current_user();
|
$user = common_current_user();
|
||||||
|
|
||||||
if ($user && $user->id != $this->profile->id) {
|
if ($user && $user->id != $this->profile->id) {
|
||||||
# XXX: special-case for user looking at own
|
# XXX: special-case for user looking at own
|
||||||
# subscriptions page
|
# subscriptions page
|
||||||
|
@ -121,37 +123,39 @@ class ProfileList {
|
||||||
common_element_end('p');
|
common_element_end('p');
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($user) {
|
if ($this->owner) {
|
||||||
$action = NULL;
|
$action = NULL;
|
||||||
|
|
||||||
if ($user->isSubscribed($this->profile)) {
|
if ($this->owner->isSubscribed($this->profile)) {
|
||||||
$action = 'subscriptions';
|
$action = 'subscriptions';
|
||||||
} else if (Subscription::pkeyGet(array('subscriber' => $this->profile->id,
|
} else if (Subscription::pkeyGet(array('subscriber' => $this->profile->id,
|
||||||
'subscribed' => $user->id))) {
|
'subscribed' => $this->owner->id))) {
|
||||||
$action = 'subscribers';
|
$action = 'subscribers';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if ($action) {
|
if ($action) {
|
||||||
$tags = Profile_tag::getTags($user->id, $this->profile->id);
|
$tags = Profile_tag::getTags($this->owner->id, $this->profile->id);
|
||||||
|
|
||||||
if ($tags) {
|
if ($tags) {
|
||||||
common_element_start('p', 'subtags');
|
common_element_start('p', 'subtags');
|
||||||
|
|
||||||
foreach ($tags as $tag) {
|
foreach ($tags as $tag) {
|
||||||
common_element('a', array('href' => common_local_url($action,
|
common_element('a', array('href' => common_local_url($action,
|
||||||
array('nickname' => $user->nickname,
|
array('nickname' => $this->owner->nickname,
|
||||||
'tag' => $tag))),
|
'tag' => $tag))),
|
||||||
$tag);
|
$tag);
|
||||||
}
|
}
|
||||||
|
|
||||||
common_element_end('p');
|
common_element_end('p');
|
||||||
}
|
}
|
||||||
|
|
||||||
common_element('a', array('href' => common_local_url('tagother',
|
if ($this->owner->id == $user->id) {
|
||||||
array('id' => $this->profile->id)),
|
common_element('a', array('href' => common_local_url('tagother',
|
||||||
'class' => 'tagother'),
|
array('id' => $this->profile->id)),
|
||||||
_('Tag'));
|
'class' => 'tagother'),
|
||||||
|
_('Tag'));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user