Define URLs for groups
This commit is contained in:
parent
ba287e9a0d
commit
97f14ef1f9
@ -85,6 +85,14 @@ RewriteRule ^peopletag/([a-zA-Z0-9]+)$ index.php?action=peopletag&tag=$1 [L,QSA]
|
|||||||
RewriteRule ^featured/?$ index.php?action=featured [L,QSA]
|
RewriteRule ^featured/?$ index.php?action=featured [L,QSA]
|
||||||
RewriteRule ^favorited/?$ index.php?action=favorited [L,QSA]
|
RewriteRule ^favorited/?$ index.php?action=favorited [L,QSA]
|
||||||
|
|
||||||
|
RewriteRule ^group/new index.php?action=newgroup [L,QSA]
|
||||||
|
RewriteRule ^group/([a-zA-Z0-9]+) index.php?action=showgroup&nickname=$1 [L,QSA]
|
||||||
|
RewriteRule ^group/([a-zA-Z0-9]+)/edit index.php?action=editgroup&nickname=$1 [L,QSA]
|
||||||
|
RewriteRule ^group/([a-zA-Z0-9]+)/join index.php?action=joingroup&nickname=$1 [L,QSA]
|
||||||
|
RewriteRule ^group/([a-zA-Z0-9]+)/leave index.php?action=leavegroup&nickname=$1 [L,QSA]
|
||||||
|
RewriteRule ^group/([0-9]+)/id index.php?action=groupbyid&id=$1 [L,QSA]
|
||||||
|
RewriteRule ^group/([0-9]+)/rss index.php?action=grouprss&id=$1 [L,QSA]
|
||||||
|
|
||||||
# Twitter-compatible API rewrites
|
# Twitter-compatible API rewrites
|
||||||
# XXX: Surely these can be refactored a little -- Zach
|
# XXX: Surely these can be refactored a little -- Zach
|
||||||
RewriteRule ^api/statuses/public_timeline(.*)$ index.php?action=api&apiaction=statuses&method=public_timeline$1 [L,QSA]
|
RewriteRule ^api/statuses/public_timeline(.*)$ index.php?action=api&apiaction=statuses&method=public_timeline$1 [L,QSA]
|
||||||
|
14
lib/util.php
14
lib/util.php
@ -915,6 +915,20 @@ function common_fancy_url($action, $args=null)
|
|||||||
} else {
|
} else {
|
||||||
return common_path('main/sup');
|
return common_path('main/sup');
|
||||||
}
|
}
|
||||||
|
case 'newgroup':
|
||||||
|
return common_path('group/new');
|
||||||
|
case 'showgroup':
|
||||||
|
return common_path('group/'.$args['nickname']);
|
||||||
|
case 'editgroup':
|
||||||
|
return common_path('group/'.$args['nickname'].'/edit');
|
||||||
|
case 'joingroup':
|
||||||
|
return common_path('group/'.$args['nickname'].'/join');
|
||||||
|
case 'leavegroup':
|
||||||
|
return common_path('group/'.$args['nickname'].'/leave');
|
||||||
|
case 'groupbyid':
|
||||||
|
return common_path('group/'.$args['id'].'/id');
|
||||||
|
case 'grouprss':
|
||||||
|
return common_path('group/'.$args['nickname'].'/rss');
|
||||||
default:
|
default:
|
||||||
return common_simple_url($action, $args);
|
return common_simple_url($action, $args);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user