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) {
87 serv_getln(buf, sizeof buf);
89 now = extract_long(&buf[4], 0);
96 serv_getln(buf, sizeof buf);
97 if (buf[0] == '1') while(serv_getln(buf, sizeof buf), strcmp(buf, "000")) {
98 extract_token(user, buf, 1, '|', sizeof user);
99 last_activity = extract_long(buf, 5);
100 if (strcmp(user, NLI)) {
101 wprintf("<li class=\"");
102 if ((now - last_activity) > 900L) {
103 wprintf("inactiveuser");
106 wprintf("activeuser");
108 wprintf("\"><a href=\"showuser?who=");
112 wprintf("</a></li>");
119 * \brief Task list section
121 void tasks_section(void) {
122 #ifdef WEBCIT_WITH_CALENDAR_SERVICE
127 #ifdef WEBCIT_WITH_CALENDAR_SERVICE
129 if (WC->wc_view != VIEW_TASKS) {
133 num_msgs = load_msg_ptrs("MSGS ALL", 0);
138 wprintf(_("(None)"));
139 wprintf("</i><br />\n");
142 for (i=0; i<num_msgs; ++i) {
143 display_task(WC->msgarr[i]);
147 calendar_summary_view();
149 #else /* WEBCIT_WITH_CALENDAR_SERVICE */
151 wprintf(_("(This server does not support task lists)"));
153 #endif /* WEBCIT_WITH_CALENDAR_SERVICE */
158 * \brief Calendar section
160 void calendar_section(void) {
161 #ifdef WEBCIT_WITH_CALENDAR_SERVICE
166 #ifdef WEBCIT_WITH_CALENDAR_SERVICE
167 gotoroom("_CALENDAR_");
168 if ( (WC->wc_view != VIEW_CALENDAR) && (WC->wc_view != VIEW_CALBRIEF) ) {
172 num_msgs = load_msg_ptrs("MSGS ALL", 0);
177 wprintf(_("(Nothing)"));
178 wprintf("</i><br />\n");
181 for (i=0; i<num_msgs; ++i) {
182 display_calendar(WC->msgarr[i]);
184 calendar_summary_view();
187 #else /* WEBCIT_WITH_CALENDAR_SERVICE */
189 wprintf(_("(This server does not support calendars)"));
191 #endif /* WEBCIT_WITH_CALENDAR_SERVICE */
195 * \brief Server info section (fluff, really)
197 void server_info_section(void) {
200 snprintf(message, sizeof message,
201 _("You are connected to %s, running %s with %s, and located in %s. Your system administrator is %s."),
202 serv_info.serv_humannode,
203 serv_info.serv_software,
205 serv_info.serv_bbs_city,
206 serv_info.serv_sysadm);
211 * \brief summary of inner div????
216 void summary_inner_div(void) {
218 * Now let's do three columns of crap. All portals and all groupware
219 * clients seem to want to do three columns, so we'll do three
220 * columns too. Conformity is not inherently a virtue, but there are
221 * a lot of really shallow people out there, and even though they're
222 * not people I consider worthwhile, I still want them to use WebCit.
225 wprintf("<div class=\"fix_scrollbar_bug\">"
226 "<table class=\"advanced\"><tr valign=top>");
231 wprintf("<td width=33%%>");
232 wprintf("<div class=\"box\">");
233 wprintf("<div class=\"boxlabel\">");
234 wprintf(_("Messages"));
235 wprintf("</div><div class=\"boxcontent\">");
236 wprintf("<div id=\"msg_inner\">");
237 new_messages_section();
238 wprintf("</div></div></div>");
244 wprintf("<td width=33%%>");
245 wprintf("<div class=\"box\">");
246 wprintf("<div class=\"boxlabel\">");
248 wprintf("</div><div class=\"boxcontent\">");
249 wprintf("<div id=\"tasks_inner\">");
251 wprintf("</div></div></div>");
257 wprintf("<td width=33%%>");
258 wprintf("<div class=\"box\">");
259 wprintf("<div class=\"boxlabel\">");
260 wprintf(_("Today on your calendar"));
261 wprintf("</div><div class=\"boxcontent\">");
262 wprintf("<div id=\"calendar_inner\">");
264 wprintf("</div></div></div>");
267 wprintf("</tr><tr valign=top>");
270 * Row Two - Column One
272 wprintf("<td colspan=2>");
273 wprintf("<div class=\"box\">");
274 wprintf("<div class=\"boxlabel\">");
275 wprintf(_("Who's online now"));
276 wprintf("</div><div class=\"boxcontent\">");
277 wprintf("<div id=\"who_inner\">");
279 wprintf("</div></div></div>");
283 * Row Two - Column Two
285 wprintf("<td width=33%%>");
286 wprintf("<div class=\"box\">");
287 wprintf("<div class=\"boxlabel\">");
288 wprintf(_("About this server"));
289 wprintf("</div><div class=\"boxcontent\">");
290 wprintf("<div id=\"info_inner\">");
291 server_info_section();
292 wprintf("</div></div></div>");
299 wprintf("</tr></table>");
304 * \brief Display this user's summary page
309 output_headers(1, 1, 2, 0, 0, 0);
310 wprintf("<div id=\"banner\">\n");
311 wprintf("<div class=\"room_banner\">");
312 wprintf("<img src=\"static/summscreen_48x.gif\">");
314 snprintf(title, sizeof title, _("Summary page for %s"), WC->wc_fullname);
316 wprintf("</h1><h2>");
318 wprintf("</h2></div>");
319 wprintf("<ul class=\"room_actions\">\n");
320 wprintf("<li class=\"start_page\">");
322 wprintf("</li></ul>");
326 * You guessed it ... we're going to refresh using ajax.
327 * In the future we might consider updating individual sections of the summary
328 * instead of the whole thing.
330 wprintf("<div id=\"content\" class=\"service\">\n");
335 "<script type=\"text/javascript\"> "
336 " new Ajax.PeriodicalUpdater('msg_inner', 'new_messages_html', "
337 " { method: 'get', frequency: 60 } ); "
338 " new Ajax.PeriodicalUpdater('tasks_inner', 'tasks_inner_html', "
339 " { method: 'get', frequency: 120 } ); "
340 " new Ajax.PeriodicalUpdater('calendar_inner', 'calendar_inner_html', "
341 " { method: 'get', frequency: 90 } ); "
342 " new Ajax.PeriodicalUpdater('who_inner', 'who_inner_html', "
343 " { method: 'get', frequency: 30 } ); "