diff options
author | victor <victor@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2004-12-02 20:43:21 +0800 |
---|---|---|
committer | victor <victor@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2004-12-02 20:43:21 +0800 |
commit | 46ce48e5d73747963891833b2725839aaac035f1 (patch) | |
tree | 078b8b9e766bb007de90c3e644516b93099c4bfe /mbbsd | |
parent | b8068a594bf203c8619e7509c7ae20085f2a1021 (diff) | |
download | pttbbs-46ce48e5d73747963891833b2725839aaac035f1.tar pttbbs-46ce48e5d73747963891833b2725839aaac035f1.tar.gz pttbbs-46ce48e5d73747963891833b2725839aaac035f1.tar.bz2 pttbbs-46ce48e5d73747963891833b2725839aaac035f1.tar.lz pttbbs-46ce48e5d73747963891833b2725839aaac035f1.tar.xz pttbbs-46ce48e5d73747963891833b2725839aaac035f1.tar.zst pttbbs-46ce48e5d73747963891833b2725839aaac035f1.zip |
some help pages are showed from file
more comments
remove dirty hack in fav.c since it's safe now
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2360 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd')
-rw-r--r-- | mbbsd/admin.c | 15 | ||||
-rw-r--r-- | mbbsd/bbs.c | 33 | ||||
-rw-r--r-- | mbbsd/board.c | 27 | ||||
-rw-r--r-- | mbbsd/fav.c | 4 | ||||
-rw-r--r-- | mbbsd/friend.c | 2 | ||||
-rw-r--r-- | mbbsd/io.c | 9 | ||||
-rw-r--r-- | mbbsd/menu.c | 3 | ||||
-rw-r--r-- | mbbsd/stuff.c | 24 | ||||
-rw-r--r-- | mbbsd/var.c | 32 |
9 files changed, 65 insertions, 84 deletions
diff --git a/mbbsd/admin.c b/mbbsd/admin.c index 90038ab3..4f4bd90c 100644 --- a/mbbsd/admin.c +++ b/mbbsd/admin.c @@ -640,7 +640,7 @@ x_file() int aborted; char ans[4], *fpath; - move(b_lines - 6, 0); + move(b_lines - 7, 0); /* Ptt */ outs("設定 (1)身份確認信 (4)post注意事項 (5)錯誤登入訊息 (6)註冊範例 (7)通過確認通知\n"); outs(" (8)email post通知 (9)系統功\能精靈 (A)茶樓 (B)站長名單 (C)email通過確認\n"); @@ -650,12 +650,11 @@ x_file() #endif "\n"); outs(" (H)看板期限 (I)故鄉 (J)出站畫面 (K)生日卡 (L)節日 (M)外籍使用者認證通知\n"); - outs(" (N)外籍使用者過期警告通知" + outs(" (N)外籍使用者過期警告通知 (O)看板列表 help (P)文章列表 help\n"); #ifdef PLAY_ANGEL - " (Y)小天使認證通知" + outs(" (Y)小天使認證通知\n"); #endif - "\n"); - getdata(b_lines - 1, 0, "[Q]取消[1-9 A-N]?", ans, sizeof(ans), LCECHO); + getdata(b_lines - 1, 0, "[Q]取消[1-9 A-P]?", ans, sizeof(ans), LCECHO); switch (ans[0]) { case '1': @@ -756,6 +755,12 @@ x_file() case 'n': fpath = "etc/foreign_expired_warn"; break; + case 'o': + fpath = "etc/boardlist.help"; + break; + case 'p': + fpath = "etc/board.help"; + break; #ifdef PLAY_ANGEL case 'y': diff --git a/mbbsd/bbs.c b/mbbsd/bbs.c index 26c5852e..7396c22e 100644 --- a/mbbsd/bbs.c +++ b/mbbsd/bbs.c @@ -2255,41 +2255,10 @@ good_post(int ent, fileheader_t * fhdr, char *direct) return FULLUPDATE; } -/* help for board reading */ -static char * const board_help[] = { - "\0全功\能看板操作說明", - "\01基本命令", - "(p)(↑) 上移一篇文章 (^P/^O/^V)發表文章/競標/活動連署", - "(n)(↓) 下移一篇文章 (d) 刪除文章", - "(P)(PgUp) 上移一頁 (S) 串連相關文章", - "(N)(PgDn) 下移一頁 (##) 跳到 ## 號文章", - "(r)(→) 閱\讀此篇文章 ($) 跳到最後一篇文章", - "\01進階命令", - "(tab)/z 文摘模式/精華區 (a/A)(^Q) 找尋作者/作者資料", - "(b/f) 展讀備忘錄/參與賭盤 (?)(/) 找尋標題", - "(V/R) 投票/查詢投票結果 (^W)(X) 我在哪裡/推薦文章/參與競標", - "(x)(w) 轉錄文章/丟水球 (=)/([]<>-+) 找尋首篇文章/主題式閱\讀", -#ifdef INTERNET_EMAIL - "(F) 文章寄回Internet郵箱 (U) 將文章 uuencode 後寄回郵箱", -#endif - "(E)/(Q) 重編文章/查詢價格/匿名(^H) 列出所有的主要標題", - "\01板主命令", - "(M/o) 舉行投票/編私投票名單 (m/c/g/^Z) 保留/選錄精華/文摘/置底", - "(D) 刪除一段範圍的文章 (T/B) 重編文章標題/重編看板標題", - "(I) 開放/禁止看板推薦 (t/^D) 標記文章/砍除標記的文章", - "(O)/(i) 發表注意事項 文章類別 (H)/(Y) 看板隱藏/現身 取消推薦文章", -#ifdef NO_GAMBLE - "(W/K/v) 編進板畫面/水桶名單/可見名單", -#else - "(^G) 舉辦賭盤/停止下注/開獎(W/K/v) 編進板畫面/水桶名單/可見名單", -#endif - NULL -}; - static int b_help(void) { - show_help(board_help); + show_helpfile(fn_boardhelp); return FULLUPDATE; } diff --git a/mbbsd/board.c b/mbbsd/board.c index 53c333bb..17a36e6f 100644 --- a/mbbsd/board.c +++ b/mbbsd/board.c @@ -561,31 +561,6 @@ show_brdlist(int head, int clsflag, int newflag) } } -static char * const choosebrdhelp[] = { - "\0看板選單輔助說明", - "\01基本指令", - "(p)(↑)/(n)(↓)上一個看板 / 下一個看板", - "(P)(^B)(PgUp) 上一頁看板", - "(N)(^F)(PgDn) 下一頁看板", - "($)/(s)/(/) 最後一個看板 / 搜尋看板 / 以中文搜尋看板關鍵字", - "(數字) 跳至該項目", - "\01進階指令", - "(^W) 迷路了 我在哪裡", - "(r)(→)/(q)(←)進入多功\能閱\讀選單 / 回到主選單", - "(y/Z) 我的最愛,訂閱\看板,所有看板 / 訂閱\新開看板", - "(L/g) 加入分隔線 / 目錄至我的最愛", - "(K/T) 備份,清理我的最愛 / 修改我的最愛目錄名稱", - "(v/V) 通通看完/全部未讀", - "(S) 按照字母/分類排序", - "(t/^T/^A/^D) 標記看板/取消所有標記/ 將已標記者加入/移出我的最愛", - "(m/a/i/M) 把看板加入或移出我的最愛,移除分隔線/搬移我的最愛", - "\01小組長指令", - "(E/W/B) 設定看板/設定小組備忘/開新看板", - "(^P) 移動已標記看板到此分類", - NULL -}; - - static void set_menu_BM(char *BM) { @@ -797,7 +772,7 @@ choose_board(int newflag) } break; case 'h': - show_help(choosebrdhelp); + show_helpfile(fn_boardlisthelp); show_brdlist(head, 1, newflag); break; case '/': diff --git a/mbbsd/fav.c b/mbbsd/fav.c index daea0c5c..18d80353 100644 --- a/mbbsd/fav.c +++ b/mbbsd/fav.c @@ -461,9 +461,7 @@ int fav_save(void) return -1; } - /* to avoid write failed */ - if (dashs(buf) != 0) - Rename(buf, buf2); + Rename(buf, buf2); return 0; } diff --git a/mbbsd/friend.c b/mbbsd/friend.c index 6da53f9f..083ab758 100644 --- a/mbbsd/friend.c +++ b/mbbsd/friend.c @@ -254,7 +254,7 @@ friend_editdesc(char *uident, int type) } inline void friend_load_real(int tosort, int maxf, - short *destn, int *destar, char *fn) + short *destn, int *destar, const char *fn) { char genbuf[200]; FILE *fp; @@ -422,6 +422,15 @@ igetch() return 0; } +/** + * 根據 mode 來 strip 字串 str,並把結果存到 buf + * @param buf + * @param str + * @param mode enum {STRIP_ALL = 0, ONLY_COLOR, NO_RELOAD}; + * STRIP_ALL: ?? + * ONLY_COLOR: ?? + * NO_RELOAD: 不 strip (?) + */ int strip_ansi(char *buf, char *str, int mode) { diff --git a/mbbsd/menu.c b/mbbsd/menu.c index fc0e4435..975656e3 100644 --- a/mbbsd/menu.c +++ b/mbbsd/menu.c @@ -5,7 +5,6 @@ static int refscreen = NA; extern char *boardprefix; extern struct utmpfile_t *utmpshm; -extern char *fn_board; extern char board_hidden_status; void @@ -34,7 +33,7 @@ showtitle(char *title, char *mid) mid = "\033[41;5m 郵差來按鈴囉 " TITLE_COLOR; spc = 22; } else if ((HAS_PERM(PERM_SYSOP) || HAS_PERM(PERM_ACCOUNTS)) && - (nreg = dashs(fn_register) / 163) >100) { + (nreg = dashs((char *)fn_register) / 163) >100) { snprintf(numreg, sizeof(numreg), "\033[41;5m 有 %03d 未審核 " TITLE_COLOR, nreg); diff --git a/mbbsd/stuff.c b/mbbsd/stuff.c index a40995dc..e46db52c 100644 --- a/mbbsd/stuff.c +++ b/mbbsd/stuff.c @@ -78,6 +78,7 @@ setbnfile(char *buf, const char *boardname, const char *fname, int n) { sprintf(buf, str_board_n_file, boardname[0], boardname, fname, n); } + /* * input direct * output buf: copy direct @@ -121,6 +122,11 @@ str_checksum(char *str) return n; } +/** + * 將字串 s 轉為小寫存回 t + * @param t allocated char array + * @param s + */ void str_lower(char *t, char *s) { @@ -498,6 +504,10 @@ pressanykey_or_callangel(){ } #endif +/** + * 給 printf format 的參數,印到最底下一行。 + * 傳回使用者的選擇(char)。 + */ char getans(const char *fmt,...) { @@ -750,8 +760,22 @@ show_help(char * const helptext[]) pressanykey_or_callangel(); else #endif + pressanykey(); +} + +void +show_helpfile(const char *helpfile) +{ + clear(); + show_file((char *)helpfile, 0, b_lines, NO_RELOAD); +#ifdef PLAY_ANGEL + if (HAS_PERM(PERM_LOGINOK)) + pressanykey_or_callangel(); + else +#endif pressanykey(); } + #endif // _BBS_UTIL_C_ /* ----------------------------------------------------- */ diff --git a/mbbsd/var.c b/mbbsd/var.c index f5826ff4..6f9079e7 100644 --- a/mbbsd/var.c +++ b/mbbsd/var.c @@ -106,21 +106,23 @@ unsigned char currfmode; /* current file mode */ /* global string variables */ /* filename */ -char *fn_passwd = FN_PASSWD; -char *fn_board = FN_BOARD; -char *fn_note_ans = FN_NOTE_ANS; -char *fn_register = "register.new"; -char *fn_plans = "plans"; -char *fn_writelog = "writelog"; -char *fn_talklog = "talklog"; -char *fn_overrides = FN_OVERRIDES; -char *fn_reject = FN_REJECT; -char *fn_canvote = FN_CANVOTE; -char *fn_notes = "notes"; -char *fn_water = FN_WATER; -char *fn_visable = FN_VISABLE; -char *fn_mandex = "/.Names"; -char *fn_proverb = "proverb"; +char *fn_passwd = FN_PASSWD; +char *fn_board = FN_BOARD; +char *fn_register = "register.new"; +char *fn_note_ans = FN_NOTE_ANS; +const char *fn_plans = "plans"; +const char *fn_writelog = "writelog"; +const char *fn_talklog = "talklog"; +const char *fn_overrides = FN_OVERRIDES; +const char *fn_reject = FN_REJECT; +const char *fn_canvote = FN_CANVOTE; +const char *fn_notes = "notes"; +const char *fn_water = FN_WATER; +const char *fn_visable = FN_VISABLE; +const char *fn_mandex = "/.Names"; +const char *fn_proverb = "proverb"; +const char *fn_boardlisthelp = FN_BRDLISTHELP; +const char *fn_boardhelp = FN_BOARDHELP; /* are descript in userec.loginview */ |