wprintf("<A HREF=\"/display_advanced\">Return to menu</A>\n");
wDumpContent(1);
}
+
+
+
+
+/*
+ * Display the menubar. Set as_single_page to 1 if we're inside a frameset
+ * and need to display HTML headers and footers -- otherwise it's assumed
+ * that the menubar is being embedded in another page.
+ */
+void display_menubar(int as_single_page) {
+ FILE *menubar_body;
+ char buf[256];
+ int i;
+
+ if (as_single_page) {
+ printf("HTTP/1.0 200 OK\n");
+ output_headers(0);
+ wprintf("<HTML>\n"
+ "<HEAD>\n"
+ "<TITLE>MenuBar</TITLE>\n"
+ "<STYLE TYPE=\"text/css\">\n"
+ "BODY { text-decoration: none; }\n"
+ "</STYLE>\n"
+ "</HEAD>\n"
+ "<BODY BACKGROUND=\"/image&name=background\" "
+ "TEXT=\"#000000\" LINK=\"#FFFFFF\" "
+ "ALINK=\"#FFFFFF\" VLINK=\"#FFFFFF\">\n");
+ }
+
+ menubar_body = fopen("static/menubar.html", "r");
+ if (menubar_body == NULL) {
+ wprintf("menubar<BR>%s", strerror(errno));
+ } else {
+ while (fgets(buf, sizeof(buf), menubar_body) != NULL) {
+ /* Sleazy hack to disable TARGET= directive */
+ if (noframes) for (i=0; i<strlen(buf); ++i) {
+ if (!strncasecmp(&buf[i], "TARGET", 6)) {
+ buf[i]='Q';
+ }
+ }
+ wprintf("%s", buf);
+ }
+ fclose(menubar_body);
+ }
+
+
+ if (as_single_page) {
+ wDumpContent(2);
+ }
+
+
+}
}
+
+void embed_room_banner(char *got) {
+ char buf[256];
+ char fakegot[256];
+
+ if (got == NULL) {
+ serv_printf("GOTO %s", wc_roomname);
+ serv_gets(fakegot);
+ got = fakegot;
+ }
+
+ wprintf("<CENTER><TABLE border=0><TR>");
+
+ if ((strlen(ugname) > 0) && (strcasecmp(ugname, wc_roomname))) {
+ wprintf("<TD VALIGN=TOP><A HREF=\"/ungoto\">");
+ wprintf("<IMG SRC=\"/static/back.gif\" BORDER=0></A></TD>");
+ }
+ wprintf("<TD VALIGN=TOP><FONT FACE=\"Arial,Helvetica,sans-serif\"><FONT SIZE=+2>%s</FONT><BR>", wc_roomname);
+ wprintf("%d new of %d messages</FONT></TD>\n",
+ extract_int(&got[4], 1),
+ extract_int(&got[4], 2));
+
+ /* Display room graphic. The server doesn't actually
+ * need the room name, but we supply it in order to
+ * keep the browser from using a cached graphic from
+ * another room.
+ */
+ serv_puts("OIMG _roompic_");
+ serv_gets(buf);
+ if (buf[0] == '2') {
+ wprintf("<TD><FONT FACE=\"Arial,Helvetica,sans-serif\">");
+ wprintf("<IMG SRC=\"/image&name=_roompic_&room=");
+ escputs(wc_roomname);
+ wprintf("\"></FONT></TD>");
+ serv_puts("CLOS");
+ serv_gets(buf);
+ }
+ wprintf("<TD VALIGN=TOP><FONT FACE=\"Arial,Helvetica,sans-serif\">");
+ readinfo(0);
+ wprintf("</FONT></TD>");
+
+ wprintf("<TD VALIGN=TOP><A HREF=\"/gotonext\">");
+ wprintf("<IMG SRC=\"/static/forward.gif\" border=0></A></TD>");
+ wprintf("</TR></TABLE></CENTER>\n");
+}
+
+
+
+
+
/*
* generic routine to take the session to a new room
*
if (display_name) {
printf("HTTP/1.0 200 OK\n");
+ printf("Pragma: no-cache\n");
+ printf("Cache-Control: no-store\n");
output_headers(0);
+
wprintf("<HTML><HEAD></HEAD>\n<BODY ");
/* automatically fire up a read-new-msgs in the bottom frame */
/* Display the room banner */
if (display_name) {
- wprintf("<CENTER><TABLE border=0><TR>");
-
- if ((strlen(ugname) > 0) && (strcasecmp(ugname, wc_roomname))) {
- wprintf("<TD VALIGN=TOP><A HREF=\"/ungoto\">");
- wprintf("<IMG SRC=\"/static/back.gif\" BORDER=0></A></TD>");
- }
- wprintf("<TD VALIGN=TOP><FONT FACE=\"Arial,Helvetica,sans-serif\"><FONT SIZE=+2>%s</FONT><BR>", wc_roomname);
- wprintf("%d new of %d messages</FONT></TD>\n",
- extract_int(&buf[4], 1),
- extract_int(&buf[4], 2));
-
- /* Display room graphic. The server doesn't actually
- * need the room name, but we supply it in order to
- * keep the browser from using a cached graphic from
- * another room.
- */
- serv_puts("OIMG _roompic_");
- serv_gets(buf);
- if (buf[0] == '2') {
- wprintf("<TD><FONT FACE=\"Arial,Helvetica,sans-serif\">");
- wprintf("<IMG SRC=\"/image&name=_roompic_&room=");
- escputs(wc_roomname);
- wprintf("\"></FONT></TD>");
- serv_puts("CLOS");
- serv_gets(buf);
- }
- wprintf("<TD VALIGN=TOP><FONT FACE=\"Arial,Helvetica,sans-serif\">");
- readinfo(0);
- wprintf("</FONT></TD>");
-
- wprintf("<TD VALIGN=TOP><A HREF=\"/gotonext\">");
- wprintf("<IMG SRC=\"/static/forward.gif\" border=0></A></TD>");
- wprintf("</TR></TABLE></CENTER>\n");
-
+ embed_room_banner(buf);
wDumpContent(1);
}
strcpy(wc_roomname, wc_roomname);
} else {
strcpy(next_room, "_BASEROOM_");
}
- gotoroom(next_room, 1);
+
+ /* In noframes mode, we goto the room silently, then do a
+ * read-new-messages which causes the banner to show up anyway.
+ */
+ if (noframes) {
+ gotoroom(next_room, 0);
+ readloop("readnew");
+ } else {
+ /* In frames mode, we let gotoroom() bring up the banner, which then
+ * uses JavaScript to bring up the new-messages display in the
+ * bottom frame.
+ */
+ gotoroom(next_room, 1);
+ }
}
#include "child.h"
#include "mime_parser.h"
+int fake_frames = 0;
+
int wc_session;
char wc_username[256];
char wc_password[256];
{
struct webcontent *wptr;
+ if (fake_frames) {
+ wprintf("</TD></TR></TABLE></TABLE>\n");
+ fake_frames = 0;
+ }
+
if (print_standard_html_footer) {
if ((noframes) && (print_standard_html_footer != 2)) {
wprintf("<BR>");
- embed_main_menu();
+ /* embed_main_menu(); */ /* not any more */
}
wprintf("</BODY></HTML>\n");
}
ExpressMessages = NULL;
}
wprintf("BACKGROUND=\"/image&name=background\" TEXT=\"#000000\" LINK=\"#004400\">\n");
+
+
+ if ((print_standard_html_head == 1) && (noframes == 1)) {
+ wprintf("<TABLE border=0 width=100%>");
+ wprintf("<TR ALIGN=TOP><TD>");
+
+ display_menubar(0);
+
+ wprintf("</TD><TD ALIGN=TOP>"
+ "<TABLE border=0 width=100%><TR ALIGN=TOP>"
+ "<TD>\n");
+
+ embed_room_banner(NULL);
+
+ wprintf("</TD></TR><TR ALIGN=TOP><TD>\n");
+
+
+ fake_frames = 1;
+ }
}
}
+
void check_for_express_messages()
{
char buf[256];
display_generic();
} else if (!strcasecmp(action, "do_generic")) {
do_generic();
+ } else if (!strcasecmp(action, "display_menubar")) {
+ display_menubar(1);
}
/* When all else fails... */
else {