summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorEvan Prodromou <evan@prodromou.name>2008-11-23 20:58:02 -0500
committerEvan Prodromou <evan@prodromou.name>2008-11-23 20:58:02 -0500
commit82696b150e6365f2dc40f2626b327d124a6e02a0 (patch)
tree0401dd5c24ff21c22f7ede5d1701e63db53b3591 /lib
parent58c7af21db187cd9823b81b7e84bf33794dc929f (diff)
show dropdown of tags only when tags are available and add tags function to profile
darcs-hash:20081124015802-84dde-d72651ff0c466d15835fe263e96bdd9b34162849.gz
Diffstat (limited to 'lib')
-rw-r--r--lib/gallery.php20
1 files changed, 11 insertions, 9 deletions
diff --git a/lib/gallery.php b/lib/gallery.php
index ca89e1029..841076819 100644
--- a/lib/gallery.php
+++ b/lib/gallery.php
@@ -86,14 +86,16 @@ class GalleryAction extends Action {
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) {
@@ -119,7 +121,7 @@ class GalleryAction extends Action {
}
# XXX: memcached results
- # XXX: SQL injection on $tag
+ # FIXME: SQL injection on $tag
$other->query('SELECT profile.* ' .
'FROM profile JOIN subscription ' .