$Log$
+ Revision 1.13 2003/11/05 03:29:12 ajc
+ * Added a room list function to the library
+ * Threw together temporary room list and goto pages to demonstrate
+
Revision 1.12 2003/11/04 19:17:16 ajc
* Added an initial version of the goto command
Revision 1.1 2003/10/31 03:47:13 ajc
* Initial CVS import
+
+//
+// Fetch the list of known rooms.
+//
+function ctdl_knrooms() {
+ global $clientsocket;
+
+ serv_puts("LKRA");
+ $response = serv_gets();
+
+ if (substr($response, 0, 1) != "1") {
+ return array(0, NULL);
+ }
+
+ $all_lines = array();
+ $num_lines = 0;
+
+ while (strcmp($buf = serv_gets(), "000")) {
+
+ $thisline = array();
+
+ $tok = strtok($buf, "|");
+ if ($tok) $thisline["name"] = $tok;
+
+ $tok = strtok("|");
+ if ($tok) $thisline["flags"] = $tok;
+
+ $tok = strtok("|");
+ if ($tok) $thisline["floor"] = $tok;
+
+ $tok = strtok("|");
+ if ($tok) $thisline["order"] = $tok;
+
+ $tok = strtok("|");
+ if ($tok) $thisline["flags2"] = $tok;
+
+ $tok = strtok("|");
+ if ($tok) $thisline["access"] = $tok;
+
+ $num_lines = array_push($all_lines, $thisline);
+ }
+
+ return array($num_lines, $all_lines);
+
+}
+
+
+
?>
bbs_page_header();
-if ($_POST["action"] == "Login") {
+if ($_REQUEST["action"] == "Login") {
list($retval, $msg) =
- login_existing_user($_POST["user"], $_POST["pass"]);
+ login_existing_user($_REQUEST["user"], $_REQUEST["pass"]);
}
-else if ($_POST["action"] == "New User") {
+else if ($_REQUEST["action"] == "New User") {
list($retval, $msg) =
- create_new_user($_POST["user"], $_POST["pass"]);
+ create_new_user($_REQUEST["user"], $_REQUEST["pass"]);
}
else {
echo "uuuuhhhhhhhhh....<BR>\n" ;
--- /dev/null
+<?PHP
+ include "ctdlheader.php";
+ bbs_page_header();
+
+ ctdl_goto($_REQUEST["towhere"]);
+
+ echo "You are now in: ", htmlspecialchars($_SESSION["room"]) , "<BR>\n";
+?>
+
+<a href="welcome.php">Page One</a><BR>
+<a href="page3.php">Page Three</a><BR>
+
+<?PHP
+ bbs_page_footer();
+?>
--- /dev/null
+<?PHP
+ include "ctdlheader.php";
+ bbs_page_header();
+?>
+
+<H1>Known rooms</H1>
+
+<UL>
+
+<?PHP
+ list($num_rooms, $roomlist) = ctdl_knrooms();
+
+ if ($num_rooms > 0) foreach ($roomlist as $x) {
+ echo '<LI><A HREF="goto.php?towhere=' .
+ urlencode($x["name"]) . '">' .
+ htmlspecialchars($x["name"]) . "</A></LI>\n" ;
+ }
+?>
+
+</UL>
+
+<a href="welcome.php">Page One</a><BR>
+<a href="page3.php">Page Three</a><BR>
+
+<?PHP
+ bbs_page_footer();
+?>
tellus tortor, vehicula at, iaculis vitae, adipiscing quis, sapien. Lorem
ipsum dolor sit amet, consectetuer adipiscing elit.</p>
-<a href="page2.php">Page Two</a><BR>
<a href="who.php">Who is online?</a><BR>
+<a href="listrooms.php">room list</A><BR>
+<a href="page2.php">Page Two</a><BR>
<a href="page3.php">Page Three</a><BR>
<?PHP