summaryrefslogtreecommitdiffstats
path: root/mbbsd
diff options
context:
space:
mode:
authorpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2008-06-04 10:09:56 +0800
committerpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2008-06-04 10:09:56 +0800
commitf4c8261b0d953bf77efe165ad4ad511191447d13 (patch)
treee3dd1b8ccc4faf07caf5ba201d78fca5bc4044cf /mbbsd
parent5c3861dac3f16ff361b816a5a6b7b092a7b76ca5 (diff)
downloadpttbbs-f4c8261b0d953bf77efe165ad4ad511191447d13.tar
pttbbs-f4c8261b0d953bf77efe165ad4ad511191447d13.tar.gz
pttbbs-f4c8261b0d953bf77efe165ad4ad511191447d13.tar.bz2
pttbbs-f4c8261b0d953bf77efe165ad4ad511191447d13.tar.lz
pttbbs-f4c8261b0d953bf77efe165ad4ad511191447d13.tar.xz
pttbbs-f4c8261b0d953bf77efe165ad4ad511191447d13.tar.zst
pttbbs-f4c8261b0d953bf77efe165ad4ad511191447d13.zip
- board: show vote limitation for VOTE_BOARDs.
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@4337 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd')
-rw-r--r--mbbsd/board.c37
1 files changed, 27 insertions, 10 deletions
diff --git a/mbbsd/board.c b/mbbsd/board.c
index e0f6dae7..57ff1e8b 100644
--- a/mbbsd/board.c
+++ b/mbbsd/board.c
@@ -311,6 +311,11 @@ b_config(void)
#define CANTPOSTMSG ANSI_COLOR(1;31) "(您未達限制)" ANSI_RESET
while(!finished) {
+ // limits
+ uint8_t llogin = bp->post_limit_logins,
+ lpost = bp->post_limit_posts,
+ lreg = bp->post_limit_regtime,
+ lbp = bp->post_limit_badpost;
move(ytitle-1, 0); clrtobot();
// outs(MSG_SEPERATOR); // deprecated by grayout
@@ -425,15 +430,27 @@ b_config(void)
outs(ANSI_COLOR(1;32));
else
outs(ANSI_COLOR(31));
- outs("發文與推文限制:" ANSI_RESET);
+
+ if (bp->brdattr & BRD_VOTEBOARD)
+ outs("提出連署限制:" ANSI_RESET);
+ else
+ outs("發文與推文限制:" ANSI_RESET);
#define POSTRESTRICTION(msg,utag) \
prints(msg, attr ? ANSI_COLOR(1) : "", i, attr ? ANSI_RESET : "")
- if (bp->post_limit_logins)
+ if (bp->brdattr & BRD_VOTEBOARD)
+ {
+ llogin = bp->vote_limit_logins;
+ lpost = bp->vote_limit_posts;
+ lreg = bp->vote_limit_regtime;
+ lbp = bp->vote_limit_badpost;
+ }
+
+ if (llogin)
{
move_ansi(ipostres++, COLPOSTRES);
- i = (int)bp->post_limit_logins * 10;
+ i = (int)llogin * 10;
attr = (cuser.numlogins < i) ? 1 : 0;
if (attr) outs(ANSI_COLOR(1;31));
prints("上站次數 %d 次以上", i);
@@ -441,10 +458,10 @@ b_config(void)
hasres = 1;
}
- if (bp->post_limit_posts)
+ if (lpost)
{
move_ansi(ipostres++, COLPOSTRES);
- i = (int)bp->post_limit_posts * 10;
+ i = (int)lpost * 10;
attr = (cuser.numposts < i) ? 1 : 0;
if (attr) outs(ANSI_COLOR(1;31));
prints("文章篇數 %d 篇以上", i);
@@ -452,12 +469,12 @@ b_config(void)
hasres = 1;
}
- if (bp->post_limit_regtime)
+ if (lreg)
{
move_ansi(ipostres++, COLPOSTRES);
- i = bp->post_limit_regtime;
+ i = lreg;
attr = (cuser.firstlogin >
- (now - (time4_t)bp->post_limit_regtime * MONTH_SECONDS)) ? 1 : 0;
+ (now - (time4_t)lreg * MONTH_SECONDS)) ? 1 : 0;
if (attr) outs(ANSI_COLOR(1;31));
outs("註冊時間 ");
if (i < 5)
@@ -468,10 +485,10 @@ b_config(void)
hasres = 1;
}
- if (bp->post_limit_badpost)
+ if (lbp)
{
move_ansi(ipostres++, COLPOSTRES);
- i = 255 - bp->post_limit_badpost;
+ i = 255 - lbp;
attr = (cuser.badpost > i) ? 1 : 0;
if (attr) outs(ANSI_COLOR(1;31));
prints("劣文篇數 %d 篇以下", i);