Initial PATH_INFO support (experimental!)
authorHarvie <tomas@mudrunka.cz>
Sun, 28 Nov 2010 22:50:15 +0000 (23:50 +0100)
committerHarvie <tomas@mudrunka.cz>
Sun, 28 Nov 2010 22:50:15 +0000 (23:50 +0100)
wwwroot/nodes.php

index 5da40699896fcf9320aba1ff09bf213e8aa80bb5..69e867d95aa88a24e2bdd80c027a0b64e340db1c 100644 (file)
@@ -28,6 +28,23 @@ if ($_SESSION['debugging']) {
     print_r($_SESSION);
 }
 
+
+//Path info (Experimental - thish should replace most of mod_rewrites in future...)
+@$PATH_INFO=trim($_SERVER[PATH_INFO]);
+if($PATH_INFO != '') {
+       $PATH_CHUNKS = preg_split("/\//", $PATH_INFO);
+       switch($PATH_CHUNKS[1]) {
+               case 'k':
+                       if(isset($PATH_CHUNKS[2]) && $PATH_CHUNKS[2] != '') $_GET['node_kid'] = $PATH_CHUNKS[2];
+                       if(isset($PATH_CHUNKS[3]) && $PATH_CHUNKS[3] != '') $_GET['template_kid'] = $PATH_CHUNKS[3];
+                       break;
+               case 'id':
+                       if(isset($PATH_CHUNKS[2]) && $PATH_CHUNKS[2] != '') $_GET['node_id'] = $PATH_CHUNKS[2];
+                       if(isset($PATH_CHUNKS[3]) && $PATH_CHUNKS[3] != '') $_GET['template_id'] = $PATH_CHUNKS[3];
+                       break;
+       }
+}
+
 //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);
This page took 0.136721 seconds and 4 git commands to generate.