From 9480bf1d10d84dc68951df19d35f2b865892452e Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Sun, 19 Dec 2010 10:15:56 -0500 Subject: [PATCH] Notice_tag::url() gets the URL for a tag string --- classes/Notice_tag.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/classes/Notice_tag.php b/classes/Notice_tag.php index bb67c8f819..f795bfc601 100644 --- a/classes/Notice_tag.php +++ b/classes/Notice_tag.php @@ -87,4 +87,19 @@ class Notice_tag extends Memcached_DataObject { 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; + } } -- 2.39.5