]> code.citadel.org Git - citadel.git/commitdiff
* Got the Zap and List-Zapped commands working
authorArt Cancro <ajc@citadel.org>
Wed, 23 Dec 1998 03:37:23 +0000 (03:37 +0000)
committerArt Cancro <ajc@citadel.org>
Wed, 23 Dec 1998 03:37:23 +0000 (03:37 +0000)
        * 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
webcit/child.h
webcit/messages.c
webcit/roomops.c
webcit/webcit.c

index 167a87ffe9a3d60209155363b9360ed3d7e0744c..95f18b33c7d9204478aee84f9347e582fcba2b6b 100644 (file)
@@ -1,3 +1,8 @@
+Tue Dec 22 22:35:50 EST 1998 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
+       * 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 <ajc@uncnsrd.mt-kisco.ny.us>
        * Added the screens to send pages
        * Changed message headers to display in bigger font, non-boldface
index 38ca8e35bc5df443c9ee8baf19a761800ac8a424..4d70a89ffb934ba1e0bd3171aa1a6480cdff2100 100644 (file)
@@ -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);
index da7a3bb5fc7bde76c455fa04c697d446e98a270e..d1e0530f734ef829efdf3c09d327efc650ffd8a8 100644 (file)
@@ -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("<CENTER><B>%s - ",wc_roomname);
index 3bffaaebfb75bdf6a393d8cf5311674fb36b54b1..668af7bc768e73e7bb389a956550c968579a5c61 100644 (file)
@@ -127,7 +127,7 @@ void list_all_rooms_by_floor(void) {
                /* Floor name column */
                wprintf("<TR><TD>");
        
-/*     
+/* FIX ... don't link to a floor pic that doesn't exist
                wprintf("<IMG SRC=\"/dynamic/_floorpic_/%d\" ALT=\"%s\">",
                        &floorlist[a][0]);
  */
@@ -156,9 +156,17 @@ void list_all_rooms_by_floor(void) {
  * list all forgotten rooms
  */
 void zapped_list(void) {
-       wprintf("<CENTER><H1>Forgotten rooms</H1>\n");
+        printf("HTTP/1.0 200 OK\n");
+        output_headers(1);
+        wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=770000><TR><TD>");
+        wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
+        wprintf("<B>Zapped (forgotten) rooms</B>\n");
+        wprintf("</FONT></TD></TR></TABLE><BR>\n");
        listrms("LZRM -1");
-       wprintf("</CENTER><HR>\n");
+       wprintf("<BR><BR>\n");
+       wprintf("Click on any room to un-zap it and goto that room.\n");
+       wprintf("</BODY></HTML>\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("<HTML><HEAD>\n");
+
+       /* automatically fire up a read-new-msgs in the bottom frame */
+       wprintf("<META HTTP-EQUIV=\"Refresh\" CONTENT=\"0;URL=/readnew\">\n");
+
+        wprintf("</HEAD><BODY ");
+        wprintf("BACKGROUND=\"/image&name=background\" TEXT=\"#000000\" LINK=\"#004400\">\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.</HTML>\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("<TABLE WIDTH=100% BORDER=0 BGCOLOR=770000><TR><TD>");
         wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
         wprintf("<B>Zap (forget) the current room</B>\n");
         wprintf("</FONT></TD></TR></TABLE>\n");
 
-       wprintf("If you select this option, <em>%s</em> will ", zaproom);
+       wprintf("If you select this option, <em>%s</em> will ", wc_roomname);
        wprintf("disappear from your room list.  Is this what you wish ");
        wprintf("to do?<BR>\n");
 
        wprintf("<FORM METHOD=\"POST\" ACTION=\"/zap\">\n");
        wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"OK\">");
        wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Cancel\">");
-       wprintf("</FORM>");
+       wprintf("</FORM></HTML>\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("<EM>%s</EM>\n",&buf[4]);
-               return(2);
+               display_error(&buf[4]);
+               return;
                }
 
        serv_puts("FORG");
        serv_gets(buf);
        if (buf[0] != '2') {
-               wprintf("<EM>%s</EM>\n",&buf[4]);
-               return(2);
+               display_error(&buf[4]);
+               return;
                }
 
        gotoroom(bstr("_BASEROOM_"),1);
-       return(0);
        }
index f1177c7b6874c81fdeb0a937fba99eb708c1640a..a426512a774ee78d2132deda95d73a498a933ee1 100644 (file)
@@ -285,7 +285,7 @@ void output_headers(int print_standard_html_head) {
 
        if (print_standard_html_head) {
                wprintf("<HTML><HEAD><TITLE>");
-               escputs("WebCit");
+               escputs("WebCit");       /* FIX -- add BBS name here */
                wprintf("</TITLE></HEAD>");
                if (ExpressMessages != NULL) {
                        wprintf("<SCRIPT language=\"javascript\">\n");
@@ -420,6 +420,25 @@ void output_image() {
 
        }
 
+
+/*
+ * Convenience function to display a page containing only an error string
+ */
+void display_error(char *errormessage) {
+        printf("HTTP/1.0 200 OK\n");
+        output_headers(1);
+        wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=770000><TR><TD>");
+        wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
+        wprintf("<B>Error</B>\n");
+        wprintf("</FONT></TD></TR></TABLE><BR>\n");
+       escputs(errormessage);
+        wprintf("</BODY></HTML>\n");
+        wDumpContent();
+       }
+
+
+
+
 void extract_action(char *actbuf, char *cmdbuf) {
        int i;
 
@@ -676,6 +695,18 @@ fclose(fp);
                goto_private();
                }
 
+       else if (!strcasecmp(action, "zapped_list")) {
+               zapped_list();
+               }
+
+       else if (!strcasecmp(action, "display_zap")) {
+               display_zap();
+               }
+
+       else if (!strcasecmp(action, "zap")) {
+               zap();
+               }
+
        /* When all else fails... */
        else {
                printf("HTTP/1.0 200 OK\n");