fancy urls for show message, new message
darcs-hash:20080917180244-5ed1f-06e2ac2d8f094eacd12b316794b0599b57d76596.gz
This commit is contained in:
parent
ae6ba61d43
commit
e42de1ccc1
@ -150,7 +150,7 @@ class ShowstreamAction extends StreamAction {
|
||||
$user = User::staticGet('id', $profile->id);
|
||||
|
||||
if ($cur->id != $user->id && $cur->mutuallySubscribed($user)) {
|
||||
common_element('a', array('href' => common_local_url('newmessage', array('nickname' => $user->nickname))),
|
||||
common_element('a', array('href' => common_local_url('newmessage', array('to' => $user->id))),
|
||||
_('Send a message'));
|
||||
}
|
||||
|
||||
|
@ -117,7 +117,7 @@ class User extends DB_DataObject
|
||||
static $blacklist = array('rss', 'xrds', 'doc', 'main',
|
||||
'settings', 'notice', 'user',
|
||||
'search', 'avatar', 'tag', 'tags',
|
||||
'api');
|
||||
'api', 'message');
|
||||
$merged = array_merge($blacklist, common_config('nickname', 'blacklist'));
|
||||
return !in_array($nickname, $merged);
|
||||
}
|
||||
|
@ -54,6 +54,9 @@ RewriteRule ^notice/(\d+)$ index.php?action=shownotice¬ice=$1 [L,QSA]
|
||||
RewriteRule ^notice/delete/((\d+))?$ index.php?action=deletenotice¬ice=$2 [L,QSA]
|
||||
RewriteRule ^notice/delete$ index.php?action=deletenotice [L,QSA]
|
||||
|
||||
RewriteRule ^message/new$ index.php?action=newmessage [L,QSA]
|
||||
RewriteRule ^message/(\d+)$ index.php?action=showmessage&id=$1 [L,QSA]
|
||||
|
||||
RewriteRule ^user/(\d+)$ index.php?action=userbyid&id=$1 [L,QSA]
|
||||
|
||||
RewriteRule ^tags/?$ index.php?action=tag [L,QSA]
|
||||
|
@ -934,6 +934,10 @@ function common_fancy_url($action, $args=NULL) {
|
||||
} else {
|
||||
return common_path($args['nickname'].'/favorites');
|
||||
}
|
||||
case 'showmessage':
|
||||
return common_path('message/' . $args['id']);
|
||||
case 'newmessage':
|
||||
return common_path('message/new' . (($args) ? ('?' . http_build_query($args)) : ''));
|
||||
default:
|
||||
return common_simple_url($action, $args);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user