4 * Displays the "Summary Page"
10 * Display today's date in a friendly format
12 void output_date(void) {
16 static char *wdays[] = {
17 "Sunday", "Monday", "Tuesday", "Wednesday",
18 "Thursday", "Friday", "Saturday"
20 static char *months[] = {
21 "January", "February", "March", "April", "May", "June", "July",
22 "August", "September", "October", "November", "December"
26 localtime_r(&now, &tm);
28 wprintf("%s, %s %d, %d",
42 void dummy_section(void) {
43 svprintf("BOXTITLE", WCS_STRING, "(dummy section)");
44 do_template("beginbox");
46 do_template("endbox");
51 * New messages section
53 void new_messages_section(void) {
57 int number_of_rooms_to_check;
58 char *rooms_to_check = "Mail|Lobby";
60 svprintf("BOXTITLE", WCS_STRING, "Messages");
61 do_template("beginbox");
63 number_of_rooms_to_check = num_tokens(rooms_to_check, '|');
64 if (number_of_rooms_to_check == 0) return;
66 wprintf("<TABLE BORDER=0 WIDTH=100%%>\n");
67 for (i=0; i<number_of_rooms_to_check; ++i) {
68 extract_token(room, rooms_to_check, i, '|', sizeof room);
70 serv_printf("GOTO %s", room);
71 serv_getln(buf, sizeof buf);
73 extract_token(room, &buf[4], 0, '|', sizeof room);
74 wprintf("<TR><TD><A HREF=\"/dotgoto?room=");
78 wprintf("</A></TD><TD>%d/%d</TD></TR>\n",
79 extract_int(&buf[4], 1),
80 extract_int(&buf[4], 2)
84 wprintf("</TABLE>\n");
85 do_template("endbox");
93 void wholist_section(void) {
97 svprintf("BOXTITLE", WCS_STRING, "Who's online now");
98 do_template("beginbox");
100 serv_getln(buf, sizeof buf);
101 if (buf[0] == '1') while(serv_getln(buf, sizeof buf), strcmp(buf, "000")) {
102 extract_token(user, buf, 1, '|', sizeof user);
106 do_template("endbox");
113 void tasks_section(void) {
114 #ifdef WEBCIT_WITH_CALENDAR_SERVICE
119 svprintf("BOXTITLE", WCS_STRING, "Tasks");
120 do_template("beginbox");
121 #ifdef WEBCIT_WITH_CALENDAR_SERVICE
123 if (WC->wc_view != VIEW_TASKS) {
127 num_msgs = load_msg_ptrs("MSGS ALL", 0);
131 wprintf("<i>(None)</i><br />\n");
134 for (i=0; i<num_msgs; ++i) {
135 display_task(WC->msgarr[i]);
139 calendar_summary_view();
141 #else /* WEBCIT_WITH_CALENDAR_SERVICE */
142 wprintf("<I>(This server does not support task lists)</I>\n");
143 #endif /* WEBCIT_WITH_CALENDAR_SERVICE */
144 do_template("endbox");
151 void calendar_section(void) {
152 #ifdef WEBCIT_WITH_CALENDAR_SERVICE
157 svprintf("BOXTITLE", WCS_STRING, "Today on your calendar");
158 do_template("beginbox");
159 #ifdef WEBCIT_WITH_CALENDAR_SERVICE
160 gotoroom("_CALENDAR_");
161 if (WC->wc_view != VIEW_CALENDAR) {
165 num_msgs = load_msg_ptrs("MSGS ALL", 0);
169 wprintf("<i>(Nothing)</i><br />\n");
172 for (i=0; i<num_msgs; ++i) {
173 display_calendar(WC->msgarr[i]);
175 calendar_summary_view();
178 #else /* WEBCIT_WITH_CALENDAR_SERVICE */
179 wprintf("<I>(This server does not support calendars)</I>\n");
180 #endif /* WEBCIT_WITH_CALENDAR_SERVICE */
181 do_template("endbox");
186 * Server info section (fluff, really)
188 void server_info_section(void) {
189 svprintf("BOXTITLE", WCS_STRING, "About this server");
190 do_template("beginbox");
191 wprintf("You are connected to ");
192 escputs(serv_info.serv_humannode);
193 wprintf(", running ");
194 escputs(serv_info.serv_software);
197 wprintf(", and located in ");
198 escputs(serv_info.serv_bbs_city);
199 wprintf(".<br />\nYour system administrator is ");
200 escputs(serv_info.serv_sysadm);
202 do_template("endbox");
207 * Display this user's summary page
211 output_headers(1, 1, 2, 0, 1, 0, 0);
212 wprintf("<div id=\"banner\">\n");
213 wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=#444455><TR>"
214 "<TD><IMG SRC=\"/static/summscreen_48x.gif\"></TD><TD>"
215 "<SPAN CLASS=\"titlebar\">"
216 "Summary page for ");
217 escputs(WC->wc_username);
218 wprintf("</SPAN></TD><TD>\n");
219 wprintf("</TD><TD ALIGN=RIGHT><SPAN CLASS=\"titlebar\">");
221 wprintf("</SPAN><br />");
223 wprintf("</TD></TR></TABLE>\n");
224 wprintf("</div>\n<div id=\"content\">\n");
227 * Now let's do three columns of crap. All portals and all groupware
228 * clients seem to want to do three columns, so we'll do three
229 * columns too. Conformity is not inherently a virtue, but there are
230 * a lot of really shallow people out there, and even though they're
231 * not people I consider worthwhile, I still want them to use WebCit.
234 wprintf("<div id=\"fix_scrollbar_bug\">"
235 "<table border=0 width=100%%><tr valign=top>");
240 wprintf("<td width=33%%>");
246 wprintf("</td><td width=33%%>");
247 server_info_section();
254 wprintf("</td><td width=33%%>");
255 new_messages_section();
262 wprintf("</td></tr></table></div>\n");