start handling fancy URLs

darcs-hash:20080530212555-84dde-213c04b9cf9048f48bf0b0b4234bcdf49546d4d9.gz
This commit is contained in:
Evan Prodromou 2008-05-30 17:25:55 -04:00
parent 2a2992b102
commit 52c7ff9827
2 changed files with 19 additions and 1 deletions

View File

@ -36,7 +36,8 @@ $config =
array('site' => array('site' =>
array('name' => 'Just another Laconica microblog', array('name' => 'Just another Laconica microblog',
'server' => 'localhost', 'server' => 'localhost',
'path' => '/'), 'path' => '/',
'fancy' => false),
'tag' => 'tag' =>
array('authority' => 'INVALID TAG', array('authority' => 'INVALID TAG',
'date' => 'PUT A DATE HERE', 'date' => 'PUT A DATE HERE',

View File

@ -431,6 +431,23 @@ function common_default_avatar($size) {
} }
function common_local_url($action, $args=NULL) { function common_local_url($action, $args=NULL) {
global $config;
if ($config['site']['fancy']) {
return common_fancy_url($action, $args);
} else {
return common_simple_url($action, $args);
}
}
function common_fancy_url($action, $args=NULL) {
switch (strtolower($action)) {
default:
return common_simple_url($action, $args);
}
}
function common_simple_url($action, $args=NULL) {
global $config;
/* XXX: pretty URLs */ /* XXX: pretty URLs */
$extra = ''; $extra = '';
if ($args) { if ($args) {