}
return NULL;
}
+
+ # Get list of tags we tagged other users with
+
+ function getAllTags() {
+ $profile_tag = new Notice_tag();
+ $profile_tag->query('SELECT DISTINCT(tag) FROM profile_tag WHERE tagger = ' . $this->id);
+ $tags = array();
+ while ($profile_tag->fetch()) {
+ $tags[] = $profile_tag->tag;
+ }
+ $profile_tag->free();
+ return $tags;
+ }
}
foreach ($tags as $t) {
$content[common_local_url($this->trimmed('action'), array('tag' => $t))] = $t;
}
- common_element('a', array('href' => common_local_url($this->trimmed('action'),
- array('nickname' => $profile->nickname))),
- _('All'));
- common_element_start('form', array('name' => 'bytag', 'id' => 'bytag'));
- common_dropdown('tag', _('Tag'), $content,
- _('Choose a tag to narrow list'), FALSE, $tag);
- common_submit('go', _('Go'));
- common_element_end('form');
+ if ($tags) {
+ common_element('a', array('href' => common_local_url($this->trimmed('action'),
+ array('nickname' => $profile->nickname))),
+ _('All'));
+ common_element_start('form', array('name' => 'bytag', 'id' => 'bytag'));
+ common_dropdown('tag', _('Tag'), $content,
+ _('Choose a tag to narrow list'), FALSE, $tag);
+ common_submit('go', _('Go'));
+ common_element_end('form');
+ }
}
function show_top($profile) {
}
# XXX: memcached results
- # XXX: SQL injection on $tag
+ # FIXME: SQL injection on $tag
$other->query('SELECT profile.* ' .
'FROM profile JOIN subscription ' .