summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvan Prodromou <evan@prodromou.name>2008-11-23 22:15:49 -0500
committerEvan Prodromou <evan@prodromou.name>2008-11-23 22:15:49 -0500
commitf80cd3273e9ff8fd64262d9d076d639cbe71ac88 (patch)
treeff922d51e92151e682aee3dd17bd19c329a365b3
parent079b88a6883331338f9f195fcd6c76a7bcbbd7a6 (diff)
only get tags for this profile list type
darcs-hash:20081124031549-84dde-c537cb25f301ac3368440d4d5f583ea3d713ac2c.gz
-rw-r--r--classes/Profile.php16
-rw-r--r--lib/gallery.php21
2 files changed, 20 insertions, 17 deletions
diff --git a/classes/Profile.php b/classes/Profile.php
index 5f762df80..794dc1de9 100644
--- a/classes/Profile.php
+++ b/classes/Profile.php
@@ -145,20 +145,4 @@ class Profile extends Memcached_DataObject
}
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 . ' ' .
- 'AND tagger != tagged');
- $tags = array();
- while ($profile_tag->fetch()) {
- $tags[] = $profile_tag->tag;
- }
- $profile_tag->free();
- return $tags;
- }
}
diff --git a/lib/gallery.php b/lib/gallery.php
index fd13ad145..bf04eaa34 100644
--- a/lib/gallery.php
+++ b/lib/gallery.php
@@ -81,7 +81,8 @@ class GalleryAction extends Action {
function show_tags_dropdown($profile) {
$tag = $this->trimmed('tag');
- $tags = $profile->getAllTags();
+ list($lst, $usr) = $this->fields();
+ $tags = $this->get_all_tags($profile, $lst, $usr);
$content = array();
foreach ($tags as $t) {
$content[$t] = $t;
@@ -241,4 +242,22 @@ class GalleryAction extends Action {
common_element_end('p');
}
+
+ # Get list of tags we tagged other users with
+
+ function get_all_tags($profile, $lst, $usr) {
+ $profile_tag = new Notice_tag();
+ $profile_tag->query('SELECT DISTINCT(tag) ' .
+ 'FROM profile_tag, subscription ' .
+ 'WHERE tagger = ' . $profile->id . ' ' .
+ 'AND ' . $usr . ' = ' . $profile->id . ' ' .
+ 'AND ' . $lst . ' = tagged ' .
+ 'AND tagger != tagged');
+ $tags = array();
+ while ($profile_tag->fetch()) {
+ $tags[] = $profile_tag->tag;
+ }
+ $profile_tag->free();
+ return $tags;
+ }
} \ No newline at end of file