From 66906b7799f92c35e5c753d59ccad9f44c7cc134 Mon Sep 17 00:00:00 2001 From: piaip Date: Thu, 13 Feb 2014 03:15:30 +0000 Subject: Move J, W to b_config(i). git-svn-id: http://opensvn.csie.org/pttbbs/trunk@5928 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- pttbbs/mbbsd/bbs.c | 52 +++--------------------------------------- pttbbs/mbbsd/board.c | 64 ++++++++++++++++++++++++++++++++++++++++++++++------ 2 files changed, 60 insertions(+), 56 deletions(-) diff --git a/pttbbs/mbbsd/bbs.c b/pttbbs/mbbsd/bbs.c index a458eeaf..39a81601 100644 --- a/pttbbs/mbbsd/bbs.c +++ b/pttbbs/mbbsd/bbs.c @@ -4062,17 +4062,6 @@ b_note_edit_bname(int bid) return 0; } -static int -b_notes_edit(void) -{ - if (currmode & MODE_BOARD) { - assert(0<=currbid-1 && currbid-1brdattr & BRD_COOLDOWN) { - if (vans("目前降溫中, 要開放嗎(y/N)?") != 'y') - return FULLUPDATE; - bp->brdattr &= ~BRD_COOLDOWN; - outs("大家都可以 post 文章了。\n"); - } else { - getdata(b_lines - 1, 0, "請輸入冷靜理由:", genbuf, 50, DOECHO); - if (vans("要限制 post 頻率, 降溫嗎(y/N)?") != 'y') - return FULLUPDATE; - bp->brdattr |= BRD_COOLDOWN; - outs("開始冷靜。\n"); - } - assert(0<=currbid-1 && currbid-1brdname, NULL, "冷靜", genbuf, bp->brdattr & BRD_COOLDOWN); - pressanykey(); - return FULLUPDATE; -} #endif static int @@ -4559,7 +4517,7 @@ const onekey_t read_comms[] = { { 0, NULL }, { 0, NULL }, { 0, NULL }, { 0, NULL }, { 0, NULL }, { 0, NULL }, { 0, NULL }, { 0, NULL }, { 0, NULL }, // 'A' 65 - { 0, b_moved_to_config }, // 'B' + { 0, NULL }, // 'B' { 1, do_limitedit }, // 'C' { 1, del_range_post }, // 'D' { 1, edit_post }, // 'E' @@ -4567,11 +4525,7 @@ const onekey_t read_comms[] = { { 0, NULL }, // 'G' { 0, NULL }, // 'H' { 0, b_config }, // 'I' -#ifdef USE_COOLDOWN - { 0, change_cooldown }, // 'J' -#else - { 0, NULL }, // 'J' -#endif + { 0, b_moved_to_config }, // 'J' { 0, NULL }, // 'K' { 1, solve_post }, // 'L' { 0, NULL }, // 'M' @@ -4584,7 +4538,7 @@ const onekey_t read_comms[] = { { 1, edit_title }, // 'T' { 1, b_quick_acl }, // 'U' { 0, b_vote }, // 'V' - { 0, b_notes_edit }, // 'W' + { 0, b_moved_to_config }, // 'W' { 1, recommend }, // 'X' { 0, moved_to_ctrl_e }, // 'Y' { 0, NULL }, // 'Z' 90 diff --git a/pttbbs/mbbsd/board.c b/pttbbs/mbbsd/board.c index 665afcab..d368bb96 100644 --- a/pttbbs/mbbsd/board.c +++ b/pttbbs/mbbsd/board.c @@ -311,6 +311,17 @@ b_posttype() return FULLUPDATE; } +static int +b_notes_edit(void) +{ + if (currmode & MODE_BOARD) { + assert(0<=currbid-1 && currbid-1brdname); - move(ytitle +2, 0); + move(ytitle + 2, 0); prints(" "ANSI_COLOR(1;36) "b" ANSI_RESET " - 中文敘述: %s\n", bp->title); prints(" 板主名單: %s\n", does_board_have_public_bm(bp) ? bp->BM : "(無)"); - - outs(" \n"); // at least one character, for move_ansi. - prints( " " ANSI_COLOR(1;36) "h" ANSI_RESET " - 公開狀態(是否隱形): %s " ANSI_RESET "\n", (bp->brdattr & BRD_HIDE) ? @@ -455,6 +469,12 @@ b_config(void) ANSI_COLOR(1)"需要" : "不需" ); #endif +#ifdef USE_COOLDOWN + prints( " " ANSI_COLOR(1;36) "j" ANSI_RESET + " - %s 設為冷靜模式\n", + (bp->brdattr & BRD_COOLDOWN) ? + ANSI_COLOR(1)"已"ANSI_RESET : "未"); +#endif prints( " " ANSI_COLOR(1;36) "L" ANSI_RESET " - 若有轉信則發文時預設 %s " ANSI_RESET "\n", @@ -561,6 +581,9 @@ b_config(void) move_ansi(ipostres++, COLPOSTRES); prints("%sc%s)文章類別 %sn%s)發文注意事項 ", aHot, aRst, aHot, aRst); + move_ansi(ipostres++, COLPOSTRES); + prints("%sp%s)進板畫面", + aHot, aRst); outs(ANSI_RESET); if (GROUPOP()) { @@ -684,6 +707,27 @@ b_config(void) " 注意: 已停止記錄推文IP"); break; +#ifdef USE_COOLDOWN + case 'j': + if (!(HasUserPerm(PERM_SYSOP | PERM_POLICE) || + (HasUserPerm(PERM_SYSSUPERSUBOP) && GROUPOP()))) { + vmsg("此項設定需要站長或看板警察或群組長權限"); + break; + } + { + char ans[50]; + getdata(b_lines - 1, 0, "請輸入理由:", ans, sizeof(ans), DOECHO); + if (!*ans) { + vmsg("未輸入理由,放棄設定。"); + break; + } + bp->brdattr ^= BRD_COOLDOWN; + post_policelog(bp->brdname, NULL, "冷靜", ans, (bp->brdattr & BRD_COOLDOWN)); + touched = 1; + } + break; +#endif + case 'g': #ifndef BMCHS if (!HasUserPerm(PERM_SYSOP)) @@ -785,6 +829,12 @@ b_config(void) clear(); break; + case 'p': + clear(); + b_notes_edit(); + clear(); + break; + case 'c': clear(); b_posttype(); -- cgit v1.2.3