echo '<TD>' . $_SESSION["username"] . '</TD>' ;
echo '<TD>' . $_SESSION["room"] . '</TD>' ;
echo '<TD ALIGN=RIGHT><A HREF="logout.php">Log out</A></TD>' ;
- echo '</TR></TABLE><HR>';
+ echo '</TR></TABLE><BR>';
+
+ // Temporary menu
+ if ($_SESSION["logged_in"]) {
+ echo '<a href="listrooms.php">' .
+ 'room list</A> ' .
+ '<a href="readmsgs.php?mode=all&count=0">' .
+ 'Read all messages</a> ' .
+ '<a href="readmsgs.php?mode=new&count=0">' .
+ 'Read new messages</a> ' .
+ '<a href="display_enter.php">' .
+ 'Enter a message</a> ' .
+ '<a href="who.php">' .
+ 'Who is online?</a> ' .
+ '<A HREF="logout.php">' .
+ 'Log out</A><HR>' ;
+ }
+
}
global $clientsocket;
fwrite($clientsocket, $buf . "\n", (strlen($buf)+1) );
+ fflush($clientsocket);
}
--- /dev/null
+<?PHP
+
+ include "ctdlheader.php";
+ bbs_page_header();
+
+ serv_puts("ENT0 ");
+ $response = serv_gets();
+
+ if (substr($response, 0, 1) != '2') {
+ echo htmlspecialchars(substr($response, 3)) . '<br>' ;
+ }
+ else {
+ echo '<center>' .
+ '<form ENCTYPE="multipart/form-data" ' .
+ 'METHOD="POST" ACTION="postmsg.php" NAME="postmsg">' .
+ '<input TYPE="submit" NAME="sc" VALUE="Save message">'.
+ '<input TYPE="submit" NAME="sc" VALUE="Cancel">' .
+ '<br>' .
+ '<textarea NAME="msgtext" wrap=soft' .
+ ' ROWS=25 COLS=80 WIDTH=80></textarea><br> '.
+ '</form>' .
+ '</center> '
+ ;
+ }
+
+ bbs_page_footer();
+?>
--- /dev/null
+<?PHP
+
+ include "ctdlheader.php";
+ bbs_page_header();
+
+ serv_puts("ENT0 1");
+ $response = serv_gets();
+
+ if (substr($response, 0, 1) != '4') {
+ echo htmlspecialchars(substr($response, 3)) . '<br>' ;
+ }
+ else {
+ echo 'Sending: ' . $_REQUEST["msgtext"] . '<BR>' ;
+ flush();
+ serv_puts($_REQUEST["msgtext"]);
+ echo 'Sending: 000<BR>' ;
+ flush();
+ serv_puts("000");
+ }
+
+ echo "Message has been posted.<BR>\n" ;
+
+ bbs_page_footer();
+?>
}
socket_write($msgsock, $talkback, strlen($talkback));
+ // LISTING_FOLLOWS mode
if (substr($talkback, 0, 1) == "1") do {
$buf = fgets($ctdlsock, 4096);
if (!$buf) {
}
} while ($buf != "000\n");
+ // SEND_LISTING mode
+ if (substr($talkback, 0, 1) == "4") do {
+ $buf = sock_gets($msgsock);
+ if (!$buf) {
+ $buf = "000" ;
+ }
+ if (!fwrite($ctdlsock, $buf . "\n")) {
+ fclose($ctdlsock);
+ socket_close($sock);
+ system("/bin/rm -f " . $sockname);
+ exit(11);
+ }
+ } while ($buf != "000");
+
}
} while($buf !== false);
include "ctdlheader.php";
bbs_page_header();
- echo "This is an example of the use of ctdl_rwho() to display the " ;
- echo "list of users currently logged in.<BR><BR>\n" ;
-
- echo "<TABLE border=1>";
- echo "<TR>";
- echo "<TD><B>User</B></TD>";
- echo "<TD><B>Room</B></TD>";
- echo "<TD><B>Host</B></TD>";
- echo "</TR>";
+ echo "This is an example of the use of ctdl_rwho() to display " .
+ "the list of users currently logged in.<BR><BR>\n" ;
+
+ echo "<TABLE border=1>" .
+ "<TR>" .
+ "<TD><B>User</B></TD>" .
+ "<TD><B>Room</B></TD>" .
+ "<TD><B>Host</B></TD>" .
+ "</TR>" ;
list($num_users, $wholist) = ctdl_rwho();