From 8fdc260eb36e797aa0c8efa5daf0cd13ba1c1d9a Mon Sep 17 00:00:00 2001 From: wens Date: Mon, 20 Dec 2004 08:05:55 +0000 Subject: add function for BMs to choose default save method git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2382 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- include/pttstruct.h | 1 + mbbsd/bbs.c | 32 ++++++++++++++++++++++++++++++-- 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/include/pttstruct.h b/include/pttstruct.h index 0fdc8921..fd1acece 100644 --- a/include/pttstruct.h +++ b/include/pttstruct.h @@ -204,6 +204,7 @@ typedef struct boardheader_t { #define BRD_BMCOUNT 000040000 /* 板主設定列入記錄 */ #define BRD_SYMBOLIC 000100000 /* symbolic link to board */ #define BRD_NOBOO 000200000 /* 不可噓 */ +#define BRD_LOCALSAVE 000400000 /* 預設 Local Save */ #define BRD_LINK_TARGET(x) ((x)->postexpire) #define GROUPOP() (currmode & MODE_GROUPOP) diff --git a/mbbsd/bbs.c b/mbbsd/bbs.c index a0391bdd..adbcdde8 100644 --- a/mbbsd/bbs.c +++ b/mbbsd/bbs.c @@ -610,7 +610,8 @@ do_general(int isbid) curredit &= ~EDIT_ITEM; setutmpmode(POSTING); /* 未具備 Internet 權限者,只能在站內發表文章 */ - if (HAS_PERM(PERM_INTERNET)) + /* 板主預設站內存檔 */ + if (HAS_PERM(PERM_INTERNET) && !(bp->brdattr & BRD_LOCALSAVE)) local_article = 0; else local_article = 1; @@ -2348,6 +2349,33 @@ change_counting(int ent, fileheader_t * fhdr, char *direct) #endif +/** + * 改變目前所在板文章的預設儲存方式 + */ +static int +change_localsave(int ent, fileheader_t * fhdr, char *direct) +{ + boardheader_t *bp; + if (!((currmode & MODE_BOARD) || HAS_PERM(PERM_SYSOP))) + return DONOTHING; + + bp = getbcache(currbid); + if (bp->brdattr & BRD_LOCALSAVE) { + if (getans("目前板預設站內存檔, 要改變嘛(y/N)?") != 'y') + return FULLUPDATE; + bp->brdattr &= ~BRD_LOCALSAVE; + outs("文章預設轉出,請有所節制。\n"); + } else { + if (getans("目前板預設站際存檔, 要改變嘛(y/N)?") != 'y') + return FULLUPDATE; + bp->brdattr |= BRD_LOCALSAVE; + outs("文章預設不轉出,轉信要自行選擇喔。\n"); + } + substitute_record(fn_board, bp, sizeof(boardheader_t), currbid); + pressanykey(); + return FULLUPDATE; +} + /* ----------------------------------------------------- */ /* 看板功能表 */ /* ----------------------------------------------------- */ @@ -2384,7 +2412,7 @@ const onekey_t read_comms[] = { NULL, // Ctrl('U') do_post_vote, // Ctrl('V') whereami, // Ctrl('W') - NULL, // Ctrl('X') + change_localsave, // Ctrl('X') NULL, // Ctrl('Y') push_bottom, // Ctrl('Z') 26 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, -- cgit v1.2.3