4 * Displays the "Summary Page"
10 * Display today's date in a friendly format
12 void output_date(void) {
16 static char *wdays[7];
17 static char *months[12];
19 wdays[0] = _("Sunday");
20 wdays[1] = _("Monday");
21 wdays[2] = _("Tuesday");
22 wdays[3] = _("Wednesday");
23 wdays[4] = _("Thursday");
24 wdays[5] = _("Friday");
25 wdays[6] = _("Saturday");
27 months[0] = _("January");
28 months[1] = _("February");
29 months[2] = _("March");
30 months[3] = _("April");
32 months[5] = _("June");
33 months[6] = _("July");
34 months[7] = _("August");
35 months[8] = _("September");
36 months[9] = _("October");
37 months[10] = _("November");
38 months[11] = _("December");
41 localtime_r(&now, &tm);
43 wprintf("%s, %s %d, %d",
57 void dummy_section(void) {
58 svprintf("BOXTITLE", WCS_STRING, "(dummy section)");
59 do_template("beginbox");
60 wprintf(_("(nothing)"));
61 do_template("endbox");
66 * New messages section
68 void new_messages_section(void) {
72 int number_of_rooms_to_check;
73 char *rooms_to_check = "Mail|Lobby";
75 svprintf("BOXTITLE", WCS_STRING, _("Messages"));
76 do_template("beginbox");
78 number_of_rooms_to_check = num_tokens(rooms_to_check, '|');
79 if (number_of_rooms_to_check == 0) return;
81 wprintf("<TABLE BORDER=0 WIDTH=100%%>\n");
82 for (i=0; i<number_of_rooms_to_check; ++i) {
83 extract_token(room, rooms_to_check, i, '|', sizeof room);
85 serv_printf("GOTO %s", room);
86 serv_getln(buf, sizeof buf);
88 extract_token(room, &buf[4], 0, '|', sizeof room);
89 wprintf("<TR><TD><a href=\"dotgoto?room=");
93 wprintf("</A></TD><TD>%d/%d</TD></TR>\n",
94 extract_int(&buf[4], 1),
95 extract_int(&buf[4], 2)
99 wprintf("</TABLE>\n");
100 do_template("endbox");
108 void wholist_section(void) {
112 svprintf("BOXTITLE", WCS_STRING, _("Who's online now"));
113 do_template("beginbox");
115 serv_getln(buf, sizeof buf);
116 if (buf[0] == '1') while(serv_getln(buf, sizeof buf), strcmp(buf, "000")) {
117 extract_token(user, buf, 1, '|', sizeof user);
121 do_template("endbox");
128 void tasks_section(void) {
129 #ifdef WEBCIT_WITH_CALENDAR_SERVICE
134 svprintf("BOXTITLE", WCS_STRING, _("Tasks"));
135 do_template("beginbox");
136 #ifdef WEBCIT_WITH_CALENDAR_SERVICE
138 if (WC->wc_view != VIEW_TASKS) {
142 num_msgs = load_msg_ptrs("MSGS ALL", 0);
147 wprintf(_("(None)"));
148 wprintf("</i><br />\n");
151 for (i=0; i<num_msgs; ++i) {
152 display_task(WC->msgarr[i]);
156 calendar_summary_view();
158 #else /* WEBCIT_WITH_CALENDAR_SERVICE */
160 wprintf(_("(This server does not support task lists)"));
162 #endif /* WEBCIT_WITH_CALENDAR_SERVICE */
163 do_template("endbox");
170 void calendar_section(void) {
171 #ifdef WEBCIT_WITH_CALENDAR_SERVICE
176 svprintf("BOXTITLE", WCS_STRING, _("Today on your calendar"));
177 do_template("beginbox");
178 #ifdef WEBCIT_WITH_CALENDAR_SERVICE
179 gotoroom("_CALENDAR_");
180 if (WC->wc_view != VIEW_CALENDAR) {
184 num_msgs = load_msg_ptrs("MSGS ALL", 0);
189 wprintf(_("(Nothing)"));
190 wprintf("</i><br />\n");
193 for (i=0; i<num_msgs; ++i) {
194 display_calendar(WC->msgarr[i]);
196 calendar_summary_view();
199 #else /* WEBCIT_WITH_CALENDAR_SERVICE */
201 wprintf(_("(This server does not support calendars)"));
203 #endif /* WEBCIT_WITH_CALENDAR_SERVICE */
204 do_template("endbox");
208 * Server info section (fluff, really)
210 void server_info_section(void) {
213 svprintf("BOXTITLE", WCS_STRING, _("About this server"));
214 do_template("beginbox");
216 snprintf(message, sizeof message,
217 _("You are connected to %s, running %s with %s, and located in %s. Your system administrator is %s."),
218 serv_info.serv_humannode,
219 serv_info.serv_software,
221 serv_info.serv_bbs_city,
222 serv_info.serv_sysadm);
224 do_template("endbox");
227 void summary_inner_div(void) {
229 * Now let's do three columns of crap. All portals and all groupware
230 * clients seem to want to do three columns, so we'll do three
231 * columns too. Conformity is not inherently a virtue, but there are
232 * a lot of really shallow people out there, and even though they're
233 * not people I consider worthwhile, I still want them to use WebCit.
236 wprintf("<div class=\"fix_scrollbar_bug\">"
237 "<table border=0 width=100%%><tr valign=top>");
242 wprintf("<td width=33%%>");
248 wprintf("</td><td width=33%%>");
249 server_info_section();
256 wprintf("</td><td width=33%%>");
257 new_messages_section();
264 wprintf("</td></tr></table>");
269 * Display this user's summary page
274 output_headers(1, 1, 2, 0, 0, 0);
275 wprintf("<div id=\"banner\">\n");
276 wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=#444455><TR>"
277 "<TD><img src=\"static/summscreen_48x.gif\"></TD><TD>"
278 "<SPAN CLASS=\"titlebar\">"
281 snprintf(title, sizeof title, _("Summary page for %s"), WC->wc_fullname);
283 wprintf("</SPAN></TD><TD>\n");
284 wprintf("</TD><TD ALIGN=RIGHT><SPAN CLASS=\"titlebar\">");
286 wprintf("</SPAN><br />");
288 wprintf("</TD></TR></TABLE>\n");
291 * You guessed it ... we're going to refresh using ajax.
292 * In the future we might consider updating individual sections of the summary
293 * instead of the whole thing.
295 wprintf("</div>\n<div id=\"content\">\n");
300 "<script type=\"text/javascript\"> "
301 " new Ajax.PeriodicalUpdater('content', 'summary_inner_div', "
302 " { method: 'get', frequency: 60 } ); "