From d8c7f000c0d4db5ede07dbe23acc860c23fc76b8 Mon Sep 17 00:00:00 2001 From: piaip Date: Sun, 16 Dec 2007 14:28:41 +0000 Subject: - move more BM management keys to integrated b_config git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3696 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- mbbsd/bbs.c | 200 ++++------------------------------------------------------ mbbsd/board.c | 197 +++++++++++++++++++++++++++++++++++++++++++++++++++++---- 2 files changed, 199 insertions(+), 198 deletions(-) diff --git a/mbbsd/bbs.c b/mbbsd/bbs.c index 5443770b..0744ad7c 100644 --- a/mbbsd/bbs.c +++ b/mbbsd/bbs.c @@ -1258,57 +1258,6 @@ b_call_in(int ent, const fileheader_t * fhdr, const char *direct) } -static int -b_posttype(int ent, const fileheader_t * fhdr, const char *direct) -{ - boardheader_t *bp; - int i, aborted; - char filepath[PATHLEN], genbuf[60], title[5], posttype_f, posttype[33]=""; - - if(!(currmode & MODE_BOARD)) return DONOTHING; - - assert(0<=currbid-1 && currbid-1posttype_f; - for( i = 0 ; i < 8 ; ++i ){ - move(2,0); - outs("文章種類: "); - strlcpy(genbuf, bp->posttype + i * 4, 5); - sprintf(title, "%d.", i + 1); - if( !getdata_buf(2, 11, title, genbuf, 5, DOECHO) ) - break; - sprintf(posttype + i * 4, "%-4.4s", genbuf); - if( posttype_f & (1<brdname, "postsample", i); - aborted = vedit(filepath, NA, NULL); - if (aborted == -1) { - clear(); - posttype_f &= ~(1<posttype_f = posttype_f; - strlcpy(bp->posttype, posttype, sizeof(bp->posttype)); /* 這邊應該要防race condition */ - - assert(0<=currbid-1 && currbid-1brdattr & BRD_HIDE) && (bp->brdattr & BRD_POSTMASK))) { - if (getans("目前看板隱形中, 要解除嗎(y/N)?") != 'y') - return FULLUPDATE; - bp->brdattr &= ~BRD_HIDE; - bp->brdattr &= ~BRD_POSTMASK; - outs("君心今傳眾人,無處不聞弦歌。\n"); - board_hidden_status = 0; - hbflreload(currbid); - } else { - if (getans("要設定看板為隱形嗎(y/N)?") != 'y') - return FULLUPDATE; - bp->brdattr |= BRD_HIDE; - bp->brdattr |= BRD_POSTMASK; - outs("君心今已掩抑,惟盼善自珍重。\n"); - board_hidden_status = 1; - } - assert(0<=currbid-1 && currbid-1brdname); - pressanykey(); - return FULLUPDATE; -} - -static int -change_counting(void) -{ - - boardheader_t *bp; - if (!((currmode & MODE_BOARD) || HasUserPerm(PERM_SYSOP))) - return DONOTHING; - - bp = getbcache(currbid); - if (!(bp->brdattr & BRD_HIDE && bp->brdattr & BRD_POSTMASK)) - return FULLUPDATE; - - if (bp->brdattr & BRD_BMCOUNT) { - if (getans("目前板列入十大排行, 要取消列入十大排行嘛(Y/N)?[N]") != 'y') - return FULLUPDATE; - bp->brdattr &= ~BRD_BMCOUNT; - outs("你再灌水也不會有十大的呀。\n"); - } else { - if (getans("目前看板不列入十大排行, 要列入十大嘛(Y/N)?[N]") != 'y') - return FULLUPDATE; - bp->brdattr |= BRD_BMCOUNT; - outs("快灌水衝十大第一吧。\n"); - } - assert(0<=currbid-1 && currbid-1posttype_f; + for( i = 0 ; i < 8 ; ++i ){ + move(2,0); + outs("文章種類: "); + strlcpy(genbuf, bp->posttype + i * 4, 5); + sprintf(title, "%d.", i + 1); + if( !getdata_buf(2, 11, title, genbuf, 5, DOECHO) ) + break; + sprintf(posttype + i * 4, "%-4.4s", genbuf); + if( posttype_f & (1<brdname, "postsample", i); + aborted = vedit(filepath, NA, NULL); + if (aborted == -1) { + clear(); + posttype_f &= ~(1<posttype_f = posttype_f; + strlcpy(bp->posttype, posttype, sizeof(bp->posttype)); /* 這邊應該要防race condition */ + + assert(0<=currbid-1 && currbid-1brdname); outs(" 看板設定"); - i = t_columns - strlen(bp->brdname) - strlen(" 看板設定") - 2; - for (; i>0; i--) - outc(' '); - outs(ANSI_RESET); - - // TODO report board level for posting while(!finished) { + move(ytitle-1, 0); clrtobot(); + // outs(MSG_SEPERATOR); // deprecated by grayout + move(ytitle, 0); + outs(ANSI_COLOR(7) " " ); outs(bp->brdname); outs(" 看板設定"); + i = t_columns - strlen(bp->brdname) - strlen(" 看板設定") - 2; + for (; i>0; i--) + outc(' '); + outs(ANSI_RESET); + move(ytitle +2, 0); clrtobot(); @@ -223,6 +329,12 @@ b_config(void) (bp->brdattr & BRD_HIDE) ? ANSI_COLOR(1)"隱形":"公開"); + prints( " " ANSI_COLOR(1;36) "g" ANSI_RESET + " - 隱板時 %s 進入十大排行榜" ANSI_RESET "\n", + (bp->brdattr & BRD_BMCOUNT) ? + ANSI_COLOR(1)"可以" ANSI_RESET: + "不可"); + prints( " " ANSI_COLOR(1;36) "r" ANSI_RESET " - %s " ANSI_RESET "推薦文章\n", (bp->brdattr & BRD_NORECOMMEND) ? @@ -293,6 +405,13 @@ b_config(void) (bp->brdattr & BRD_RESTRICTEDPOST) ? ANSI_COLOR(1)"只有板友才可發文" : "無特別設定" ); + prints("\n " ANSI_COLOR(1;32) "名單編輯與其它:" ANSI_RESET " " + ANSI_COLOR(1;36) "v" ANSI_RESET ")可見名單 " + ANSI_COLOR(1;36) "w" ANSI_RESET ")水桶名單 " + ANSI_COLOR(1;36) "n" ANSI_RESET ")發文注意事項 " + ANSI_COLOR(1;36) "c" ANSI_RESET ")文章類別 " + "\n"); + ipostres = b_lines - LNPOSTRES; move_ansi(ipostres++, COLPOSTRES-2); prints("發文限制"); @@ -384,10 +503,25 @@ b_config(void) { bp->brdattr &= ~BRD_HIDE; bp->brdattr &= ~BRD_POSTMASK; + board_hidden_status = 0; + hbflreload(currbid); } else { bp->brdattr |= BRD_HIDE; bp->brdattr |= BRD_POSTMASK; + board_hidden_status = 1; + } + touched = 1; + break; + + case 'g': +#ifndef BMCHS + if (!HasUserPerm(PERM_SYSOP)) + { + vmsg("此項設定需要站長權限"); + break; } +#endif + bp->brdattr ^= BRD_BMCOUNT; touched = 1; break; @@ -445,6 +579,46 @@ b_config(void) touched = 1; break; + case 'v': + if (currmode & MODE_BOARD) + { + b_visible_edit(); + clear(); + } else { + vmsg("此項設定需要板主權限"); + } + break; + + case 'w': + if (currmode & MODE_BOARD) + { + b_water_edit(); + clear(); + } else { + vmsg("此項設定需要板主權限"); + } + break; + + case 'n': + if (currmode & MODE_BOARD) + { + b_post_note(); + clear(); + } else { + vmsg("此項設定需要板主權限"); + } + break; + + case 'c': + if (currmode & MODE_BOARD) + { + b_posttype(); + clear(); + } else { + vmsg("此項設定需要板主權限"); + } + break; + case 'y': if (!(HasUserPerm(PERM_SYSOP) || (HasUserPerm(PERM_SYSSUPERSUBOP) && GROUPOP()) ) ) { vmsg("此項設定需要群組長或站長權限"); @@ -463,6 +637,7 @@ b_config(void) { assert(0<=currbid-1 && currbid-1brdname); vmsg("已儲存新設定"); } else -- cgit v1.2.3