11 #include <sys/socket.h>
14 #include <netinet/in.h>
32 * display the form for editing something (room info, bio, etc)
34 void display_edit(char *description, char *check_cmd,
35 char *read_cmd, char *save_cmd, int with_room_banner)
43 strcpy(WC->ImportantMessage, &buf[4]);
47 if (with_room_banner) {
48 output_headers(1, 1, 1, 0, 0, 0, 0);
51 output_headers(1, 1, 0, 0, 0, 0, 0);
54 svprintf("BOXTITLE", WCS_STRING, "Edit %s", description);
55 do_template("beginbox");
57 wprintf("<CENTER>Enter %s below. Text is formatted to\n", description);
58 wprintf("the <EM>reader's</EM> screen width. To defeat the\n");
59 wprintf("formatting, indent a line at least one space. \n");
62 wprintf("<FORM METHOD=\"POST\" ACTION=\"%s\">\n", save_cmd);
63 wprintf("<TEXTAREA NAME=\"msgtext\" wrap=soft "
64 "ROWS=10 COLS=80 WIDTH=80>\n");
69 wprintf("</TEXTAREA><br /><br />\n");
70 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Save\">");
72 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Cancel\"><br />\n");
74 wprintf("</FORM></CENTER>\n");
75 do_template("endbox");
81 * save a screen which was displayed with display_edit()
83 void save_edit(char *description, char *enter_cmd, int regoto)
87 if (strcmp(bstr("sc"), "Save")) {
88 sprintf(WC->ImportantMessage,
89 "Cancelled. %s was not saved.\n", description);
96 strcpy(WC->ImportantMessage, &buf[4]);
100 text_to_server(bstr("msgtext"), 0);
104 smart_goto(WC->wc_roomname);
106 sprintf(WC->ImportantMessage,
107 "%s has been saved.\n", description);