From 5bf3106fa859cf2e1f88c95acf112c40608941ad Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Wed, 23 Dec 1998 03:37:23 +0000 Subject: [PATCH] * Got the Zap and List-Zapped commands working * Added a convenience function to display a page with an error string * Automatically do a read-new-msgs whenever a new room banner is loaded --- webcit/ChangeLog | 5 ++++ webcit/child.h | 4 ++++ webcit/messages.c | 1 + webcit/roomops.c | 58 +++++++++++++++++++++++++++-------------------- webcit/webcit.c | 33 ++++++++++++++++++++++++++- 5 files changed, 76 insertions(+), 25 deletions(-) diff --git a/webcit/ChangeLog b/webcit/ChangeLog index 167a87ffe..95f18b33c 100644 --- a/webcit/ChangeLog +++ b/webcit/ChangeLog @@ -1,3 +1,8 @@ +Tue Dec 22 22:35:50 EST 1998 Art Cancro + * Got the Zap and List-Zapped commands working + * Added a convenience function to display a page with an error string + * Automatically do a read-new-msgs whenever a new room banner is loaded + Thu Dec 17 20:38:00 EST 1998 Art Cancro * Added the screens to send pages * Changed message headers to display in bigger font, non-boldface diff --git a/webcit/child.h b/webcit/child.h index 38ca8e35b..4d70a89ff 100644 --- a/webcit/child.h +++ b/webcit/child.h @@ -55,3 +55,7 @@ void page_user(void); void do_chat(void); void display_private(char *rname, int req_pass); void goto_private(void); +void zapped_list(void); +void display_zap(void); +void zap(void); +void display_error(char *errormessage); diff --git a/webcit/messages.c b/webcit/messages.c index da7a3bb5f..d1e0530f7 100644 --- a/webcit/messages.c +++ b/webcit/messages.c @@ -214,6 +214,7 @@ void readloop(char *oper) { int nummsgs; printf("HTTP/1.0 200 OK\n"); + printf("Window-target: bottom\n"); output_headers(1); wprintf("
%s - ",wc_roomname); diff --git a/webcit/roomops.c b/webcit/roomops.c index 3bffaaebf..668af7bc7 100644 --- a/webcit/roomops.c +++ b/webcit/roomops.c @@ -127,7 +127,7 @@ void list_all_rooms_by_floor(void) { /* Floor name column */ wprintf(""); -/* +/* FIX ... don't link to a floor pic that doesn't exist wprintf("\"%s\"", &floorlist[a][0]); */ @@ -156,9 +156,17 @@ void list_all_rooms_by_floor(void) { * list all forgotten rooms */ void zapped_list(void) { - wprintf("

Forgotten rooms

\n"); + printf("HTTP/1.0 200 OK\n"); + output_headers(1); + wprintf("
"); + wprintf("Zapped (forgotten) rooms\n"); + wprintf("

\n"); listrms("LZRM -1"); - wprintf("

\n"); + wprintf("

\n"); + wprintf("Click on any room to un-zap it and goto that room.\n"); + wprintf("\n"); + wDumpContent(); } @@ -193,7 +201,15 @@ void gotoroom(char *gname, int display_name) printf("HTTP/1.0 200 OK\n"); printf("Window-target: top\n"); - output_headers(1); + output_headers(0); + + wprintf("\n"); + + /* automatically fire up a read-new-msgs in the bottom frame */ + wprintf("\n"); + + wprintf("\n"); if (display_name != 2) { /* store ungoto information */ @@ -816,10 +832,7 @@ void goto_private(void) { char buf[256]; if (strcasecmp(bstr("sc"),"OK")) { - printf("HTTP/1.0 200 OK\n"); - output_headers(1); - wprintf("Cancelled.\n"); - wDumpContent(); + display_main_menu(); return; } @@ -853,53 +866,50 @@ void goto_private(void) { * display the screen to zap a room */ void display_zap(void) { - char zaproom[32]; - - strcpy(zaproom, bstr("room")); + printf("HTTP/1.0 200 OK\n"); + output_headers(1); wprintf("
"); wprintf("Zap (forget) the current room\n"); wprintf("
\n"); - wprintf("If you select this option, %s will ", zaproom); + wprintf("If you select this option, %s will ", wc_roomname); wprintf("disappear from your room list. Is this what you wish "); wprintf("to do?
\n"); wprintf("
\n"); wprintf(""); wprintf(""); - wprintf("
"); + wprintf("\n"); + wDumpContent(); } /* * zap a room */ -int zap(void) { - char zaproom[32]; +void zap(void) { char buf[256]; if (strcmp(bstr("sc"),"OK")) { - return(2); + display_main_menu(); + return; } - strcpy(zaproom, bstr("room")); - sprintf(buf, "GOTO %s", zaproom); - serv_puts(buf); + serv_printf("GOTO %s", wc_roomname); serv_gets(buf); if (buf[0] != '2') { - wprintf("%s\n",&buf[4]); - return(2); + display_error(&buf[4]); + return; } serv_puts("FORG"); serv_gets(buf); if (buf[0] != '2') { - wprintf("%s\n",&buf[4]); - return(2); + display_error(&buf[4]); + return; } gotoroom(bstr("_BASEROOM_"),1); - return(0); } diff --git a/webcit/webcit.c b/webcit/webcit.c index f1177c7b6..a426512a7 100644 --- a/webcit/webcit.c +++ b/webcit/webcit.c @@ -285,7 +285,7 @@ void output_headers(int print_standard_html_head) { if (print_standard_html_head) { wprintf(""); - escputs("WebCit"); + escputs("WebCit"); /* FIX -- add BBS name here */ wprintf(""); if (ExpressMessages != NULL) { wprintf("