]> code.citadel.org Git - citadel.git/commitdiff
fixed the noframes mode
authorArt Cancro <ajc@citadel.org>
Sat, 30 Jan 1999 04:07:33 +0000 (04:07 +0000)
committerArt Cancro <ajc@citadel.org>
Sat, 30 Jan 1999 04:07:33 +0000 (04:07 +0000)
webcit/auth.c
webcit/mainmenu.c
webcit/roomops.c
webcit/static/blankpage.html [new file with mode: 0644]
webcit/webcit.c

index 24fc878f0cfdaaacea1743625aeebe939bebe678..fff1347282a8b3cc62b61f39d9fc472130afcc1f 100644 (file)
@@ -172,9 +172,6 @@ void do_login(void) {
 
 void do_welcome(void) {
 
-
-       fprintf(stderr, "DO_WELCOME CALLED, NOFRAMES=%d\n", noframes);
-
        if (noframes) {
                printf("HTTP/1.0 200 OK\n");
                output_headers(1, "_top");
@@ -182,10 +179,6 @@ void do_welcome(void) {
                escputs(wc_username);
                wprintf("</H1>\n");
                /* FIX add user stats here */
-       
-               wprintf("<HR>");
-               embed_main_menu();
-       
                wDumpContent(1);
                }
 
@@ -213,7 +206,7 @@ void do_logout(void) {
        else wprintf("Goodbye\n");
 
        wprintf("<HR><A HREF=\"/\">Log in again</A></CENTER>\n");
-       wDumpContent(1);
+       wDumpContent(2);
        serv_puts("QUIT");
        exit(0);
        }
index 7ef6322d82d50b507c71064cc6ea7def23004f2b..1ef9dc62542acdf9c9a7eef7217f94fd2dcba459 100644 (file)
@@ -203,7 +203,7 @@ void display_main_menu(void) {
        printf("HTTP/1.0 200 OK\n");
        output_headers(1, "bottom");
        embed_main_menu();
-       wDumpContent(1);
+       wDumpContent(2);
        }
 
 
@@ -212,7 +212,7 @@ void display_advanced_menu(void) {
        output_headers(1, "bottom");
        embed_advanced_menu();
        embed_main_menu();
-       wDumpContent(1);
+       wDumpContent(2);
        }
 
 
index 7afc51959fd2254ea52f3424044107d509d4eca8..2283e4b2e3f44cb2aa2a0bc55669b9507279b8a6 100644 (file)
@@ -396,39 +396,32 @@ void gotoroom(char *gname, int display_name)
 
 
 /*
- * Locate the room on the march list which we most want to go to
+ * Locate the room on the march list which we most want to go to.  Each room
+ * is measured given a "weight" of preference based on various factors.
  */
 char *pop_march(int desired_floor) {
        static char TheRoom[64];
        int TheFloor = 0;
        int TheOrder = 32767;
+       int TheWeight = 0;
+       int weight;
        struct march *mptr = NULL;
 
        strcpy(TheRoom, "_BASEROOM_");
        if (march == NULL) return(TheRoom);
 
        for (mptr = march; mptr != NULL; mptr = mptr->next) {
-               if ((strcasecmp(mptr->march_name, "_BASEROOM_"))
-                  &&(!strcasecmp(TheRoom, "_BASEROOM_"))) {
-                       strcpy(TheRoom, mptr->march_name);
-                       TheFloor = mptr->march_floor;
-                       TheOrder = mptr->march_order;
-                       }
-               else if ( (mptr->march_floor == desired_floor)
-                  && (TheFloor != desired_floor)
-                  && (strcasecmp(mptr->march_name, "_BASEROOM_")) ) {
-                       strcpy(TheRoom, mptr->march_name);
-                       TheFloor = mptr->march_floor;
-                       TheOrder = mptr->march_order;
-                       }
-               else if ((mptr->march_floor < TheFloor)
-                    && (strcasecmp(mptr->march_name, "_BASEROOM_")) ) {
-                       strcpy(TheRoom, mptr->march_name);
-                       TheFloor = mptr->march_floor;
-                       TheOrder = mptr->march_order;
-                       }
-               else if ((mptr->march_order < TheOrder)
-                    && (strcasecmp(mptr->march_name, "_BASEROOM_")) ) {
+               weight = 0;
+               if ((strcasecmp(mptr->march_name, "_BASEROOM_")))
+                       weight = weight + 10000;
+               if (mptr->march_floor == desired_floor)
+                       weight = weight + 5000;
+
+                       weight = weight + ((128-(mptr->march_floor))*128);
+                       weight = weight + (128-(mptr->march_order));
+
+               if (weight > TheWeight) {
+                       TheWeight = weight;
                        strcpy(TheRoom, mptr->march_name);
                        TheFloor = mptr->march_floor;
                        TheOrder = mptr->march_order;
diff --git a/webcit/static/blankpage.html b/webcit/static/blankpage.html
new file mode 100644 (file)
index 0000000..8ae4bdb
--- /dev/null
@@ -0,0 +1,3 @@
+<HTML>
+<BODY BACKGROUND="/image&name=background" TEXT="#000000" LINK="#004400">
+</BODY></HTML>
index 18c5f764e47fa20d9422c7469519d72fa9dfea98..092302f661aba52af93d0a37e2e473c8d1233049 100644 (file)
@@ -178,11 +178,21 @@ int wContentLength(void) {
        return(len);
        }
 
+/*
+ * wDumpContent() takes all the stuff that's been queued up using
+ * the wprintf() and escputs() functions, and sends it out to the browser.
+ * By queuing instead of transmitting as it's generated, we're able to
+ * calculate a Content-length: header.
+ *
+ * print_standard_html_footer should be set to 0 to transmit only, 1 to
+ * append the main menu (if in noframes mode) and closing tags, or 2 to
+ * append the closing tags only.
+ */
 void wDumpContent(int print_standard_html_footer) {
        struct webcontent *wptr;
 
        if (print_standard_html_footer) {
-               if (noframes) {
+               if ( (noframes) && (print_standard_html_footer != 2) ) {
                        wprintf("<BR>");
                        embed_main_menu();
                        }