From 58f876da2d247c7c19d033e7e873844d45603d3b Mon Sep 17 00:00:00 2001 From: scw Date: Wed, 14 Dec 2005 13:43:28 +0000 Subject: * recording bad post judgement made by BM on board defined by BAD_POST_RECORD * post older than a week cannot be made bad post git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3254 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- mbbsd/bbs.c | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) (limited to 'mbbsd') diff --git a/mbbsd/bbs.c b/mbbsd/bbs.c index 082bfecf..8126f3b1 100644 --- a/mbbsd/bbs.c +++ b/mbbsd/bbs.c @@ -2439,8 +2439,13 @@ del_post(int ent, fileheader_t * fhdr, char *direct) #define SIZE sizeof(badpost_reason) / sizeof(char *) if (not_owned && tusernum > 0 && !(currmode & MODE_DIGEST)) { - getdata(1, 40, "惡劣文章?(y/N)", genbuf, 3, LCECHO); - if(genbuf[0]=='y') { + if (now - atoi(fhdr->filename + 2) > 7 * 24 * 60 * 60) + /* post older than a week */ + genbuf[0] = 'n'; + else + getdata(1, 40, "惡劣文章?(y/N)", genbuf, 3, LCECHO); + + if (genbuf[0]=='y') { int i; char *userid=getuserid(tusernum); move(b_lines - 2, 0); @@ -2479,6 +2484,23 @@ del_post(int ent, fileheader_t * fhdr, char *direct) passwd_update(tusernum, &xuser); } mail_id(userid, genbuf, newpath, cuser.userid); + +#ifdef BAD_POST_RECORD + { + fileheader_t report_fh; + char report_path[PATHLEN]; + setbpath(report_path, BAD_POST_RECORD); + stampfile(report_path, &report_fh); + + snprintf(report_fh.title, sizeof(report_fh.title), + "%s 板 %s 板主給予 %s 一篇劣文", + currboard, cuser.userid, userid); + Copy(newpath, report_path); + + setbdir(report_path, BAD_POST_RECORD); + append_record(report_path, &report_fh, sizeof(report_fh)); + } +#endif /* defined(BAD_POST_RECORD) */ } } } -- cgit v1.2.3