Standardise URI for showing Areas in a City.
[readifood.git] / lib / area.php
index 5785ed2..9670a86 100644 (file)
   /* /area/in/Cambridge/1 */
   if (count($parameters)) {
     if ($parameters[0] == "in") {
-      $city_id = $parameters[2];
-      show_areas(0, 10, $parameters[1], $city_id);
-      show_new_area_form($city_id);
+      if ($parameters[1] == "city") {
+        $city_id = $parameters[3];
+        show_areas(0, 10, $parameters[2], $city_id);
+        show_new_area_form($city_id);
+      }
     }
   }
   list($name, $id, $args) = parse_parameters($parameters);