X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=webcit%2Fsummary.c;h=a5db298b030bf8cbec17e3f0b9cf31e9c54257b5;hb=6ec73d6906542ea2f8cca2e62f7625ee2e17ae03;hp=f78438666d6ed0a60c820af53eb3d53730659101;hpb=70248410404a14e5f368c09e74d896f3e3f9c4b5;p=citadel.git diff --git a/webcit/summary.c b/webcit/summary.c index f78438666..a5db298b0 100644 --- a/webcit/summary.c +++ b/webcit/summary.c @@ -5,6 +5,7 @@ */ #include "webcit.h" +#include "calendar.h" /* * Display today's date in a friendly format @@ -12,40 +13,13 @@ void output_date(void) { struct tm tm; time_t now; - - static char *wdays[7]; - static char *months[12]; - - wdays[0] = _("Sunday"); - wdays[1] = _("Monday"); - wdays[2] = _("Tuesday"); - wdays[3] = _("Wednesday"); - wdays[4] = _("Thursday"); - wdays[5] = _("Friday"); - wdays[6] = _("Saturday"); - - months[0] = _("January"); - months[1] = _("February"); - months[2] = _("March"); - months[3] = _("April"); - months[4] = _("May"); - months[5] = _("June"); - months[6] = _("July"); - months[7] = _("August"); - months[8] = _("September"); - months[9] = _("October"); - months[10] = _("November"); - months[11] = _("December"); + char buf[128]; time(&now); localtime_r(&now, &tm); - wprintf("%s, %s %d, %d", - wdays[tm.tm_wday], - months[tm.tm_mon], - tm.tm_mday, - tm.tm_year + 1900 - ); + wc_strftime(buf, 32, "%A, %x", &tm); + wprintf("%s", buf); } @@ -55,10 +29,10 @@ void output_date(void) { * Dummy section */ void dummy_section(void) { - svprintf("BOXTITLE", WCS_STRING, "(dummy section)"); - do_template("beginbox"); + svput("BOXTITLE", WCS_STRING, "(dummy section)"); + do_template("beginboxx", NULL); wprintf(_("(nothing)")); - do_template("endbox"); + do_template("endbox", NULL); } @@ -72,13 +46,11 @@ void new_messages_section(void) { int number_of_rooms_to_check; char *rooms_to_check = "Mail|Lobby"; - svprintf("BOXTITLE", WCS_STRING, _("Messages")); - do_template("beginbox"); number_of_rooms_to_check = num_tokens(rooms_to_check, '|'); if (number_of_rooms_to_check == 0) return; - wprintf("
"); escputs(room); - wprintf(" | %d/%d | \n", + wprintf("%d/%d | \n", extract_int(&buf[4], 1), extract_int(&buf[4], 2) ); } } - wprintf("