From 8d6ea9a5ef7318ad822adb7f0398bfe505c730da Mon Sep 17 00:00:00 2001 From: victor Date: Mon, 27 Oct 2003 02:08:28 +0000 Subject: use assess if defined ASSESS git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1266 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- mbbsd/assess.c | 2 ++ mbbsd/bbs.c | 7 +++++++ mbbsd/talk.c | 6 ++++++ 3 files changed, 15 insertions(+) (limited to 'mbbsd') diff --git a/mbbsd/assess.c b/mbbsd/assess.c index 46a1a6f9..282af895 100644 --- a/mbbsd/assess.c +++ b/mbbsd/assess.c @@ -1,5 +1,6 @@ #include "bbs.h" +#ifdef ASSESS /* do (*num) + n, n is integer. */ inline static void inc(unsigned char *num, int n) @@ -59,3 +60,4 @@ void set_assess(int uid, unsigned char num, int type) } passwd_update(uid, &xuser); } +#endif diff --git a/mbbsd/bbs.c b/mbbsd/bbs.c index 478c7a37..10197821 100644 --- a/mbbsd/bbs.c +++ b/mbbsd/bbs.c @@ -1363,6 +1363,9 @@ recommend_cancel(int ent, fileheader_t * fhdr, char *direct) getdata(b_lines - 1, 0, "確定要推薦歸零(Y/N)?[n] ", yn, 5, LCECHO); if (yn[0] != 'y') return FULLUPDATE; +#ifdef ASSESS + inc_goodpost(searchuser(fhdr->owner), -1 * (fhdr->recommend / 10)); +#endif fhdr->recommend = 0; substitute_record(direct, fhdr, sizeof(*fhdr), ent); @@ -1579,9 +1582,11 @@ recommend(int ent, fileheader_t * fhdr, char *direct) 51 - strlen(cuser.userid) - strlen(path), " ", fromhost, ptime->tm_mon + 1, ptime->tm_mday); do_add_recommend(direct, fhdr, ent, buf); +#ifdef ASSESS /* 每 10 次推文 加一次 goodpost */ if ((fhdr->filemode & FILE_MARKED) && fhdr->recommend % 10 == 0) inc_goodpost(searchuser(fhdr->owner), 1); +#endif lastrecommend = now; return FULLUPDATE; } @@ -1602,12 +1607,14 @@ mark_post(int ent, fileheader_t * fhdr, char *direct) fhdr->filemode ^= FILE_MARKED; +#ifdef ASSESS if (!(fhdr->filemode & FILE_BID)){ if (fhdr->filemode & FILE_MARKED) inc_goodpost(searchuser(fhdr->owner), fhdr->recommend / 10); else inc_goodpost(searchuser(fhdr->owner), -1 * (fhdr->recommend / 10)); } +#endif substitute_record(direct, fhdr, sizeof(*fhdr), ent); substitute_check(fhdr); diff --git a/mbbsd/talk.c b/mbbsd/talk.c index 07c94c45..3f30f251 100644 --- a/mbbsd/talk.c +++ b/mbbsd/talk.c @@ -363,7 +363,11 @@ my_query(char *uident) prints("《上站次數》%d次", muser.numlogins); move(2, 40); +#ifdef ASSESS prints("《文章篇數》%d篇 (佳作%d/劣文%d)\n", muser.numposts, muser.goodpost, muser.badpost); +#else + prints("《文章篇數》%d篇\n", muser.numposts); +#endif prints("\033[1;33m《目前動態》%-28.28s\033[m", (uentp && isvisible_stat(currutmp, uentp, fri_stat)) ? @@ -379,7 +383,9 @@ my_query(char *uident) "《象棋戰績》%3d 勝 %3d 敗 %3d 和\n", muser.five_win, muser.five_lose, muser.five_tie, muser.chc_win, muser.chc_lose, muser.chc_tie); +#ifdef ASSESS prints("《競標評比》 優 %d / 劣 %d", muser.goodsale, muser.badsale); +#endif move(6, 40); if ((uentp && ((fri_stat & HFM) || strcmp(muser.userid,cuser.userid) == 0) && !uentp->invisible)) prints("《 性 別 》%-28.28s\n", sex[muser.sex % 8]); -- cgit v1.2.3