summaryrefslogtreecommitdiffstats
path: root/mbbsd
diff options
context:
space:
mode:
authorpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2008-03-25 23:06:25 +0800
committerpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2008-03-25 23:06:25 +0800
commit212bdcdaf3069d8aac268441352eb4dc69f87583 (patch)
tree62e9262b2de2310831d977ffe123fe6e76d7686c /mbbsd
parentbd379500e396078f3f8ebe443e1fa1f28443b2bf (diff)
downloadpttbbs-212bdcdaf3069d8aac268441352eb4dc69f87583.tar
pttbbs-212bdcdaf3069d8aac268441352eb4dc69f87583.tar.gz
pttbbs-212bdcdaf3069d8aac268441352eb4dc69f87583.tar.bz2
pttbbs-212bdcdaf3069d8aac268441352eb4dc69f87583.tar.lz
pttbbs-212bdcdaf3069d8aac268441352eb4dc69f87583.tar.xz
pttbbs-212bdcdaf3069d8aac268441352eb4dc69f87583.tar.zst
pttbbs-212bdcdaf3069d8aac268441352eb4dc69f87583.zip
- refine board_config display (prevent garbage restriction display)
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@4019 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd')
-rw-r--r--mbbsd/board.c23
1 files changed, 19 insertions, 4 deletions
diff --git a/mbbsd/board.c b/mbbsd/board.c
index f5cfe0de..b8d2ce01 100644
--- a/mbbsd/board.c
+++ b/mbbsd/board.c
@@ -278,6 +278,10 @@ b_config(void)
bp = getbcache(currbid);
int i = 0, attr = 0, ipostres;
char isBM = (currmode & MODE_BOARD) || HasUserPerm(PERM_SYSOP);
+ // perm cache
+ char hasres = 0,
+ cachePostPerm = CheckPostPerm(),
+ cachePostRes = CheckPostRestriction(currbid);
#define LNBOARDINFO (17)
#define LNPOSTRES (12)
@@ -297,6 +301,7 @@ b_config(void)
// better not: l 0
while(!finished) {
+
move(ytitle-1, 0); clrtobot();
// outs(MSG_SEPERATOR); // deprecated by grayout
move(ytitle, 0);
@@ -398,11 +403,11 @@ b_config(void)
ipostres = b_lines - LNPOSTRES;
move_ansi(ipostres++, COLPOSTRES-2);
- if (CheckPostPerm() && CheckPostRestriction(currbid))
+ if (cachePostPerm && cachePostRes)
outs(ANSI_COLOR(1;32));
else
outs(ANSI_COLOR(1;31));
- outs("發文與推文限制" ANSI_RESET);
+ outs("發文與推文限制:" ANSI_RESET);
#define POSTRESTRICTION(msg,utag) \
prints(msg, attr ? ANSI_COLOR(1) : "", i, attr ? ANSI_RESET : "")
@@ -415,6 +420,7 @@ b_config(void)
if (attr) outs(ANSI_COLOR(31));
prints("上站次數 %d 次以上", i);
if (attr) outs(ANSI_RESET);
+ hasres = 1;
}
if (bp->post_limit_posts)
@@ -425,6 +431,7 @@ b_config(void)
if (attr) outs(ANSI_COLOR(31));
prints("文章篇數 %d 篇以上", i);
if (attr) outs(ANSI_RESET);
+ hasres = 1;
}
if (bp->post_limit_regtime)
@@ -436,9 +443,10 @@ b_config(void)
if (attr) outs(ANSI_COLOR(31));
prints("註冊時間 %d 個月以上",i);
if (attr) outs(ANSI_RESET);
+ hasres = 1;
}
- // if (bp->post_limit_badpost)
+ if (bp->post_limit_badpost)
{
move_ansi(ipostres++, COLPOSTRES);
i = 255 - bp->post_limit_badpost;
@@ -446,9 +454,10 @@ b_config(void)
if (attr) outs(ANSI_COLOR(31));
prints("劣文篇數 %d 篇以下", i);
if (attr) outs(ANSI_RESET);
+ hasres = 1;
}
- if (!CheckPostPerm())
+ if (!cachePostPerm)
{
const char *msg = postperm_msg(bp->brdname);
if (msg) // some reasons
@@ -458,6 +467,12 @@ b_config(void)
outs(msg);
outs(ANSI_RESET);
}
+ }
+
+ if (!hasres && cachePostPerm)
+ {
+ move_ansi(ipostres++, COLPOSTRES);
+ outs("無特別限制");
}
// show BM commands