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";
50 svprintf("BOXTITLE", WCS_STRING, _("Messages"));
51 do_template("beginbox");
53 number_of_rooms_to_check = num_tokens(rooms_to_check, '|');
54 if (number_of_rooms_to_check == 0) return;
56 wprintf("<table border=0 width=100%%>\n");
57 for (i=0; i<number_of_rooms_to_check; ++i) {
58 extract_token(room, rooms_to_check, i, '|', sizeof room);
60 serv_printf("GOTO %s", room);
61 serv_getln(buf, sizeof buf);
63 extract_token(room, &buf[4], 0, '|', sizeof room);
64 wprintf("<tr><td><a href=\"dotgoto?room=");
68 wprintf("</a></td><td>%d/%d</td></tr>\n",
69 extract_int(&buf[4], 1),
70 extract_int(&buf[4], 2)
74 wprintf("</table>\n");
75 do_template("endbox");
81 * \brief Wholist section
83 void wholist_section(void) {
87 svprintf("BOXTITLE", WCS_STRING, _("Who's online now"));
88 do_template("beginbox");
90 serv_getln(buf, sizeof buf);
91 if (buf[0] == '1') while(serv_getln(buf, sizeof buf), strcmp(buf, "000")) {
92 extract_token(user, buf, 1, '|', sizeof user);
96 do_template("endbox");
101 * \brief Task list section
103 void tasks_section(void) {
104 #ifdef WEBCIT_WITH_CALENDAR_SERVICE
109 svprintf("BOXTITLE", WCS_STRING, _("Tasks"));
110 do_template("beginbox");
111 #ifdef WEBCIT_WITH_CALENDAR_SERVICE
113 if (WC->wc_view != VIEW_TASKS) {
117 num_msgs = load_msg_ptrs("MSGS ALL", 0);
122 wprintf(_("(None)"));
123 wprintf("</i><br />\n");
126 for (i=0; i<num_msgs; ++i) {
127 display_task(WC->msgarr[i]);
131 calendar_summary_view();
133 #else /* WEBCIT_WITH_CALENDAR_SERVICE */
135 wprintf(_("(This server does not support task lists)"));
137 #endif /* WEBCIT_WITH_CALENDAR_SERVICE */
138 do_template("endbox");
143 * \brief Calendar section
145 void calendar_section(void) {
146 #ifdef WEBCIT_WITH_CALENDAR_SERVICE
151 svprintf("BOXTITLE", WCS_STRING, _("Today on your calendar"));
152 do_template("beginbox");
153 #ifdef WEBCIT_WITH_CALENDAR_SERVICE
154 gotoroom("_CALENDAR_");
155 if ( (WC->wc_view != VIEW_CALENDAR) && (WC->wc_view != VIEW_CALBRIEF) ) {
159 num_msgs = load_msg_ptrs("MSGS ALL", 0);
164 wprintf(_("(Nothing)"));
165 wprintf("</i><br />\n");
168 for (i=0; i<num_msgs; ++i) {
169 display_calendar(WC->msgarr[i]);
171 calendar_summary_view();
174 #else /* WEBCIT_WITH_CALENDAR_SERVICE */
176 wprintf(_("(This server does not support calendars)"));
178 #endif /* WEBCIT_WITH_CALENDAR_SERVICE */
179 do_template("endbox");
183 * \brief Server info section (fluff, really)
185 void server_info_section(void) {
188 svprintf("BOXTITLE", WCS_STRING, _("About this server"));
189 do_template("beginbox");
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);
199 do_template("endbox");
203 * \brief summary of inner div????
205 void summary_inner_div(void) {
207 * Now let's do three columns of crap. All portals and all groupware
208 * clients seem to want to do three columns, so we'll do three
209 * columns too. Conformity is not inherently a virtue, but there are
210 * a lot of really shallow people out there, and even though they're
211 * not people I consider worthwhile, I still want them to use WebCit.
214 wprintf("<div class=\"fix_scrollbar_bug\">"
215 "<table border=0 width=100%%><tr valign=top>");
220 wprintf("<td width=33%%>");
226 wprintf("</td><td width=33%%>");
227 server_info_section();
234 wprintf("</td><td width=33%%>");
235 new_messages_section();
242 wprintf("</td></tr></table>");
247 * \brief Display this user's summary page
252 output_headers(1, 1, 2, 0, 0, 0);
253 wprintf("<div id=\"banner\">\n");
254 wprintf("<table width=100%% border=0 bgcolor=#444455><tr>"
255 "<td><img src=\"static/summscreen_48x.gif\"></td><td>"
256 "<span class=\"titlebar\">"
259 snprintf(title, sizeof title, _("Summary page for %s"), WC->wc_fullname);
261 wprintf("</span></td><td>\n");
262 wprintf("</td><td aling=right><span class=\"titlebar\">");
264 wprintf("</span><br />");
266 wprintf("</td></tr></table>\n");
269 * You guessed it ... we're going to refresh using ajax.
270 * In the future we might consider updating individual sections of the summary
271 * instead of the whole thing.
273 wprintf("</div>\n<div id=\"content\">\n");
278 "<script type=\"text/javascript\"> "
279 " new Ajax.PeriodicalUpdater('content', 'summary_inner_div', "
280 " { method: 'get', frequency: 60 } ); "