diff options
author | Evan Prodromou <evan@controlyourself.ca> | 2009-02-16 18:02:31 -0500 |
---|---|---|
committer | Evan Prodromou <evan@controlyourself.ca> | 2009-02-16 18:02:31 -0500 |
commit | ca90d790aa9d93a4e88602330f91d4703c29b75d (patch) | |
tree | 256d565255f1ae9b377eea5a46615bb8233dfbf3 /classes/Notice_tag.php | |
parent | 9978eadbf213e84a0bf3326fbf953e343d703e8e (diff) |
Automatically add a tag for every group messages
If you post to a group !foo, it's automatically listed as being tagged
"foo". This is to keep users from having to do !foo #foo in all their
messages.
Diffstat (limited to 'classes/Notice_tag.php')
-rw-r--r-- | classes/Notice_tag.php | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/classes/Notice_tag.php b/classes/Notice_tag.php index 94f9296d6..0365973f5 100644 --- a/classes/Notice_tag.php +++ b/classes/Notice_tag.php @@ -19,7 +19,7 @@ require_once INSTALLDIR.'/classes/Memcached_DataObject.php'; -class Notice_tag extends Memcached_DataObject +class Notice_tag extends Memcached_DataObject { ###START_AUTOCODE /* the code below is auto generated do not remove the above tag */ @@ -35,9 +35,9 @@ class Notice_tag extends Memcached_DataObject /* the code above is auto generated do not remove the tag below */ ###END_AUTOCODE - + static function getStream($tag, $offset=0, $limit=20) { - $qry = + $qry = 'SELECT notice.* ' . 'FROM notice JOIN notice_tag ON notice.id = notice_tag.notice_id ' . 'WHERE notice_tag.tag = "%s" '; @@ -46,7 +46,7 @@ class Notice_tag extends Memcached_DataObject 'notice_tag:notice_stream:' . common_keyize($tag), $offset, $limit); } - + function blowCache() { $cache = common_memcache(); @@ -54,4 +54,9 @@ class Notice_tag extends Memcached_DataObject $cache->delete(common_cache_key('notice_tag:notice_stream:' . $this->tag)); } } + + function &pkeyGet($kv) + { + return Memcached_DataObject::pkeyGet('Notice_tag', $kv); + } } |