diff options
author | ptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2002-06-23 11:50:14 +0800 |
---|---|---|
committer | ptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2002-06-23 11:50:14 +0800 |
commit | d47fe901bf9eade78fcfacc5945d84a13040e697 (patch) | |
tree | 67dd4b5150896b1cf8f94805c56cf1dbeeb972f1 | |
parent | 19e940b90afb841d30dfde1dd0469226b70d1b50 (diff) | |
download | pttbbs-d47fe901bf9eade78fcfacc5945d84a13040e697.tar pttbbs-d47fe901bf9eade78fcfacc5945d84a13040e697.tar.gz pttbbs-d47fe901bf9eade78fcfacc5945d84a13040e697.tar.bz2 pttbbs-d47fe901bf9eade78fcfacc5945d84a13040e697.tar.lz pttbbs-d47fe901bf9eade78fcfacc5945d84a13040e697.tar.xz pttbbs-d47fe901bf9eade78fcfacc5945d84a13040e697.tar.zst pttbbs-d47fe901bf9eade78fcfacc5945d84a13040e697.zip |
auto expire gamble
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@342 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r-- | mbbsd/bbs.c | 14 | ||||
-rw-r--r-- | mbbsd/stuff.c | 4 |
2 files changed, 9 insertions, 9 deletions
diff --git a/mbbsd/bbs.c b/mbbsd/bbs.c index 904d4638..39ba5a1f 100644 --- a/mbbsd/bbs.c +++ b/mbbsd/bbs.c @@ -1,4 +1,4 @@ -/* $Id: bbs.c,v 1.57 2002/06/23 03:33:07 ptt Exp $ */ +/* $Id: bbs.c,v 1.58 2002/06/23 03:50:14 ptt Exp $ */ #include "bbs.h" static void mail_by_link(char* owner, char* title, char* path) { @@ -1035,7 +1035,7 @@ static int hold_gamble(int ent, fileheader_t *fhdr, char *direct) { i=atoi(yn); } while( i<10 || i>10000); fprintf(fp,"%d\n",i); - if(getdata(3,0,"設定自動封盤時間?(Y/n)",yn,6,LCECHO) && yn[0]!='n') + if(getdata(3,0,"設定自動封盤時間?(Y/n)",yn,3,LCECHO) && yn[0]!='n') { bp->endgamble= gettime(4, now); substitute_record(fn_board, bp, sizeof(boardheader_t), currbid); @@ -1510,11 +1510,11 @@ int b_note_edit_bname(int bid) { outs(msg_cancel); pressanykey(); } else { - aborted = (fh->bupdate - now ) / 86400 + 1; - sprintf(buf,"%d", aborted > 0 ? aborted : 0); - getdata_buf(3, 0, "請設定有效期限(0 - 9999)天?", buf, 5, DOECHO); - aborted = atoi(buf); - fh->bupdate = aborted ? now + aborted * 86400 : 0; + if(!getdata_buf(2, 0, "設定有效期限天?(n/Y)", buf, 3, LCECHO) + || buf[0]!='n') + fh->bupdate = gettime(3, fh->bupdate?fh->bupdate:now); + else + fh->bupdate = 0; substitute_record(fn_board, fh, sizeof(boardheader_t), bid); } return 0; diff --git a/mbbsd/stuff.c b/mbbsd/stuff.c index f11ff9d5..750158a2 100644 --- a/mbbsd/stuff.c +++ b/mbbsd/stuff.c @@ -1,4 +1,4 @@ -/* $Id: stuff.c,v 1.4 2002/06/23 03:33:07 ptt Exp $ */ +/* $Id: stuff.c,v 1.5 2002/06/23 03:50:14 ptt Exp $ */ #include "bbs.h" /* ----------------------------------------------------- */ @@ -287,7 +287,7 @@ time_t gettime(int line, time_t dt) }while((endtime.tm_mday = atoi(yn))<1 || endtime.tm_mday>31); sprintf(yn, "%d", ptime->tm_hour); do{ - getdata_buf(line, 22, "時(0-23):", yn, 3, LCECHO); + getdata_buf(line, 31, "時(0-23):", yn, 3, LCECHO); }while(( endtime.tm_hour = atoi(yn))<0 || endtime.tm_hour>23); return mktime(&endtime); } |