]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
fancier urls for tagged subscriptions/subscribers
authorEvan Prodromou <evan@prodromou.name>
Fri, 21 Nov 2008 02:57:49 +0000 (21:57 -0500)
committerEvan Prodromou <evan@prodromou.name>
Fri, 21 Nov 2008 02:57:49 +0000 (21:57 -0500)
darcs-hash:20081121025749-84dde-9fd9a98c23ecabd1c1615dec938edbd4be884aec.gz

htaccess.sample
lib/util.php

index 28da7b66f6e52744669e9b7a940a8890abad6583..4779f18b197c97c2ba9de859b41b62ab8b777351 100644 (file)
@@ -76,6 +76,9 @@ RewriteRule ^featured/?$ index.php?action=featured [L,QSA]
 RewriteRule ^favorited/?$ index.php?action=favorited [L,QSA]
 
 RewriteRule ^(\w+)/subscriptions$ index.php?action=subscriptions&nickname=$1 [L,QSA]
+RewriteRule ^(\w+)/subscriptions/([a-zA-Z0-9]+)$ index.php?action=subscriptions&nickname=$1&tag=$2 [L,QSA]
+RewriteRule ^(\w+)/subscribers$ index.php?action=subscribers&nickname=$1 [L,QSA]
+RewriteRule ^(\w+)/subscribers/([a-zA-Z0-9]+)$ index.php?action=subscribers&nickname=$1&tag=$2 [L,QSA]
 RewriteRule ^(\w+)/subscribers$ index.php?action=subscribers&nickname=$1 [L,QSA]
 RewriteRule ^(\w+)/xrds$ index.php?action=xrds&nickname=$1 [L,QSA]
 RewriteRule ^(\w+)/rss$ index.php?action=userrss&nickname=$1 [L,QSA]
index ce9e312b691a49306ada4d71cd078e8b67a87348..b8e482eef865b3c55ee83c4e49276bbc9341117a 100644 (file)
@@ -1045,11 +1045,15 @@ function common_fancy_url($action, $args=NULL) {
         case 'subscribers':
                $nickname = $args['nickname'];
                unset($args['nickname']);
+               if (isset($args['tag'])) {
+                       $tag = $args['tag'];
+                       unset($args['tag']);
+               }
                $params = http_build_query($args);
                if ($params) {
-                       return common_path($nickname.'/'.$action . '?' . $params);
+                       return common_path($nickname.'/'.$action . (($tag) ? '/' . tag : '') . '?' . $params);
                } else {
-                       return common_path($nickname.'/'.$action);
+                       return common_path($nickname.'/'.$action . (($tag) ? '/' . tag : ''));
                }
         case 'allrss':
                return common_path($args['nickname'].'/all/rss');