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 headers_type)
43 strcpy(WC->ImportantMessage, &buf[4]);
47 output_headers(headers_type);
49 svprintf("BOXTITLE", WCS_STRING, "Edit %s", description);
50 do_template("beginbox");
52 wprintf("<CENTER>Enter %s below. Text is formatted to\n", description);
53 wprintf("the <EM>reader's</EM> screen width. To defeat the\n");
54 wprintf("formatting, indent a line at least one space. \n");
57 wprintf("<FORM METHOD=\"POST\" ACTION=\"%s\">\n", save_cmd);
58 wprintf("<TEXTAREA NAME=\"msgtext\" wrap=soft "
59 "ROWS=10 COLS=80 WIDTH=80>\n");
64 wprintf("</TEXTAREA><BR><BR>\n");
65 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Save\">");
67 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Cancel\"><BR>\n");
69 wprintf("</FORM></CENTER>\n");
70 do_template("endbox");
76 * save a screen which was displayed with display_edit()
78 void save_edit(char *description, char *enter_cmd, int regoto)
82 if (strcmp(bstr("sc"), "Save")) {
83 sprintf(WC->ImportantMessage,
84 "Cancelled. %s was not saved.\n", description);
91 strcpy(WC->ImportantMessage, &buf[4]);
95 text_to_server(bstr("msgtext"), 0);
99 smart_goto(WC->wc_roomname);
101 sprintf(WC->ImportantMessage,
102 "%s has been saved.\n", description);