diff options
author | in2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2002-11-07 17:13:24 +0800 |
---|---|---|
committer | in2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2002-11-07 17:13:24 +0800 |
commit | 2fe339599a7c3955298d7eba2e83ec710ae0299a (patch) | |
tree | 5be8f478952c6536b5e29b3d6167b659d5c9f057 | |
parent | 3135cf3e37a4b5fbd7b7b4e7a67b66c47d0e1e3a (diff) | |
download | pttbbs-2fe339599a7c3955298d7eba2e83ec710ae0299a.tar pttbbs-2fe339599a7c3955298d7eba2e83ec710ae0299a.tar.gz pttbbs-2fe339599a7c3955298d7eba2e83ec710ae0299a.tar.bz2 pttbbs-2fe339599a7c3955298d7eba2e83ec710ae0299a.tar.lz pttbbs-2fe339599a7c3955298d7eba2e83ec710ae0299a.tar.xz pttbbs-2fe339599a7c3955298d7eba2e83ec710ae0299a.tar.zst pttbbs-2fe339599a7c3955298d7eba2e83ec710ae0299a.zip |
BRD_NORECOMMEND
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@559 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r-- | include/common.h | 13 | ||||
-rw-r--r-- | include/pttstruct.h | 27 | ||||
-rw-r--r-- | mbbsd/bbs.c | 93 | ||||
-rw-r--r-- | mbbsd/var.c | 6 |
4 files changed, 77 insertions, 62 deletions
diff --git a/include/common.h b/include/common.h index 90b4aca1..d70e8b82 100644 --- a/include/common.h +++ b/include/common.h @@ -1,4 +1,4 @@ -/* $Id: common.h,v 1.4 2002/06/22 07:24:47 ptt Exp $ */ +/* $Id: common.h,v 1.5 2002/11/07 09:13:23 in2 Exp $ */ #ifndef INCLUDE_COMMON_H #define INCLUDE_COMMON_H @@ -172,17 +172,6 @@ #define LTR(x) ((x) * 2 + 3) #define CHE(a, b) ((a) | ((b) << 3)) -#define BRD_NOZAP 00001 /* 不可zap */ -#define BRD_NOCOUNT 00002 /* 不列入統計 */ -#define BRD_NOTRAN 00004 /* 不轉信 */ -#define BRD_GROUPBOARD 00010 /* 群組板 */ -#define BRD_HIDE 00020 /* 隱藏板 (看板好友才可看) */ -#define BRD_POSTMASK 00040 /* 限制發表或閱讀 */ -#define BRD_ANONYMOUS 00100 /* 匿名板 */ -#define BRD_DEFAULTANONYMOUS 00200 /* 預設匿名板 */ -#define BRD_BAD 00400 /* 違法改進中看板 */ -#define BRD_VOTEBOARD 01000 /* 連署機看板 */ - #define MAX_MODES 80 #ifndef MIN diff --git a/include/pttstruct.h b/include/pttstruct.h index 56d262e6..7d546415 100644 --- a/include/pttstruct.h +++ b/include/pttstruct.h @@ -1,4 +1,4 @@ -/* $Id: pttstruct.h,v 1.25 2002/07/19 18:01:39 in2 Exp $ */ +/* $Id: pttstruct.h,v 1.26 2002/11/07 09:13:23 in2 Exp $ */ #ifndef INCLUDE_STRUCT_H #define INCLUDE_STRUCT_H @@ -120,18 +120,19 @@ typedef struct boardheader_t { char pad3[84]; } boardheader_t; -#define BRD_NOZAP 00001 /* 不可zap */ -#define BRD_NOCOUNT 00002 /* 不列入統計 */ -#define BRD_NOTRAN 00004 /* 不轉信 */ -#define BRD_GROUPBOARD 00010 /* 群組板 */ -#define BRD_HIDE 00020 /* 隱藏板 (看板好友才可看) */ -#define BRD_POSTMASK 00040 /* 限制發表或閱讀 */ -#define BRD_ANONYMOUS 00100 /* 匿名板? */ -#define BRD_DEFAULTANONYMOUS 00200 /* 預設匿名板 */ -#define BRD_BAD 00400 /* 違法改進中看板 */ -#define BRD_VOTEBOARD 01000 /* 連署機看板 */ -#define BRD_WARNDEL 02000 /* 已警告要廢除的看板 */ -#define BRD_TOP 04000 /* 熱門看板的群組 設群組板才有用*/ +#define BRD_NOZAP 000000001 /* 不可zap */ +#define BRD_NOCOUNT 000000002 /* 不列入統計 */ +#define BRD_NOTRAN 000000004 /* 不轉信 */ +#define BRD_GROUPBOARD 000000010 /* 群組板 */ +#define BRD_HIDE 000000020 /* 隱藏板 (看板好友才可看) */ +#define BRD_POSTMASK 000000040 /* 限制發表或閱讀 */ +#define BRD_ANONYMOUS 000000100 /* 匿名板 */ +#define BRD_DEFAULTANONYMOUS 000000200 /* 預設匿名板 */ +#define BRD_BAD 000000400 /* 違法改進中看板 */ +#define BRD_VOTEBOARD 000001000 /* 連署機看板 */ +#define BRD_WARNEL 000002000 /* 連署機看板 */ +#define BRD_TOP 000004000 /* 熱門看板群組 */ +#define BRD_NORECOMMEND 000010000 /* 不可推薦 */ #define TTLEN 64 /* Length of title */ #define FNLEN 33 /* Length of filename */ diff --git a/mbbsd/bbs.c b/mbbsd/bbs.c index f32f5b91..0c720dda 100644 --- a/mbbsd/bbs.c +++ b/mbbsd/bbs.c @@ -1,4 +1,4 @@ -/* $Id: bbs.c,v 1.71 2002/11/06 16:25:14 in2 Exp $ */ +/* $Id: bbs.c,v 1.72 2002/11/07 09:13:24 in2 Exp $ */ #include "bbs.h" static void @@ -1204,12 +1204,14 @@ recommend(int ent, fileheader_t * fhdr, char *direct) struct tm *ptime = localtime(&now); char buf[200], path[200], yn[5]; boardheader_t *bp; - bp = getbcache(currbid); + bp = getbcache(currbid); + if( bp->brdattr & BRD_NORECOMMEND ){ + vmsg("抱歉, 本板禁止推薦"); + return FULLUPDATE; + } if (!(currmode & MODE_POST) || bp->brdattr & BRD_VOTEBOARD) { - move(b_lines - 1, 0); - prints("您因權限不足無法推薦!"); - pressanykey(); + vmsg("您因權限不足無法推薦!"); return FULLUPDATE; } @@ -1860,6 +1862,28 @@ b_help() return FULLUPDATE; } +static int +b_changerecommend(int ent, fileheader_t * fhdr, char *direct) +{ + boardheader_t bh; + int bid; + if (!((currmode & MODE_BOARD) || HAS_PERM(PERM_SYSOP)) || + currboard[0] == 0 || + (bid = getbnum(currboard)) < 0 || + get_record(fn_board, &bh, sizeof(bh), bid) == -1) + return DONOTHING; + if( bh.brdattr & BRD_NORECOMMEND ) + bh.brdattr -= BRD_NORECOMMEND; + else + bh.brdattr += BRD_NORECOMMEND; + setup_man(&bh); + substitute_record(fn_board, &bh, sizeof(bh), bid); + reset_board(bid); + vmsg("本板現在 %s 推薦", + (bh.brdattr & BRD_NORECOMMEND) ? "禁止" : "開放"); + return FULLUPDATE; +} + /* ----------------------------------------------------- */ /* 板主設定隱形/ 解隱形 */ /* ----------------------------------------------------- */ @@ -1920,49 +1944,50 @@ change_hidden(int ent, fileheader_t * fhdr, char *direct) /* ----------------------------------------------------- */ struct onekey_t read_comms[] = { {KEY_TAB, board_digest}, - {'C', board_etc}, + {'B', bh_title_edit}, {'b', b_notes}, + {'C', board_etc}, {'c', cite_post}, - {'r', read_post}, - {'z', b_man}, {'D', del_range}, - {'S', sequential_read}, + {'d', del_post}, {'E', edit_post}, - {'T', edit_title}, - {'s', do_select}, - {'R', b_results}, - {'V', b_vote}, - {'M', b_vote_maintain}, - {'B', bh_title_edit}, - {'W', b_notes_edit}, - {'O', b_post_note}, - {'K', b_water_edit}, - {'w', b_call_in}, - {'v', visable_list_edit}, - {'i', b_application}, - {'o', can_vote_edit}, - {'x', cross_post}, - {'X', recommend}, - {'Y', recommend_cancel}, - {'h', b_help}, #ifndef NO_GAMBLE {'f', join_gamble}, {'G', hold_gamble}, #endif {'g', good_post}, - {'y', reply_post}, - {'d', del_post}, - {'m', mark_post}, +#ifdef BMCHS + {'H', change_hidden}, +#endif + {'h', b_help}, + {'I', b_changerecommend}, + {'i', b_application}, + {'K', b_water_edit}, {'L', solve_post}, - {Ctrl('P'), do_post}, - {Ctrl('W'), whereami}, + {'M', b_vote_maintain}, + {'m', mark_post}, + {'O', b_post_note}, + {'o', can_vote_edit}, {'Q', view_postmoney}, + {'R', b_results}, + {'r', read_post}, + {'S', sequential_read}, + {'s', do_select}, + {'T', edit_title}, #ifdef OUTJOBSPOOL {'u', tar_addqueue}, #endif -#ifdef BMCHS - {'H', change_hidden}, -#endif + {'V', b_vote}, + {'v', visable_list_edit}, + {'W', b_notes_edit}, + {'w', b_call_in}, + {'X', recommend}, + {'x', cross_post}, + {'Y', recommend_cancel}, + {'y', reply_post}, + {'z', b_man}, + {Ctrl('P'), do_post}, + {Ctrl('W'), whereami}, {'\0', NULL} }; diff --git a/mbbsd/var.c b/mbbsd/var.c index 819be5ba..e7f6996f 100644 --- a/mbbsd/var.c +++ b/mbbsd/var.c @@ -1,4 +1,4 @@ -/* $Id: var.c,v 1.13 2002/09/11 03:22:50 kcwu Exp $ */ +/* $Id: var.c,v 1.14 2002/11/07 09:13:24 in2 Exp $ */ #define INCLUDE_VAR_H #include "bbs.h" @@ -41,7 +41,7 @@ char *str_permboard[] = { "不可 Zap", /* BRD_NOZAP */ "不列入統計", /* BRD_NOCOUNT */ "不轉信", /* BRD_NOTRAN */ - "群組板", /* BRD_GROUP */ + "群組板", /* BRD_GROUPBOARD */ "隱藏板", /* BRD_HIDE */ "限制(不需設定)", /* BRD_POSTMASK */ "匿名板", /* BRD_ANONYMOUS */ @@ -50,7 +50,7 @@ char *str_permboard[] = { "連署專用看板", /* BRD_VOTEBOARD */ "已警告要廢除", /* BRD_WARNEL */ "熱門看板群組", /* BRD_TOP */ - "沒想到", + "不可推薦", /* BRD_NORECOMMEND */ "沒想到", "沒想到", "沒想到", |