Fossil SCM
Take the email-renew-cutoff into account when computing the number of active subscribers.
Commit
fc10e775e92713db167679078b16ab15937052b41535d845a5b6d5b6b7ed40c5
Parent
01ee25cf58aa607…
1 file changed
+4
-1
+4
-1
| --- src/stat.c | ||
| +++ src/stat.c | ||
| @@ -59,10 +59,11 @@ | ||
| 59 | 59 | */ |
| 60 | 60 | void stats_for_email(void){ |
| 61 | 61 | const char *zDest = db_get("email-send-method",0); |
| 62 | 62 | int nSub, nASub, nPend, nDPend; |
| 63 | 63 | const char *zDir, *zDb, *zCmd, *zRelay; |
| 64 | + int iCutoff; | |
| 64 | 65 | @ <tr><th>Outgoing Email:</th><td> |
| 65 | 66 | if( fossil_strcmp(zDest,"pipe")==0 |
| 66 | 67 | && (zCmd = db_get("email-send-command",0))!=0 |
| 67 | 68 | ){ |
| 68 | 69 | @ Piped to command "%h(zCmd)" |
| @@ -110,12 +111,14 @@ | ||
| 110 | 111 | @ <tr><th><a href="%R/subscribers">Subscribers:</a></th><td> |
| 111 | 112 | }else{ |
| 112 | 113 | @ <tr><th>Subscribers:</th><td> |
| 113 | 114 | } |
| 114 | 115 | nSub = db_int(0, "SELECT count(*) FROM subscriber"); |
| 116 | + iCutoff = db_get_int("email-renew-cutoff",0); | |
| 115 | 117 | nASub = db_int(0, "SELECT count(*) FROM subscriber WHERE sverified" |
| 116 | - " AND NOT sdonotcall AND length(ssub)>1"); | |
| 118 | + " AND NOT sdonotcall AND length(ssub)>1" | |
| 119 | + " AND lastContact>=%d;", iCutoff); | |
| 117 | 120 | @ %,d(nASub) active, %,d(nSub) total |
| 118 | 121 | @ </td></tr> |
| 119 | 122 | } |
| 120 | 123 | |
| 121 | 124 | /* |
| 122 | 125 |
| --- src/stat.c | |
| +++ src/stat.c | |
| @@ -59,10 +59,11 @@ | |
| 59 | */ |
| 60 | void stats_for_email(void){ |
| 61 | const char *zDest = db_get("email-send-method",0); |
| 62 | int nSub, nASub, nPend, nDPend; |
| 63 | const char *zDir, *zDb, *zCmd, *zRelay; |
| 64 | @ <tr><th>Outgoing Email:</th><td> |
| 65 | if( fossil_strcmp(zDest,"pipe")==0 |
| 66 | && (zCmd = db_get("email-send-command",0))!=0 |
| 67 | ){ |
| 68 | @ Piped to command "%h(zCmd)" |
| @@ -110,12 +111,14 @@ | |
| 110 | @ <tr><th><a href="%R/subscribers">Subscribers:</a></th><td> |
| 111 | }else{ |
| 112 | @ <tr><th>Subscribers:</th><td> |
| 113 | } |
| 114 | nSub = db_int(0, "SELECT count(*) FROM subscriber"); |
| 115 | nASub = db_int(0, "SELECT count(*) FROM subscriber WHERE sverified" |
| 116 | " AND NOT sdonotcall AND length(ssub)>1"); |
| 117 | @ %,d(nASub) active, %,d(nSub) total |
| 118 | @ </td></tr> |
| 119 | } |
| 120 | |
| 121 | /* |
| 122 |
| --- src/stat.c | |
| +++ src/stat.c | |
| @@ -59,10 +59,11 @@ | |
| 59 | */ |
| 60 | void stats_for_email(void){ |
| 61 | const char *zDest = db_get("email-send-method",0); |
| 62 | int nSub, nASub, nPend, nDPend; |
| 63 | const char *zDir, *zDb, *zCmd, *zRelay; |
| 64 | int iCutoff; |
| 65 | @ <tr><th>Outgoing Email:</th><td> |
| 66 | if( fossil_strcmp(zDest,"pipe")==0 |
| 67 | && (zCmd = db_get("email-send-command",0))!=0 |
| 68 | ){ |
| 69 | @ Piped to command "%h(zCmd)" |
| @@ -110,12 +111,14 @@ | |
| 111 | @ <tr><th><a href="%R/subscribers">Subscribers:</a></th><td> |
| 112 | }else{ |
| 113 | @ <tr><th>Subscribers:</th><td> |
| 114 | } |
| 115 | nSub = db_int(0, "SELECT count(*) FROM subscriber"); |
| 116 | iCutoff = db_get_int("email-renew-cutoff",0); |
| 117 | nASub = db_int(0, "SELECT count(*) FROM subscriber WHERE sverified" |
| 118 | " AND NOT sdonotcall AND length(ssub)>1" |
| 119 | " AND lastContact>=%d;", iCutoff); |
| 120 | @ %,d(nASub) active, %,d(nSub) total |
| 121 | @ </td></tr> |
| 122 | } |
| 123 | |
| 124 | /* |
| 125 |