diff options
-rw-r--r-- | pttbbs/mbbsd/assess.c | 4 | ||||
-rw-r--r-- | pttbbs/mbbsd/bbs.c | 14 | ||||
-rw-r--r-- | pttbbs/mbbsd/board.c | 12 |
3 files changed, 14 insertions, 16 deletions
diff --git a/pttbbs/mbbsd/assess.c b/pttbbs/mbbsd/assess.c index e2efc168..be1633d6 100644 --- a/pttbbs/mbbsd/assess.c +++ b/pttbbs/mbbsd/assess.c @@ -98,9 +98,9 @@ int assign_badpost(const char *userid, fileheader_t *fhdr, if (!(inc_badpost(userid, 1) % 5)){ userec_t xuser; - post_violatelaw(userid, BBSMNAME " 系統警察", + post_violatelaw(userid, BBSMNAME "系統警察", "劣文累計 5 篇", "罰單一張"); - mail_violatelaw(userid, BBSMNAME " 系統警察", + mail_violatelaw(userid, BBSMNAME "系統警察", "劣文累計 5 篇", "罰單一張"); kick_all(userid); passwd_sync_query(tusernum, &xuser); diff --git a/pttbbs/mbbsd/bbs.c b/pttbbs/mbbsd/bbs.c index 65a7d641..a199c691 100644 --- a/pttbbs/mbbsd/bbs.c +++ b/pttbbs/mbbsd/bbs.c @@ -537,17 +537,19 @@ readtitle(void) outs("[←]離開 [→]閱\讀 [Ctrl-P]發表文章 [d]刪除 [z]精華區 [i]看板資訊/設定 [h]說明\n"); buf[0] = 0; -#ifdef DISABLE_HIDDEN_BOARD_POPULARITY - if (bp->brdattr & BRD_HIDE) - snprintf(buf, sizeof(buf), "[隱板]"); - else -#endif #ifdef USE_COOLDOWN if (bp->brdattr & BRD_COOLDOWN) snprintf(buf, sizeof(buf), "[靜]"); else #endif - snprintf(buf, sizeof(buf), "人氣:%d ", SHM->bcache[currbid - 1].nuser); + { + // nuser is not real-time updated (maintained by utmpsort), so let's + // make some calibration here. It's minimal value is one because the + // user IS reading it. + int nuser = SHM->bcache[currbid - 1].nuser; + if (nuser < 1) nuser = 1; + snprintf(buf, sizeof(buf), "人氣:%d ", nuser); + } vbarf(ANSI_REVERSE " 編號 %s 作 者 文 章 標 題\t%s ", IS_LISTING_MONEY ? listmode_desc[LISTMODE_MONEY] : listmode_desc[currlistmode], diff --git a/pttbbs/mbbsd/board.c b/pttbbs/mbbsd/board.c index 4d1da191..5b684975 100644 --- a/pttbbs/mbbsd/board.c +++ b/pttbbs/mbbsd/board.c @@ -1409,15 +1409,11 @@ show_brdlist(int head, int clsflag, int newflag) #ifdef USE_COOLDOWN if (B_BH(ptr)->brdattr & BRD_COOLDOWN) -#else - if (0) -#endif - outs("靜 "); -#ifdef DISABLE_HIDDEN_BOARD_POPULARITY - else if (B_BH(ptr)->brdattr & BRD_HIDE) - outs(" "); #endif - else if (B_BH(ptr)->nuser <= 0) + outs("靜 "); + // since nuser is not updated in-time, '1' may be caused by + // user who just left board. + else if (B_BH(ptr)->nuser <= 1) prints(" %c ", B_BH(ptr)->bvote ? 'V' : ' '); else if (B_BH(ptr)->nuser <= 10) prints("%2d ", B_BH(ptr)->nuser); |