5 * \defgroup SymaryFuncs Displays the "Summary Page"
11 * \brief Display today's date in a friendly format
13 void output_date(void) {
17 static char *wdays[7];
18 static char *months[12];
20 wdays[0] = _("Sunday");
21 wdays[1] = _("Monday");
22 wdays[2] = _("Tuesday");
23 wdays[3] = _("Wednesday");
24 wdays[4] = _("Thursday");
25 wdays[5] = _("Friday");
26 wdays[6] = _("Saturday");
28 months[0] = _("January");
29 months[1] = _("February");
30 months[2] = _("March");
31 months[3] = _("April");
33 months[5] = _("June");
34 months[6] = _("July");
35 months[7] = _("August");
36 months[8] = _("September");
37 months[9] = _("October");
38 months[10] = _("November");
39 months[11] = _("December");
42 localtime_r(&now, &tm);
44 wprintf("%s, %s %d, %d",
56 * \brief Dummy section
58 void dummy_section(void) {
59 svprintf("BOXTITLE", WCS_STRING, "(dummy section)");
60 do_template("beginbox");
61 wprintf(_("(nothing)"));
62 do_template("endbox");
67 * \brief New messages section
69 void new_messages_section(void) {
73 int number_of_rooms_to_check;
74 char *rooms_to_check = "Mail|Lobby";
76 svprintf("BOXTITLE", WCS_STRING, _("Messages"));
77 do_template("beginbox");
79 number_of_rooms_to_check = num_tokens(rooms_to_check, '|');
80 if (number_of_rooms_to_check == 0) return;
82 wprintf("<TABLE BORDER=0 WIDTH=100%%>\n");
83 for (i=0; i<number_of_rooms_to_check; ++i) {
84 extract_token(room, rooms_to_check, i, '|', sizeof room);
86 serv_printf("GOTO %s", room);
87 serv_getln(buf, sizeof buf);
89 extract_token(room, &buf[4], 0, '|', sizeof room);
90 wprintf("<TR><TD><a href=\"dotgoto?room=");
94 wprintf("</A></TD><TD>%d/%d</TD></TR>\n",
95 extract_int(&buf[4], 1),
96 extract_int(&buf[4], 2)
100 wprintf("</TABLE>\n");
101 do_template("endbox");
107 * \brief Wholist section
109 void wholist_section(void) {
113 svprintf("BOXTITLE", WCS_STRING, _("Who's online now"));
114 do_template("beginbox");
116 serv_getln(buf, sizeof buf);
117 if (buf[0] == '1') while(serv_getln(buf, sizeof buf), strcmp(buf, "000")) {
118 extract_token(user, buf, 1, '|', sizeof user);
122 do_template("endbox");
127 * \brief Task list section
129 void tasks_section(void) {
130 #ifdef WEBCIT_WITH_CALENDAR_SERVICE
135 svprintf("BOXTITLE", WCS_STRING, _("Tasks"));
136 do_template("beginbox");
137 #ifdef WEBCIT_WITH_CALENDAR_SERVICE
139 if (WC->wc_view != VIEW_TASKS) {
143 num_msgs = load_msg_ptrs("MSGS ALL", 0);
148 wprintf(_("(None)"));
149 wprintf("</i><br />\n");
152 for (i=0; i<num_msgs; ++i) {
153 display_task(WC->msgarr[i]);
157 calendar_summary_view();
159 #else /* WEBCIT_WITH_CALENDAR_SERVICE */
161 wprintf(_("(This server does not support task lists)"));
163 #endif /* WEBCIT_WITH_CALENDAR_SERVICE */
164 do_template("endbox");
169 * \brief Calendar section
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 (WC->wc_view != VIEW_CALENDAR) {
185 num_msgs = load_msg_ptrs("MSGS ALL", 0);
190 wprintf(_("(Nothing)"));
191 wprintf("</i><br />\n");
194 for (i=0; i<num_msgs; ++i) {
195 display_calendar(WC->msgarr[i]);
197 calendar_summary_view();
200 #else /* WEBCIT_WITH_CALENDAR_SERVICE */
202 wprintf(_("(This server does not support calendars)"));
204 #endif /* WEBCIT_WITH_CALENDAR_SERVICE */
205 do_template("endbox");
209 * \brief Server info section (fluff, really)
211 void server_info_section(void) {
214 svprintf("BOXTITLE", WCS_STRING, _("About this server"));
215 do_template("beginbox");
217 snprintf(message, sizeof message,
218 _("You are connected to %s, running %s with %s, and located in %s. Your system administrator is %s."),
219 serv_info.serv_humannode,
220 serv_info.serv_software,
222 serv_info.serv_bbs_city,
223 serv_info.serv_sysadm);
225 do_template("endbox");
229 * \brief summary of inner div????
231 void summary_inner_div(void) {
233 * Now let's do three columns of crap. All portals and all groupware
234 * clients seem to want to do three columns, so we'll do three
235 * columns too. Conformity is not inherently a virtue, but there are
236 * a lot of really shallow people out there, and even though they're
237 * not people I consider worthwhile, I still want them to use WebCit.
240 wprintf("<div class=\"fix_scrollbar_bug\">"
241 "<table border=0 width=100%%><tr valign=top>");
246 wprintf("<td width=33%%>");
252 wprintf("</td><td width=33%%>");
253 server_info_section();
260 wprintf("</td><td width=33%%>");
261 new_messages_section();
268 wprintf("</td></tr></table>");
273 * \brief Display this user's summary page
278 output_headers(1, 1, 2, 0, 0, 0);
279 wprintf("<div id=\"banner\">\n");
280 wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=#444455><TR>"
281 "<TD><img src=\"static/summscreen_48x.gif\"></TD><TD>"
282 "<SPAN CLASS=\"titlebar\">"
285 snprintf(title, sizeof title, _("Summary page for %s"), WC->wc_fullname);
287 wprintf("</SPAN></TD><TD>\n");
288 wprintf("</TD><TD ALIGN=RIGHT><SPAN CLASS=\"titlebar\">");
290 wprintf("</SPAN><br />");
292 wprintf("</TD></TR></TABLE>\n");
295 * You guessed it ... we're going to refresh using ajax.
296 * In the future we might consider updating individual sections of the summary
297 * instead of the whole thing.
299 wprintf("</div>\n<div id=\"content\">\n");
304 "<script type=\"text/javascript\"> "
305 " new Ajax.PeriodicalUpdater('content', 'summary_inner_div', "
306 " { method: 'get', frequency: 60 } ); "