exists()) trigger_error("This node does not exists.", E_USER_ERROR); if (!isset($_SESSION['cache'])) $_SESSION['cache'] = new NodeCache($DEFAULT_CACHE_COUNT); $_SESSION['cache']->add($node); if (isset($_GET['mode'])) $_SESSION['mode'] = $_GET['mode']; if (!isset($_SESSION['mode'])) $_SESSION['mode'] = $DEFAULT_MODE; if (form_text_submitted("evolve")) { // evolution if ($_SESSION['mode'] == "beginner") $redirect = "evolve.php?id=".$_GET['id']; else if($_SESSION['mode'] == "expert") $redirect = "evolve.php?id=".$_GET['id']."&function=".$_GET_POST['evolve_function']."&mate=".$_GET_POST['evolve_mate']; else trigger_error("Wrong mode: '" . $_SESSION['mode'] . "'.", E_USER_ERROR); if ($_POST['tour'] == 2) $redirect .= "&tour=3"; header("Location: $redirect"); } $it =& Node::create_iterator(0, null, null, null, "ORDER BY `name`, `meaning`"); $prev = null; $next = null; while ($entry = $it->next()) { if ($entry->get('id') == $node->get('id')) break; else $prev = $entry; } $next = $it->next(); $display_mates = (isset($_GET_POST['evolve_function']) && in_array($_GET_POST['evolve_function'], $MATING_FUNCTION_KEYS)); $display = new Display($node); if ($_GET_POST['tour'] == 2) $inTourStep2 = true; else if ($_GET_POST['tour'] == 4) $inTourStep4 = true; ?> :