summaryrefslogtreecommitdiffstats
path: root/mbbsd
diff options
context:
space:
mode:
authorvictor <victor@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2003-10-27 10:08:28 +0800
committervictor <victor@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2003-10-27 10:08:28 +0800
commit8d6ea9a5ef7318ad822adb7f0398bfe505c730da (patch)
tree9d0989b422d4ac49c9d1963ca6b9ae7090b43cca /mbbsd
parent21a627d65d7d0cabc6acc169ec35011ab51feab3 (diff)
downloadpttbbs-8d6ea9a5ef7318ad822adb7f0398bfe505c730da.tar
pttbbs-8d6ea9a5ef7318ad822adb7f0398bfe505c730da.tar.gz
pttbbs-8d6ea9a5ef7318ad822adb7f0398bfe505c730da.tar.bz2
pttbbs-8d6ea9a5ef7318ad822adb7f0398bfe505c730da.tar.lz
pttbbs-8d6ea9a5ef7318ad822adb7f0398bfe505c730da.tar.xz
pttbbs-8d6ea9a5ef7318ad822adb7f0398bfe505c730da.tar.zst
pttbbs-8d6ea9a5ef7318ad822adb7f0398bfe505c730da.zip
use assess if defined ASSESS
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1266 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd')
-rw-r--r--mbbsd/assess.c2
-rw-r--r--mbbsd/bbs.c7
-rw-r--r--mbbsd/talk.c6
3 files changed, 15 insertions, 0 deletions
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]);