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) {
18 static char *wdays[7];
19 static char *months[12];
21 wdays[0] = _("Sunday");
22 wdays[1] = _("Monday");
23 wdays[2] = _("Tuesday");
24 wdays[3] = _("Wednesday");
25 wdays[4] = _("Thursday");
26 wdays[5] = _("Friday");
27 wdays[6] = _("Saturday");
29 months[0] = _("January");
30 months[1] = _("February");
31 months[2] = _("March");
32 months[3] = _("April");
34 months[5] = _("June");
35 months[6] = _("July");
36 months[7] = _("August");
37 months[8] = _("September");
38 months[9] = _("October");
39 months[10] = _("November");
40 months[11] = _("December");
43 localtime_r(&now, &tm);
45 wprintf("%s, %s %d, %d",
57 * \brief Dummy section
59 void dummy_section(void) {
60 svprintf("BOXTITLE", WCS_STRING, "(dummy section)");
61 do_template("beginbox");
62 wprintf(_("(nothing)"));
63 do_template("endbox");
68 * \brief New messages section
70 void new_messages_section(void) {
74 int number_of_rooms_to_check;
75 char *rooms_to_check = "Mail|Lobby";
77 svprintf("BOXTITLE", WCS_STRING, _("Messages"));
78 do_template("beginbox");
80 number_of_rooms_to_check = num_tokens(rooms_to_check, '|');
81 if (number_of_rooms_to_check == 0) return;
83 wprintf("<TABLE BORDER=0 WIDTH=100%%>\n");
84 for (i=0; i<number_of_rooms_to_check; ++i) {
85 extract_token(room, rooms_to_check, i, '|', sizeof room);
87 serv_printf("GOTO %s", room);
88 serv_getln(buf, sizeof buf);
90 extract_token(room, &buf[4], 0, '|', sizeof room);
91 wprintf("<TR><TD><a href=\"dotgoto?room=");
95 wprintf("</A></TD><TD>%d/%d</TD></TR>\n",
96 extract_int(&buf[4], 1),
97 extract_int(&buf[4], 2)
101 wprintf("</TABLE>\n");
102 do_template("endbox");
108 * \brief Wholist section
110 void wholist_section(void) {
114 svprintf("BOXTITLE", WCS_STRING, _("Who's online now"));
115 do_template("beginbox");
117 serv_getln(buf, sizeof buf);
118 if (buf[0] == '1') while(serv_getln(buf, sizeof buf), strcmp(buf, "000")) {
119 extract_token(user, buf, 1, '|', sizeof user);
123 do_template("endbox");
128 * \brief Task list section
130 void tasks_section(void) {
131 #ifdef WEBCIT_WITH_CALENDAR_SERVICE
136 svprintf("BOXTITLE", WCS_STRING, _("Tasks"));
137 do_template("beginbox");
138 #ifdef WEBCIT_WITH_CALENDAR_SERVICE
140 if (WC->wc_view != VIEW_TASKS) {
144 num_msgs = load_msg_ptrs("MSGS ALL", 0);
149 wprintf(_("(None)"));
150 wprintf("</i><br />\n");
153 for (i=0; i<num_msgs; ++i) {
154 display_task(WC->msgarr[i]);
158 calendar_summary_view();
160 #else /* WEBCIT_WITH_CALENDAR_SERVICE */
162 wprintf(_("(This server does not support task lists)"));
164 #endif /* WEBCIT_WITH_CALENDAR_SERVICE */
165 do_template("endbox");
170 * \brief Calendar section
172 void calendar_section(void) {
173 #ifdef WEBCIT_WITH_CALENDAR_SERVICE
178 svprintf("BOXTITLE", WCS_STRING, _("Today on your calendar"));
179 do_template("beginbox");
180 #ifdef WEBCIT_WITH_CALENDAR_SERVICE
181 gotoroom("_CALENDAR_");
182 if ( (WC->wc_view != VIEW_CALENDAR) && (WC->wc_view != VIEW_CALBRIEF) ) {
186 num_msgs = load_msg_ptrs("MSGS ALL", 0);
191 wprintf(_("(Nothing)"));
192 wprintf("</i><br />\n");
195 for (i=0; i<num_msgs; ++i) {
196 display_calendar(WC->msgarr[i]);
198 calendar_summary_view();
201 #else /* WEBCIT_WITH_CALENDAR_SERVICE */
203 wprintf(_("(This server does not support calendars)"));
205 #endif /* WEBCIT_WITH_CALENDAR_SERVICE */
206 do_template("endbox");
210 * \brief Server info section (fluff, really)
212 void server_info_section(void) {
215 svprintf("BOXTITLE", WCS_STRING, _("About this server"));
216 do_template("beginbox");
218 snprintf(message, sizeof message,
219 _("You are connected to %s, running %s with %s, and located in %s. Your system administrator is %s."),
220 serv_info.serv_humannode,
221 serv_info.serv_software,
223 serv_info.serv_bbs_city,
224 serv_info.serv_sysadm);
226 do_template("endbox");
230 * \brief summary of inner div????
232 void summary_inner_div(void) {
234 * Now let's do three columns of crap. All portals and all groupware
235 * clients seem to want to do three columns, so we'll do three
236 * columns too. Conformity is not inherently a virtue, but there are
237 * a lot of really shallow people out there, and even though they're
238 * not people I consider worthwhile, I still want them to use WebCit.
241 wprintf("<div class=\"fix_scrollbar_bug\">"
242 "<table border=0 width=100%%><tr valign=top>");
247 wprintf("<td width=33%%>");
253 wprintf("</td><td width=33%%>");
254 server_info_section();
261 wprintf("</td><td width=33%%>");
262 new_messages_section();
269 wprintf("</td></tr></table>");
274 * \brief Display this user's summary page
279 output_headers(1, 1, 2, 0, 0, 0);
280 wprintf("<div id=\"banner\">\n");
281 wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=#444455><TR>"
282 "<TD><img src=\"static/summscreen_48x.gif\"></TD><TD>"
283 "<SPAN CLASS=\"titlebar\">"
286 snprintf(title, sizeof title, _("Summary page for %s"), WC->wc_fullname);
288 wprintf("</SPAN></TD><TD>\n");
289 wprintf("</TD><TD ALIGN=RIGHT><SPAN CLASS=\"titlebar\">");
291 wprintf("</SPAN><br />");
293 wprintf("</TD></TR></TABLE>\n");
296 * You guessed it ... we're going to refresh using ajax.
297 * In the future we might consider updating individual sections of the summary
298 * instead of the whole thing.
300 wprintf("</div>\n<div id=\"content\">\n");
305 "<script type=\"text/javascript\"> "
306 " new Ajax.PeriodicalUpdater('content', 'summary_inner_div', "
307 " { method: 'get', frequency: 60 } ); "