Notice_tag::url() gets the URL for a tag string

This commit is contained in:
Evan Prodromou 2010-12-19 10:15:56 -05:00
parent c389386c8b
commit 9480bf1d10

View File

@ -87,4 +87,19 @@ class Notice_tag extends Memcached_DataObject
{ {
return Memcached_DataObject::pkeyGet('Notice_tag', $kv); return Memcached_DataObject::pkeyGet('Notice_tag', $kv);
} }
static function url($tag)
{
if (common_config('singleuser', 'enabled')) {
// regular TagAction isn't set up in 1user mode
$nickname = User::singleUserNickname();
$url = common_local_url('showstream',
array('nickname' => $nickname,
'tag' => $tag));
} else {
$url = common_local_url('tag', array('tag' => $tag));
}
return $url;
}
} }