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);
88 if (buf[0] == '1') while(serv_getln(buf, sizeof buf), strcmp(buf, "000")) {
89 extract_token(user, buf, 1, '|', sizeof user);
90 last_activity = extract_long(buf, 5);
91 if (strcmp(user, NLI)) {
92 wprintf("<li class=\"");
93 if ((now - last_activity) > 900L) {
94 wprintf("inactiveuser");
97 wprintf("activeuser");
99 wprintf("\"><a href=\"showuser?who=");
103 wprintf("</a></li>");
110 * \brief Task list section
112 void tasks_section(void) {
113 #ifdef WEBCIT_WITH_CALENDAR_SERVICE
118 #ifdef WEBCIT_WITH_CALENDAR_SERVICE
120 if (WC->wc_view != VIEW_TASKS) {
124 num_msgs = load_msg_ptrs("MSGS ALL", 0);
129 wprintf(_("(None)"));
130 wprintf("</i><br />\n");
133 for (i=0; i<num_msgs; ++i) {
134 display_task(WC->msgarr[i]);
138 calendar_summary_view();
140 #else /* WEBCIT_WITH_CALENDAR_SERVICE */
142 wprintf(_("(This server does not support task lists)"));
144 #endif /* WEBCIT_WITH_CALENDAR_SERVICE */
149 * \brief Calendar section
151 void calendar_section(void) {
152 #ifdef WEBCIT_WITH_CALENDAR_SERVICE
157 #ifdef WEBCIT_WITH_CALENDAR_SERVICE
158 gotoroom("_CALENDAR_");
159 if ( (WC->wc_view != VIEW_CALENDAR) && (WC->wc_view != VIEW_CALBRIEF) ) {
163 num_msgs = load_msg_ptrs("MSGS ALL", 0);
168 wprintf(_("(Nothing)"));
169 wprintf("</i><br />\n");
172 for (i=0; i<num_msgs; ++i) {
173 display_calendar(WC->msgarr[i]);
175 calendar_summary_view();
178 #else /* WEBCIT_WITH_CALENDAR_SERVICE */
180 wprintf(_("(This server does not support calendars)"));
182 #endif /* WEBCIT_WITH_CALENDAR_SERVICE */
186 * \brief Server info section (fluff, really)
188 void server_info_section(void) {
191 snprintf(message, sizeof message,
192 _("You are connected to %s, running %s with %s, and located in %s. Your system administrator is %s."),
193 serv_info.serv_humannode,
194 serv_info.serv_software,
196 serv_info.serv_bbs_city,
197 serv_info.serv_sysadm);
202 * \brief summary of inner div????
207 void summary_inner_div(void) {
209 * Now let's do three columns of crap. All portals and all groupware
210 * clients seem to want to do three columns, so we'll do three
211 * columns too. Conformity is not inherently a virtue, but there are
212 * a lot of really shallow people out there, and even though they're
213 * not people I consider worthwhile, I still want them to use WebCit.
216 wprintf("<div class=\"fix_scrollbar_bug\">"
217 "<table border=0 width=100%%><tr valign=top>");
222 wprintf("<td width=33%%>");
223 wprintf("<div class=\"box\">");
224 wprintf("<div class=\"boxlabel\">");
225 wprintf(_("Messages"));
226 wprintf("</div><div class=\"boxcontent\">");
227 wprintf("<div id=\"msg_inner\">");
228 new_messages_section();
229 wprintf("</div></div></div>");
235 wprintf("<td width=33%%>");
236 wprintf("<div class=\"box\">");
237 wprintf("<div class=\"boxlabel\">");
239 wprintf("</div><div class=\"boxcontent\">");
240 wprintf("<div id=\"tasks_inner\">");
242 wprintf("</div></div></div>");
248 wprintf("<td width=33%%>");
249 wprintf("<div class=\"box\">");
250 wprintf("<div class=\"boxlabel\">");
251 wprintf(_("Today on your calendar"));
252 wprintf("</div><div class=\"boxcontent\">");
253 wprintf("<div id=\"calendar_inner\">");
255 wprintf("</div></div></div>");
258 wprintf("</tr><tr valign=top>");
259 wprintf("<td colspan=3><br/></td>");
260 wprintf("</tr><tr valign=top>");
263 * Row Two - Column One
265 wprintf("<td colspan=2>");
266 wprintf("<div class=\"box\">");
267 wprintf("<div class=\"boxlabel\">");
268 wprintf(_("Who's online now"));
269 wprintf("</div><div class=\"boxcontent\">");
270 wprintf("<div id=\"who_inner\">");
272 wprintf("</div></div></div>");
276 * Row Two - Column Two
278 wprintf("<td width=33%%>");
279 wprintf("<div class=\"box\">");
280 wprintf("<div class=\"boxlabel\">");
281 wprintf(_("About this server"));
282 wprintf("</div><div class=\"boxcontent\">");
283 wprintf("<div id=\"info_inner\">");
284 server_info_section();
285 wprintf("</div></div></div>");
292 wprintf("</tr></table>");
297 * \brief Display this user's summary page
302 output_headers(1, 1, 2, 0, 0, 0);
303 wprintf("<div id=\"banner\">\n");
304 wprintf("<div class=\"service_banner\">\n");
305 wprintf("<img src=\"static/summscreen_48x.gif\">");
307 snprintf(title, sizeof title, _("Summary page for %s"), WC->wc_fullname);
309 wprintf("</h1><h2>\n");
311 wprintf("</h2></div>");
312 wprintf("<ul><li class=\"start_page\">");
314 wprintf("</li></ul>");
318 * You guessed it ... we're going to refresh using ajax.
319 * In the future we might consider updating individual sections of the summary
320 * instead of the whole thing.
322 wprintf("<div id=\"content\">\n");
327 "<script type=\"text/javascript\"> "
328 " new Ajax.PeriodicalUpdater('msg_inner', 'new_messages_html', "
329 " { method: 'get', frequency: 60 } ); "
330 " new Ajax.PeriodicalUpdater('tasks_inner', 'tasks_inner_html', "
331 " { method: 'get', frequency: 120 } ); "
332 " new Ajax.PeriodicalUpdater('calendar_inner', 'calendar_inner_html', "
333 " { method: 'get', frequency: 90 } ); "
334 " new Ajax.PeriodicalUpdater('who_inner', 'who_inner_html', "
335 " { method: 'get', frequency: 30 } ); "