4 * Displays the "Summary Page"
13 #include <sys/types.h>
15 #include <sys/socket.h>
18 #include <netinet/in.h>
30 * Display today's date in a friendly format
32 void output_date(void) {
36 static char *wdays[] = {
37 "Sunday", "Monday", "Tuesday", "Wednesday",
38 "Thursday", "Friday", "Saturday"
40 static char *months[] = {
41 "January", "February", "March", "April", "May", "June", "July",
42 "August", "September", "October", "November", "December"
46 localtime_r(&now, &tm);
48 wprintf("%s, %s %d, %d",
62 void dummy_section(void) {
63 svprintf("BOXTITLE", WCS_STRING, "(dummy section)");
64 do_template("beginbox");
66 do_template("endbox");
71 * New messages section
73 void new_messages_section(void) {
77 int number_of_rooms_to_check;
78 char *rooms_to_check = "Mail|Lobby";
80 svprintf("BOXTITLE", WCS_STRING, "Messages");
81 do_template("beginbox");
83 number_of_rooms_to_check = num_tokens(rooms_to_check, '|');
84 if (number_of_rooms_to_check == 0) return;
86 wprintf("<TABLE BORDER=0 WIDTH=100%%>\n");
87 for (i=0; i<number_of_rooms_to_check; ++i) {
88 extract(room, rooms_to_check, i);
90 serv_printf("GOTO %s", room);
93 extract(room, &buf[4], 0);
94 wprintf("<TR><TD><A HREF=\"/dotgoto?room=");
98 wprintf("</A></TD><TD>%d/%d</TD></TR>\n",
99 extract_int(&buf[4], 1),
100 extract_int(&buf[4], 2)
104 wprintf("</TABLE>\n");
105 do_template("endbox");
113 void wholist_section(void) {
117 svprintf("BOXTITLE", WCS_STRING, "Who's online now");
118 do_template("beginbox");
121 if (buf[0] == '1') while(serv_gets(buf), strcmp(buf, "000")) {
122 extract(user, buf, 1);
126 do_template("endbox");
133 void tasks_section(void) {
134 #ifdef WEBCIT_WITH_CALENDAR_SERVICE
139 svprintf("BOXTITLE", WCS_STRING, "Tasks");
140 do_template("beginbox");
141 #ifdef WEBCIT_WITH_CALENDAR_SERVICE
143 if (strcasecmp(WC->wc_roomname, "Tasks")) {
147 num_msgs = load_msg_ptrs("MSGS ALL");
151 wprintf("<i>(None)</i><br />\n");
154 for (i=0; i<num_msgs; ++i) {
155 display_task(WC->msgarr[i]);
159 calendar_summary_view();
161 #else /* WEBCIT_WITH_CALENDAR_SERVICE */
162 wprintf("<I>(This server does not support task lists)</I>\n");
163 #endif /* WEBCIT_WITH_CALENDAR_SERVICE */
164 do_template("endbox");
171 void calendar_section(void) {
172 #ifdef WEBCIT_WITH_CALENDAR_SERVICE
177 svprintf("BOXTITLE", WCS_STRING, "Today on your calendar");
178 do_template("beginbox");
179 #ifdef WEBCIT_WITH_CALENDAR_SERVICE
180 gotoroom("Calendar");
181 if (strcasecmp(WC->wc_roomname, "Calendar")) {
185 num_msgs = load_msg_ptrs("MSGS ALL");
189 wprintf("<i>(Nothing)</i><br />\n");
192 for (i=0; i<num_msgs; ++i) {
193 display_calendar(WC->msgarr[i]);
195 calendar_summary_view();
198 #else /* WEBCIT_WITH_CALENDAR_SERVICE */
199 wprintf("<I>(This server does not support calendars)</I>\n");
200 #endif /* WEBCIT_WITH_CALENDAR_SERVICE */
201 do_template("endbox");
206 * Server info section (fluff, really)
208 void server_info_section(void) {
209 svprintf("BOXTITLE", WCS_STRING, "About this server");
210 do_template("beginbox");
211 wprintf("You are connected to ");
212 escputs(serv_info.serv_humannode);
213 wprintf(", running ");
214 escputs(serv_info.serv_software);
215 wprintf(", and located in ");
216 escputs(serv_info.serv_bbs_city);
217 wprintf(".<br />\nYour system administrator is ");
218 escputs(serv_info.serv_sysadm);
220 do_template("endbox");
225 * Display this user's summary page
229 output_headers(1, 1, 2, 0, 1, 0, 0);
230 wprintf("<div id=\"banner\">\n");
231 wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=#444455><TR>"
232 "<TD><IMG SRC=\"/static/summary.gif\"></TD><TD>"
233 "<SPAN CLASS=\"titlebar\">"
234 "Summary page for ");
235 escputs(WC->wc_username);
236 wprintf("</SPAN></TD><TD>\n");
237 wprintf("</TD><TD ALIGN=RIGHT><SPAN CLASS=\"titlebar\">");
239 wprintf("</SPAN><br />");
241 wprintf("</TD></TR></TABLE>\n");
242 wprintf("</div>\n<div id=\"content\">\n");
245 * Now let's do three columns of crap. All portals and all groupware
246 * clients seem to want to do three columns, so we'll do three
247 * columns too. Conformity is not inherently a virtue, but there are
248 * a lot of really shallow people out there, and even though they're
249 * not people I consider worthwhile, I still want them to use WebCit.
252 wprintf("<center><table border=0 width=99%%><tr valign=top>");
257 wprintf("<td width=33%%>");
263 wprintf("</td><td width=33%%>");
264 server_info_section();
271 wprintf("</td><td width=33%%>");
272 new_messages_section();
279 wprintf("</td></tr></table></center>\n");