5 * \defgroup SymaryFuncs Displays the "Summary Page"
6 * \ingroup WebcitDisplayItems
12 * \brief Display today's date in a friendly format
14 void output_date(void) {
20 localtime_r(&now, &tm);
22 wc_strftime(buf, 32, "%A, %x", &tm);
30 * \brief Dummy section
32 void dummy_section(void) {
33 svprintf("BOXTITLE", WCS_STRING, "(dummy section)");
34 do_template("beginbox");
35 wprintf(_("(nothing)"));
36 do_template("endbox");
41 * \brief New messages section
43 void new_messages_section(void) {
47 int number_of_rooms_to_check;
48 char *rooms_to_check = "Mail|Lobby";
51 number_of_rooms_to_check = num_tokens(rooms_to_check, '|');
52 if (number_of_rooms_to_check == 0) return;
54 wprintf("<table border=0 width=100%%>\n");
55 for (i=0; i<number_of_rooms_to_check; ++i) {
56 extract_token(room, rooms_to_check, i, '|', sizeof room);
58 serv_printf("GOTO %s", room);
59 serv_getln(buf, sizeof buf);
61 extract_token(room, &buf[4], 0, '|', sizeof room);
62 wprintf("<tr><td><a href=\"dotgoto?room=");
66 wprintf("</a></td><td>%d/%d</td></tr>\n",
67 extract_int(&buf[4], 1),
68 extract_int(&buf[4], 2)
72 wprintf("</table>\n");
78 * \brief Wholist section
80 void wholist_section(void) {
85 serv_getln(buf, sizeof buf);
86 if (buf[0] == '1') while(serv_getln(buf, sizeof buf), strcmp(buf, "000")) {
87 extract_token(user, buf, 1, '|', sizeof user);
88 wprintf("<li><a href=\"showuser?who=");
98 * \brief Task list section
100 void tasks_section(void) {
101 #ifdef WEBCIT_WITH_CALENDAR_SERVICE
106 #ifdef WEBCIT_WITH_CALENDAR_SERVICE
108 if (WC->wc_view != VIEW_TASKS) {
112 num_msgs = load_msg_ptrs("MSGS ALL", 0);
117 wprintf(_("(None)"));
118 wprintf("</i><br />\n");
121 for (i=0; i<num_msgs; ++i) {
122 display_task(WC->msgarr[i]);
126 calendar_summary_view();
128 #else /* WEBCIT_WITH_CALENDAR_SERVICE */
130 wprintf(_("(This server does not support task lists)"));
132 #endif /* WEBCIT_WITH_CALENDAR_SERVICE */
137 * \brief Calendar section
139 void calendar_section(void) {
140 #ifdef WEBCIT_WITH_CALENDAR_SERVICE
145 #ifdef WEBCIT_WITH_CALENDAR_SERVICE
146 gotoroom("_CALENDAR_");
147 if ( (WC->wc_view != VIEW_CALENDAR) && (WC->wc_view != VIEW_CALBRIEF) ) {
151 num_msgs = load_msg_ptrs("MSGS ALL", 0);
156 wprintf(_("(Nothing)"));
157 wprintf("</i><br />\n");
160 for (i=0; i<num_msgs; ++i) {
161 display_calendar(WC->msgarr[i]);
163 calendar_summary_view();
166 #else /* WEBCIT_WITH_CALENDAR_SERVICE */
168 wprintf(_("(This server does not support calendars)"));
170 #endif /* WEBCIT_WITH_CALENDAR_SERVICE */
174 * \brief Server info section (fluff, really)
176 void server_info_section(void) {
179 snprintf(message, sizeof message,
180 _("You are connected to %s, running %s with %s, and located in %s. Your system administrator is %s."),
181 serv_info.serv_humannode,
182 serv_info.serv_software,
184 serv_info.serv_bbs_city,
185 serv_info.serv_sysadm);
190 * \brief summary of inner div????
195 void summary_inner_div(void) {
197 * Now let's do three columns of crap. All portals and all groupware
198 * clients seem to want to do three columns, so we'll do three
199 * columns too. Conformity is not inherently a virtue, but there are
200 * a lot of really shallow people out there, and even though they're
201 * not people I consider worthwhile, I still want them to use WebCit.
204 wprintf("<div class=\"fix_scrollbar_bug\">"
205 "<table border=0 width=100%%><tr valign=top>");
210 wprintf("<td width=33%%>");
211 wprintf("<div class=\"box\">");
212 wprintf("<div class=\"boxlabel\">");
213 wprintf(_("Messages"));
214 wprintf("</div><div class=\"boxcontent\">");
215 wprintf("<div id=\"msg_inner\">");
216 new_messages_section();
217 wprintf("</div></div></div>");
223 wprintf("<td width=33%%>");
224 wprintf("<div class=\"box\">");
225 wprintf("<div class=\"boxlabel\">");
227 wprintf("</div><div class=\"boxcontent\">");
228 wprintf("<div id=\"tasks_inner\">");
230 wprintf("</div></div></div>");
236 wprintf("<td width=33%%>");
237 wprintf("<div class=\"box\">");
238 wprintf("<div class=\"boxlabel\">");
239 wprintf(_("Today on your calendar"));
240 wprintf("</div><div class=\"boxcontent\">");
241 wprintf("<div id=\"calendar_inner\">");
243 wprintf("</div></div></div>");
246 wprintf("</tr><tr valign=top>");
247 wprintf("<td colspan=3><br/></td>");
248 wprintf("</tr><tr valign=top>");
251 * Row Two - Column One
253 wprintf("<td colspan=2>");
254 wprintf("<div class=\"box\">");
255 wprintf("<div class=\"boxlabel\">");
256 wprintf(_("Who's online now"));
257 wprintf("</div><div class=\"boxcontent\">");
258 wprintf("<div id=\"who_inner\">");
260 wprintf("</div></div></div>");
264 * Row Two - Column Two
266 wprintf("<td width=33%%>");
267 wprintf("<div class=\"box\">");
268 wprintf("<div class=\"boxlabel\">");
269 wprintf(_("About this server"));
270 wprintf("</div><div class=\"boxcontent\">");
271 wprintf("<div id=\"info_inner\">");
272 server_info_section();
273 wprintf("</div></div></div>");
280 wprintf("</tr></table>");
285 * \brief Display this user's summary page
290 output_headers(1, 1, 2, 0, 0, 0);
291 wprintf("<div id=\"banner\">\n");
292 wprintf("<div class=\"service_banner\">\n");
293 wprintf("<img src=\"static/summscreen_48x.gif\">");
295 snprintf(title, sizeof title, _("Summary page for %s"), WC->wc_fullname);
297 wprintf("</h1><h2>\n");
299 wprintf("</h2></div>");
300 wprintf("<ul><li class=\"start_page\">");
302 wprintf("</li></ul>");
306 * You guessed it ... we're going to refresh using ajax.
307 * In the future we might consider updating individual sections of the summary
308 * instead of the whole thing.
310 wprintf("<div id=\"content\">\n");
315 "<script type=\"text/javascript\"> "
316 " new Ajax.PeriodicalUpdater('msg_inner', 'new_messages_html', "
317 " { method: 'get', frequency: 60 } ); "
318 " new Ajax.PeriodicalUpdater('tasks_inner', 'tasks_inner_html', "
319 " { method: 'get', frequency: 120 } ); "
320 " new Ajax.PeriodicalUpdater('calendar_inner', 'calendar_inner_html', "
321 " { method: 'get', frequency: 90 } ); "
322 " new Ajax.PeriodicalUpdater('who_inner', 'who_inner_html', "
323 " { method: 'get', frequency: 30 } ); "