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 if (strcmp(user, NLI)) {
89 wprintf("<li><a href=\"showuser?who=");
100 * \brief Task list section
102 void tasks_section(void) {
103 #ifdef WEBCIT_WITH_CALENDAR_SERVICE
108 #ifdef WEBCIT_WITH_CALENDAR_SERVICE
110 if (WC->wc_view != VIEW_TASKS) {
114 num_msgs = load_msg_ptrs("MSGS ALL", 0);
119 wprintf(_("(None)"));
120 wprintf("</i><br />\n");
123 for (i=0; i<num_msgs; ++i) {
124 display_task(WC->msgarr[i]);
128 calendar_summary_view();
130 #else /* WEBCIT_WITH_CALENDAR_SERVICE */
132 wprintf(_("(This server does not support task lists)"));
134 #endif /* WEBCIT_WITH_CALENDAR_SERVICE */
139 * \brief Calendar section
141 void calendar_section(void) {
142 #ifdef WEBCIT_WITH_CALENDAR_SERVICE
147 #ifdef WEBCIT_WITH_CALENDAR_SERVICE
148 gotoroom("_CALENDAR_");
149 if ( (WC->wc_view != VIEW_CALENDAR) && (WC->wc_view != VIEW_CALBRIEF) ) {
153 num_msgs = load_msg_ptrs("MSGS ALL", 0);
158 wprintf(_("(Nothing)"));
159 wprintf("</i><br />\n");
162 for (i=0; i<num_msgs; ++i) {
163 display_calendar(WC->msgarr[i]);
165 calendar_summary_view();
168 #else /* WEBCIT_WITH_CALENDAR_SERVICE */
170 wprintf(_("(This server does not support calendars)"));
172 #endif /* WEBCIT_WITH_CALENDAR_SERVICE */
176 * \brief Server info section (fluff, really)
178 void server_info_section(void) {
181 snprintf(message, sizeof message,
182 _("You are connected to %s, running %s with %s, and located in %s. Your system administrator is %s."),
183 serv_info.serv_humannode,
184 serv_info.serv_software,
186 serv_info.serv_bbs_city,
187 serv_info.serv_sysadm);
192 * \brief summary of inner div????
197 void summary_inner_div(void) {
199 * Now let's do three columns of crap. All portals and all groupware
200 * clients seem to want to do three columns, so we'll do three
201 * columns too. Conformity is not inherently a virtue, but there are
202 * a lot of really shallow people out there, and even though they're
203 * not people I consider worthwhile, I still want them to use WebCit.
206 wprintf("<div class=\"fix_scrollbar_bug\">"
207 "<table border=0 width=100%%><tr valign=top>");
212 wprintf("<td width=33%%>");
213 wprintf("<div class=\"box\">");
214 wprintf("<div class=\"boxlabel\">");
215 wprintf(_("Messages"));
216 wprintf("</div><div class=\"boxcontent\">");
217 wprintf("<div id=\"msg_inner\">");
218 new_messages_section();
219 wprintf("</div></div></div>");
225 wprintf("<td width=33%%>");
226 wprintf("<div class=\"box\">");
227 wprintf("<div class=\"boxlabel\">");
229 wprintf("</div><div class=\"boxcontent\">");
230 wprintf("<div id=\"tasks_inner\">");
232 wprintf("</div></div></div>");
238 wprintf("<td width=33%%>");
239 wprintf("<div class=\"box\">");
240 wprintf("<div class=\"boxlabel\">");
241 wprintf(_("Today on your calendar"));
242 wprintf("</div><div class=\"boxcontent\">");
243 wprintf("<div id=\"calendar_inner\">");
245 wprintf("</div></div></div>");
248 wprintf("</tr><tr valign=top>");
249 wprintf("<td colspan=3><br/></td>");
250 wprintf("</tr><tr valign=top>");
253 * Row Two - Column One
255 wprintf("<td colspan=2>");
256 wprintf("<div class=\"box\">");
257 wprintf("<div class=\"boxlabel\">");
258 wprintf(_("Who's online now"));
259 wprintf("</div><div class=\"boxcontent\">");
260 wprintf("<div id=\"who_inner\">");
262 wprintf("</div></div></div>");
266 * Row Two - Column Two
268 wprintf("<td width=33%%>");
269 wprintf("<div class=\"box\">");
270 wprintf("<div class=\"boxlabel\">");
271 wprintf(_("About this server"));
272 wprintf("</div><div class=\"boxcontent\">");
273 wprintf("<div id=\"info_inner\">");
274 server_info_section();
275 wprintf("</div></div></div>");
282 wprintf("</tr></table>");
287 * \brief Display this user's summary page
292 output_headers(1, 1, 2, 0, 0, 0);
293 wprintf("<div id=\"banner\">\n");
294 wprintf("<div class=\"service_banner\">\n");
295 wprintf("<img src=\"static/summscreen_48x.gif\">");
297 snprintf(title, sizeof title, _("Summary page for %s"), WC->wc_fullname);
299 wprintf("</h1><h2>\n");
301 wprintf("</h2></div>");
302 wprintf("<ul><li class=\"start_page\">");
304 wprintf("</li></ul>");
308 * You guessed it ... we're going to refresh using ajax.
309 * In the future we might consider updating individual sections of the summary
310 * instead of the whole thing.
312 wprintf("<div id=\"content\">\n");
317 "<script type=\"text/javascript\"> "
318 " new Ajax.PeriodicalUpdater('msg_inner', 'new_messages_html', "
319 " { method: 'get', frequency: 60 } ); "
320 " new Ajax.PeriodicalUpdater('tasks_inner', 'tasks_inner_html', "
321 " { method: 'get', frequency: 120 } ); "
322 " new Ajax.PeriodicalUpdater('calendar_inner', 'calendar_inner_html', "
323 " { method: 'get', frequency: 90 } ); "
324 " new Ajax.PeriodicalUpdater('who_inner', 'who_inner_html', "
325 " { method: 'get', frequency: 30 } ); "