diff options
-rw-r--r-- | mbbsd/assess.c | 17 | ||||
-rw-r--r-- | mbbsd/bbs.c | 17 |
2 files changed, 18 insertions, 16 deletions
diff --git a/mbbsd/assess.c b/mbbsd/assess.c index dcae8c4e..957d3042 100644 --- a/mbbsd/assess.c +++ b/mbbsd/assess.c @@ -13,37 +13,36 @@ inline static void inc(unsigned char *num, int n) (*num) += n; } -void inc_goodpost(int uid, int num) +int inc_goodpost(int uid, int num) { passwd_query(uid, &xuser); inc(&xuser.goodpost, num); passwd_update(uid, &xuser); + return xuser.goodpost; } -void inc_badpost(int uid, int num) +int inc_badpost(int uid, int num) { passwd_query(uid, &xuser); inc(&xuser.badpost, num); - if (!(xuser.badpost % 10)) { - post_violatelaw(xuser.userid, "Ptt 系統警察", "劣文累計十篇", "罰單一張"); - mail_violatelaw(xuser.userid, "Ptt 系統警察", "劣文累計十篇", "罰單一張"); - xuser.userlevel |= PERM_VIOLATELAW; - } passwd_update(uid, &xuser); + return xuser.badpost; } -void inc_goodsale(int uid, int num) +int inc_goodsale(int uid, int num) { passwd_query(uid, &xuser); inc(&xuser.goodsale, num); passwd_update(uid, &xuser); + return xuser.goodsale; } -void inc_badsale(int uid, int num) +int inc_badsale(int uid, int num) { passwd_query(uid, &xuser); inc(&xuser.badsale, num); passwd_update(uid, &xuser); + return xuser.badsale; } void set_assess(int uid, unsigned char num, int type) diff --git a/mbbsd/bbs.c b/mbbsd/bbs.c index 6ebbe75c..80a012c8 100644 --- a/mbbsd/bbs.c +++ b/mbbsd/bbs.c @@ -1752,13 +1752,16 @@ del_post(int ent, fileheader_t * fhdr, char *direct) if (not_owned && currmode & MODE_DIGEST && is_BM(cuser.userid)) { getdata(1, 40, "惡劣文章?(y/N)", genbuf, 3, LCECHO); - if(genbuf[0]=='y') - { - inc_badpost(searchuser(fhdr->owner), 1); - sprintf(genbuf,"劣文退回:%40.40s", fhdr->title); - mail_id(fhdr->owner, genbuf, newpath, cuser.userid); - } - } + if(genbuf[0]=='y') { + if (!(inc_badpost(searchuser(fhdr->owner), 1) % 10)){ + post_violatelaw(xuser.userid, "Ptt 系統警察", "劣文累計十篇", "罰單一張"); + mail_violatelaw(xuser.userid, "Ptt 系統警察", "劣文累計十篇", "罰單一張"); + xuser.userlevel |= PERM_VIOLATELAW; + } + sprintf(genbuf,"劣文退回:%40.40s", fhdr->title); + mail_id(fhdr->owner, genbuf, newpath, cuser.userid); + } + } #endif setbtotal(currbid); |