From: Harvie Date: Sun, 28 Nov 2010 21:59:47 +0000 (+0100) Subject: Initial Base36 ( http://en.wikipedia.org/wiki/Base_36 ) support - experimental X-Git-Url: https://git.harvie.cz/?a=commitdiff_plain;h=96a2b554920e334880110a4b34e797f30eac32dd;p=mirrors%2FKyberia-bloodline.git Initial Base36 ( en.wikipedia.org/wiki/Base_36 ) support - experimental --- diff --git a/apache/kyberia.conf b/apache/kyberia.conf index 47790a7..3458f54 100644 --- a/apache/kyberia.conf +++ b/apache/kyberia.conf @@ -79,6 +79,15 @@ RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^$ /nodes.php?node_id=1 + #base36 + RewriteCond %{REQUEST_FILENAME} !-f + RewriteRule ^k/([0-9a-zA-Z]+)/?$ /nodes.php?node_kid=$1 [L] + RewriteCond %{REQUEST_FILENAME} !-f + RewriteRule ^k/([0-9a-zA-Z]+)/([0-9a-zA-Z]+)/(.+)/?$ /nodes.php?node_kid=$1&template_kid=$2&magic_word=$3 [L] + RewriteCond %{REQUEST_FILENAME} !-f + RewriteRule ^k/([0-9a-zA-Z]+)/(.+)/?$ /nodes.php?node_kid=$1&template_kid=$2 [L] + + Options Indexes FollowSymLinks AllowOverride All #None diff --git a/wwwroot/nodes.php b/wwwroot/nodes.php index 9a5ff1b..5da4069 100644 --- a/wwwroot/nodes.php +++ b/wwwroot/nodes.php @@ -28,6 +28,10 @@ if ($_SESSION['debugging']) { print_r($_SESSION); } +//Base36 http://en.wikipedia.org/wiki/Base_36 (Initial support only :-) +if(isset($_GET['node_kid'])) $_GET['node_id'] = base_convert($_GET['node_kid'], 36, 10); +if(isset($_GET['template_kid'])) $_GET['template_id'] = base_convert($_GET['template_kid'], 36, 10); + //requiring main config file with path/database etc. constants require('config/config.inc'); require(INCLUDE_DIR.'senate.inc');