回精華區
作者itoc, 信區: itoc
標題[功能] 簡體支援 (1) -- 繁體/簡體中文轉換介面
時間04/12/17
作者: itoc (站上人數:802) 看板: plan
標題: [功能] 簡體支援 (1)
時間: 2004/12/17 Fri 18:05:29                           Updated: 2004/12/17

※ 引述《intelp.bbs@wretch.csie.nctu.edu.tw (....)》之銘言:
> 就是向無名站一樣...
> 輸入帳號後面再多加一個 點
> 就可以轉成 簡體畫面...

  進站輸入 ID 後面加個 . 表示 用簡體

: global.h

+ VAR int trans2gb;             /* 轉成簡體中文 */
VAR int bbsmode;                /* bbs operating mode, see modes.h */
VAR usint bbstate;              /* bbs operatine state */

: bbsd.c:login_user()

  int attempts;         /* 嘗試幾次錯誤 */
  int multi;
+ int len;
- char fpath[64], uid[IDLEN + 1];
+ char fpath[64], uid[IDLEN + 2];
#ifndef CHAT_SECURE
  char passbuf[PSWDLEN + 1];
#endif

  move(b_lines, 0);
  outs("   ※ 參觀帳號:\033[1;32m" STR_GUEST "\033[m  申請新帳號:...");
+ move(b_lines - 3, 0);
+ outs("Add '.' after your ID for simplified Chinese GB support");

  ...
  ...

-   vget(b_lines - 2, 0, "   [您的帳號] ", uid, IDLEN + 1, DOECHO);
+   vget(b_lines - 2, 0, "   [您的帳號] ", uid, IDLEN + 2, DOECHO);

+   len = strlen(uid) - 1;
+   if (uid[len] == '.')
+   {
+     uid[len] = '\0';
+     trans2gb = 1;
+   }

--
□ 本文章由 itocitoc.Dorm11.NCTU.edu.tw 發表
精華選讀←離開[主題上]主題下(k)上篇(j)下篇S/a搜尋 G串列 TAB精華 ↑↓捲 Pg/Space翻