12 #include <sys/types.h>
14 #include <sys/socket.h>
17 #include <netinet/in.h>
29 * Display today's date in a friendly format
31 void output_date(void) {
35 static char *wdays[] = {
36 "Sunday", "Monday", "Tuesday", "Wednesday",
37 "Thursday", "Friday", "Saturday"
39 static char *months[] = {
40 "January", "February", "March", "April", "May", "June", "July",
41 "August", "September", "October", "November", "December"
45 localtime_r(&now, &tm);
47 wprintf("%s, %s %d, %d",
58 * Display the title bar for a section
60 void section_title(char *title) {
62 wprintf("<TABLE width=100%% border=0 cellpadding=5 cellspacing=0>"
63 "<TR><TD BGCOLOR=444455>"
64 "<FONT COLOR=FFFFEE>");
66 wprintf("</FONT></TD></TR></TABLE>\n");
73 void dummy_section(void) {
79 * New messages section
81 void new_messages_section(void) {
85 int number_of_rooms_to_check;
86 char *rooms_to_check = "Mail|Lobby";
88 section_title("Messages");
90 number_of_rooms_to_check = num_tokens(rooms_to_check, '|');
91 if (number_of_rooms_to_check == 0) return;
93 wprintf("<TABLE BORDER=0 WIDTH=100%%>\n");
94 for (i=0; i<number_of_rooms_to_check; ++i) {
95 extract(room, rooms_to_check, i);
97 serv_printf("GOTO %s", room);
100 extract(room, &buf[4], 0);
103 wprintf("</TD><TD>%d/%d</TD></TR>\n",
104 extract_int(&buf[4], 1),
105 extract_int(&buf[4], 2)
109 wprintf("</TABLE>\n");
117 void wholist_section(void) {
121 section_title("Who's online now");
124 if (buf[0] == '1') while(serv_gets(buf), strcmp(buf, "000")) {
125 extract(user, buf, 1);
135 * Display this user's summary page
140 wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=007700><TR><TD>"
141 "<FONT SIZE=+1 COLOR=\"FFFFFF\""
142 "<B>Summary page for ");
143 escputs(WC->wc_username);
144 wprintf("</B><FONT></TD><TD>\n");
146 wprintf("</TD></TR></TABLE>\n");
148 wprintf("<DIV ALIGN=RIGHT>");
153 * Now let's do three columns of crap. All portals and all groupware
154 * clients seem to want to do three columns, so we'll do three
155 * columns too. Conformity is not inherently a virtue, but there are
156 * a lot of really shallow people out there, and even though they're
157 * not people I consider worthwhile, I still want them to use WebCit.
160 wprintf("<TABLE WIDTH=100%% BORDER=0 CELLPADDING=10><TR VALIGN=TOP>");
171 wprintf("</TD><TD>");
177 wprintf("</TD><TD>");
178 new_messages_section();
183 wprintf("</TD></TR></TABLE>\n");