From 96a2b554920e334880110a4b34e797f30eac32dd Mon Sep 17 00:00:00 2001 From: Harvie Date: Sun, 28 Nov 2010 22:59:47 +0100 Subject: [PATCH] Initial Base36 ( http://en.wikipedia.org/wiki/Base_36 ) support - experimental --- apache/kyberia.conf | 9 +++++++++ wwwroot/nodes.php | 4 ++++ 2 files changed, 13 insertions(+) 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'); -- 2.30.2