From 3217095b1f68b1beb329d89a31d7bf11e75b1c1d Mon Sep 17 00:00:00 2001 From: piaip Date: Mon, 25 Feb 2008 16:51:07 +0000 Subject: - b_config: prompt fine-tune, reducing unnecessary messages git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3949 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- mbbsd/board.c | 70 +++++++++++++++++++++++++++++++++++------------------------ 1 file changed, 42 insertions(+), 28 deletions(-) diff --git a/mbbsd/board.c b/mbbsd/board.c index c87a968d..f8f9952c 100644 --- a/mbbsd/board.c +++ b/mbbsd/board.c @@ -407,35 +407,48 @@ b_config(void) #define POSTRESTRICTION(msg,utag) \ prints(msg, attr ? ANSI_COLOR(1) : "", i, attr ? ANSI_RESET : "") - move_ansi(ipostres++, COLPOSTRES); - i = (int)bp->post_limit_logins * 10; - attr = (cuser.numlogins < i) ? 1 : 0; - if (attr) outs(ANSI_COLOR(31)); - prints("Ω计 %d Ω", i); - if (attr) outs(ANSI_RESET); - - move_ansi(ipostres++, COLPOSTRES); - i = (int)bp->post_limit_posts * 10; - attr = (cuser.numposts < i) ? 1 : 0; - if (attr) outs(ANSI_COLOR(31)); - prints("ゅ彻絞计 %d 絞", i); - if (attr) outs(ANSI_RESET); - - move_ansi(ipostres++, COLPOSTRES); - i = bp->post_limit_regtime; - attr = (cuser.firstlogin > - (now - (time4_t)bp->post_limit_regtime * 2592000)) ? 1 : 0; - if (attr) outs(ANSI_COLOR(31)); - prints("爹丁 %d る",i); - if (attr) outs(ANSI_RESET); - - move_ansi(ipostres++, COLPOSTRES); - i = 255 - bp->post_limit_badpost; - attr = (cuser.badpost > i) ? 1 : 0; - if (attr) outs(ANSI_COLOR(31)); - prints("ゅ絞计 %d 絞", i); - if (attr) outs(ANSI_RESET); + if (bp->post_limit_logins) + { + move_ansi(ipostres++, COLPOSTRES); + i = (int)bp->post_limit_logins * 10; + attr = (cuser.numlogins < i) ? 1 : 0; + if (attr) outs(ANSI_COLOR(31)); + prints("Ω计 %d Ω", i); + if (attr) outs(ANSI_RESET); + } + + if (bp->post_limit_posts) + { + move_ansi(ipostres++, COLPOSTRES); + i = (int)bp->post_limit_posts * 10; + attr = (cuser.numposts < i) ? 1 : 0; + if (attr) outs(ANSI_COLOR(31)); + prints("ゅ彻絞计 %d 絞", i); + if (attr) outs(ANSI_RESET); + } + + if (bp->post_limit_regtime) + { + move_ansi(ipostres++, COLPOSTRES); + i = bp->post_limit_regtime; + attr = (cuser.firstlogin > + (now - (time4_t)bp->post_limit_regtime * 2592000)) ? 1 : 0; + if (attr) outs(ANSI_COLOR(31)); + prints("爹丁 %d る",i); + if (attr) outs(ANSI_RESET); + } + + // if (bp->post_limit_badpost) + { + move_ansi(ipostres++, COLPOSTRES); + i = 255 - bp->post_limit_badpost; + attr = (cuser.badpost > i) ? 1 : 0; + if (attr) outs(ANSI_COLOR(31)); + prints("ゅ絞计 %d 絞", i); + if (attr) outs(ANSI_RESET); + } + if (!CheckPostPerm()) { const char *msg = postperm_msg(bp->brdname); if (msg) // some reasons @@ -447,6 +460,7 @@ b_config(void) } } + // show BM commands { const char *aCat = ANSI_COLOR(1;32); const char *aHot = ANSI_COLOR(1;36); -- cgit v1.2.3