function getLists()
{
- $profile = $this->target;
- $fn = array($profile, 'getOtherTags');
+ $fn = array($this->target, 'getOtherTags');
# 20 lists
list($this->lists, $this->next_cursor, $this->prev_cursor) =
- Profile_list::getAtCursor($fn, array($this->auth_user), $this->cursor, 20);
+ Profile_list::getAtCursor($fn, array($this->scoped), $this->cursor, 20);
}
}
$offset = ($this->page-1) * PEOPLETAGS_PER_PAGE;
$limit = PEOPLETAGS_PER_PAGE + 1;
- $ptags = $this->tagged->getOtherTags(common_current_user(), $offset, $limit);
+ $ptags = $this->tagged->getOtherTags($this->scoped, $offset, $limit);
$pl = new PeopletagList($ptags, $this);
$cnt = $pl->show();
/**
* Get tags that other people put on this profile, in reverse-chron order
*
- * @param (Profile|User) $auth_user Authorized user (used for privacy)
+ * @param Profile $scoped User we are requesting as
* @param int $offset Offset from latest
* @param int $limit Max number to get
* @param datetime $since_id max date
* @return Profile_list resulting lists
*/
- function getOtherTags($auth_user=null, $offset=0, $limit=null, $since_id=0, $max_id=0)
+ function getOtherTags(Profile $scoped=null, $offset=0, $limit=null, $since_id=0, $max_id=0)
{
$list = new Profile_list();
$this->id);
- if ($auth_user instanceof User || $auth_user instanceof Profile) {
+ if (!is_null($scoped)) {
$qry .= sprintf('AND ( ( profile_list.private = false ) ' .
'OR ( profile_list.tagger = %d AND ' .
'profile_list.private = true ) )',
- $auth_user->id);
+ $scoped->getID());
} else {
$qry .= 'AND profile_list.private = 0 ';
}
$limit = PEOPLETAGS_PER_SECTION+1;
$offset = 0;
- $auth_user = common_current_user();
- $ptags = $this->profile->getOtherTags($auth_user, $offset, $limit);
+ $ptags = $this->profile->getOtherTags(Profile::current(), $offset, $limit);
return $ptags;
}