common_local_url() second parameter optional

darcs-hash:20080517160908-84dde-c176f1fa4c4026a84efac994e65db0158935cb11.gz
This commit is contained in:
Evan Prodromou 2008-05-17 12:09:08 -04:00
parent 76c0575ad0
commit 1d9e45fb9b

View File

@ -264,12 +264,14 @@ function common_avatar_url($filename) {
return $config['avatar']['path'] . '/' . $filename; return $config['avatar']['path'] . '/' . $filename;
} }
function common_local_url($action, $args) { function common_local_url($action, $args=NULL) {
global $config; global $config;
/* XXX: pretty URLs */ /* XXX: pretty URLs */
$extra = ''; $extra = '';
foreach ($args as $key => $value) { if ($args) {
$extra .= "&${key}=${value}"; foreach ($args as $key => $value) {
$extra .= "&${key}=${value}";
}
} }
return "http://".$config['site']['server'].'/'.$config['site']['path']."/index.php?action=${action}${extra}"; return "http://".$config['site']['server'].'/'.$config['site']['path']."/index.php?action=${action}${extra}";
} }