5 * \defgroup StickyNotes Functions which handle "sticky notes"
10 #include "webserver.h"
13 * \brief display sticky notes
14 * \param msgnum the citadel mesage number
16 void display_note(long msgnum) {
19 char display_notetext[SIZ];
23 wprintf("<IMG ALIGN=MIDDLE src=\"static/storenotes_48x.gif\">\n");
25 serv_printf("MSG0 %ld", msgnum);
26 serv_getln(buf, sizeof buf);
28 wprintf("%s<br />\n", &buf[4]);
33 while (serv_getln(buf, sizeof buf), strcmp(buf, "000")) {
35 /** Fill the buffer to at least 256 characters */
36 if ( (in_text) && (strlen(notetext) < 256) ) {
37 strcat(notetext, buf);
40 if ( (!in_text) && (!strcasecmp(buf, "text")) ) {
45 /** Now sanitize the buffer, and shorten it to just a small snippet */
46 for (i=0; i<strlen(notetext); ++i) {
47 if (isspace(notetext[i])) notetext[i] = ' ';
49 strcpy(¬etext[72], "...");
51 /** Make it HTML-happy and print it. */
52 stresc(display_notetext, notetext, 1, 1);
53 wprintf("%s<br />\n", display_notetext);