From 1f5f24abc427f95cb07e660f2d58ed9d39486e0c Mon Sep 17 00:00:00 2001 From: ptt Date: Tue, 27 Apr 2004 18:04:08 +0000 Subject: =?UTF-8?q?fix=20for=20ptt2=20:=20:=201.=20=E5=9C=A8=E5=88=86?= =?UTF-8?q?=E9=A1=9E=E7=9C=8B=E6=9D=BF=E5=85=A7=E7=9A=84=E5=90=84=E7=BE=A4?= =?UTF-8?q?=E7=B5=84=E4=B8=8B=E7=9A=84=E7=9C=8B=E6=9D=BF=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E4=B8=8D=E6=AD=A3=E5=B8=B8=20:=20:=20=20=20=20=E6=9C=83?= =?UTF-8?q?=E6=9C=89=E9=83=A8=E4=BB=BD=E7=9A=84=E6=9D=BF=E6=89=BE=E4=B8=8D?= =?UTF-8?q?=E5=88=B0=20=20=E9=87=8D=E9=80=B2=E7=BE=A4=E7=B5=84=E6=AF=8F?= =?UTF-8?q?=E6=AC=A1=E5=A4=A7=E6=A6=82=E6=9C=83=E5=A4=9A=E5=87=BA=E7=8F=BE?= =?UTF-8?q?=E5=85=A9=E5=80=8B=E6=9D=BF=20:=20:=20=20=20=20=E9=80=99?= =?UTF-8?q?=E5=B0=8D=E5=B0=8F=E7=B5=84=E9=95=B7=E4=BE=86=E8=AA=AA=E5=BE=88?= =?UTF-8?q?=E9=BA=BB=E7=85=A9=E5=90=A7=20fixed...=E7=9C=8B=E6=9D=BF?= =?UTF-8?q?=E7=AD=89victor=E5=9B=9E=E4=BE=86=E5=86=8Dreview=E4=B8=80?= =?UTF-8?q?=E6=AC=A1=20:=20:=202.=20=E5=8F=AE=E5=8F=AE=E8=81=B2=E6=98=AF?= =?UTF-8?q?=E6=B2=92=E4=B9=8B=E5=89=8D=E5=9A=B4=E9=87=8D=E4=BA=86=20=20?= =?UTF-8?q?=E4=B8=8D=E9=81=8E=E5=8E=9F=E6=9C=AC=E5=A6=82=E6=9E=9C=E5=9C=A8?= =?UTF-8?q?=E6=96=87=E7=AB=A0=E5=88=97=E8=A1=A8=E7=9A=84=E6=9C=80=E5=BE=8C?= =?UTF-8?q?=E4=B8=80=E7=AF=87=E6=96=87=E7=AB=A0=E6=8C=89=E2=86=93=20:=20:?= =?UTF-8?q?=20=20=20=20=E6=9C=83=E5=87=BA=E7=8F=BE=E7=9A=84=E5=8F=AE?= =?UTF-8?q?=E5=8F=AE=E8=81=B2=E7=8F=BE=E5=9C=A8=E6=B6=88=E5=A4=B1=E4=BA=86?= =?UTF-8?q?=20=20=E5=8F=AF=E4=B8=8D=E5=8F=AF=E4=BB=A5=E6=8A=8A=E9=80=99?= =?UTF-8?q?=E5=80=8B=E5=8F=AE=E8=A6=81=E5=9B=9E=E4=BE=86=20^^"=20fixed=20:?= =?UTF-8?q?=20:=203.=20=E6=8F=9B=E9=A0=81=E6=99=82=E5=8F=AF=E4=B8=8D?= =?UTF-8?q?=E5=8F=AF=E4=BB=A5=E8=B7=9F=E4=B9=8B=E5=89=8D=E4=B8=80=E6=A8=A3?= =?UTF-8?q?=E6=98=AF=E6=8F=9B=E4=B8=80=E6=95=B4=E9=A0=81=20=20=E8=80=8C?= =?UTF-8?q?=E4=B8=8D=E6=98=AF=E7=8F=BE=E5=9C=A8=E9=80=99=E6=A8=A3=E5=8F=AA?= =?UTF-8?q?=E6=8F=9B=E5=8D=8A=E9=A0=81=20@@=20fixed=20:=204.=20tag=20?= =?UTF-8?q?=E5=AE=8C=E6=96=87=E7=AB=A0=E6=8C=89=20^D=20=E4=B9=8B=E5=BE=8C?= =?UTF-8?q?=E7=9A=84=E7=A2=BA=E8=AA=8D=20=20=E8=83=BD=E4=B8=8D=E8=83=BD?= =?UTF-8?q?=E4=B8=8D=E8=A6=81=E6=8C=89=E5=80=8B=20y=20=E5=B0=B1=E7=9B=B4?= =?UTF-8?q?=E6=8E=A5=E7=A0=8D=E6=8E=89=20:=20=20=20=20=E6=87=89=E8=A9=B2?= =?UTF-8?q?=E8=A6=81=E5=A4=9A=E6=8C=89=E5=80=8B=20enter=20=E5=86=8D?= =?UTF-8?q?=E7=A0=8D=E6=AF=94=E8=BC=83=E4=BF=9D=E9=9A=AA=E4=B8=80=E9=BB=9E?= =?UTF-8?q?=20default=E6=98=AF'N'=E6=87=89=E8=A9=B2=E9=82=84=E5=A5=BD?= =?UTF-8?q?=E5=9B=89=20=E6=88=91=E8=A6=BA=E5=BE=97=E9=80=99=E7=94=A8?= =?UTF-8?q?=E4=B9=85=E6=9C=83=E6=AF=94=E8=BC=83=E6=96=B9=E4=BE=BF=20?= =?UTF-8?q?=E4=B8=8D=E6=83=B3=E6=94=B9=E4=BA=86''''''''''=20:=205.=20?= =?UTF-8?q?=E5=9C=A8=E6=96=87=E7=AB=A0=E5=88=97=E8=A1=A8=E4=B8=8A=E6=8C=89?= =?UTF-8?q?=20ctrl=20+=20q=20=E6=9F=A5=E8=A9=A2=20user=20=E5=BE=8C=20=20?= =?UTF-8?q?=E6=9C=83=E6=8E=A5=E8=91=97=E9=80=B2=E5=85=A5=E8=A8=AD=E5=AE=9A?= =?UTF-8?q?=E8=A9=B2=E5=B8=B3=E8=99=9F=E7=9A=84=E7=95=AB=E9=9D=A2=20:=20?= =?UTF-8?q?=20=20=20=E9=80=99=E6=AD=A3=E5=B8=B8=E5=97=8E=EF=BC=9F=20XD=20f?= =?UTF-8?q?ixed?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1878 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- mbbsd/admin.c | 7 ++++--- mbbsd/read.c | 7 +++++++ mbbsd/user.c | 34 ++++++++++++---------------------- 3 files changed, 23 insertions(+), 25 deletions(-) diff --git a/mbbsd/admin.c b/mbbsd/admin.c index 5379d0be..aa370b1e 100644 --- a/mbbsd/admin.c +++ b/mbbsd/admin.c @@ -231,9 +231,10 @@ setperms(unsigned int pbits, char *pstring[]) ((pbits >> (i + 16)) & 1 ? "ˇ" : "X")); } clrtobot(); - while (getdata(b_lines - 1, 0, "請按 [A-5] 切換設定,按 [Return] 結束:", - choice, sizeof(choice), LCECHO)) { - i = choice[0] - 'a'; + while ( + (i = getans("請按 [A-5] 切換設定,按 [Return] 結束:"))!='\r') + { + i = i - 'a'; if (i < 0) i = choice[0] - '0' + 26; if (i >= NUMPERMS) diff --git a/mbbsd/read.c b/mbbsd/read.c index 5fcf885c..b771ccb9 100644 --- a/mbbsd/read.c +++ b/mbbsd/read.c @@ -238,9 +238,15 @@ cursor_pos(keeploc_t * locmem, int val, int from_top, int isshow) return DONOTHING; } if (val > last_line) + { + bell(); val = last_line; + } if (val <= 0) + { + bell(); val = 1; + } if (val >= top && val < top + p_lines) { if(isshow) { @@ -550,6 +556,7 @@ i_read_key(onekey_t * rcmdlist, keeploc_t * locmem, break; case Ctrl('Q'): mode = my_query(headers[locmem->crs_ln - locmem->top_ln].owner); + break; case Ctrl('S'): if (HAS_PERM(PERM_ACCOUNTS)) { int id; diff --git a/mbbsd/user.c b/mbbsd/user.c index f6681cc2..edbe4fb1 100644 --- a/mbbsd/user.c +++ b/mbbsd/user.c @@ -217,7 +217,7 @@ violate_law(userec_t * u, int unum) static void Customize(void) { - char ans[4], done = 0, mindbuf[5]; + char done = 0, mindbuf[5]; char *wm[3] = {"一般", "進階", "未來"}; showtitle("個人化設定", "個人化設定"); @@ -236,11 +236,7 @@ static void Customize(void) prints("%-30s%10s\n", "D. 目前的心情", mindbuf); prints("%-30s%10s\n", "E. 高亮度顯示我的最愛", ((cuser.uflag2 & FAVNOHILIGHT) ? "否" : "是")); - getdata(b_lines - 1, 0, "請按 [A-E] 切換設定,按 [Return] 結束:", - ans, 3, DOECHO); - - switch( ans[0] ){ - case 'A': + switch(getans("請按 [A-E] 切換設定,按 [Return] 結束:")){ case 'a':{ int currentset = cuser.uflag2 & WATER_MASK; currentset = (currentset + 1) % 3; @@ -249,17 +245,14 @@ static void Customize(void) vmsg("修正水球模式後請正常離線再重新上線"); } break; - case 'B': case 'b': cuser.userlevel ^= PERM_NOOUTMAIL; break; - case 'C': case 'c': cuser.uflag2 ^= FAVNEW_FLAG; if (cuser.uflag2 & FAVNEW_FLAG) subscribe_newfav(); break; - case 'D': case 'd':{ getdata(b_lines - 1, 0, "現在的心情? ", mindbuf, sizeof(mindbuf), DOECHO); @@ -271,7 +264,6 @@ static void Customize(void) memcpy(currutmp->mind, mindbuf, 4); } break; - case 'E': case 'e': cuser.uflag2 ^= FAVNOHILIGHT; break; @@ -280,7 +272,7 @@ static void Customize(void) } passwd_update(usernum, &cuser); } - pressanykey(); + vmsg("設定完成"); } void @@ -288,8 +280,8 @@ uinfo_query(userec_t * u, int real, int unum) { userec_t x; register int i = 0, fail, mail_changed; - int uid; - char ans[4], buf[STRLEN], *p; + int uid, ans; + char buf[STRLEN], *p; char genbuf[200], reason[50]; int money = 0; fileheader_t fhdr; @@ -300,23 +292,22 @@ uinfo_query(userec_t * u, int real, int unum) fail = mail_changed = 0; memcpy(&x, u, sizeof(userec_t)); - getdata(b_lines - 1, 0, real ? + ans = getans(real ? "(1)改資料(2)設密碼(3)設權限(4)砍帳號(5)改ID" "(6)殺/復活寵物(7)審判 [0]結束 " : - "請選擇 (1)修改資料 (2)設定密碼 (C) 個人化設定 ==> [0]結束 ", - ans, sizeof(ans), DOECHO); + "請選擇 (1)修改資料 (2)設定密碼 (C) 個人化設定 ==> [0]結束 "); - if (ans[0] > '2' && ans[0] != 'C' && ans[0] != 'c' && !real) - ans[0] = '0'; + if (ans > '2' && ans != 'C' && ans != 'c' && !real) + ans = '0'; - if (ans[0] == '1' || ans[0] == '3') { + if (ans == '1' || ans == '3') { clear(); i = 1; move(i++, 0); outs(msg_uid); outs(x.userid); } - switch (ans[0]) { + switch (ans) { case 'C': case 'c': Customize(); @@ -588,8 +579,7 @@ uinfo_query(userec_t * u, int real, int unum) pressanykey(); return; } - getdata(b_lines - 1, 0, msg_sure_ny, ans, 3, LCECHO); - if (*ans == 'y') { + if (getans(msg_sure_ny) == 'y') { if (flag) post_change_perm(temp, i, cuser.userid, x.userid); if (strcmp(u->userid, x.userid)) { -- cgit v1.2.3