回精華區
作者itoc.bbs@processor.tfcis.org (核心動力) 看板: plan
標題Re: [問題] 請問如何讓使用者在註冊時輸入生日、性別
時間動力核心 (2004/05/17 Mon 18:37:38) Updated: 2004/05/18
※ 引述《TOTO (ㄍㄟˇㄍㄟˊ)》之銘言:
> 可不可以請問一下,這一篇的修改在現在的系統上應該怎麼做?
> 因為我make的時候出現fpath未宣告的錯誤訊息@@"

 每次上站都檢查是否有填生日及性別

: bbsd.c:tn_motd()

static void
tn_motd()
{
  usint ufo;
+ char ans[4];

  ...
  ...

#ifdef HAVE_FORCE_BOARD
  brd_force();  /* itoc.000319: 強制閱讀公告板 */
#endif

+ while (cuser.year < 1 || cuser.year > 99)
+ {
+   vget(22, 0, "出生年份:", ans, 3, DOECHO);
+   cuser.year = (ans[0] - '0') * 10 + (ans[1] - '0');
+ }

+ while (cuser.month < 1 || cuser.month > 12)
+ {
+   vget(22, 0, "出生月份:", ans, 3, DOECHO);
+   cuser.month = (ans[0] - '0') * 10 + (ans[1] - '0');
+ }

+ while (cuser.day < 1 || cuser.day > 31)
+ {
+   vget(22, 0, "出生日期:", ans, 3, DOECHO);
+   cuser.day = (ans[0] - '0') * 10 + (ans[1] - '0');
+ }

+ while (cuser.sex != 0  && cuser.sex != 1 && cuser.sex != 2)
+ {
+   cuser.sex = vget(22, 0, "性別 (0)中性 (1)男性 (2)女性:", ans, 2, DOECHO) - '0';
+ }
}

--
  Origin:  Maple-itoc˙動力核心  processor.tfcis.org 
  Author: itoc pc512-12.ee.nctu.edu.tw 發表
精華選讀←離開[主題上]主題下(k)上篇(j)下篇S/a搜尋 G串列 TAB精華 ↑↓捲 Pg/Space翻