* roomops.c: fixed buggy implementation of ungoto
* Set up an option in output_headers() to optionally print the most
often used opening HTML as well as the HTTP headers.
+ * Display express messages in cute little JavaScript popup window.
Fri Dec 11 21:14:36 EST 1998 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
* Brought over message reading and entry functions from old WebCit
int connected = 0;
int logged_in = 0;
int axlevel;
+char *ExpressMessages = NULL;
struct webcontent *wlist = NULL;
struct webcontent *wlast = NULL;
wprintf("<HTML><HEAD><TITLE>");
escputs("WebCit");
wprintf("</TITLE></HEAD>");
- wprintf("<BODY BACKGROUND=\"/image&name=background\" TEXT=\"#000000\" LINK=\"#004400\">\n");
+ if (ExpressMessages != NULL) {
+ wprintf("<SCRIPT language=\"javascript\">\n");
+ wprintf("function ExpressMessage() {\n");
+ wprintf(" alert(\"");
+ escputs(ExpressMessages);
+ wprintf("\")\n");
+ wprintf(" }\n </SCRIPT>\n");
+ }
+ wprintf("<BODY ");
+ if (ExpressMessages != NULL) {
+ wprintf("onload=\"ExpressMessage()\" ");
+ free(ExpressMessages);
+ ExpressMessages = NULL;
+ }
+ wprintf("BACKGROUND=\"/image&name=background\" TEXT=\"#000000\" LINK=\"#004400\">\n");
}
}
+
+
+
+void check_for_express_messages() {
+ char buf[256];
+
+ serv_puts("PEXP");
+ serv_gets(buf);
+ if (buf[0]=='1') {
+ while (serv_gets(buf), strcmp(buf, "000")) {
+ if (ExpressMessages == NULL) {
+ ExpressMessages = malloc(strlen(buf) + 4);
+ strcpy(ExpressMessages, "");
+ }
+ else {
+ ExpressMessages = realloc(ExpressMessages,
+ (strlen(ExpressMessages) + strlen(buf) + 4) );
+ }
+ strcat(ExpressMessages, buf);
+ strcat(ExpressMessages, "\\n");
+ }
+ }
+ }
+
+
+
+
void output_static(char *what) {
char buf[256];
FILE *fp;
get_serv_info();
}
+ check_for_express_messages();
/*
* If we're not logged in, but we have username and password cookies