]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Notice_tag::url() gets the URL for a tag string
authorEvan Prodromou <evan@status.net>
Sun, 19 Dec 2010 15:15:56 +0000 (10:15 -0500)
committerEvan Prodromou <evan@status.net>
Sun, 19 Dec 2010 15:15:56 +0000 (10:15 -0500)
classes/Notice_tag.php

index bb67c8f8195740ac82504fad049421d943465259..f795bfc601cfc6765afc121fa417f7f652893137 100644 (file)
@@ -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;
+       }
 }