summaryrefslogtreecommitdiff
path: root/classes
diff options
context:
space:
mode:
Diffstat (limited to 'classes')
-rw-r--r--classes/Profile_tag.php15
1 files changed, 15 insertions, 0 deletions
diff --git a/classes/Profile_tag.php b/classes/Profile_tag.php
index 9943ebfa0..dde19aea2 100644
--- a/classes/Profile_tag.php
+++ b/classes/Profile_tag.php
@@ -83,4 +83,19 @@ class Profile_tag extends Memcached_DataObject
return true;
}
+
+ # Return profiles with a given tag
+ static function getTagged($tagger, $tag) {
+ $profile = new Profile();
+ $profile->query('SELECT profile.* ' .
+ 'FROM profile JOIN profile_tag ' .
+ 'ON profile.id = profile_tag.tagged ' .
+ 'WHERE profile_tag.tagger = ' . $tagger . ' ' .
+ 'AND profile_tag.tag = "' . $tag . '" ');
+ $tagged = array();
+ while ($profile->fetch()) {
+ $tagged[] = clone($profile);
+ }
+ return $tagged;
+ }
}