From: Evan Prodromou Date: Fri, 30 May 2008 21:25:55 +0000 (-0400) Subject: start handling fancy URLs X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=52c7ff9827aa815cda4d811fe76452e72ab3fe7f;p=quix0rs-gnu-social.git start handling fancy URLs darcs-hash:20080530212555-84dde-213c04b9cf9048f48bf0b0b4234bcdf49546d4d9.gz --- diff --git a/lib/common.php b/lib/common.php index 6ff40ab5f0..19b0e4b643 100644 --- a/lib/common.php +++ b/lib/common.php @@ -36,7 +36,8 @@ $config = array('site' => array('name' => 'Just another Laconica microblog', 'server' => 'localhost', - 'path' => '/'), + 'path' => '/', + 'fancy' => false), 'tag' => array('authority' => 'INVALID TAG', 'date' => 'PUT A DATE HERE', diff --git a/lib/util.php b/lib/util.php index 2706ebda58..59f0aa10f0 100644 --- a/lib/util.php +++ b/lib/util.php @@ -431,6 +431,23 @@ function common_default_avatar($size) { } 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 */ $extra = ''; if ($args) {