From 593f3986b4567c32c2949bfe7de60a21d092be77 Mon Sep 17 00:00:00 2001 From: piaip Date: Mon, 31 Mar 2008 09:00:56 +0000 Subject: - (internal) change GLOBAL_* to BN_* WARNING: PLEASE MANUALLY UPDATE pttbbs.conf!! git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@4051 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- UPDATING | 3 +++ include/config.h | 40 +++++++++++++++++------------------ mbbsd/admin.c | 6 +++--- mbbsd/announce.c | 16 +++++++------- mbbsd/assess.c | 2 +- mbbsd/bbs.c | 62 +++++++++++++++++++++++++++--------------------------- mbbsd/bbslua.c | 6 +++--- mbbsd/cache.c | 6 +++--- mbbsd/chc.c | 4 ++-- mbbsd/chicken.c | 2 +- mbbsd/edit.c | 2 +- mbbsd/fav.c | 16 +++++++------- mbbsd/gamble.c | 6 +++--- mbbsd/go.c | 4 ++-- mbbsd/gomo.c | 4 ++-- mbbsd/mail.c | 2 +- mbbsd/mbbsd.c | 4 ++-- mbbsd/more.c | 6 +++--- mbbsd/read.c | 2 +- mbbsd/register.c | 2 +- mbbsd/reversi.c | 4 ++-- mbbsd/syspost.c | 2 +- mbbsd/talk.c | 4 ++-- mbbsd/user.c | 12 +++++------ sample/pttbbs.conf | 34 +++++++++++++++--------------- util/initbbs.c | 10 ++++----- 26 files changed, 132 insertions(+), 129 deletions(-) diff --git a/UPDATING b/UPDATING index 9d78ac6b..cafb05e0 100644 --- a/UPDATING +++ b/UPDATING @@ -14,6 +14,9 @@ $Id$ https://opensvn.csie.org/traccgi/pttbbs/changeset/2273 ----------------------------------------------------------------------------- +r4051: [CONF] +所有的 GLOBAL_* 板名定義現全改為 BN_* +請記得更新你的 pttbbs.conf r4035: [REGISTER] 註冊系統導入 Regform v2, 請用 upgrade/r4035_regnew 轉移已填註冊單。 diff --git a/include/config.h b/include/config.h index 28b547a1..694a2e4f 100644 --- a/include/config.h +++ b/include/config.h @@ -37,40 +37,40 @@ #endif /* Default Board Names */ -#ifndef GLOBAL_BUGREPORT -#define GLOBAL_BUGREPORT "SYSOP" +#ifndef BN_BUGREPORT +#define BN_BUGREPORT "SYSOP" #endif -#ifndef GLOBAL_SYSOP -#define GLOBAL_SYSOP "SYSOP" +#ifndef BN_SYSOP +#define BN_SYSOP "SYSOP" #endif -#ifndef GLOBAL_LAW -#define GLOBAL_LAW BBSMNAME "Law" +#ifndef BN_LAW +#define BN_LAW BBSMNAME "Law" #endif -#ifndef GLOBAL_NEWBIE -#define GLOBAL_NEWBIE BBSMNAME "Newhand" +#ifndef BN_NEWBIE +#define BN_NEWBIE BBSMNAME "Newhand" #endif -#ifndef GLOBAL_TEST -#define GLOBAL_TEST "Test" +#ifndef BN_TEST +#define BN_TEST "Test" #endif -#ifndef GLOBAL_NOTE -#define GLOBAL_NOTE "Note" +#ifndef BN_NOTE +#define BN_NOTE "Note" #endif -#ifndef GLOBAL_SECURITY -#define GLOBAL_SECURITY "Security" +#ifndef BN_SECURITY +#define BN_SECURITY "Security" #endif -#ifndef GLOBAL_RECORD -#define GLOBAL_RECORD "Record" +#ifndef BN_RECORD +#define BN_RECORD "Record" #endif -#ifndef GLOBAL_FOREIGN -#define GLOBAL_FOREIGN BBSMNAME "Foreign" +#ifndef BN_FOREIGN +#define BN_FOREIGN BBSMNAME "Foreign" #endif /* Environment */ @@ -298,8 +298,8 @@ #define CHAT_LOGIN_BOGUS "BG" #define BADCIDCHARS " *" /* Chat Room 中禁用於 nick 的字元 */ -#define ALLPOST "ALLPOST" -#define ALLHIDPOST "ALLHIDPOST" +#define BN_ALLPOST "ALLPOST" +#define BN_ALLHIDPOST "ALLHIDPOST" #define MAXTAGS 255 #define WRAPMARGIN (511) diff --git a/mbbsd/admin.c b/mbbsd/admin.c index a69776c2..b0695b3b 100644 --- a/mbbsd/admin.c +++ b/mbbsd/admin.c @@ -569,7 +569,7 @@ m_mod_board(char *bname) memset(&bh, 0, sizeof(bh)); snprintf(bh.title, sizeof(bh.title), " %s 看板 %s 刪除", bname, cuser.userid); - post_msg(GLOBAL_SECURITY, bh.title, "請注意刪除的合法性", "[系統安全局]"); + post_msg(BN_SECURITY, bh.title, "請注意刪除的合法性", "[系統安全局]"); assert(0<=bid-1 && bid-1 %s\n" "板主: %s => %s\n", bh.brdname, newbh.brdname, bh.BM, newbh.BM); - post_msg(GLOBAL_SECURITY, buf, genbuf, "[系統安全局]"); + post_msg(BN_SECURITY, buf, genbuf, "[系統安全局]"); } } return 0; @@ -1167,7 +1167,7 @@ give_money(void) fclose(fp2); sprintf(buf, "%s 紅包機: %s", cuser.userid, reason); - post_file(GLOBAL_SECURITY, buf, "etc/givemoney.log", "[紅包機報告]"); + post_file(BN_SECURITY, buf, "etc/givemoney.log", "[紅包機報告]"); pressanykey(); return FULLUPDATE; } diff --git a/mbbsd/announce.c b/mbbsd/announce.c index fb7db427..29d51b14 100644 --- a/mbbsd/announce.c +++ b/mbbsd/announce.c @@ -440,15 +440,15 @@ a_newitem(menu_t * pm, int mode) case ADDITEM: { int edflags = 0; -# ifdef GLOBAL_BBSMOVIE +# ifdef BN_BBSMOVIE if (pm && pm->bid && strcmp(getbcache(pm->bid)->brdname, - GLOBAL_BBSMOVIE) == 0) + BN_BBSMOVIE) == 0) { edflags |= EDITFLAG_UPLOAD; edflags |= EDITFLAG_ALLOWLARGE; } -# endif // GLOBAL_BBSMOVIE +# endif // BN_BBSMOVIE if (vedit2(fpath, 0, NULL, edflags) == -1) { unlink(fpath); pressanykey(); @@ -663,7 +663,7 @@ a_pastetagpost(menu_t * pm, int mode) if (tagnum > MAXTAGS || tagnum < 0) { vmsg("內部錯誤。請把你剛剛進行的完整步驟貼到 " - GLOBAL_BUGREPORT " 板。"); + BN_BUGREPORT " 板。"); return ans; } @@ -688,7 +688,7 @@ a_pastetagpost(menu_t * pm, int mode) grayout(0, b_lines-2, GRAYOUT_DARK); move(b_lines-1, 0); clrtobot(); prints("第 %d 項處理發生錯誤。 請把你剛剛進行的完整步驟貼到 " - GLOBAL_BUGREPORT " 板。\n", ent); + BN_BUGREPORT " 板。\n", ent); vmsg("忽略錯誤並繼續進行。"); continue; } @@ -1154,14 +1154,14 @@ a_menu(const char *maintitle, const char *path, int edflags = 0; *quote_file = 0; -# ifdef GLOBAL_BBSMOVIE +# ifdef BN_BBSMOVIE if (me.bid && strcmp(getbcache(me.bid)->brdname, - GLOBAL_BBSMOVIE) == 0) + BN_BBSMOVIE) == 0) { edflags |= EDITFLAG_UPLOAD; edflags |= EDITFLAG_ALLOWLARGE; } -# endif // GLOBAL_BBSMOVIE +# endif // BN_BBSMOVIE if (vedit2(fname, NA, NULL, edflags) != -1) { char fpath[PATHLEN]; diff --git a/mbbsd/assess.c b/mbbsd/assess.c index 4d63a8d8..c1bb90ed 100644 --- a/mbbsd/assess.c +++ b/mbbsd/assess.c @@ -203,7 +203,7 @@ u_fixgoodpost(void) if (fd < 0) { outs(ANSI_COLOR(1;31) "系統錯誤。 請稍候再重試。\n"); - vmsg("若持續發生請至" GLOBAL_BUGREPORT "報告。"); + vmsg("若持續發生請至" BN_BUGREPORT "報告。"); continue; } diff --git a/mbbsd/bbs.c b/mbbsd/bbs.c index a2cfb0bd..e03ba94a 100644 --- a/mbbsd/bbs.c +++ b/mbbsd/bbs.c @@ -313,9 +313,9 @@ set_board(void) int IsFreeBoardName(const char *brdname) { - if (strcmp(currboard, GLOBAL_TEST) == 0) + if (strcmp(currboard, BN_TEST) == 0) return 1; - if (strcmp(currboard, ALLPOST) == 0) + if (strcmp(currboard, BN_ALLPOST) == 0) return 1; return 0; } @@ -728,8 +728,8 @@ deleteCrossPost(const fileheader_t *fh, char *bname) { if(!fh || !fh->filename[0]) return; - if(!strcmp(bname, ALLPOST) || !strcmp(bname, "NEWIDPOST") || - !strcmp(bname, ALLHIDPOST) || !strcmp(bname, "UnAnonymous")) + if(!strcmp(bname, BN_ALLPOST) || !strcmp(bname, "NEWIDPOST") || + !strcmp(bname, BN_ALLHIDPOST) || !strcmp(bname, "UnAnonymous")) { int len=0; char xbname[TTLEN + 1], *po = strrchr(fh->title, '.'); @@ -743,7 +743,7 @@ deleteCrossPost(const fileheader_t *fh, char *bname) } else { - do_deleteCrossPost(fh, ALLPOST); + do_deleteCrossPost(fh, BN_ALLPOST); } } @@ -756,14 +756,14 @@ delete_allpost(const char *userid) if(!userid) return; - setbdir(bdir, ALLPOST); + setbdir(bdir, BN_ALLPOST); if( (fd = open(bdir, O_RDWR)) != -1) { for(i=0; read(fd, &fhdr, sizeof(fileheader_t)) >0; i++){ if(strcmp(fhdr.owner, userid)) continue; - deleteCrossPost(&fhdr, ALLPOST); - setbfile(file, ALLPOST, fhdr.filename); + deleteCrossPost(&fhdr, BN_ALLPOST); + setbfile(file, BN_ALLPOST, fhdr.filename); unlink(file); sprintf(fhdr.title, "(本文已被刪除)"); @@ -783,11 +783,11 @@ static int solveEdFlagByBoard(const char *bn, int flags) { if ( -#ifdef GLOBAL_BBSMOVIE - strcmp(bn, GLOBAL_BBSMOVIE) == 0 || +#ifdef BN_BBSMOVIE + strcmp(bn, BN_BBSMOVIE) == 0 || #endif -#ifdef GLOBAL_TEST - strcmp(bn, GLOBAL_TEST) == 0 || +#ifdef BN_TEST + strcmp(bn, BN_TEST) == 0 || #endif 0 ) @@ -935,7 +935,7 @@ do_general(int isbid) #ifdef FOREIGN_REG // 不是外籍使用者在 PttForeign 板 && !((cuser.uflag2 & FOREIGN) && - strcmp(bp->brdname, GLOBAL_FOREIGN) == 0) + strcmp(bp->brdname, BN_FOREIGN) == 0) #endif ) { vmsg("對不起,您目前無法在此發表文章!"); @@ -1142,9 +1142,9 @@ do_general(int isbid) do_crosspost("NEWIDPOST", &postfile, fpath, 0); if (!(currbrdattr & BRD_HIDE) ) - do_crosspost(ALLPOST, &postfile, fpath, 0); + do_crosspost(BN_ALLPOST, &postfile, fpath, 0); else - do_crosspost(ALLHIDPOST, &postfile, fpath, 0); + do_crosspost(BN_ALLHIDPOST, &postfile, fpath, 0); } outs("順利貼出佈告,"); @@ -1454,7 +1454,7 @@ edit_post(int ent, fileheader_t * fhdr, const char *direct) return DONOTHING; // board check - if (strcmp(bp->brdname, GLOBAL_SECURITY) == EQUSTR || + if (strcmp(bp->brdname, BN_SECURITY) == EQUSTR || (bp->brdattr & BRD_VOTEBOARD)) return DONOTHING; @@ -1577,7 +1577,7 @@ edit_post(int ent, fileheader_t * fhdr, const char *direct) outs(ANSI_COLOR(1;33) "自動合併 (Smart Merge) 是實驗中的新功\能," "請檢查一下您的文章合併後是否正常。" ANSI_RESET "\n" - "若有問題請至 " GLOBAL_BUGREPORT " 板報告,謝謝。"); + "若有問題請至 " BN_BUGREPORT " 板報告,謝謝。"); #endif vmsg("合併完成"); } else { @@ -3031,7 +3031,7 @@ del_range(int ent, const fileheader_t *fhdr, const char *direct) { // 很不幸的是有一種是信件->mail_cite->精華區 bp = getbcache(currbid); - if (strcmp(bp->brdname, GLOBAL_SECURITY) == 0) + if (strcmp(bp->brdname, BN_SECURITY) == 0) return DONOTHING; } @@ -3088,7 +3088,7 @@ del_post(int ent, fileheader_t * fhdr, char *direct) assert(0<=currbid-1 && currbid-1brdname, GLOBAL_SECURITY) == 0) + if (strcmp(bp->brdname, BN_SECURITY) == 0) return DONOTHING; /* TODO recursive lookup */ @@ -3670,12 +3670,12 @@ good_post(int ent, fileheader_t * fhdr, const char *direct) if (fhdr->filemode & FILE_DIGEST) { fhdr->filemode = (fhdr->filemode & ~FILE_DIGEST); - if (!strcmp(currboard, GLOBAL_NOTE) || -#ifdef GLOBAL_ARTDSN - !strcmp(currboard, GLOBAL_ARTDSN) || + if (!strcmp(currboard, BN_NOTE) || +#ifdef BN_ARTDSN + !strcmp(currboard, BN_ARTDSN) || #endif - !strcmp(currboard, GLOBAL_BUGREPORT) || - !strcmp(currboard, GLOBAL_LAW) + !strcmp(currboard, BN_BUGREPORT) || + !strcmp(currboard, BN_LAW) ) { deumoney(searchuser(fhdr->owner, NULL), -1000); // TODO if searchuser() return 0 @@ -3706,22 +3706,22 @@ good_post(int ent, fileheader_t * fhdr, const char *direct) strcpy(ptr, fn_mandex); append_record(buf, &digest, sizeof(digest)); -#ifdef GLOBAL_DIGEST +#ifdef BN_DIGEST assert(0<=currbid-1 && currbid-1brdattr & BRD_HIDE)) { getdata(1, 0, "好文值得出版到全站文摘?(N/y)", genbuf2, 3, LCECHO); if(genbuf2[0] == 'y') - do_crosspost(GLOBAL_DIGEST, &digest, genbuf, 1); + do_crosspost(BN_DIGEST, &digest, genbuf, 1); } #endif fhdr->filemode = (fhdr->filemode & ~FILE_MARKED) | FILE_DIGEST; - if (!strcmp(currboard, GLOBAL_NOTE) || -#ifdef GLOBAL_ARTDSN - !strcmp(currboard, GLOBAL_ARTDSN) || + if (!strcmp(currboard, BN_NOTE) || +#ifdef BN_ARTDSN + !strcmp(currboard, BN_ARTDSN) || #endif - !strcmp(currboard, GLOBAL_BUGREPORT) || - !strcmp(currboard, GLOBAL_LAW) + !strcmp(currboard, BN_BUGREPORT) || + !strcmp(currboard, BN_LAW) ) { deumoney(searchuser(fhdr->owner, NULL), 1000); // TODO if searchuser() return 0 diff --git a/mbbsd/bbslua.c b/mbbsd/bbslua.c index 0305bd78..2b276b3b 100644 --- a/mbbsd/bbslua.c +++ b/mbbsd/bbslua.c @@ -107,7 +107,7 @@ enum { }; // #define BLSCONF_ENABLED -#define BLSCONF_GLOBAL_VAL "global" +#define BLSCONF_BN_VAL "global" #define BLSCONF_USER_VAL "user" #define BLSCONF_GMAXSIZE (16*1024) // should be aligned to block size #define BLSCONF_UMAXSIZE (16*1024) // should be aligned to block size @@ -714,7 +714,7 @@ bls_getcat(const char *s) { if (!s || !*s) return BLS_INVALID; - if (strcmp(s, BLSCONF_GLOBAL_VAL) == 0) + if (strcmp(s, BLSCONF_BN_VAL) == 0) return BLS_GLOBAL; else if (strcmp(s, BLSCONF_USER_VAL) == 0) return BLS_USER; @@ -1016,7 +1016,7 @@ bbsluaRegConst(lua_State *L) lua_getglobal(L, "store"); lua_pushstring(L, BLSCONF_USER_VAL); lua_setfield(L, -2, "USER"); - lua_pushstring(L, BLSCONF_GLOBAL_VAL); + lua_pushstring(L, BLSCONF_BN_VAL); lua_setfield(L, -2, "GLOBAL"); lua_pop(L, 1); #endif // BLSCONF_ENABLED diff --git a/mbbsd/cache.c b/mbbsd/cache.c index 5a30c24f..76518ce6 100644 --- a/mbbsd/cache.c +++ b/mbbsd/cache.c @@ -942,7 +942,7 @@ reload_pttcache(void) SHM->Pbusystate = 1; SHM->last_film = 0; bzero(SHM->notes, sizeof(SHM->notes)); - setapath(pbuf, GLOBAL_NOTE); + setapath(pbuf, BN_NOTE); setadir(buf, pbuf); load_aggressive_state(); @@ -957,9 +957,9 @@ reload_pttcache(void) if (item.title[3] != '<' || item.title[8] != '>') continue; -#ifdef GLOBAL_NOTE_AGGCHKDIR +#ifdef BN_NOTE_AGGCHKDIR // TODO aggressive: only count '<點歌>' section - if (strcmp(item.title+3, GLOBAL_NOTE_AGGCHKDIR) == 0) + if (strcmp(item.title+3, BN_NOTE_AGGCHKDIR) == 0) chkagg = 1; #endif diff --git a/mbbsd/chc.c b/mbbsd/chc.c index 602fc37e..5c69a9bd 100644 --- a/mbbsd/chc.c +++ b/mbbsd/chc.c @@ -123,8 +123,8 @@ static const ChessConstants chc_constants = { 0, "楚河漢界", "photo_cchess", -#ifdef GLOBAL_CCHESS_LOG - GLOBAL_CCHESS_LOG, +#ifdef BN_CCHESS_LOG + BN_CCHESS_LOG, #else NULL, #endif diff --git a/mbbsd/chicken.c b/mbbsd/chicken.c index 368ddd19..7963e393 100644 --- a/mbbsd/chicken.c +++ b/mbbsd/chicken.c @@ -243,7 +243,7 @@ new_chicken(void) fd = open(fn, O_WRONLY|O_CREAT, 0666); if (fd < 0) { - vmsg("系統錯誤: 無法建立資料,請至 " GLOBAL_BUGREPORT " 報告。"); + vmsg("系統錯誤: 無法建立資料,請至 " BN_BUGREPORT " 報告。"); return 0; } diff --git a/mbbsd/edit.c b/mbbsd/edit.c index 9b4f9d2a..76915401 100644 --- a/mbbsd/edit.c +++ b/mbbsd/edit.c @@ -1820,7 +1820,7 @@ write_file(char *fpath, int saveheader, int *islocal, char *mytitle, int upload, { #ifndef ALL_REEDIT_LOG // why force signature in SYSOP board? - if(strcmp(currboard, GLOBAL_SYSOP) == 0) + if(strcmp(currboard, BN_SYSOP) == 0) #endif { ptime = localtime4(&now); diff --git a/mbbsd/fav.c b/mbbsd/fav.c index 8a6c1e2f..3e491f0e 100644 --- a/mbbsd/fav.c +++ b/mbbsd/fav.c @@ -1215,23 +1215,23 @@ void reginit_fav(void) fav_load(); // for creating root -#ifdef GLOBAL_NEWBIE - bid = getbnum(GLOBAL_NEWBIE); +#ifdef BN_NEWBIE + bid = getbnum(BN_NEWBIE); if (bid > 0) fav_add_board(bid); #endif -#ifdef GLOBAL_TEST - bid = getbnum(GLOBAL_TEST); +#ifdef BN_TEST + bid = getbnum(BN_TEST); if (bid > 0) fav_add_board(bid); #endif -#ifdef GLOBAL_ASKBOARD - bid = getbnum(GLOBAL_ASKBOARD); +#ifdef BN_ASKBOARD + bid = getbnum(BN_ASKBOARD); if (bid > 0) fav_add_board(bid); #endif -#ifdef GLOBAL_SYSOP - bid = getbnum(GLOBAL_SYSOP); +#ifdef BN_SYSOP + bid = getbnum(BN_SYSOP); if (bid > 0) fav_add_board(bid); #endif diff --git a/mbbsd/gamble.c b/mbbsd/gamble.c index b7fe8d5a..a7d93548 100644 --- a/mbbsd/gamble.c +++ b/mbbsd/gamble.c @@ -249,7 +249,7 @@ openticket(int bid) if(rename(buf, outcome) != 0) { unlockutmpmode(); - vmsg("無法準備開獎... 請至 " GLOBAL_BUGREPORT " 報告並附上板名。"); + vmsg("無法準備開獎... 請至 " BN_BUGREPORT " 報告並附上板名。"); return 0; } @@ -365,13 +365,13 @@ openticket(int bid) snprintf(buf, sizeof(buf), "[公告] %s 賭盤取消", bh->brdname); post_file(bh->brdname, buf, outcome, "[賭神]"); post_file("Record", buf + 7, outcome, "[馬路探子]"); - post_file(GLOBAL_SECURITY, buf + 7, outcome, "[馬路探子]"); + post_file(BN_SECURITY, buf + 7, outcome, "[馬路探子]"); setbfile(buf, bh->brdname, FN_TICKET_RECORD); unlink(buf); setbfile(buf, bh->brdname, FN_TICKET_USER); - post_file(GLOBAL_SECURITY, bh->brdname, buf, "[下注紀錄]"); + post_file(BN_SECURITY, bh->brdname, buf, "[下注紀錄]"); unlink(buf); setbfile(buf, bh->brdname, FN_TICKET_LOCK); diff --git a/mbbsd/go.c b/mbbsd/go.c index 44cf9cc8..4e0445b5 100644 --- a/mbbsd/go.c +++ b/mbbsd/go.c @@ -104,8 +104,8 @@ const static ChessConstants go_constants = { 1, "圍棋", "photo_go", -#ifdef GLOBAL_GOCHESS_LOG - GLOBAL_GOCHESS_LOG, +#ifdef BN_GOCHESS_LOG + BN_GOCHESS_LOG, #else NULL, #endif diff --git a/mbbsd/gomo.c b/mbbsd/gomo.c index c697507c..0caa7c4d 100644 --- a/mbbsd/gomo.c +++ b/mbbsd/gomo.c @@ -62,8 +62,8 @@ const static ChessConstants gomo_constants = { 0, "五子棋", "photo_fivechess", -#ifdef GLOBAL_FIVECHESS_LOG - GLOBAL_FIVECHESS_LOG, +#ifdef BN_FIVECHESS_LOG + BN_FIVECHESS_LOG, #else NULL, #endif diff --git a/mbbsd/mail.c b/mbbsd/mail.c index 1f5f8f96..64a61ca9 100644 --- a/mbbsd/mail.c +++ b/mbbsd/mail.c @@ -160,7 +160,7 @@ invalidaddr(const char *addr) "但檢查不出原因,所以我們需要正確的錯誤回報。\n\n" "如果你確實打錯了,請直接略過下面的說明。\n" "如果你認為你輸入的位址確實是對的,請把下面的訊息複製起來\n" - "並貼到 " GLOBAL_BUGREPORT " 板。本站為造成不便深感抱歉。\n\n" + "並貼到 " BN_BUGREPORT " 板。本站為造成不便深感抱歉。\n\n" ANSI_COLOR(1;33)); sprintf(errmsg, "原始輸入位址: [%s]\n" "錯誤位置: 第 %d 字元: 0x%02X [ %c ]\n", diff --git a/mbbsd/mbbsd.c b/mbbsd/mbbsd.c index 0e0bc8a5..23e20f41 100644 --- a/mbbsd/mbbsd.c +++ b/mbbsd/mbbsd.c @@ -281,12 +281,12 @@ abort_bbs_debug(int sig) #define CRASH_MSG ANSI_COLOR(0) \ "\r\n程式異常, 立刻斷線. \r\n" \ - "請洽 " GLOBAL_BUGREPORT " 板詳述問題發生經過。\r\n" + "請洽 " BN_BUGREPORT " 板詳述問題發生經過。\r\n" #define XCPU_MSG ANSI_COLOR(0) \ "\r\n程式耗用過多計算資源, 立刻斷線。\r\n" \ "可能是 (a)執行太多耗用資源的動作 或 (b)程式掉入無窮迴圈. "\ - "請洽 " GLOBAL_BUGREPORT " 板詳述問題發生經過。\r\n" + "請洽 " BN_BUGREPORT " 板詳述問題發生經過。\r\n" if(sig==SIGXCPU) write(1, XCPU_MSG, sizeof(XCPU_MSG)); diff --git a/mbbsd/more.c b/mbbsd/more.c index d506754a..7110971e 100644 --- a/mbbsd/more.c +++ b/mbbsd/more.c @@ -16,10 +16,10 @@ int more(char *fpath, int promptend) strcmp(fpath, "etc/ve.hlp") == 0) break; -#ifdef GLOBAL_SECURITY - if (strcmp(currboard, GLOBAL_SECURITY) == 0) +#ifdef BN_SECURITY + if (strcmp(currboard, BN_SECURITY) == 0) break; -#endif // GLOBAL_SECURITY +#endif // BN_SECURITY log_filef("log/security", LOG_CREAT, "%u %24.24s %d %s admin edit file=%s\n", diff --git a/mbbsd/read.c b/mbbsd/read.c index 3de710aa..e94e1191 100644 --- a/mbbsd/read.c +++ b/mbbsd/read.c @@ -173,7 +173,7 @@ TagPruner(int bid) assert(bid >= 0); /* bid == 0 means in mailbox */ if (bid){ bp = getbcache(bid); - if (strcmp(bp->brdname, GLOBAL_SECURITY) == 0) + if (strcmp(bp->brdname, BN_SECURITY) == 0) return DONOTHING; } if (TagNum && ((currstat != READING) || (currmode & MODE_BOARD))) { diff --git a/mbbsd/register.c b/mbbsd/register.c index 3296135d..50213851 100644 --- a/mbbsd/register.c +++ b/mbbsd/register.c @@ -923,7 +923,7 @@ toregister(char *email, char *phone, char *career, char *mobile) if (strcasecmp(email, "x") == 0) { /* 手動認證 */ if (!create_regform_request(career, phone)) { - vmsg("註冊申請單建立失敗。請至 " GLOBAL_BUGREPORT " 報告。"); + vmsg("註冊申請單建立失敗。請至 " BN_BUGREPORT " 報告。"); } } else { // register by mail of phone diff --git a/mbbsd/reversi.c b/mbbsd/reversi.c index ea64f35a..d29d8613 100644 --- a/mbbsd/reversi.c +++ b/mbbsd/reversi.c @@ -82,8 +82,8 @@ const static ChessConstants reversi_constants = { 0, "黑白棋", "photo_reversi", -#ifdef GLOBAL_REVERSI_LOG - GLOBAL_REVERSI_LOG, +#ifdef BN_REVERSI_LOG + BN_REVERSI_LOG, #else NULL, #endif diff --git a/mbbsd/syspost.c b/mbbsd/syspost.c index 9ced9918..6654d5ba 100644 --- a/mbbsd/syspost.c +++ b/mbbsd/syspost.c @@ -87,7 +87,7 @@ post_change_perm(int oldperm, int newperm, const char *sysopid, const char *user snprintf(title, sizeof(title), "[公安報告] 站長%s修改%s權限報告", cuser.userid, userid); - post_msg(GLOBAL_SECURITY, title, genbuf, "[系統安全局]"); + post_msg(BN_SECURITY, title, genbuf, "[系統安全局]"); } void diff --git a/mbbsd/talk.c b/mbbsd/talk.c index 6f45650f..e3134f59 100644 --- a/mbbsd/talk.c +++ b/mbbsd/talk.c @@ -3508,7 +3508,7 @@ GotoNewHand(){ currboard = "";// force enter_board } - if (enter_board(GLOBAL_NEWBIE) == 0) + if (enter_board(BN_NEWBIE) == 0) canRead = 1; if (canRead) @@ -3573,7 +3573,7 @@ AngelNotOnline(){ "──────────────┴☉" ANSI_RESET "\n"); move(b_lines - 4, 0); - outs("小主人使用上問題找不到小天使請到新手版(" GLOBAL_NEWBIE ")\n" + outs("小主人使用上問題找不到小天使請到新手版(" BN_NEWBIE ")\n" " 想留言給小天使請到許\願版(AngelPray)\n" " 想找看板在哪的話可到(AskBoard)\n" "請先在各板上尋找答案或按 Ctrl-P 發問"); diff --git a/mbbsd/user.c b/mbbsd/user.c index 6ed90b72..90959c00 100644 --- a/mbbsd/user.c +++ b/mbbsd/user.c @@ -255,7 +255,7 @@ mail_violatelaw(const char *crime, const char *police, const char *reason, const ANSI_COLOR(1;32) "%s" ANSI_RESET "判決:\n " ANSI_COLOR(1;32) "%s" ANSI_RESET "因" ANSI_COLOR(1;35) "%s" ANSI_RESET "行為,\n" "違反本站站規,處以" ANSI_COLOR(1;35) "%s" ANSI_RESET ",特此通知\n\n" - "請到 " GLOBAL_LAW " 查詢相關法規資訊,並從主選單進入:\n" + "請到 " BN_LAW " 查詢相關法規資訊,並從主選單進入:\n" "(P)lay【娛樂與休閒】=>(P)ay【Ptt量販店 】=> (1)ViolateLaw 繳罰單\n" "以繳交罰單。\n", ctime4(&now), police, crime, reason, result); @@ -525,7 +525,7 @@ uinfo_query(userec_t *u, int adminmode, int unum) int xuid = getuser(u->userid, &x); if (xuid != unum) { - vmsg("系統錯誤: 使用者資料號碼 (unum) 不合。請至 " GLOBAL_BUGREPORT "報告。"); + vmsg("系統錯誤: 使用者資料號碼 (unum) 不合。請至 " BN_BUGREPORT "報告。"); return; } } @@ -893,7 +893,7 @@ uinfo_query(userec_t *u, int adminmode, int unum) if(! (fp = fopen("etc/updatepwd.log", "w"))) { move(b_lines-1, 0); clrtobot(); - outs("系統錯誤: 無法建立通知檔,請至 " GLOBAL_BUGREPORT " 報告。"); + outs("系統錯誤: 無法建立通知檔,請至 " BN_BUGREPORT " 報告。"); fail++; pre_confirmed = 0; break; } @@ -903,7 +903,7 @@ uinfo_query(userec_t *u, int adminmode, int unum) u->userid, witness[0], witness[1], witness[2] ); fclose(fp); - post_file(GLOBAL_SECURITY, title, "etc/updatepwd.log", "[系統安全局]"); + post_file(BN_SECURITY, title, "etc/updatepwd.log", "[系統安全局]"); mail_id(u->userid, title, "etc/updatepwd.log", cuser.userid); for(i=0; i<3; i++) { @@ -944,7 +944,7 @@ uinfo_query(userec_t *u, int adminmode, int unum) "真實姓名:%s\n住址:%s\n認證資料:%s\nEmail:%s\n", x.userid, cuser.userid, reason, x.realname, x.address, x.justify, x.email); - post_msg(GLOBAL_SECURITY, title, msg, "[系統安全局]"); + post_msg(BN_SECURITY, title, msg, "[系統安全局]"); } break; @@ -1021,7 +1021,7 @@ uinfo_query(userec_t *u, int adminmode, int unum) snprintf(title, sizeof(title), "[公安報告] 站長%s修改%s錢報告", cuser.userid, x.userid); - post_msg(GLOBAL_SECURITY, title, msg, "[系統安全局]"); + post_msg(BN_SECURITY, title, msg, "[系統安全局]"); setumoney(unum, x.money); } passwd_update(unum, &x); diff --git a/sample/pttbbs.conf b/sample/pttbbs.conf index 9a68e15a..f19f99db 100644 --- a/sample/pttbbs.conf +++ b/sample/pttbbs.conf @@ -39,47 +39,47 @@ /* *** 以下為預設板名 *** */ /* 安全紀錄 */ -#define GLOBAL_SECURITY "Security" +#define BN_SECURITY "Security" /* 動態看板的家 */ -#define GLOBAL_NOTE "Note" +#define BN_NOTE "Note" /* 紀錄 */ -#define GLOBAL_RECORD "Record" +#define BN_RECORD "Record" /* SYSOP 板 */ -#define GLOBAL_SYSOP "SYSOP" +#define BN_SYSOP "SYSOP" /* 測試板 */ -#define GLOBAL_TEST "Test" +#define BN_TEST "Test" /* 發生錯誤時建議的回報板名為此板 */ -#define GLOBAL_BUGREPORT BBSMNAME "Bug" +#define BN_BUGREPORT BBSMNAME "Bug" /* 法律訴訟的板 */ -#define GLOBAL_LAW BBSMNAME "Law" +#define BN_LAW BBSMNAME "Law" /* 新手板(會自動進我的最愛) */ -#define GLOBAL_NEWBIE BBSMNAME "NewHand" +#define BN_NEWBIE BBSMNAME "NewHand" /* 找看板(會自動進我的最愛) */ -#define GLOBAL_ASKBOARD "AskBoard" +#define BN_ASKBOARD "AskBoard" /* 外國板 */ -#define GLOBAL_FOREIGN BBSMNAME "Foreign" +#define BN_FOREIGN BBSMNAME "Foreign" /* *** 以下為定義時會多出功能的板名 *** */ /* 若定義, 提供美工特別用板 */ -#define GLOBAL_ARTDSN "Artdsn" +#define BN_ARTDSN "Artdsn" /* 若定義,該板發文不受行限或是可上傳 */ -#define GLOBAL_BBSMOVIE "BBSmovie" +#define BN_BBSMOVIE "BBSmovie" /* 若定義, 則以此為版名提供全站文摘 */ -#define GLOBAL_DIGEST BBSMNAME "Digest" +#define BN_DIGEST BBSMNAME "Digest" // /* 若定義,則.... */ -// #define GLOBAL_WHOAMI "WhoAmI" +// #define BN_WHOAMI "WhoAmI" /* 若定義, 則全站所有五子棋/象棋棋譜都會紀錄在此板 */ -//#define GLOBAL_FIVECHESS_LOG BBSMNAME "Five" -//#define GLOBAL_CCHESS_LOG BBSMNAME "CChess" +//#define BN_FIVECHESS_LOG BBSMNAME "Five" +//#define BN_CCHESS_LOG BBSMNAME "CChess" /* 若定義,則動態看板會動態檢查爭議性字眼 */ -//#define GLOBAL_NOTE_AGGCHKDIR "<點歌> 動態看板" +//#define BN_NOTE_AGGCHKDIR "<點歌> 動態看板" /* 最大編輯行數, 以防有惡意使用者 post 巨大文章 */ #define MAX_EDIT_LINE (2048) diff --git a/util/initbbs.c b/util/initbbs.c index 9073d247..8d25b113 100644 --- a/util/initbbs.c +++ b/util/initbbs.c @@ -140,7 +140,7 @@ static void initBoards() { b.gid = 1; newboard(fp, &b); - strcpy(b.brdname, "ALLPOST"); + strcpy(b.brdname, BN_ALLPOST); strcpy(b.title, "嘰哩 ◎跨板式LOCAL新文章"); b.brdattr = BRD_POSTMASK | BRD_NOTRAN; b.level = PERM_SYSOP; @@ -190,8 +190,8 @@ static void initBoards() { b.gid = 5; newboard(fp, &b); -#ifdef GLOBAL_DIGEST - strcpy(b.brdname, GLOBAL_DIGEST); +#ifdef BN_DIGEST + strcpy(b.brdname, BN_DIGEST); strcpy(b.title, "文摘 ◎" BBSNAME "文摘 好文的收集地"); b.brdattr = BRD_NOTRAN | BRD_POSTMASK; b.level = PERM_SYSOP; @@ -199,8 +199,8 @@ static void initBoards() { newboard(fp, &b); #endif -#ifdef GLOBAL_FIVECHESS_LOG - strcpy(b.brdname, GLOBAL_FIVECHESS_LOG); +#ifdef BN_FIVECHESS_LOG + strcpy(b.brdname, BN_FIVECHESS_LOG); strcpy(b.title, "棋藝 ◎" BBSNAME "五子棋譜 站上對局全紀錄"); b.brdattr = BRD_NOTRAN | BRD_POSTMASK; b.level = PERM_SYSOP; -- cgit v1.2.3