summaryrefslogtreecommitdiff
path: root/classes
diff options
context:
space:
mode:
authorEvan Prodromou <evan@prodromou.name>2008-11-23 22:49:52 -0500
committerEvan Prodromou <evan@prodromou.name>2008-11-23 22:49:52 -0500
commitf8fa9a942fefffb99b8559bc483393464b9ac21e (patch)
treeeb7456e4163b59d5bc924c40ae5b1e26de1aadc8 /classes
parentf80cd3273e9ff8fd64262d9d076d639cbe71ac88 (diff)
Make replies to @#
darcs-hash:20081124034952-84dde-e059f0800780de879ffa922e5ce379682a4f275a.gz
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;
+ }
}