and more dependent on the HTTP Window-target: directive.
+Thu Jan 28 20:30:08 EST 1999 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
+ * Made the frames stuff less dependent on the HTML TARGET= directive
+ and more dependent on the HTTP Window-target: directive.
+
Sat Jan 23 19:36:10 EST 1999 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
* Brought over the new room listing code and <G>oto heuristics
from the main Citadel tree, to pay attention to floor/room ordering
char buf[256];
printf("HTTP/1.0 200 OK\n");
- output_headers(1);
+ output_headers(1, "_top");
/* Da banner */
wprintf("<CENTER><TABLE border=0 width=100%><TR><TD>\n");
void do_welcome(void) {
printf("HTTP/1.0 200 OK\n");
- output_headers(1);
+ output_headers(1, "bottom");
wprintf("<CENTER><H1>");
escputs(wc_username);
wprintf("</H1>\n");
strcpy(wc_roomname, "");
printf("HTTP/1.0 200 OK\n");
- output_headers(2); /* note the "2" which causes cookies to be unset */
+ output_headers(2, "_top"); /* note "2" causes cookies to be unset */
wprintf("<CENTER>");
serv_puts("MESG goodbye");
int a;
printf("HTTP/1.0 200 OK\n");
- output_headers(1);
+ output_headers(1, "bottom");
strcpy(buf,bstr("user"));
if (strlen(buf)>0) if (strlen(bstr("axlevel"))>0) {
int a;
printf("HTTP/1.0 200 OK\n");
- output_headers(1);
+ output_headers(1, "bottom");
wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=007700><TR><TD>");
wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
char buf[256];
printf("HTTP/1.0 200 OK\n");
- output_headers(1);
+ output_headers(1, "bottom");
wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=770000><TR><TD>");
wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
char *bstr(char *key);
char *urlesc(char *);
void urlescputs(char *);
-void output_headers(int);
+void output_headers(int, char *);
void wprintf(const char *format, ...);
void extract(char *dest, char *source, int parmnum);
int extract_int(char *source, int parmnum);
}
printf("HTTP/1.0 200 OK\n");
- output_headers(1);
+ output_headers(1, "bottom");
wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=770000><TR><TD>");
wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
wprintf("<B>Set/change %s</B>\n", description);
int a;
printf("HTTP/1.0 200 OK\n");
- output_headers(1);
+ output_headers(1, "bottom");
wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=770000><TR><TD>");
wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
wprintf("List known rooms</B></A><BR>\n");
wprintf("Where can I go from here?</LI>\n");
- wprintf("<LI><B><A HREF=\"/gotonext\" TARGET=\"top\">\n");
+ wprintf("<LI><B><A HREF=\"/gotonext\">\n");
wprintf("Goto next room</B></A><BR>\n");
wprintf("...with <EM>unread</EM> messages</LI>\n");
- wprintf("<LI><B><A HREF=\"/skip\" TARGET=\"top\">\n");
+ wprintf("<LI><B><A HREF=\"/skip\">\n");
wprintf("Skip to next room</B></A><BR>\n");
wprintf("(come back here later)</LI>\n");
if ( (strlen(ugname)>0) && (strcasecmp(ugname,wc_roomname)) ) {
- wprintf("<LI><B><A HREF=\"/ungoto\" TARGET=\"top\">\n");
+ wprintf("<LI><B><A HREF=\"/ungoto\">\n");
wprintf("Ungoto</B></A><BR>\n");
wprintf("(oops! Back to %s)</LI>\n",ugname);
}
wprintf("<LI><B><A HREF=\"/advanced\">\n");
wprintf("Advanced options</B></A><BR>...and maintenance</LI>\n");
- wprintf("<LI><B><A HREF=\"/termquit\" TARGET=\"_top\">\n");
+ wprintf("<LI><B><A HREF=\"/termquit\">\n");
wprintf("Log off</B></A><BR>Bye!</LI>\n");
wprintf("</UL>\n");
*/
void display_main_menu(void) {
printf("HTTP/1.0 200 OK\n");
- output_headers(1);
+ output_headers(1, "bottom");
embed_main_menu();
wprintf("</BODY></HTML>\n");
wDumpContent();
void display_advanced_menu(void) {
printf("HTTP/1.0 200 OK\n");
- output_headers(1);
+ output_headers(1, "bottom");
embed_advanced_menu();
embed_main_menu();
wprintf("</BODY></HTML>\n");
*/
void display_generic(void) {
printf("HTTP/1.0 200 OK\n");
- output_headers(1);
+ output_headers(1, "bottom");
wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=770077><TR><TD>");
wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
serv_gets(buf);
printf("HTTP/1.0 200 OK\n");
- output_headers(1);
+ output_headers(1, "bottom");
wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=770077><TR><TD>");
wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
wprintf("<B>Server command results</B>\n");
int nummsgs;
printf("HTTP/1.0 200 OK\n");
- printf("Window-target: bottom\n");
- output_headers(1);
+ output_headers(1, "bottom");
wprintf("<CENTER><B>%s - ",wc_roomname);
if (!strcmp(oper,"readnew")) {
char buf[256];
printf("HTTP/1.0 200 OK\n");
- output_headers(1);
+ output_headers(1, "bottom");
strcpy(buf, bstr("sc"));
if (strcasecmp(buf, "Save message")) {
struct tm *tm;
printf("HTTP/1.0 200 OK\n");
- output_headers(1);
+ output_headers(1, "bottom");
sprintf(buf,"ENT0 0|%s|0|0",bstr("recp"));
serv_puts(buf);
msgid = atol(bstr("msgid"));
printf("HTTP/1.0 200 OK\n");
- output_headers(1);
+ output_headers(1, "bottom");
wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=770000><TR><TD>");
wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
msgid = atol(bstr("msgid"));
printf("HTTP/1.0 200 OK\n");
- output_headers(1);
+ output_headers(1, "bottom");
if (!strcasecmp(bstr("yesno"), "Yes")) {
sprintf(buf, "DELE %ld", msgid);
msgid = atol(bstr("msgid"));
printf("HTTP/1.0 200 OK\n");
- output_headers(1);
+ output_headers(1, "bottom");
wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=770000><TR><TD>");
wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
msgid = atol(bstr("msgid"));
printf("HTTP/1.0 200 OK\n");
- output_headers(1);
+ output_headers(1, "bottom");
if (!strcasecmp(bstr("yesno"), "Move")) {
sprintf(buf, "MOVE %ld|%s", msgid, bstr("target_room"));
strcpy(node, bstr("node"));
printf("HTTP/1.0 200 OK\n");
- output_headers(1);
+ output_headers(1, "bottom");
wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=000077><TR><TD>");
wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
wprintf("<B>Edit share list for ");
char node[256];
printf("HTTP/1.0 200 OK\n");
- output_headers(1);
+ output_headers(1, "bottom");
wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=770000><TR><TD>");
wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
wprintf("<B>Network configuration</B>\n");
char sroom[256];
printf("HTTP/1.0 200 OK\n");
- output_headers(1);
+ output_headers(1, "bottom");
wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=770000><TR><TD>");
wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
wprintf("<B>Confirm unshare</B>\n");
char node[256];
printf("HTTP/1.0 200 OK\n");
- output_headers(1);
+ output_headers(1, "bottom");
wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=770000><TR><TD>");
wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
wprintf("<B>Confirm delete</B>\n");
serv_gets(buf);
if (buf[0]=='1') {
printf("HTTP/1.0 200 OK\n");
- output_headers(1);
+ output_headers(1, "bottom");
server_to_text();
wprintf("<A HREF=\"/display_netconf\">Back to menu</A>\n");
wprintf("</BODY></HTML>\n");
serv_gets(buf);
if (buf[0]=='1') {
printf("HTTP/1.0 200 OK\n");
- output_headers(1);
+ output_headers(1, "bottom");
server_to_text();
wprintf("<A HREF=\"/display_netconf\">Back to menu</A>\n");
wprintf("</BODY></HTML>\n");
void display_add_node(void) {
printf("HTTP/1.0 200 OK\n");
- output_headers(1);
+ output_headers(1, "bottom");
wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=007700><TR><TD>");
wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
wprintf("<B>Add a new node</B>\n");
serv_gets(buf);
if (buf[0]=='1') {
printf("HTTP/1.0 200 OK\n");
- output_headers(1);
+ output_headers(1, "bottom");
server_to_text();
wprintf("<A HREF=\"/display_netconf\">Back to menu</A>\n");
wprintf("</BODY></HTML>\n");
strcpy(node, bstr("node"));
printf("HTTP/1.0 200 OK\n");
- output_headers(1);
+ output_headers(1, "bottom");
wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=007700><TR><TD>");
wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
wprintf("<B>Add a shared room</B>\n");
serv_gets(buf);
if (buf[0]=='1') {
printf("HTTP/1.0 200 OK\n");
- output_headers(1);
+ output_headers(1, "bottom");
server_to_text();
wprintf("<A HREF=\"/display_netconf\">Back to menu</A>\n");
wprintf("</BODY></HTML>\n");
char user[256];
printf("HTTP/1.0 200 OK\n");
- output_headers(1);
+ output_headers(1, "bottom");
wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=007700><TR><TD>");
wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
char buf[256];
printf("HTTP/1.0 200 OK\n");
- output_headers(1);
+ output_headers(1, "bottom");
strcpy(recp,bstr("recp"));
strcpy(msgtext,bstr("msgtext"));
void do_chat(void) {
printf("HTTP/1.0 200 OK\n");
- output_headers(1);
+ output_headers(1, "bottom");
wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=000077><TR><TD>");
wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
wprintf("<A HREF=\"/dotgoto&room=");
urlescputs(rmname);
- wprintf("\" TARGET=\"top\">");
+ wprintf("\">");
escputs1(rmname,1);
if ((f & QR_DIRECTORY) && (f & QR_NETWORK)) wprintf("}");
else if (f & QR_DIRECTORY) wprintf("]");
load_floorlist();
printf("HTTP/1.0 200 OK\n");
- output_headers(1);
+ output_headers(1, "bottom");
wprintf("<TABLE width=100% border><TR><TH>Floor</TH>");
wprintf("<TH>Rooms with new messages</TH>");
*/
void zapped_list(void) {
printf("HTTP/1.0 200 OK\n");
- output_headers(1);
+ output_headers(1, "bottom");
wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=770000><TR><TD>");
wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
wprintf("<B>Zapped (forgotten) rooms</B>\n");
if (display_name) {
printf("HTTP/1.0 200 OK\n");
- printf("Window-target: top\n");
- output_headers(0);
+ output_headers(0, "top");
wprintf("<HTML><HEAD></HEAD>\n<BODY ");
/* automatically fire up a read-new-msgs in the bottom frame */
printf("HTTP/1.0 200 OK\n");
- output_headers(1);
+ output_headers(1, "bottom");
wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=000077><TR><TD>");
wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
}
printf("HTTP/1.0 200 OK\n");
- output_headers(1);
+ output_headers(1, "bottom");
wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=000077><TR><TD>");
wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
{
printf("HTTP/1.0 200 OK\n");
- output_headers(1);
+ output_headers(1, "bottom");
wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=770000><TR><TD>");
wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
}
printf("HTTP/1.0 200 OK\n");
- output_headers(1);
+ output_headers(1, "bottom");
wprintf("%s\n",&buf[4]);
wDumpContent();
return;
*/
void display_zap(void) {
printf("HTTP/1.0 200 OK\n");
- output_headers(1);
+ output_headers(1, "bottom");
wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=770000><TR><TD>");
wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
}
printf("HTTP/1.0 200 OK\n");
- output_headers(1);
+ output_headers(1, "bottom");
wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=770000><TR><TD>");
wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
wprintf("<B>Confirm deletion of room</B>\n");
}
printf("HTTP/1.0 200 OK\n");
- output_headers(1);
+ output_headers(1, "bottom");
wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=007700><TR><TD>");
wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"<B>Site configuration");
}
printf("HTTP/1.0 200 OK\n");
- output_headers(1);
+ output_headers(1, "bottom");
wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=007700><TR><TD>");
wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
if (strcmp(bstr("sc"),"Save")) {
printf("HTTP/1.0 200 OK\n");
- output_headers(1);
+ output_headers(1, "bottom");
wprintf("Cancelled. %s was not saved.<BR>\n", description);
wDumpContent();
return;
}
else {
printf("HTTP/1.0 200 OK\n");
- output_headers(1);
+ output_headers(1, "bottom");
wprintf("%s has been saved.</BODY></HTML>\n", description);
wDumpContent();
}
printf("HTTP/1.0 200 OK\n");
- output_headers(1);
+ output_headers(1, "bottom");
serv_puts("LIST");
serv_gets(buf);
int have_pic;
printf("HTTP/1.0 200 OK\n");
- output_headers(1);
+ output_headers(1, "bottom");
wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=007700><TR><TD>");
int logged_in = 0;
int axlevel;
char *ExpressMessages = NULL;
+int noframes = 0;
struct webcontent *wlist = NULL;
struct webcontent *wlast = NULL;
* If print_standard_html_head is nonzero, we also get some standard HTML
* headers. If it's set to 2, the session is considered to be closing.
*/
-void output_headers(int print_standard_html_head) {
+void output_headers(int print_standard_html_head, char *target) {
static char *unset = "; expires=28-May-1971 18:10:00 GMT";
char cookie[256];
printf("Server: %s\n", SERVER);
printf("Connection: close\n");
+
+ if ( (strlen(target)>0) && (noframes == 0) ) {
+ printf("Window-target: %s\n", target);
+ }
+
+
if (print_standard_html_head > 0) {
printf("Pragma: no-cache\n");
printf("Cache-Control: no-store\n");
fp = fopen(buf, "rb");
if (fp == NULL) {
printf("HTTP/1.0 404 %s\n", strerror(errno));
- output_headers(0);
+ output_headers(0, "");
printf("Content-Type: text/plain\n");
sprintf(buf, "%s: %s\n", what, strerror(errno));
printf("Content-length: %d\n", strlen(buf));
}
else {
printf("HTTP/1.0 200 OK\n");
- output_headers(0);
+ output_headers(0, "");
if (!strncasecmp(&what[strlen(what)-4], ".gif", 4))
printf("Content-type: image/gif\n");
if (buf[0]=='2') {
bytes = extract_long(&buf[4], 0);
printf("HTTP/1.0 200 OK\n");
- output_headers(0);
+ output_headers(0, "");
printf("Content-type: image/gif\n");
printf("Content-length: %ld\n", bytes);
printf("\n");
}
else {
printf("HTTP/1.0 404 %s\n", strerror(errno));
- output_headers(0);
+ output_headers(0, "");
printf("Content-Type: text/plain\n");
sprintf(buf, "Error retrieving image\n");
printf("Content-length: %d\n", strlen(buf));
*/
void convenience_page(char *titlebarcolor, char *titlebarmsg, char *messagetext) {
printf("HTTP/1.0 200 OK\n");
- output_headers(1);
+ output_headers(1, "bottom");
wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=%s><TR><TD>", titlebarcolor);
wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
wprintf("<B>%s</B>\n", titlebarmsg);
/* When all else fails... */
else {
printf("HTTP/1.0 200 OK\n");
- output_headers(1);
+ output_headers(1, "");
wprintf("TransactionCount is %d<BR>\n", TransactionCount);
wprintf("You're in session %d<HR>\n", wc_session);
extern int upload_length;
extern char *upload;
extern char floorlist[128][256];
+extern int noframes;
void stuff_to_cookie(char *, int, char *, char *, char *);
void cookie_to_stuff(char *, int *, char *, char *, char *);
int foundit;
printf("HTTP/1.0 200 OK\n");
- output_headers(1);
+ output_headers(1, "bottom");
wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=007700><TR><TD>");
wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"<B>Users currently on ");
else {
printf("HTTP/1.0 200 OK\n");
- output_headers(1);
+ output_headers(1, "bottom");
wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=770000><TR><TD>");
wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"<B>Confirm session termination");
wprintf("</B></FONT></TD></TR></TABLE>\n");
char buf[256];
printf("HTTP/1.0 200 OK\n");
- output_headers(1);
+ output_headers(1, "bottom");
if (!strcasecmp(bstr("sc"), "Change room name")) {
serv_printf("RCHG %s", bstr("fake_roomname"));