X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=webcit%2Fsummary.c;h=00a52096dddc9e4e1cf9f99ddd8aa97617c1bae0;hb=611d86f026c1590948e1317406656bfb106217e5;hp=ed5bb61e81b7aacb3fe4f6a055c08a8cb59bb01f;hpb=aa8ca3b0af3efdabd8559b886efb3164319bdce1;p=citadel.git diff --git a/webcit/summary.c b/webcit/summary.c index ed5bb61e8..00a52096d 100644 --- a/webcit/summary.c +++ b/webcit/summary.c @@ -12,43 +12,31 @@ void output_date(void) { struct tm tm; time_t now; - - static char *wdays[] = { - "Sunday", "Monday", "Tuesday", "Wednesday", - "Thursday", "Friday", "Saturday" - }; - static char *months[] = { - "January", "February", "March", "April", "May", "June", "July", - "August", "September", "October", "November", "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); } -/* - * Dummy section +/** + * \brief Dummy section */ void dummy_section(void) { - svprintf("BOXTITLE", WCS_STRING, "(dummy section)"); - do_template("beginbox"); - wprintf("(nothing)"); - do_template("endbox"); + svput("BOXTITLE", WCS_STRING, "(dummy section)"); + do_template("beginbox", NULL); + wprintf(_("(nothing)")); + do_template("endbox", NULL); } -/* - * New messages section +/** + * \brief New messages section */ void new_messages_section(void) { char buf[SIZ]; @@ -57,13 +45,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("