]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
start handling fancy URLs
authorEvan Prodromou <evan@prodromou.name>
Fri, 30 May 2008 21:25:55 +0000 (17:25 -0400)
committerEvan Prodromou <evan@prodromou.name>
Fri, 30 May 2008 21:25:55 +0000 (17:25 -0400)
darcs-hash:20080530212555-84dde-213c04b9cf9048f48bf0b0b4234bcdf49546d4d9.gz

lib/common.php
lib/util.php

index 6ff40ab5f0f058d01af883ffea4f5ab0a3cc2244..19b0e4b643d4a0676a4ee0e827c3d3453322a757 100644 (file)
@@ -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',
index 2706ebda58e153118f2b59fe901221a1de397e09..59f0aa10f08efce903944b9c52fe5028e1a3b4b2 100644 (file)
@@ -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) {