From 665bda543e959c88158e95a7bee7148667ba2d8d Mon Sep 17 00:00:00 2001 From: Stefan Ritt Date: Mon, 15 Dec 2003 09:36:23 +0000 Subject: [PATCH] Added 'date on reply = 2' option SVN revision: 638 --- doc/config.html | 8 +++++--- src/elogd.c | 19 ++++++++++++++++++- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/doc/config.html b/doc/config.html index d2ba7185..5320328c 100755 --- a/doc/config.html +++ b/doc/config.html @@ -1330,10 +1330,12 @@ resulting in all messages being locked. In those cases locking has to be turned Default for "Use Lock" is 0.

-

  • Date on reply = 0|1 +
  • Date on reply = 0|1|2
    -If this flag is 1, the current date is placed between the quoted original entry -and the new entry. This can be useful for email notifications, if one wants to see the +If this flag is nozero, the current date is placed between the quoted original entry +and the new entry. 1 causes the date to appear on top of the quoted entry, +2 cuses the date to appear below the quoted entry. +This can be useful for email notifications, if one wants to see the time history of all replies in the email messages. Default is 0.

    diff --git a/src/elogd.c b/src/elogd.c index 44aec2f9..67dae91f 100755 --- a/src/elogd.c +++ b/src/elogd.c @@ -6,6 +6,9 @@ Contents: Web server program for Electronic Logbook ELOG $Log$ + Revision 1.167 2003/12/15 09:36:23 midas + Added 'date on reply = 2' option + Revision 1.166 2003/12/05 12:16:23 midas Added .selframe style class @@ -5772,6 +5775,20 @@ struct tm *ts; { if (!getcfg(lbs->name, "Quote on reply", str) || atoi(str) > 0) { + if (getcfg(lbs->name, "Date on reply", str) && atoi(str) == 1) + { + time(&now); + ts = localtime(&now); + if (getcfg(lbs->name, "Date format", format)) + strftime(str, sizeof(str), format, ts); + else + { + strcpy(str, ctime(&now)); + str[strlen(str)-1] = 0; + } + rsprintf("%s\n\n", str); + } + p = text; if (!getcfg(lbs->name, "Reply string", reply_string)) @@ -5816,7 +5833,7 @@ struct tm *ts; } while (TRUE); - if (getcfg(lbs->name, "Date on reply", str) && atoi(str) > 0) + if (getcfg(lbs->name, "Date on reply", str) && atoi(str) == 2) { time(&now); ts = localtime(&now);