diff options
Diffstat (limited to 'mbbsd')
-rw-r--r-- | mbbsd/admin.c | 302 | ||||
-rw-r--r-- | mbbsd/announce.c | 142 | ||||
-rw-r--r-- | mbbsd/bbs.c | 354 | ||||
-rw-r--r-- | mbbsd/guess.c | 81 | ||||
-rw-r--r-- | mbbsd/talk.c | 374 |
5 files changed, 607 insertions, 646 deletions
diff --git a/mbbsd/admin.c b/mbbsd/admin.c index d7a562fe..b9f311ae 100644 --- a/mbbsd/admin.c +++ b/mbbsd/admin.c @@ -10,16 +10,16 @@ m_loginmsg() clrtobot(); if(SHM->loginmsg.pid && SHM->loginmsg.pid != currutmp->pid) { - prints(SHM->i18nstr[cuser.language][0]); + prints(I18N[0]); getmessage(SHM->loginmsg); } getdata(22, 0, - SHM->i18nstr[cuser.language][1], + I18N[1], msg, 3, LCECHO); if(msg[0]=='y' && - getdata_str(23, 0, SHM->i18nstr[cuser.language][2], msg, 56, DOECHO, SHM->loginmsg.last_call_in)) + getdata_str(23, 0, I18N[2], msg, 56, DOECHO, SHM->loginmsg.last_call_in)) { SHM->loginmsg.pid=currutmp->pid; /*站長不多 就不管race condition */ strcpy(SHM->loginmsg.last_call_in, msg); @@ -36,7 +36,7 @@ m_user() int id; char genbuf[200]; - stand_title(SHM->i18nstr[cuser.language][3]); + stand_title(I18N[3]); usercomplete(msg_uid, genbuf); if (*genbuf) { move(2, 0); @@ -66,13 +66,13 @@ search_key_user(char *passwdfile, int mode) assert(fp1); clear(); - getdata(0, 0, mode ? SHM->i18nstr[cuser.language][4] : SHM->i18nstr[cuser.language][5], key, sizeof(key), DOECHO); + getdata(0, 0, mode ? I18N[4] : SHM->i18nstr[cuser.language][5], key, sizeof(key), DOECHO); if(!key[0]) return 0; while ((fread(&user, sizeof(user), 1, fp1)) > 0 && coun < MAX_USERS) { if (!(++coun & 15)) { move(1, 0); - prints(SHM->i18nstr[cuser.language][6], coun); + prints(I18N[6], coun); refresh(); } keymatch = NULL; @@ -98,15 +98,15 @@ search_key_user(char *passwdfile, int mode) } if(keymatch) { move(1, 0); - prints(SHM->i18nstr[cuser.language][7], coun); + prints(I18N[7], coun); refresh(); user_display(&user, 1); uinfo_query(&user, 1, coun); - outs(SHM->i18nstr[cuser.language][8]); + outs(I18N[8]); outs(mode ? " A: add to namelist \033[m " : - SHM->i18nstr[cuser.language][9]); + I18N[9]); while (1) { while ((ch = igetch()) == 0); if (ch == 'a' || ch=='A' ) @@ -134,24 +134,24 @@ search_key_user(char *passwdfile, int mode) } else { move(b_lines - 1, 0); getdata(0, 0, - SHM->i18nstr[cuser.language][10], + I18N[10], genbuf, 3, LCECHO); if (genbuf[0] != 'y') { - outs(SHM->i18nstr[cuser.language][11]); + outs(I18N[11]); } else { int allocid = getnewuserid(); if (allocid > MAX_USERS || allocid <= 0) { - fprintf(stderr, SHM->i18nstr[cuser.language][12]); + fprintf(stderr, I18N[12]); exit(1); } if (passwd_update(allocid, &user) == -1) { - fprintf(stderr, SHM->i18nstr[cuser.language][13]); + fprintf(stderr, I18N[13]); exit(1); } setuserid(allocid, user.userid); if (!searchuser(user.userid)) { - fprintf(stderr, SHM->i18nstr[cuser.language][14]); + fprintf(stderr, I18N[14]); exit(1); } fclose(fp1); @@ -188,13 +188,13 @@ search_user_bybakpwd() clear(); move(1, 1); - outs(SHM->i18nstr[cuser.language][15]); - outs(SHM->i18nstr[cuser.language][16]); - outs(SHM->i18nstr[cuser.language][17]); - outs(SHM->i18nstr[cuser.language][18]); + outs(I18N[15]); + outs(I18N[16]); + outs(I18N[17]); + outs(I18N[18]); do { move(5, 1); - outs(SHM->i18nstr[cuser.language][19]); + outs(I18N[19]); ch = igetch(); if (ch == 'q' || ch == 'Q') return 0; @@ -207,8 +207,8 @@ search_user_bybakpwd() static void bperm_msg(boardheader_t * board) { - prints(SHM->i18nstr[cuser.language][20], board->brdname, - board->brdattr & BRD_POSTMASK ? SHM->i18nstr[cuser.language][21] : SHM->i18nstr[cuser.language][22]); + prints(I18N[20], board->brdname, + board->brdattr & BRD_POSTMASK ? I18N[21] : SHM->i18nstr[cuser.language][22]); } unsigned int @@ -220,15 +220,15 @@ setperms(unsigned int pbits, int *pstring) move(4, 0); for (i = 0; i < NUMPERMS / 2; i++) { prints("%c. %-20s %-15s %c. %-20s %s\n", - 'A' + i, SHM->i18nstr[cuser.language][pstring[i]], - ((pbits >> i) & 1 ? SHM->i18nstr[cuser.language][23] : SHM->i18nstr[cuser.language][24]), + 'A' + i, I18N[pstring[i]], + ((pbits >> i) & 1 ? I18N[23] : SHM->i18nstr[cuser.language][24]), i < 10 ? 'Q' + i : '0' + i - 10, - SHM->i18nstr[cuser.language][pstring[i + 16]], - ((pbits >> (i + 16)) & 1 ? SHM->i18nstr[cuser.language][25] : SHM->i18nstr[cuser.language][26])); + I18N[pstring[i + 16]], + ((pbits >> (i + 16)) & 1 ? I18N[25] : SHM->i18nstr[cuser.language][26])); } clrtobot(); while( - (i = getkey(SHM->i18nstr[cuser.language][27]))!='\r') + (i = getkey(I18N[27]))!='\r') { i = i - 'a'; if (i < 0) @@ -238,7 +238,7 @@ setperms(unsigned int pbits, int *pstring) else { pbits ^= (1 << i); move(i % 16 + 4, i <= 15 ? 24 : 64); - prints((pbits >> i) & 1 ? SHM->i18nstr[cuser.language][28] : SHM->i18nstr[cuser.language][29]); + prints((pbits >> i) & 1 ? I18N[28] : SHM->i18nstr[cuser.language][29]); } } return pbits; @@ -276,14 +276,14 @@ m_mod_board(char *bname) pressanykey(); return -1; } - prints(SHM->i18nstr[cuser.language][30], bh.brdname, bh.title, bid, bh.gid, bh.BM); + prints(I18N[30], bh.brdname, bh.title, bid, bh.gid, bh.BM); bperm_msg(&bh); /* Ptt 這邊斷行會檔到下面 */ move(9, 0); - snprintf(genbuf, sizeof(genbuf), SHM->i18nstr[cuser.language][31], - HAS_PERM(PERM_SYSOP) ? SHM->i18nstr[cuser.language][32] : "", - HAS_PERM(PERM_SYSSUBOP) ? SHM->i18nstr[cuser.language][33] : ""); + snprintf(genbuf, sizeof(genbuf), I18N[31], + HAS_PERM(PERM_SYSOP) ? I18N[32] : "", + HAS_PERM(PERM_SYSSUBOP) ? I18N[33] : ""); getdata(10, 0, genbuf, ans, sizeof(ans), LCECHO); switch (*ans) { @@ -310,8 +310,8 @@ m_mod_board(char *bname) memcpy(&newbh, &bh, sizeof(bh)); snprintf(bvotebuf, sizeof(bvotebuf), "%d", newbh.bvote); move(20, 0); - prints(SHM->i18nstr[cuser.language][34], bh.brdname, bh.bvote); - getdata_str(21, 0, SHM->i18nstr[cuser.language][35], genbuf, 5, LCECHO, bvotebuf); + prints(I18N[34], bh.brdname, bh.bvote); + getdata_str(21, 0, I18N[35], genbuf, 5, LCECHO, bvotebuf); newbh.bvote = atoi(genbuf); substitute_record(fn_board, &newbh, sizeof(newbh), bid); reset_board(bid); @@ -321,9 +321,9 @@ m_mod_board(char *bname) break; case 'v': memcpy(&newbh, &bh, sizeof(bh)); - outs(SHM->i18nstr[cuser.language][36]); - outs((bh.brdattr & BRD_BAD) ? SHM->i18nstr[cuser.language][37] : SHM->i18nstr[cuser.language][38]); - getdata(21, 0, SHM->i18nstr[cuser.language][39], genbuf, 5, LCECHO); + outs(I18N[36]); + outs((bh.brdattr & BRD_BAD) ? I18N[37] : SHM->i18nstr[cuser.language][38]); + getdata(21, 0, I18N[39], genbuf, 5, LCECHO); if (genbuf[0] == 'y') { if (newbh.brdattr & BRD_BAD) newbh.brdattr = newbh.brdattr & (!BRD_BAD); @@ -352,24 +352,24 @@ m_mod_board(char *bname) system(genbuf); memset(&bh, 0, sizeof(bh)); snprintf(bh.title, sizeof(bh.title), - SHM->i18nstr[cuser.language][40], bname, cuser.userid); - post_msg("Security", bh.title, SHM->i18nstr[cuser.language][41], SHM->i18nstr[cuser.language][42]); + I18N[40], bname, cuser.userid); + post_msg("Security", bh.title, I18N[41], SHM->i18nstr[cuser.language][42]); substitute_record(fn_board, &bh, sizeof(bh), bid); reset_board(bid); sort_bcache(); log_usies("DelBoard", bh.title); - outs(SHM->i18nstr[cuser.language][43]); + outs(I18N[43]); } break; case 'e': move(8, 0); - outs(SHM->i18nstr[cuser.language][44]); + outs(I18N[44]); memcpy(&newbh, &bh, sizeof(bh)); - while (getdata(9, 0, SHM->i18nstr[cuser.language][45], genbuf, IDLEN + 1, DOECHO)) { + while (getdata(9, 0, I18N[45], genbuf, IDLEN + 1, DOECHO)) { if (getbnum(genbuf)) { move(3, 0); - outs(SHM->i18nstr[cuser.language][46]); + outs(I18N[46]); } else if ( !invalid_brdname(genbuf) ){ strlcpy(newbh.brdname, genbuf, sizeof(newbh.brdname)); break; @@ -377,7 +377,7 @@ m_mod_board(char *bname) } do { - getdata_str(12, 0, SHM->i18nstr[cuser.language][47], genbuf, 5, DOECHO, bh.title); + getdata_str(12, 0, I18N[47], genbuf, 5, DOECHO, bh.title); if (strlen(genbuf) == 4) break; } while (1); @@ -387,11 +387,11 @@ m_mod_board(char *bname) newbh.title[4] = ' '; - getdata_str(14, 0, SHM->i18nstr[cuser.language][48], genbuf, BTLEN + 1, DOECHO, + getdata_str(14, 0, I18N[48], genbuf, BTLEN + 1, DOECHO, bh.title + 7); if (genbuf[0]) strlcpy(newbh.title + 7, genbuf, sizeof(newbh.title) - 7); - if (getdata_str(15, 0, SHM->i18nstr[cuser.language][49], genbuf, IDLEN * 3 + 3, DOECHO, + if (getdata_str(15, 0, I18N[49], genbuf, IDLEN * 3 + 3, DOECHO, bh.BM)) { trim(genbuf); strlcpy(newbh.BM, genbuf, sizeof(newbh.BM)); @@ -404,16 +404,16 @@ m_mod_board(char *bname) clrtobot(); } if (newbh.brdattr & BRD_GROUPBOARD) - strncpy(newbh.title + 5, SHM->i18nstr[cuser.language][50], 2); + strncpy(newbh.title + 5, I18N[50], 2); else if (newbh.brdattr & BRD_NOTRAN) - strncpy(newbh.title + 5, SHM->i18nstr[cuser.language][51], 2); + strncpy(newbh.title + 5, I18N[51], 2); else - strncpy(newbh.title + 5, SHM->i18nstr[cuser.language][52], 2); + strncpy(newbh.title + 5, I18N[52], 2); if (HAS_PERM(PERM_SYSOP) && !(newbh.brdattr & BRD_HIDE)) { - getdata_str(14, 0, SHM->i18nstr[cuser.language][53], ans, sizeof(ans), LCECHO, "N"); + getdata_str(14, 0, I18N[53], ans, sizeof(ans), LCECHO, "N"); if (*ans == 'y') { - getdata_str(15, 0, SHM->i18nstr[cuser.language][54], ans, sizeof(ans), LCECHO, + getdata_str(15, 0, I18N[54], ans, sizeof(ans), LCECHO, "R"); if (*ans == 'p') newbh.brdattr |= BRD_POSTMASK; @@ -427,7 +427,7 @@ m_mod_board(char *bname) clear(); } } - getdata(b_lines - 1, 0, SHM->i18nstr[cuser.language][55], genbuf, 4, LCECHO); + getdata(b_lines - 1, 0, I18N[55], genbuf, 4, LCECHO); if ((*genbuf != 'n') && memcmp(&newbh, &bh, sizeof(bh))) { if (strcmp(bh.brdname, newbh.brdname)) { @@ -457,7 +457,7 @@ m_board() { char bname[32]; - stand_title(SHM->i18nstr[cuser.language][56]); + stand_title(I18N[56]); generalnamecomplete(msg_bid, bname, sizeof(bname), SHM->Bnumber, completeboard_compar, completeboard_permission, @@ -477,16 +477,16 @@ x_file() move(b_lines - 6, 0); /* Ptt */ - outs(SHM->i18nstr[cuser.language][57]); - outs(SHM->i18nstr[cuser.language][58]); - outs(SHM->i18nstr[cuser.language][59]); + outs(I18N[57]); + outs(I18N[58]); + outs(I18N[59]); #ifdef MULTI_WELCOME_LOGIN - outs(SHM->i18nstr[cuser.language][60]); + outs(I18N[60]); #endif outs("\n"); - outs(SHM->i18nstr[cuser.language][61]); - outs(SHM->i18nstr[cuser.language][62]); - getdata(b_lines - 1, 0, SHM->i18nstr[cuser.language][63], ans, sizeof(ans), LCECHO); + outs(I18N[61]); + outs(I18N[62]); + getdata(b_lines - 1, 0, I18N[63], ans, sizeof(ans), LCECHO); switch (ans[0]) { case '1': @@ -527,7 +527,7 @@ x_file() break; case 'g': #ifdef MULTI_WELCOME_LOGIN - getdata(b_lines - 1, 0, SHM->i18nstr[cuser.language][64], ans, sizeof(ans), LCECHO); + getdata(b_lines - 1, 0, I18N[64], ans, sizeof(ans), LCECHO); if (ans[0] == '1') { fpath = "etc/Welcome_login.1"; } else if (ans[0] == '2') { @@ -546,7 +546,7 @@ x_file() #ifdef MULTI_WELCOME_LOGIN case 'x': - getdata(b_lines - 1, 0, SHM->i18nstr[cuser.language][65], ans, sizeof(ans), LCECHO); + getdata(b_lines - 1, 0, I18N[65], ans, sizeof(ans), LCECHO); if (ans[0] == '1') { unlink("etc/Welcome_login.1"); outs("ok"); @@ -560,7 +560,7 @@ x_file() unlink("etc/Welcome_login.4"); outs("ok"); } else { - outs(SHM->i18nstr[cuser.language][66]); + outs(I18N[66]); } pressanykey(); return FULLUPDATE; @@ -592,8 +592,8 @@ x_file() return FULLUPDATE; } aborted = vedit(fpath, NA, NULL); - prints(SHM->i18nstr[cuser.language][67], fpath, - (aborted == -1) ? SHM->i18nstr[cuser.language][68] : SHM->i18nstr[cuser.language][69]); + prints(I18N[67], fpath, + (aborted == -1) ? I18N[68] : SHM->i18nstr[cuser.language][69]); pressanykey(); return FULLUPDATE; } @@ -620,13 +620,13 @@ m_newbrd(int recover) char ans[4]; char genbuf[200]; - stand_title(SHM->i18nstr[cuser.language][70]); + stand_title(I18N[70]); memset(&newboard, 0, sizeof(newboard)); newboard.gid = class_bid; if (newboard.gid == 0) { move(6, 0); - outs(SHM->i18nstr[cuser.language][71]); + outs(I18N[71]); pressanykey(); return -1; } @@ -637,7 +637,7 @@ m_newbrd(int recover) } while (invalid_brdname(newboard.brdname)); do { - getdata(6, 0, SHM->i18nstr[cuser.language][72], genbuf, 5, DOECHO); + getdata(6, 0, I18N[72], genbuf, 5, DOECHO); if (strlen(genbuf) == 4) break; } while (1); @@ -646,19 +646,19 @@ m_newbrd(int recover) newboard.title[4] = ' '; - getdata(8, 0, SHM->i18nstr[cuser.language][73], genbuf, BTLEN + 1, DOECHO); + getdata(8, 0, I18N[73], genbuf, BTLEN + 1, DOECHO); if (genbuf[0]) strlcpy(newboard.title + 7, genbuf, sizeof(newboard.title) - 7); setbpath(genbuf, newboard.brdname); if (recover) { if (dashd(genbuf)) { - outs(SHM->i18nstr[cuser.language][74]); + outs(I18N[74]); pressanykey(); return -1; } } else if (getbnum(newboard.brdname) > 0 || mkdir(genbuf, 0755) == -1) { - outs(SHM->i18nstr[cuser.language][75]); + outs(I18N[75]); pressanykey(); return -1; } @@ -671,24 +671,24 @@ m_newbrd(int recover) move(1, 0); clrtobot(); } - getdata(9, 0, SHM->i18nstr[cuser.language][76], genbuf, 3, LCECHO); + getdata(9, 0, I18N[76], genbuf, 3, LCECHO); if (genbuf[0] == 'n') newboard.brdattr |= BRD_GROUPBOARD; if (newboard.brdattr & BRD_GROUPBOARD) - strncpy(newboard.title + 5, SHM->i18nstr[cuser.language][77], 2); + strncpy(newboard.title + 5, I18N[77], 2); else if (newboard.brdattr & BRD_NOTRAN) - strncpy(newboard.title + 5, SHM->i18nstr[cuser.language][78], 2); + strncpy(newboard.title + 5, I18N[78], 2); else - strncpy(newboard.title + 5, SHM->i18nstr[cuser.language][79], 2); + strncpy(newboard.title + 5, I18N[79], 2); newboard.level = 0; - getdata(11, 0, SHM->i18nstr[cuser.language][80], newboard.BM, sizeof(newboard.BM), DOECHO); + getdata(11, 0, I18N[80], newboard.BM, sizeof(newboard.BM), DOECHO); if (HAS_PERM(PERM_SYSOP) && !(newboard.brdattr & BRD_HIDE)) { - getdata_str(14, 0, SHM->i18nstr[cuser.language][81], ans, sizeof(ans), LCECHO, "N"); + getdata_str(14, 0, I18N[81], ans, sizeof(ans), LCECHO, "N"); if (*ans == 'y') { - getdata_str(15, 0, SHM->i18nstr[cuser.language][82], ans, sizeof(ans), LCECHO, "R"); + getdata_str(15, 0, I18N[82], ans, sizeof(ans), LCECHO, "R"); if (*ans == 'p') newboard.brdattr |= BRD_POSTMASK; else @@ -707,7 +707,7 @@ m_newbrd(int recover) pressanykey(); setup_man(&newboard); - outs(SHM->i18nstr[cuser.language][83]); + outs(I18N[83]); post_newboard(newboard.title, newboard.brdname, newboard.BM); log_usies("NewBoard", newboard.title); pressanykey(); @@ -738,7 +738,7 @@ int make_symbolic_link(char *bname, int gid) strlcpy(newboard.brdname, bname, sizeof(newboard.brdname)); newboard.brdname[strlen(bname) - 1] = '~'; strlcpy(newboard.title, bcache[bid - 1].title, sizeof(newboard.title)); - strcpy(newboard.title + 5, SHM->i18nstr[cuser.language][84]); + strcpy(newboard.title + 5, I18N[84]); newboard.gid = gid; BRD_LINK_TARGET(&newboard) = bid; @@ -760,10 +760,10 @@ int make_symbolic_link_interactively(int gid) if (!buf[0]) return -1; - stand_title(SHM->i18nstr[cuser.language][85]); + stand_title(I18N[85]); if (make_symbolic_link(buf, gid) < 0) { - vmsg(SHM->i18nstr[cuser.language][86]); + vmsg(I18N[86]); return -1; } log_usies("NewSymbolic", buf); @@ -778,8 +778,8 @@ auto_scan(char fdata[][STRLEN], char ans[]) int i; char temp[10]; - if (!strncmp(fdata[2], SHM->i18nstr[cuser.language][87], 2) || strstr(fdata[2], SHM->i18nstr[cuser.language][88]) - || strstr(fdata[2], SHM->i18nstr[cuser.language][89]) || strstr(fdata[2], SHM->i18nstr[cuser.language][90])) { + if (!strncmp(fdata[2], I18N[87], 2) || strstr(fdata[2], SHM->i18nstr[cuser.language][88]) + || strstr(fdata[2], I18N[89]) || strstr(fdata[2], SHM->i18nstr[cuser.language][90])) { ans[0] = '0'; return 1; } @@ -792,17 +792,17 @@ auto_scan(char fdata[][STRLEN], char ans[]) return 1; } if (strlen(fdata[2]) >= 6) { - if (strstr(fdata[2], SHM->i18nstr[cuser.language][91])) { + if (strstr(fdata[2], I18N[91])) { ans[0] = '0'; return 1; } - if (strstr(SHM->i18nstr[cuser.language][92], temp)) + if (strstr(I18N[92], temp)) good++; - else if (strstr(SHM->i18nstr[cuser.language][93], temp)) + else if (strstr(I18N[93], temp)) good++; - else if (strstr(SHM->i18nstr[cuser.language][94], temp)) + else if (strstr(I18N[94], temp)) good++; - else if (strstr(SHM->i18nstr[cuser.language][95], temp)) + else if (strstr(I18N[95], temp)) good++; } if (!good) @@ -814,25 +814,25 @@ auto_scan(char fdata[][STRLEN], char ans[]) ans[0] = '4'; return 5; } - if (strstr(fdata[3], SHM->i18nstr[cuser.language][96])) { - if (strstr(fdata[3], SHM->i18nstr[cuser.language][97]) || strstr(fdata[3], SHM->i18nstr[cuser.language][98]) || - strstr(fdata[3], SHM->i18nstr[cuser.language][99]) || strstr(fdata[3], SHM->i18nstr[cuser.language][100]) || - strstr(fdata[3], SHM->i18nstr[cuser.language][101]) || strstr(fdata[3], SHM->i18nstr[cuser.language][102]) || - strstr(fdata[3], SHM->i18nstr[cuser.language][103]) || strstr(fdata[3], SHM->i18nstr[cuser.language][104]) || - strstr(fdata[3], SHM->i18nstr[cuser.language][105]) || strstr(fdata[3], SHM->i18nstr[cuser.language][106]) || - strstr(fdata[3], SHM->i18nstr[cuser.language][107]) || strstr(fdata[3], SHM->i18nstr[cuser.language][108])) + if (strstr(fdata[3], I18N[96])) { + if (strstr(fdata[3], I18N[97]) || strstr(fdata[3], SHM->i18nstr[cuser.language][98]) || + strstr(fdata[3], I18N[99]) || strstr(fdata[3], SHM->i18nstr[cuser.language][100]) || + strstr(fdata[3], I18N[101]) || strstr(fdata[3], SHM->i18nstr[cuser.language][102]) || + strstr(fdata[3], I18N[103]) || strstr(fdata[3], SHM->i18nstr[cuser.language][104]) || + strstr(fdata[3], I18N[105]) || strstr(fdata[3], SHM->i18nstr[cuser.language][106]) || + strstr(fdata[3], I18N[107]) || strstr(fdata[3], SHM->i18nstr[cuser.language][108])) good++; - } else if (strstr(fdata[3], SHM->i18nstr[cuser.language][109])) + } else if (strstr(fdata[3], I18N[109])) good++; - if (strstr(fdata[4], SHM->i18nstr[cuser.language][110]) || strstr(fdata[4], SHM->i18nstr[cuser.language][111]) || - strstr(fdata[4], SHM->i18nstr[cuser.language][112])) { + if (strstr(fdata[4], I18N[110]) || strstr(fdata[4], SHM->i18nstr[cuser.language][111]) || + strstr(fdata[4], I18N[112])) { ans[0] = '2'; return 3; } - if (strstr(fdata[4], SHM->i18nstr[cuser.language][113]) || strstr(fdata[4], SHM->i18nstr[cuser.language][114])) { - if (strstr(fdata[4], SHM->i18nstr[cuser.language][115]) || strstr(fdata[4], SHM->i18nstr[cuser.language][116])) { - if (strstr(fdata[4], SHM->i18nstr[cuser.language][117])) + if (strstr(fdata[4], I18N[113]) || strstr(fdata[4], SHM->i18nstr[cuser.language][114])) { + if (strstr(fdata[4], I18N[115]) || strstr(fdata[4], SHM->i18nstr[cuser.language][116])) { + if (strstr(fdata[4], I18N[117])) good++; } } @@ -864,17 +864,17 @@ scan_register_form(char *regfile, int automode, int neednum) "uid", "ident", "name", "career", "addr", "phone", "email", NULL }; char *finfo[] = { - SHM->i18nstr[cuser.language][118], SHM->i18nstr[cuser.language][119], SHM->i18nstr[cuser.language][120], SHM->i18nstr[cuser.language][121], SHM->i18nstr[cuser.language][122], - SHM->i18nstr[cuser.language][123], SHM->i18nstr[cuser.language][124], NULL + I18N[118], SHM->i18nstr[cuser.language][119], SHM->i18nstr[cuser.language][120], SHM->i18nstr[cuser.language][121], SHM->i18nstr[cuser.language][122], + I18N[123], SHM->i18nstr[cuser.language][124], NULL }; char *reason[] = { - SHM->i18nstr[cuser.language][125], - SHM->i18nstr[cuser.language][126], - SHM->i18nstr[cuser.language][127], - SHM->i18nstr[cuser.language][128], - SHM->i18nstr[cuser.language][129], - SHM->i18nstr[cuser.language][130], - SHM->i18nstr[cuser.language][131], + I18N[125], + I18N[126], + I18N[127], + I18N[128], + I18N[129], + I18N[130], + I18N[131], NULL }; char *autoid = "AutoScan"; @@ -891,22 +891,22 @@ scan_register_form(char *regfile, int automode, int neednum) move(2, 0); if (dashf(fname)) { if (neednum == 0) { /* 自己進 Admin 來審的 */ - outs(SHM->i18nstr[cuser.language][132]); + outs(I18N[132]); pressanykey(); } return -1; } Rename(regfile, fname); if ((fn = fopen(fname, "r")) == NULL) { - prints(SHM->i18nstr[cuser.language][133], fname); + prints(I18N[133], fname); pressanykey(); return -1; } if (neednum) { /* 被強迫審的 */ move(1, 0); clrtobot(); - prints(SHM->i18nstr[cuser.language][134], neednum); - prints(SHM->i18nstr[cuser.language][135]); + prints(I18N[134], neednum); + prints(I18N[135]); pressanykey(); } memset(fdata, 0, sizeof(fdata)); @@ -923,7 +923,7 @@ scan_register_form(char *regfile, int automode, int neednum) } else if ((unum = getuser(fdata[0])) == 0) { move(2, 0); clrtobot(); - outs(SHM->i18nstr[cuser.language][136]); + outs(I18N[136]); for (n = 0; field[n]; n++) prints("%s : %s\n", finfo[n], fdata[n]); pressanykey(); @@ -938,27 +938,27 @@ scan_register_form(char *regfile, int automode, int neednum) uid = cuser.userid; move(1, 0); - prints(SHM->i18nstr[cuser.language][137], unum); + prints(I18N[137], unum); user_display(&muser, 1); move(14, 0); - prints(SHM->i18nstr[cuser.language][138], neednum); - prints(SHM->i18nstr[cuser.language][139], finfo[0], fdata[0]); - prints(SHM->i18nstr[cuser.language][140], finfo[1], fdata[1]); + prints(I18N[138], neednum); + prints(I18N[139], finfo[0], fdata[0]); + prints(I18N[140], finfo[1], fdata[1]); #ifdef FOREIGN_REG - prints(SHM->i18nstr[cuser.language][141], finfo[2], fdata[2], muser.uflag2 & FOREIGN ? SHM->i18nstr[cuser.language][142] : ""); + prints(I18N[141], finfo[2], fdata[2], muser.uflag2 & FOREIGN ? SHM->i18nstr[cuser.language][142] : ""); #else - prints(SHM->i18nstr[cuser.language][143], finfo[2], fdata[2]); + prints(I18N[143], finfo[2], fdata[2]); #endif for (n = 3; field[n]; n++) { - prints(SHM->i18nstr[cuser.language][144], n - 2, finfo[n], fdata[n]); + prints(I18N[144], n - 2, finfo[n], fdata[n]); } if (muser.userlevel & PERM_LOGINOK) { - ans[0] = getkey(SHM->i18nstr[cuser.language][145]); + ans[0] = getkey(I18N[145]); if (ans[0] != 'y' && ans[0] != 's') ans[0] = 'd'; } else { if (search_ulist(unum) == NULL) - ans[0] = vmsg_lines(22, SHM->i18nstr[cuser.language][146]); + ans[0] = vmsg_lines(22, I18N[146]); else ans[0] = 's'; if ('A' <= ans[0] && ans[0] <= 'Z') @@ -974,7 +974,7 @@ scan_register_form(char *regfile, int automode, int neednum) if (neednum > 0 && ans[0] == 'q') { move(2, 0); clrtobot(); - prints(SHM->i18nstr[cuser.language][147]); + prints(I18N[147]); pressanykey(); ans[0] = 's'; } @@ -1000,13 +1000,13 @@ scan_register_form(char *regfile, int automode, int neednum) for (n = 0; field[n]; n++) prints("%s: %s\n", finfo[n], fdata[n]); move(9, 0); - prints(SHM->i18nstr[cuser.language][148]); + prints(I18N[148]); for (n = 0; reason[n]; n++) - prints(SHM->i18nstr[cuser.language][149], n, reason[n]); + prints(I18N[149], n, reason[n]); } else buf[0] = ans[0]; if (ans[0] != 'n' || - getdata(10 + n, 0, SHM->i18nstr[cuser.language][150], buf, 60, DOECHO)) + getdata(10 + n, 0, I18N[150], buf, 60, DOECHO)) if ((buf[0] - '0') >= 0 && (buf[0] - '0') < n) { int i; fileheader_t mhdr; @@ -1016,7 +1016,7 @@ scan_register_form(char *regfile, int automode, int neednum) sethomepath(buf1, muser.userid); stampfile(buf1, &mhdr); strlcpy(mhdr.owner, cuser.userid, sizeof(mhdr.owner)); - strlcpy(mhdr.title, SHM->i18nstr[cuser.language][151], TTLEN); + strlcpy(mhdr.title, I18N[151], TTLEN); mhdr.filemode = 0; sethomedir(title, muser.userid); if (append_record(title, &mhdr, sizeof(mhdr)) != -1) { @@ -1026,7 +1026,7 @@ scan_register_form(char *regfile, int automode, int neednum) if (!isdigit(buf[i])) continue; snprintf(genbuf, sizeof(genbuf), - SHM->i18nstr[cuser.language][152], reason[buf[i] - '0']); + I18N[152], reason[buf[i] - '0']); fprintf(fp, "%s\n", genbuf); } @@ -1044,7 +1044,7 @@ scan_register_form(char *regfile, int automode, int neednum) } move(10, 0); clrtobot(); - prints(SHM->i18nstr[cuser.language][153]); + prints(I18N[153]); case 's': if ((freg = fopen(regfile, "a"))) { for (n = 0; field[n]; n++) @@ -1054,10 +1054,10 @@ scan_register_form(char *regfile, int automode, int neednum) } break; default: - prints(SHM->i18nstr[cuser.language][154]); - mail_muser(muser, SHM->i18nstr[cuser.language][155], "etc/registered"); + prints(I18N[154]); + mail_muser(muser, I18N[155], "etc/registered"); if(muser.uflag2 & FOREIGN) - mail_muser(muser, SHM->i18nstr[cuser.language][156], "etc/foreign_welcome"); + mail_muser(muser, I18N[156], "etc/foreign_welcome"); muser.userlevel |= (PERM_LOGINOK | PERM_POST); strlcpy(muser.realname, fdata[2], sizeof(muser.realname)); strlcpy(muser.address, fdata[4], sizeof(muser.address)); @@ -1088,7 +1088,7 @@ scan_register_form(char *regfile, int automode, int neednum) clrtobot(); move(5, 0); - prints(SHM->i18nstr[cuser.language][157], nSelf, nAuto); + prints(I18N[157], nSelf, nAuto); /** DickG: 將審了幾份的相關資料 post 到 Security 板上 ***********/ /* @@ -1118,10 +1118,10 @@ m_register() char genbuf[200]; if ((fn = fopen(fn_register, "r")) == NULL) { - outs(SHM->i18nstr[cuser.language][158]); + outs(I18N[158]); return XEASY; } - stand_title(SHM->i18nstr[cuser.language][159]); + stand_title(I18N[159]); y = 2; x = wid = 0; @@ -1139,7 +1139,7 @@ m_register() } } fclose(fn); - getdata(b_lines - 1, 0, SHM->i18nstr[cuser.language][160], ans, sizeof(ans), LCECHO); + getdata(b_lines - 1, 0, I18N[160], ans, sizeof(ans), LCECHO); if (ans[0] == 'a') scan_register_form(fn_register, 1, 0); else if (ans[0] == 'y') @@ -1153,9 +1153,9 @@ cat_register() { if (system("cat register.new.tmp >> register.new") == 0 && system("rm -f register.new.tmp") == 0) - vmsg(SHM->i18nstr[cuser.language][161]); + vmsg(I18N[161]); else - vmsg(SHM->i18nstr[cuser.language][162]); + vmsg(I18N[162]); return 0; } @@ -1167,12 +1167,12 @@ give_id_money(char *user_id, int money, FILE * log_fp, char *mail_title, time_t if (deumoney(searchuser(user_id), money) < 0) { move(12, 0); clrtoeol(); - prints(SHM->i18nstr[cuser.language][163], user_id, money); + prints(I18N[163], user_id, money); pressanykey(); } else { fprintf(log_fp, "%d %s %d", (int)t, user_id, money); - snprintf(tt, sizeof(tt), SHM->i18nstr[cuser.language][164], mail_title, money); - mail_id(user_id, tt, "etc/givemoney.why", SHM->i18nstr[cuser.language][165]); + snprintf(tt, sizeof(tt), I18N[164], mail_title, money); + mail_id(user_id, tt, "etc/givemoney.why", I18N[165]); } } @@ -1185,16 +1185,16 @@ give_money() struct tm *pt = localtime(&now); int to_all = 0, money = 0; - getdata(0, 0, SHM->i18nstr[cuser.language][166], buf, sizeof(buf), LCECHO); + getdata(0, 0, I18N[166], buf, sizeof(buf), LCECHO); if (buf[0] == 'q') return 1; else if (buf[0] == 'a') { to_all = 1; - getdata(1, 0, SHM->i18nstr[cuser.language][167], buf, 20, DOECHO); + getdata(1, 0, I18N[167], buf, 20, DOECHO); money = atoi(buf); if (money <= 0) { move(2, 0); - prints(SHM->i18nstr[cuser.language][168]); + prints(I18N[168]); pressanykey(); return 1; } @@ -1204,7 +1204,7 @@ give_money() } clear(); - getdata(0, 0, SHM->i18nstr[cuser.language][169], buf, 3, LCECHO); + getdata(0, 0, I18N[169], buf, 3, LCECHO); if (buf[0] != 'y') return 1; @@ -1214,17 +1214,17 @@ give_money() fprintf(fp2, "%s\n", buf); - getdata(1, 0, SHM->i18nstr[cuser.language][170], tt, TTLEN, DOECHO); + getdata(1, 0, I18N[170], tt, TTLEN, DOECHO); move(2, 0); - prints(SHM->i18nstr[cuser.language][171]); + prints(I18N[171]); pressanykey(); if (vedit("etc/givemoney.why", NA, NULL) < 0) { fclose(fp2); return 1; } - stand_title(SHM->i18nstr[cuser.language][172]); + stand_title(I18N[172]); if (to_all) { int i, unum; for (unum = SHM->number, i = 0; i < unum; i++) { @@ -1234,7 +1234,7 @@ give_money() give_id_money(id, money, fp2, tt, now); } //something wrong @ _ @ - //give_money_post(SHM->i18nstr[cuser.language][173], atoi(money)); + //give_money_post(I18N[173], atoi(money)); } else { if (!(fp = fopen("etc/givemoney.txt", "r+"))) { fclose(fp2); diff --git a/mbbsd/announce.c b/mbbsd/announce.c index e09f0448..184cf3e9 100644 --- a/mbbsd/announce.c +++ b/mbbsd/announce.c @@ -17,7 +17,7 @@ a_copyitem(char *fpath, char *title, char *owner, int mode) else *copyowner = 0; if (mode) { - vmsg(SHM->i18nstr[cuser.language][174]); + vmsg(I18N[174]); } } @@ -52,9 +52,9 @@ a_showmenu(menu_t * pm) char buf[PATHLEN]; time_t dtime; - showtitle(SHM->i18nstr[cuser.language][175], pm->mtitle); - prints(SHM->i18nstr[cuser.language][176], - SHM->i18nstr[cuser.language][177]); + showtitle(I18N[175], pm->mtitle); + prints(I18N[176], + I18N[177]); if (pm->num) { setadir(buf, pm->path); @@ -76,12 +76,12 @@ a_showmenu(menu_t * pm) buf); } } else - outs(SHM->i18nstr[cuser.language][178]); + outs(I18N[178]); move(b_lines, 1); outs(pm->level ? - SHM->i18nstr[cuser.language][179] : - SHM->i18nstr[cuser.language][180]); + I18N[179] : + I18N[180]); } static int @@ -90,7 +90,7 @@ a_searchtitle(menu_t * pm, int rev) static char search_str[40] = ""; int pos; - getdata(b_lines - 1, 1, SHM->i18nstr[cuser.language][181], search_str, sizeof(search_str), DOECHO); + getdata(b_lines - 1, 1, I18N[181], search_str, sizeof(search_str), DOECHO); if (!*search_str) return pm->now; @@ -123,14 +123,14 @@ static void a_showhelp(int level) { clear(); - outs(SHM->i18nstr[cuser.language][182]); + outs(I18N[182]); outs(BBSNAME); - outs(SHM->i18nstr[cuser.language][183]); + outs(I18N[183]); if (level >= MANAGER) { - outs(SHM->i18nstr[cuser.language][184]); + outs(I18N[184]); } if (level >= SYSOP) { - outs(SHM->i18nstr[cuser.language][185]); + outs(I18N[185]); } pressanykey(); } @@ -183,9 +183,9 @@ static void a_newitem(menu_t * pm, int mode) { char *mesg[3] = { - SHM->i18nstr[cuser.language][186], /* ADDITEM */ - SHM->i18nstr[cuser.language][187], /* ADDGROUP */ - SHM->i18nstr[cuser.language][188] /* ADDLINK */ + I18N[186], /* ADDITEM */ + I18N[187], /* ADDGROUP */ + I18N[188] /* ADDLINK */ }; char fpath[PATHLEN], buf[PATHLEN], lpath[PATHLEN]; @@ -197,20 +197,20 @@ a_newitem(menu_t * pm, int mode) switch (mode) { case ADDITEM: stampfile(fpath, &item); - strlcpy(item.title, SHM->i18nstr[cuser.language][189], sizeof(item.title)); /* A1BA */ + strlcpy(item.title, I18N[189], sizeof(item.title)); /* A1BA */ break; case ADDGROUP: stampdir(fpath, &item); - strlcpy(item.title, SHM->i18nstr[cuser.language][190], sizeof(item.title)); /* A1BB */ + strlcpy(item.title, I18N[190], sizeof(item.title)); /* A1BB */ break; case ADDLINK: stamplink(fpath, &item); - if (!getdata(b_lines - 2, 1, SHM->i18nstr[cuser.language][191], buf, 61, DOECHO)) + if (!getdata(b_lines - 2, 1, I18N[191], buf, 61, DOECHO)) return; if (invalid_pname(buf)) { unlink(fpath); - outs(SHM->i18nstr[cuser.language][192]); + outs(I18N[192]); igetch(); return; } @@ -237,10 +237,10 @@ a_newitem(menu_t * pm, int mode) break; } if (dashf(lpath)) { - strlcpy(item.title, SHM->i18nstr[cuser.language][193], sizeof(item.title)); /* A1B3 */ + strlcpy(item.title, I18N[193], sizeof(item.title)); /* A1B3 */ break; } else if (dashd(lpath)) { - strlcpy(item.title, SHM->i18nstr[cuser.language][194], sizeof(item.title)); /* A1B4 */ + strlcpy(item.title, I18N[194], sizeof(item.title)); /* A1B4 */ break; } if (!HAS_PERM(PERM_BBSADM) && d == 1) @@ -249,7 +249,7 @@ a_newitem(menu_t * pm, int mode) if (!item.title[0]) { unlink(fpath); - outs(SHM->i18nstr[cuser.language][195]); + outs(I18N[195]); igetch(); return; } @@ -273,7 +273,7 @@ a_newitem(menu_t * pm, int mode) case ADDLINK: unlink(fpath); if (symlink(lpath, fpath) == -1) { - outs(SHM->i18nstr[cuser.language][196]); + outs(I18N[196]); igetch(); return; } @@ -298,13 +298,13 @@ a_pasteitem(menu_t * pm, int mode) if (dashd(copyfile)) { for (i = 0; copyfile[i] && copyfile[i] == pm->path[i]; i++); if (!copyfile[i]) { - vmsg(SHM->i18nstr[cuser.language][197]); + vmsg(I18N[197]); return; } } if (mode) { snprintf(buf, sizeof(buf), - SHM->i18nstr[cuser.language][198], copytitle); + I18N[198], copytitle); getdata(b_lines - 1, 1, buf, ans, sizeof(ans), LCECHO); } else ans[0] = 'y'; @@ -322,7 +322,7 @@ a_pasteitem(menu_t * pm, int mode) mkdir(pm->path, 0755); memset(&item, 0, sizeof(fileheader_t)); strlcpy(item.filename, fname + 1, sizeof(item.filename)); - memcpy(copytitle, SHM->i18nstr[cuser.language][199], 2); + memcpy(copytitle, I18N[199], 2); if (HAS_PERM(PERM_BBSADM)) Link(copyfile, newpath); else { @@ -330,17 +330,17 @@ a_pasteitem(menu_t * pm, int mode) } } else if (dashf(copyfile)) { stampfile(newpath, &item); - memcpy(copytitle, SHM->i18nstr[cuser.language][200], 2); + memcpy(copytitle, I18N[200], 2); Copy(copyfile, newpath); } else if (dashd(copyfile)) { stampdir(newpath, &item); - memcpy(copytitle, SHM->i18nstr[cuser.language][201], 2); + memcpy(copytitle, I18N[201], 2); snprintf(buf, sizeof(buf), "/bin/cp -r %s/* %s/.D* %s", copyfile, copyfile, newpath); system(buf); } else { - outs(SHM->i18nstr[cuser.language][202]); + outs(I18N[202]); igetch(); return; } @@ -351,7 +351,7 @@ a_pasteitem(menu_t * pm, int mode) copyfile[0] = '\0'; } } else { - outs(SHM->i18nstr[cuser.language][203]); + outs(I18N[203]); igetch(); } } @@ -372,7 +372,7 @@ a_appenditem(menu_t * pm, int isask) if (dashf(fname)) { if (isask) { snprintf(buf, sizeof(buf), - SHM->i18nstr[cuser.language][204], copytitle); + I18N[204], copytitle); getdata(b_lines - 2, 1, buf, ans, sizeof(ans), LCECHO); } if (ans[0] == 'y') { @@ -383,7 +383,7 @@ a_appenditem(menu_t * pm, int isask) fprintf(fp, "\n> %s <\n\n", buf); if (isask) getdata(b_lines - 1, 1, - SHM->i18nstr[cuser.language][205], + I18N[205], ans, sizeof(ans), LCECHO); while (fgets(buf, sizeof(buf), fin)) { if ((ans[0] == 'n') && @@ -398,15 +398,15 @@ a_appenditem(menu_t * pm, int isask) } } } else { - outs(SHM->i18nstr[cuser.language][206]); + outs(I18N[206]); igetch(); } } else { - outs(SHM->i18nstr[cuser.language][207]); + outs(I18N[207]); igetch(); } } else { - outs(SHM->i18nstr[cuser.language][208]); + outs(I18N[208]); igetch(); } } @@ -440,7 +440,7 @@ a_pastetagpost(menu_t * pm, int mode) setbfile(buf, bh->brdname, fhdr.filename); if (dashf(buf)) { - strcpy(title, SHM->i18nstr[cuser.language][209]); + strcpy(title, I18N[209]); strncpy(title + 3, fhdr.title, TTLEN - 3); title[TTLEN] = '\0'; a_copyitem(buf, title, 0, 0); @@ -466,7 +466,7 @@ a_moveitem(menu_t * pm) char buf[PATHLEN]; int fail; - snprintf(buf, sizeof(buf), SHM->i18nstr[cuser.language][210], pm->now + 1); + snprintf(buf, sizeof(buf), I18N[210], pm->now + 1); if (!getdata(b_lines - 1, 1, buf, newnum, sizeof(newnum), DOECHO)) return; num = (newnum[0] == '$') ? 9999 : atoi(newnum) - 1; @@ -522,14 +522,14 @@ a_delete(menu_t * pm) if (pm->header[pm->now - pm->page].filename[0] == 'H' && pm->header[pm->now - pm->page].filename[1] == '.') { - getdata(b_lines - 1, 1, SHM->i18nstr[cuser.language][211], + getdata(b_lines - 1, 1, I18N[211], ans, sizeof(ans), LCECHO); if (ans[0] != 'y') return; if (delete_record(buf, FHSZ, pm->now + 1) == -1) return; } else if (dashl(fpath)) { - getdata(b_lines - 1, 1, SHM->i18nstr[cuser.language][212], + getdata(b_lines - 1, 1, I18N[212], ans, sizeof(ans), LCECHO); if (ans[0] != 'y') return; @@ -537,7 +537,7 @@ a_delete(menu_t * pm) return; unlink(fpath); } else if (dashf(fpath)) { - getdata(b_lines - 1, 1, SHM->i18nstr[cuser.language][213], ans, + getdata(b_lines - 1, 1, I18N[213], ans, sizeof(ans), LCECHO); if (ans[0] != 'y') return; @@ -557,7 +557,7 @@ a_delete(menu_t * pm) setbdir(buf, "deleted"); append_record(buf, &backup, sizeof(backup)); } else if (dashd(fpath)) { - getdata(b_lines - 1, 1, SHM->i18nstr[cuser.language][214], ans, + getdata(b_lines - 1, 1, I18N[214], ans, sizeof(ans), LCECHO); if (ans[0] != 'y') return; @@ -579,7 +579,7 @@ a_delete(menu_t * pm) setadir(buf, buf); append_record(buf, &backup, sizeof(backup)); } else { /* Ptt 損毀的項目 */ - getdata(b_lines - 1, 1, SHM->i18nstr[cuser.language][215], + getdata(b_lines - 1, 1, I18N[215], ans, sizeof(ans), LCECHO); if (ans[0] != 'y') return; @@ -597,7 +597,7 @@ a_newtitle(menu_t * pm) memcpy(&item, &pm->header[pm->now - pm->page], FHSZ); strlcpy(buf, item.title + 3, sizeof(buf)); - if (getdata_buf(b_lines - 1, 1, SHM->i18nstr[cuser.language][216], buf, 60, DOECHO)) { + if (getdata_buf(b_lines - 1, 1, I18N[216], buf, 60, DOECHO)) { strlcpy(item.title + 3, buf, sizeof(item.title) - 3); setadir(buf, pm->path); substitute_record(buf, &item, FHSZ, pm->now + 1); @@ -626,7 +626,7 @@ a_editsign(menu_t * pm) memcpy(&item, &pm->header[pm->now - pm->page], FHSZ); snprintf(buf, sizeof(buf), "%c%c", item.title[0], item.title[1]); - if (getdata_buf(b_lines - 1, 1, SHM->i18nstr[cuser.language][217], buf, 5, DOECHO)) { + if (getdata_buf(b_lines - 1, 1, I18N[217], buf, 5, DOECHO)) { item.title[0] = buf[0] ? buf[0] : ' '; item.title[1] = buf[1] ? buf[1] : ' '; item.title[2] = buf[2] ? buf[2] : ' '; @@ -647,7 +647,7 @@ a_showname(menu_t * pm) snprintf(buf, sizeof(buf), "%s/%s", pm->path, pm->header[pm->now - pm->page].filename); if (dashl(buf)) { - prints(SHM->i18nstr[cuser.language][218], + prints(I18N[218], pm->header[pm->now - pm->page].filename); if ((len = readlink(buf, buf, PATHLEN - 1)) >= 0) { buf[len] = '\0'; @@ -663,16 +663,16 @@ a_showname(menu_t * pm) sym = 1; } if (sym) { - vmsg(SHM->i18nstr[cuser.language][219], &buf[i + 1]); + vmsg(I18N[219], &buf[i + 1]); } } } } else if (dashf(buf)) - prints(SHM->i18nstr[cuser.language][220], pm->header[pm->now - pm->page].filename); + prints(I18N[220], pm->header[pm->now - pm->page].filename); else if (dashd(buf)) - prints(SHM->i18nstr[cuser.language][221], pm->header[pm->now - pm->page].filename); + prints(I18N[221], pm->header[pm->now - pm->page].filename); else - outs(SHM->i18nstr[cuser.language][222]); + outs(I18N[222]); pressanykey(); } @@ -682,8 +682,8 @@ static char *a_title; static void atitle() { - showtitle(SHM->i18nstr[cuser.language][223], a_title); - outs(SHM->i18nstr[cuser.language][224]); + showtitle(I18N[223], a_title); + outs(I18N[224]); } #endif @@ -849,7 +849,7 @@ a_menu(char *maintitle, char *path, int lastlevel) */ if( !lastlevel && !HAS_PERM(PERM_SYSOP) && !is_BM_cache(currbid) && dashd(fname) ) - vmsg(SHM->i18nstr[cuser.language][225]); + vmsg(I18N[225]); else a_copyitem(fname, me.header[me.now - me.page].title, 0, 1); me.page = 9999; @@ -868,7 +868,7 @@ a_menu(char *maintitle, char *path, int lastlevel) #endif snprintf(fname, sizeof(fname), "%s/%s", path, fhdr->filename); if (*fhdr->filename == 'H' && fhdr->filename[1] == '.') { - vmsg(SHM->i18nstr[cuser.language][226]); + vmsg(I18N[226]); vmsg("gopher://%s/1/",fhdr->filename+2); } else if (dashf(fname)) { int more_result; @@ -882,8 +882,8 @@ a_menu(char *maintitle, char *path, int lastlevel) clrtoeol(); getdata(22, 1, currstat == EDITEXP ? - SHM->i18nstr[cuser.language][227] : - SHM->i18nstr[cuser.language][228], + I18N[227] : + I18N[228], ans, sizeof(ans), LCECHO); if (ans[0] == 'y') { strlcpy(trans_buffer, @@ -937,7 +937,7 @@ a_menu(char *maintitle, char *path, int lastlevel) a_forward(path, &me.header[me.now - me.page], ch /* == 'U' */ ); /* By CharlieL */ } else - vmsg(SHM->i18nstr[cuser.language][229]); + vmsg(I18N[229]); me.page = 9999; break; @@ -945,20 +945,20 @@ a_menu(char *maintitle, char *path, int lastlevel) #ifdef BLOG case 'b': if( !HAS_PERM(PERM_SYSOP) && !is_BM_cache(currbid) ) - vmsg(SHM->i18nstr[cuser.language][230]); + vmsg(I18N[230]); else{ char genbuf[128]; snprintf(genbuf, sizeof(genbuf), "bin/builddb.pl -f -n %d %s", me.now, currboard); system(genbuf); - vmsg(SHM->i18nstr[cuser.language][231]); + vmsg(I18N[231]); } me.page = 9999; break; case 'B': if( !HAS_PERM(SYSOP) && !is_BM_cache(currbid) ) - vmsg(SHM->i18nstr[cuser.language][232]); + vmsg(I18N[232]); else BlogMain(me.now); me.page = 9999; @@ -1054,7 +1054,7 @@ Announce() { setutmpmode(ANNOUNCE); char mytitle[256]; - sprintf(mytitle, "%s%s", BBSNAME, SHM->i18nstr[cuser.language][233]); + sprintf(mytitle, "%s%s", BBSNAME, I18N[233]); a_menu(mytitle, "man", ((HAS_PERM(PERM_SYSOP) || HAS_PERM(PERM_ANNOUNCE)) ? SYSOP : NOBODY)); @@ -1069,13 +1069,13 @@ void BlogMain(int num) char genbuf[128], exit = 0; //setutmpmode(BLOGGING); /* will crash someone using old program */ - sprintf(genbuf, SHM->i18nstr[cuser.language][234], currboard); - showtitle(SHM->i18nstr[cuser.language][235], genbuf); + sprintf(genbuf, I18N[234], currboard); + showtitle(I18N[235], genbuf); while( !exit ){ move(1, 0); - prints(SHM->i18nstr[cuser.language][236] + prints(I18N[236] ); - switch( getans(SHM->i18nstr[cuser.language][237]) ){ + switch( getans(I18N[237]) ){ case '1': snprintf(genbuf, sizeof(genbuf), "bin/builddb.pl -c %s", currboard); @@ -1094,17 +1094,17 @@ void BlogMain(int num) case '4':{ char hash[35]; int i; - getdata(16, 0, SHM->i18nstr[cuser.language][238], + getdata(16, 0, I18N[238], hash, sizeof(hash), DOECHO); for( i = 0 ; hash[i] != 0 ; ++i ) /* 前面用 getdata() 保證有 \0 */ if( !islower(hash[i]) && !isnumber(hash[i]) ) break; if( i != 32 ){ - vmsg(SHM->i18nstr[cuser.language][239]); + vmsg(I18N[239]); break; } if( hash[0] != 0 && - getans(SHM->i18nstr[cuser.language][240]) == 'y' ){ + getans(I18N[240]) == 'y' ){ MYSQL mysql; char cmd[256]; @@ -1117,7 +1117,7 @@ void BlogMain(int num) BLOGDB_PASSWD, BLOGDB_DB, BLOGDB_PORT, BLOGDB_SOCK, 0) || mysql_query(&mysql, cmd)) ) - vmsg(SHM->i18nstr[cuser.language][241]); + vmsg(I18N[241]); else vmsg( #ifdef DEBUG @@ -1133,7 +1133,7 @@ void BlogMain(int num) case '5': { char date[9]; - getdata(16, 0, SHM->i18nstr[cuser.language][242], + getdata(16, 0, I18N[242], date, sizeof(date), DOECHO); snprintf(genbuf, sizeof(genbuf), "bin/builddb.pl -D %s %s", date, currboard); @@ -1146,7 +1146,7 @@ void BlogMain(int num) char fpath[PATHLEN], adir[PATHLEN], buf[256]; sprintf(fpath, "man/boards/%c/%s", currboard[0], currboard); stampdir(fpath, &item); - strlcpy(item.title, SHM->i18nstr[cuser.language][243], sizeof(item.title)); + strlcpy(item.title, I18N[243], sizeof(item.title)); strlcpy(item.owner, cuser.userid, sizeof(item.owner)); sprintf(adir, "man/boards/%c/%s/.DIR", currboard[0], currboard); @@ -1166,7 +1166,7 @@ void BlogMain(int num) break; } if( !exit ) - vmsg(SHM->i18nstr[cuser.language][244]); + vmsg(I18N[244]); } currutmp->mode = oldmode; pressanykey(); diff --git a/mbbsd/bbs.c b/mbbsd/bbs.c index 2f181e9b..bee3cd26 100644 --- a/mbbsd/bbs.c +++ b/mbbsd/bbs.c @@ -5,7 +5,7 @@ static int recommend(int ent, fileheader_t * fhdr, char *direct); #ifdef ASSESS static char *badpost_reason[] = { - SHM->i18nstr[cuser.language][245], SHM->i18nstr[cuser.language][246], SHM->i18nstr[cuser.language][247] + I18N[245], SHM->i18nstr[cuser.language][246], SHM->i18nstr[cuser.language][247] }; #endif @@ -30,11 +30,11 @@ mail_by_link(char *owner, char *title, char *path) void anticrosspost() { - log_file("etc/illegal_money", 1, SHM->i18nstr[cuser.language][248], cuser.userid, ctime(&now)); - post_violatelaw(cuser.userid, SHM->i18nstr[cuser.language][249], "Cross-post", SHM->i18nstr[cuser.language][250]); + log_file("etc/illegal_money", 1, I18N[248], cuser.userid, ctime(&now)); + post_violatelaw(cuser.userid, I18N[249], "Cross-post", SHM->i18nstr[cuser.language][250]); cuser.userlevel |= PERM_VIOLATELAW; cuser.vl_count++; - mail_by_link(SHM->i18nstr[cuser.language][251], SHM->i18nstr[cuser.language][252], + mail_by_link(I18N[251], SHM->i18nstr[cuser.language][252], BBSHOME "/etc/crosspost.txt"); u_exit("Cross Post"); exit(0); @@ -48,39 +48,39 @@ save_violatelaw() setutmpmode(VIOLATELAW); clear(); - stand_title(SHM->i18nstr[cuser.language][253]); + stand_title(I18N[253]); if (!(cuser.userlevel & PERM_VIOLATELAW)) { - mouts(22, 0, SHM->i18nstr[cuser.language][254]); + mouts(22, 0, I18N[254]); pressanykey(); return 0; } reload_money(); if (cuser.money < (int)cuser.vl_count * 1000) { - snprintf(buf, sizeof(buf), SHM->i18nstr[cuser.language][255], + snprintf(buf, sizeof(buf), I18N[255], (int)cuser.vl_count, (int)cuser.vl_count * 1000, cuser.money); mouts(22, 0, buf); pressanykey(); return 0; } move(5, 0); - prints(SHM->i18nstr[cuser.language][256]); - prints(SHM->i18nstr[cuser.language][257]); + prints(I18N[256]); + prints(I18N[257]); - if (!getdata(10, 0, SHM->i18nstr[cuser.language][258], ok, sizeof(ok), LCECHO) || + if (!getdata(10, 0, I18N[258], ok, sizeof(ok), LCECHO) || ok[0] == 'n' || ok[0] == 'N') { - mouts(22, 0, SHM->i18nstr[cuser.language][259]); + mouts(22, 0, I18N[259]); pressanykey(); return 0; } - snprintf(buf, sizeof(buf), SHM->i18nstr[cuser.language][260], + snprintf(buf, sizeof(buf), I18N[260], cuser.vl_count, cuser.vl_count * 1000); mouts(11, 0, buf); - if (!getdata(10, 0, SHM->i18nstr[cuser.language][261], ok, sizeof(ok), LCECHO) || + if (!getdata(10, 0, I18N[261], ok, sizeof(ok), LCECHO) || ok[0] == 'N' || ok[0] == 'n') { - mouts(22, 0, SHM->i18nstr[cuser.language][262]); + mouts(22, 0, I18N[262]); pressanykey(); return 0; } @@ -109,9 +109,9 @@ set_board() } board_note_time = &bp->bupdate; if(bp->BM[0] <= ' ') - strcpy(currBM, SHM->i18nstr[cuser.language][263]); + strcpy(currBM, I18N[263]); else - snprintf(currBM, sizeof(currBM), SHM->i18nstr[cuser.language][264], bp->BM); + snprintf(currBM, sizeof(currBM), I18N[264], bp->BM); /* init basic perm, but post perm is checked on demand */ currmode = (currmode & (MODE_DIRTY | MODE_GROUPOP)) | MODE_STARTED; @@ -143,12 +143,12 @@ readtitle() bp = getbcache(currbid); if(bp->bvote != 2 && bp->bvote) - brd_title = SHM->i18nstr[cuser.language][265]; + brd_title = I18N[265]; else brd_title = bp->title + 7; showtitle(currBM, brd_title); - prints(SHM->i18nstr[cuser.language][266], SHM->bcache[currbid - 1].nuser); + prints(I18N[266], SHM->bcache[currbid - 1].nuser); } static void @@ -175,18 +175,18 @@ readdoent(int num, fileheader_t * ent) } title = subject(mark = ent->title); if (ent->filemode & FILE_VOTE) - color = '2', mark = SHM->i18nstr[cuser.language][267]; + color = '2', mark = I18N[267]; else if (ent->filemode & FILE_BID) - color = '6', mark = SHM->i18nstr[cuser.language][268]; + color = '6', mark = I18N[268]; else if (title == mark) - color = '1', mark = SHM->i18nstr[cuser.language][269]; + color = '1', mark = I18N[269]; else color = '3', mark = "R:"; if (title[45]) - strlcpy(title + 42, SHM->i18nstr[cuser.language][270], sizeof(title) - 42); /* 把多餘的 string 砍掉 */ + strlcpy(title + 42, I18N[270], sizeof(title) - 42); /* 把多餘的 string 砍掉 */ - if (!strncmp(title, SHM->i18nstr[cuser.language][271], 6)) + if (!strncmp(title, I18N[271], 6)) special = 1; #if 1 if (!strchr(ent->owner, '.') && !SHM->GV2.e.noonlineuser && @@ -199,7 +199,7 @@ readdoent(int num, fileheader_t * ent) isonline = 1; #endif if(ent->recommend>99) - strcpy(recom,SHM->i18nstr[cuser.language][272]); + strcpy(recom,I18N[272]); else if(ent->recommend>9) sprintf(recom,"3m%2d",ent->recommend); else if(ent->recommend>0) @@ -243,7 +243,7 @@ whereami(int ent, fileheader_t * fhdr, char *direct) for (i = 0; i < 31 && p[i]->parent != root && p[i]->parent; i++) p[i + 1] = p[i]->parent; j = i; - prints(SHM->i18nstr[cuser.language][273], p[j]->title + 7, p[j]->BM); + prints(I18N[273], p[j]->title + 7, p[j]->BM); for (j--; j >= 0; j--) prints("%*s %-13.13s %-37.37s %.13s\n", (i - j) * 2, "", p[j]->brdname, p[j]->title, @@ -370,10 +370,10 @@ do_reply_title(int row, char *title) else strlcpy(save_title, title, sizeof(save_title)); save_title[TTLEN - 1] = '\0'; - snprintf(genbuf, sizeof(genbuf), SHM->i18nstr[cuser.language][274], save_title); + snprintf(genbuf, sizeof(genbuf), I18N[274], save_title); getdata(row, 0, genbuf, genbuf2, 4, LCECHO); if (genbuf2[0] == 'n' || genbuf2[0] == 'N') - getdata(++row, 0, SHM->i18nstr[cuser.language][275], save_title, TTLEN, DOECHO); + getdata(++row, 0, I18N[275], save_title, TTLEN, DOECHO); } static void @@ -415,7 +415,7 @@ do_crosspost(char *brd, fileheader_t *postfile, const char *fpath) stampfile(genbuf, &fh); strcpy(fh.owner, postfile->owner); strcpy(fh.date, postfile->date); - sprintf(fh.title,SHM->i18nstr[cuser.language][276], len, len, postfile->title, currboard); + sprintf(fh.title,I18N[276], len, len, postfile->title, currboard); unlink(genbuf); Link((char *)fpath, genbuf); postfile->filemode = FILE_LOCAL; @@ -428,53 +428,53 @@ static void setupbidinfo(bid_t *bidinfo) { char buf[256]; - bidinfo->enddate = gettime(20, now+86400,SHM->i18nstr[cuser.language][277]); + bidinfo->enddate = gettime(20, now+86400,I18N[277]); do - getdata_str(21,0,SHM->i18nstr[cuser.language][278],buf, 8, LCECHO, "1"); + getdata_str(21,0,I18N[278],buf, 8, LCECHO, "1"); while((bidinfo->high=atoi(buf))<=0); do - getdata_str(21,20, SHM->i18nstr[cuser.language][279],buf, 5, LCECHO, "1"); + getdata_str(21,20, I18N[279],buf, 5, LCECHO, "1"); while((bidinfo->increment=atoi(buf))<=0); - getdata(21,44, SHM->i18nstr[cuser.language][280],buf, 10, LCECHO); + getdata(21,44, I18N[280],buf, 10, LCECHO); bidinfo->buyitnow=atoi(buf); getdata_str(22,0, - SHM->i18nstr[cuser.language][281], + I18N[281], buf, 3, LCECHO,"1"); bidinfo->payby=(buf[0]-'1'); if(bidinfo->payby<0 ||bidinfo->payby>3)bidinfo->payby=0; - getdata_str(23,0, SHM->i18nstr[cuser.language][282], buf, 6, LCECHO, "0"); + getdata_str(23,0, I18N[282], buf, 6, LCECHO, "0"); bidinfo->shipping = atoi(buf); if(bidinfo->shipping<0) bidinfo->shipping=0; } static void print_bidinfo(FILE *io, bid_t bidinfo) { - char *payby[4]={ SHM->i18nstr[cuser.language][283],SHM->i18nstr[cuser.language][284],SHM->i18nstr[cuser.language][285],SHM->i18nstr[cuser.language][286]}; + char *payby[4]={ I18N[283],SHM->i18nstr[cuser.language][284],SHM->i18nstr[cuser.language][285],SHM->i18nstr[cuser.language][286]}; if(io) { if(!bidinfo.userid[0]) - fprintf(io,SHM->i18nstr[cuser.language][287],bidinfo.high); + fprintf(io,I18N[287],bidinfo.high); else - fprintf(io, SHM->i18nstr[cuser.language][288],bidinfo.high, bidinfo.userid); - fprintf(io, SHM->i18nstr[cuser.language][289],payby[bidinfo.payby%4],Cdate(& bidinfo.enddate)); + fprintf(io, I18N[288],bidinfo.high, bidinfo.userid); + fprintf(io, I18N[289],payby[bidinfo.payby%4],Cdate(& bidinfo.enddate)); if(bidinfo.buyitnow) - fprintf(io, SHM->i18nstr[cuser.language][290],bidinfo.buyitnow); + fprintf(io, I18N[290],bidinfo.buyitnow); if(bidinfo.shipping) - fprintf(io, SHM->i18nstr[cuser.language][291], bidinfo.shipping); + fprintf(io, I18N[291], bidinfo.shipping); fprintf(io, "\n"); } else { if(!bidinfo.userid[0]) - prints(SHM->i18nstr[cuser.language][292],bidinfo.high); + prints(I18N[292],bidinfo.high); else - prints(SHM->i18nstr[cuser.language][293],bidinfo.high, bidinfo.userid); - prints(SHM->i18nstr[cuser.language][294],payby[bidinfo.payby%4],Cdate(& bidinfo.enddate)); + prints(I18N[293],bidinfo.high, bidinfo.userid); + prints(I18N[294],payby[bidinfo.payby%4],Cdate(& bidinfo.enddate)); if(bidinfo.buyitnow) - prints(SHM->i18nstr[cuser.language][295],bidinfo.buyitnow); + prints(I18N[295],bidinfo.buyitnow); if(bidinfo.shipping) - prints(SHM->i18nstr[cuser.language][296], bidinfo.shipping); + prints(I18N[296], bidinfo.shipping); prints("\n"); } @@ -500,7 +500,7 @@ do_general(int isbid) && !((cuser.uflag2 & FOREIGN) && strcmp(bp->brdname, "PttForeign") == 0) #endif ) { - vmsg(SHM->i18nstr[cuser.language][305]); + vmsg(I18N[305]); return READ_REDRAW; } #ifdef NO_WATER_POST @@ -508,7 +508,7 @@ do_general(int isbid) /* 三分鐘內最多發表五篇文章 */ if (currutmp->lastact - last_post_time < 60 * 3) { if (water_counts >= 5) { - vmsg(SHM->i18nstr[cuser.language][306]); + vmsg(I18N[306]); return READ_REDRAW; } } else { @@ -531,8 +531,8 @@ do_general(int isbid) more("etc/" FN_POST_BID, NA); } move(19, 0); - prints(SHM->i18nstr[cuser.language][307], - isbid?SHM->i18nstr[cuser.language][308]:SHM->i18nstr[cuser.language][309], + prints(I18N[307], + isbid?I18N[308]:SHM->i18nstr[cuser.language][309], currboard, bp->title + 7); if(isbid) @@ -549,15 +549,15 @@ do_general(int isbid) if(!isbid) { move(21,0); - prints(SHM->i18nstr[cuser.language][310]); + prints(I18N[310]); for(i=0; i<8 ; i++) - strlcpy(ctype[i], SHM->i18nstr[cuser.language][297 + i], sizeof(ctype[0])); + strlcpy(ctype[i], I18N[297 + i], sizeof(ctype[0])); for(i=0; i<8 && bp->posttype[i*4]; i++) strncpy(ctype[i],bp->posttype+4*i,4); if(i==0) i=8; for(aborted=0; aborted<i; aborted++) prints("%d.%4.4s ", aborted+1, ctype[aborted]); - sprintf(buf,SHM->i18nstr[cuser.language][311],i); + sprintf(buf,I18N[311],i); getdata(21, 6+7*i, buf, save_title, 3, LCECHO); posttype = save_title[0] - '1'; if (posttype >= 0 && posttype < i) @@ -569,7 +569,7 @@ do_general(int isbid) posttype=-1; } } - getdata_buf(22, 0, SHM->i18nstr[cuser.language][312], save_title, TTLEN, DOECHO); + getdata_buf(22, 0, I18N[312], save_title, TTLEN, DOECHO); strip_ansi(save_title, save_title, STRIP_ALL); } if (save_title[0] == '\0') @@ -661,29 +661,29 @@ do_general(int isbid) (!bp->level || (currbrdattr & BRD_POSTMASK))) { do_crosspost(ALLPOST, &postfile, fpath); } - outs(SHM->i18nstr[cuser.language][313]); + outs(I18N[313]); #ifdef MAX_POST_MONEY aborted = (aborted > MAX_POST_MONEY) ? MAX_POST_MONEY : aborted; #endif if (strcmp(currboard, "Test") && !ifuseanony) { - prints(SHM->i18nstr[cuser.language][314],++cuser.numposts); + prints(I18N[314],++cuser.numposts); if(postfile.filemode&FILE_BID) - prints(SHM->i18nstr[cuser.language][315]); + prints(I18N[315]); else if(currbrdattr&BRD_BAD) - prints(SHM->i18nstr[cuser.language][316]); + prints(I18N[316]); else { - prints(SHM->i18nstr[cuser.language][317],aborted); + prints(I18N[317],aborted); demoney(aborted); } } else - outs(SHM->i18nstr[cuser.language][318]); + outs(I18N[318]); /* 回應到原作者信箱 */ if (curredit & EDIT_BOTH) { - char *str, *msg = SHM->i18nstr[cuser.language][319]; + char *str, *msg = I18N[319]; if ((str = strchr(quote_user, '.'))) { if ( @@ -693,7 +693,7 @@ do_general(int isbid) bsmtp(fpath, save_title, str + 1, 0) #endif < 0) - msg = SHM->i18nstr[cuser.language][320]; + msg = I18N[320]; } else { sethomepath(genbuf, quote_user); stampfile(genbuf, &postfile); @@ -749,7 +749,7 @@ do_generalboardreply(fileheader_t * fhdr) { char genbuf[3]; getdata(b_lines - 1, 0, - SHM->i18nstr[cuser.language][321], + I18N[321], genbuf, sizeof(genbuf), LCECHO); switch (genbuf[0]) { case 'm': @@ -813,7 +813,7 @@ b_posttype(int ent, fileheader_t * fhdr, char *direct) for(i=0; i<8; i++) { move(2,0); - outs(SHM->i18nstr[cuser.language][322]); + outs(I18N[322]); strncpy(genbuf, bp->posttype+i*4, 4); genbuf[4]=0; sprintf(title,"%d.",i+1); @@ -821,14 +821,14 @@ b_posttype(int ent, fileheader_t * fhdr, char *direct) sprintf(posttype+i*4,"%-4.4s", genbuf); if( posttype_f & (1<<i) ) { - if(getdata(2, 20, SHM->i18nstr[cuser.language][323], genbuf, 3, LCECHO) && + if(getdata(2, 20, I18N[323], genbuf, 3, LCECHO) && genbuf[0]=='n') { posttype_f &= ~(1<<i); continue; } } - else if (!getdata(2, 20, SHM->i18nstr[cuser.language][324], genbuf, 3, LCECHO) || + else if (!getdata(2, 20, I18N[324], genbuf, 3, LCECHO) || genbuf[0]!='y') continue; setbnfile(filepath, bp->brdname, "postsample", i); @@ -927,7 +927,7 @@ cross_post(int ent, fileheader_t * fhdr, char *direct) boardheader_t *bp; if (!CheckPostPerm()) { move(5, 10); - outs(SHM->i18nstr[cuser.language][325]); + outs(I18N[325]); pressanykey(); return FULLUPDATE; } @@ -937,7 +937,7 @@ cross_post(int ent, fileheader_t * fhdr, char *direct) bp = getbcache(currbid); if (bp && (bp->brdattr & BRD_VOTEBOARD) ) return FULLUPDATE; - generalnamecomplete(SHM->i18nstr[cuser.language][326], xboard, sizeof(xboard), + generalnamecomplete(I18N[326], xboard, sizeof(xboard), SHM->Bnumber, completeboard_compar, completeboard_permission, @@ -957,27 +957,27 @@ cross_post(int ent, fileheader_t * fhdr, char *direct) ent = 1; if (HAS_PERM(PERM_SYSOP) || !strcmp(fhdr->owner, cuser.userid)) { - getdata(2, 0, SHM->i18nstr[cuser.language][327], + getdata(2, 0, I18N[327], genbuf, 3, DOECHO); if (genbuf[0] != '2') { ent = 0; - getdata(2, 0, SHM->i18nstr[cuser.language][328], inputbuf, 3, DOECHO); + getdata(2, 0, I18N[328], inputbuf, 3, DOECHO); if (inputbuf[0] != 'n' && inputbuf[0] != 'N') author = 1; } } if (ent) - snprintf(xtitle, sizeof(xtitle), SHM->i18nstr[cuser.language][329], fhdr->title); + snprintf(xtitle, sizeof(xtitle), I18N[329], fhdr->title); else strlcpy(xtitle, fhdr->title, sizeof(xtitle)); - snprintf(genbuf, sizeof(genbuf), SHM->i18nstr[cuser.language][330], xtitle); + snprintf(genbuf, sizeof(genbuf), I18N[330], xtitle); getdata(2, 0, genbuf, genbuf2, 4, LCECHO); if (genbuf2[0] == 'n' || genbuf2[0] == 'N') { - if (getdata_str(2, 0, SHM->i18nstr[cuser.language][331], genbuf, TTLEN, DOECHO, xtitle)) + if (getdata_str(2, 0, I18N[331], genbuf, TTLEN, DOECHO, xtitle)) strlcpy(xtitle, genbuf, sizeof(xtitle)); } - getdata(2, 0, SHM->i18nstr[cuser.language][332], genbuf, 3, LCECHO); + getdata(2, 0, I18N[332], genbuf, 3, LCECHO); if (genbuf[0] == 'l' || genbuf[0] == 's') { int currmode0 = currmode; char *save_currboard; @@ -1002,7 +1002,7 @@ cross_post(int ent, fileheader_t * fhdr, char *direct) write_header(xptr); currboard = save_currboard; - fprintf(xptr, SHM->i18nstr[cuser.language][333], currboard); + fprintf(xptr, I18N[333], currboard); b_suckinfile(xptr, fname); addsignature(xptr, 0); @@ -1018,7 +1018,7 @@ cross_post(int ent, fileheader_t * fhdr, char *direct) setbtotal(getbnum(xboard)); cuser.numposts++; UPDATE_USEREC; - outs(SHM->i18nstr[cuser.language][334]); + outs(I18N[334]); pressanykey(); currmode = currmode0; } @@ -1105,7 +1105,7 @@ join_gamble(int ent, fileheader_t * fhdr, char *direct) if (!HAS_PERM(PERM_LOGINOK)) return DONOTHING; if (stop_gamble()) { - vmsg(SHM->i18nstr[cuser.language][336]); + vmsg(I18N[336]); return DONOTHING; } ticket(currbid); @@ -1126,7 +1126,7 @@ hold_gamble(int ent, fileheader_t * fhdr, char *direct) setbfile(fn_ticket_end, currboard, FN_TICKET_END); setbfile(genbuf, currboard, FN_TICKET_LOCK); if (dashf(fn_ticket)) { - getdata(b_lines - 1, 0, SHM->i18nstr[cuser.language][337], yn, 3, LCECHO); + getdata(b_lines - 1, 0, I18N[337], yn, 3, LCECHO); if (yn[0] != 'y') return FULLUPDATE; rename(fn_ticket, fn_ticket_end); @@ -1138,26 +1138,26 @@ hold_gamble(int ent, fileheader_t * fhdr, char *direct) return FULLUPDATE; } if (dashf(fn_ticket_end)) { - getdata(b_lines - 1, 0, SHM->i18nstr[cuser.language][338], yn, 3, LCECHO); + getdata(b_lines - 1, 0, I18N[338], yn, 3, LCECHO); if (yn[0] != 'y') return FULLUPDATE; openticket(currbid); return FULLUPDATE; } else if (dashf(genbuf)) { - vmsg(SHM->i18nstr[cuser.language][339]); + vmsg(I18N[339]); return FULLUPDATE; } - getdata(b_lines - 2, 0, SHM->i18nstr[cuser.language][340], yn, 3, LCECHO); + getdata(b_lines - 2, 0, I18N[340], yn, 3, LCECHO); if (yn[0] != 'y') return FULLUPDATE; - getdata(b_lines - 1, 0, SHM->i18nstr[cuser.language][341], + getdata(b_lines - 1, 0, I18N[341], msg, 20, DOECHO); if (msg[0] == 0 || vedit(fn_ticket_end, NA, NULL) < 0) return FULLUPDATE; clear(); - showtitle(SHM->i18nstr[cuser.language][342], BBSNAME); + showtitle(I18N[342], BBSNAME); setbfile(genbuf, currboard, FN_TICKET_ITEMS); //sprintf(genbuf, "%s/" FN_TICKET_ITEMS, direct); @@ -1165,25 +1165,25 @@ hold_gamble(int ent, fileheader_t * fhdr, char *direct) if (!(fp = fopen(genbuf, "w"))) return FULLUPDATE; do { - getdata(2, 0, SHM->i18nstr[cuser.language][343], yn, 6, LCECHO); + getdata(2, 0, I18N[343], yn, 6, LCECHO); i = atoi(yn); } while (i < 10 || i > 10000); fprintf(fp, "%d\n", i); - if (!getdata(3, 0, SHM->i18nstr[cuser.language][344], yn, 3, LCECHO) || yn[0] != 'n') { - bp->endgamble = gettime(4, now, SHM->i18nstr[cuser.language][345]); + if (!getdata(3, 0, I18N[344], yn, 3, LCECHO) || yn[0] != 'n') { + bp->endgamble = gettime(4, now, I18N[345]); substitute_record(fn_board, bp, sizeof(boardheader_t), currbid); } move(6, 0); snprintf(genbuf, sizeof(genbuf), - SHM->i18nstr[cuser.language][346], + I18N[346], currboard, - i, i < 100 ? SHM->i18nstr[cuser.language][347] : i < 500 ? SHM->i18nstr[cuser.language][348] : - i < 1000 ? SHM->i18nstr[cuser.language][349] : i < 5000 ? SHM->i18nstr[cuser.language][350] : SHM->i18nstr[cuser.language][351], - bp->endgamble ? SHM->i18nstr[cuser.language][352] : "", + i, i < 100 ? I18N[347] : i < 500 ? SHM->i18nstr[cuser.language][348] : + i < 1000 ? I18N[349] : i < 5000 ? SHM->i18nstr[cuser.language][350] : SHM->i18nstr[cuser.language][351], + bp->endgamble ? I18N[352] : "", bp->endgamble ? Cdate(&bp->endgamble) : "" ); strcat(msg, genbuf); - prints(SHM->i18nstr[cuser.language][353]); + prints(I18N[353]); for (i = 0; i < 8; i++) { snprintf(yn, sizeof(yn), " %d)", i + 1); getdata(7 + i, 0, yn, genbuf, 9, DOECHO); @@ -1199,10 +1199,10 @@ hold_gamble(int ent, fileheader_t * fhdr, char *direct) unlink(genbuf); // Ptt: 防堵利用不同id同時舉辦賭場 move(8 + i, 0); - prints(SHM->i18nstr[cuser.language][354]); - snprintf(genbuf, sizeof(genbuf), SHM->i18nstr[cuser.language][355], currboard); + prints(I18N[354]); + snprintf(genbuf, sizeof(genbuf), I18N[355], currboard); post_msg(currboard, genbuf, msg, cuser.userid); - post_msg("Record", genbuf + 7, msg, SHM->i18nstr[cuser.language][356]); + post_msg("Record", genbuf + 7, msg, I18N[356]); /* Tim 控制CS, 以免正在玩的user把資料已經寫進來 */ rename(fn_ticket_end, fn_ticket); /* 設定完才把檔名改過來 */ @@ -1218,7 +1218,7 @@ cite_post(int ent, fileheader_t * fhdr, char *direct) char title[TTLEN + 1]; setbfile(fpath, currboard, fhdr->filename); - strlcpy(title, SHM->i18nstr[cuser.language][357], sizeof(title)); + strlcpy(title, I18N[357], sizeof(title)); strlcpy(title + 3, fhdr->title, TTLEN - 3); title[TTLEN] = '\0'; a_copyitem(fpath, title, 0, 1); @@ -1234,23 +1234,23 @@ edit_title(int ent, fileheader_t * fhdr, char *direct) int dirty = 0; if (currmode & MODE_BOARD || !strcmp(cuser.userid, fhdr->owner)) { - if (getdata(b_lines - 1, 0, SHM->i18nstr[cuser.language][358], genbuf, TTLEN, DOECHO)) { + if (getdata(b_lines - 1, 0, I18N[358], genbuf, TTLEN, DOECHO)) { strlcpy(tmpfhdr.title, genbuf, sizeof(tmpfhdr.title)); dirty++; } } if (HAS_PERM(PERM_SYSOP)) { - if (getdata(b_lines - 1, 0, SHM->i18nstr[cuser.language][359], genbuf, IDLEN + 2, DOECHO)) { + if (getdata(b_lines - 1, 0, I18N[359], genbuf, IDLEN + 2, DOECHO)) { strlcpy(tmpfhdr.owner, genbuf, sizeof(tmpfhdr.owner)); dirty++; } - if (getdata(b_lines - 1, 0, SHM->i18nstr[cuser.language][360], genbuf, 6, DOECHO)) { + if (getdata(b_lines - 1, 0, I18N[360], genbuf, 6, DOECHO)) { snprintf(tmpfhdr.date, sizeof(tmpfhdr.date), "%.5s", genbuf); dirty++; } } if (currmode & MODE_BOARD || !strcmp(cuser.userid, fhdr->owner)) { - getdata(b_lines - 1, 0, SHM->i18nstr[cuser.language][361], genbuf, 3, DOECHO); + getdata(b_lines - 1, 0, I18N[361], genbuf, 3, DOECHO); if ((genbuf[0] == 'y' || genbuf[0] == 'Y') && dirty) { *fhdr = tmpfhdr; substitute_ref_record(direct, fhdr, ent); @@ -1277,7 +1277,7 @@ recommend_cancel(int ent, fileheader_t * fhdr, char *direct) char yn[5]; if (!(currmode & MODE_BOARD)) return DONOTHING; - getdata(b_lines - 1, 0, SHM->i18nstr[cuser.language][362], yn, 5, LCECHO); + getdata(b_lines - 1, 0, I18N[362], yn, 5, LCECHO); if (yn[0] != 'y') return FULLUPDATE; #ifdef ASSESS @@ -1305,7 +1305,7 @@ do_add_recommend(char *direct, fileheader_t *fhdr, int ent, char *buf) */ setdirpath(path, direct, fhdr->filename); if( log_file(path, 0, buf) == -1 ){ // 不 CREATE - vmsg(SHM->i18nstr[cuser.language][363]); + vmsg(I18N[363]); return -1; } @@ -1340,21 +1340,21 @@ do_bid(int ent, fileheader_t * fhdr, boardheader_t *bp, char *direct, struct t get_record(fpath, &bidinfo, sizeof(bidinfo), 1); move(18,0); clrtobot(); - prints(SHM->i18nstr[cuser.language][364], fhdr->title); + prints(I18N[364], fhdr->title); print_bidinfo(0, bidinfo); if(!bidinfo.payby) money="Ptt$ "; else money=" NT$ "; if(now>bidinfo.enddate || bidinfo.high==bidinfo.buyitnow) { - prints(SHM->i18nstr[cuser.language][365]); + prints(I18N[365]); if( bidinfo.userid[0]) { /*if(!payby && bidinfo.usermax!=-1) {以Ptt幣自動扣款 }*/ - prints(SHM->i18nstr[cuser.language][366], bidinfo.userid, + prints(I18N[366], bidinfo.userid, bidinfo.high); #ifdef ASSESS if (!(bidinfo.flag & SALE_COMMENTED) && strcmp(bidinfo.userid, currutmp->userid) == 0){ - char tmp = getans(SHM->i18nstr[cuser.language][367]); + char tmp = getans(I18N[367]); if ('1' <= tmp && tmp <= '3'){ switch(tmp){ case 1: @@ -1370,40 +1370,40 @@ do_bid(int ent, fileheader_t * fhdr, boardheader_t *bp, char *direct, struct t } #endif } - else prints(SHM->i18nstr[cuser.language][368]); + else prints(I18N[368]); pressanykey(); return FULLUPDATE; } if(bidinfo.userid[0]) { - prints(SHM->i18nstr[cuser.language][369], money,bidinfo.high + bidinfo.increment); + prints(I18N[369], money,bidinfo.high + bidinfo.increment); if(bidinfo.buyitnow) - prints(SHM->i18nstr[cuser.language][370],bidinfo.buyitnow); + prints(I18N[370],bidinfo.buyitnow); next=bidinfo.high + bidinfo.increment; } else { - prints(SHM->i18nstr[cuser.language][371], bidinfo.high); + prints(I18N[371], bidinfo.high); next=bidinfo.high; } if(!strcmp(cuser.userid,bidinfo.userid)) { - prints(SHM->i18nstr[cuser.language][372]); + prints(I18N[372]); pressanykey(); return FULLUPDATE; } if (strcmp(cuser.userid, fhdr->owner) == 0){ - vmsg(SHM->i18nstr[cuser.language][373]); + vmsg(I18N[373]); return FULLUPDATE; } - getdata_str(23,0,SHM->i18nstr[cuser.language][374], genbuf, 3, LCECHO,"n"); + getdata_str(23,0,I18N[374], genbuf, 3, LCECHO,"n"); if(genbuf[0]!='y') return FULLUPDATE; - getdata(23, 0, SHM->i18nstr[cuser.language][375], genbuf, 10, LCECHO); + getdata(23, 0, I18N[375], genbuf, 10, LCECHO); mymax=atoi(genbuf); - getdata(23,0,SHM->i18nstr[cuser.language][376],say,12,DOECHO); + getdata(23,0,I18N[376],say,12,DOECHO); get_record(fpath, &bidinfo, sizeof(bidinfo), 1); @@ -1417,12 +1417,12 @@ do_bid(int ent, fileheader_t * fhdr, boardheader_t *bp, char *direct, struct t if(mymax< next || (bidinfo.payby==0 && cuser.money<mymax )) { - vmsg(SHM->i18nstr[cuser.language][377]); + vmsg(I18N[377]); return FULLUPDATE; } snprintf(genbuf, sizeof(genbuf), - SHM->i18nstr[cuser.language][378], + I18N[378], cuser.userid,say, 31 - strlen(cuser.userid) - strlen(say), " ", money, @@ -1443,7 +1443,7 @@ do_bid(int ent, fileheader_t * fhdr, boardheader_t *bp, char *direct, struct t strcpy(bidinfo.userid,cuser.userid); snprintf(genbuf, sizeof(genbuf), -SHM->i18nstr[cuser.language][379], +I18N[379], cuser.userid, 20 - strlen(cuser.userid) , " ",money, bidinfo.high, @@ -1457,7 +1457,7 @@ SHM->i18nstr[cuser.language][379], else bidinfo.high=bidinfo.usermax; /*這邊怪怪的*/ snprintf(genbuf, sizeof(genbuf), -SHM->i18nstr[cuser.language][380], +I18N[380], bidinfo.userid, 20 - strlen(bidinfo.userid) , " ", money, bidinfo.high, @@ -1465,7 +1465,7 @@ SHM->i18nstr[cuser.language][380], do_add_recommend(direct, fhdr, ent, genbuf); } substitute_record(fpath, &bidinfo, sizeof(bidinfo), 1); - vmsg(SHM->i18nstr[cuser.language][381]); + vmsg(I18N[381]); return FULLUPDATE; } @@ -1479,16 +1479,16 @@ recommend(int ent, fileheader_t * fhdr, char *direct) bp = getbcache(currbid); if( bp->brdattr & BRD_NORECOMMEND ){ - vmsg(SHM->i18nstr[cuser.language][382]); + vmsg(I18N[382]); return FULLUPDATE; } if (!CheckPostPerm() || bp->brdattr & BRD_VOTEBOARD || fhdr->filemode & FILE_VOTE) { - vmsg(SHM->i18nstr[cuser.language][383]); + vmsg(I18N[383]); return FULLUPDATE; } #ifdef SAFE_ARTICLE_DELETE if( fhdr->filename[0] == '.' ){ - vmsg(SHM->i18nstr[cuser.language][384]); + vmsg(I18N[384]); return FULLUPDATE; } #endif @@ -1499,27 +1499,27 @@ recommend(int ent, fileheader_t * fhdr, char *direct) setdirpath(path, direct, fhdr->filename); if (fhdr->recommend == 0 && strcmp(cuser.userid, fhdr->owner) == 0){ - vmsg(SHM->i18nstr[cuser.language][385]); + vmsg(I18N[385]); return FULLUPDATE; } #ifndef DEBUG if (!(currmode & MODE_BOARD) && getuser(cuser.userid) && now - lastrecommend < 40) { - vmsg(SHM->i18nstr[cuser.language][386]); + vmsg(I18N[386]); return FULLUPDATE; } #endif - if (!getdata(b_lines - 2, 0, SHM->i18nstr[cuser.language][387], path, 40, DOECHO) || + if (!getdata(b_lines - 2, 0, I18N[387], path, 40, DOECHO) || path == NULL || - !getdata(b_lines - 1, 0, SHM->i18nstr[cuser.language][388], + !getdata(b_lines - 1, 0, I18N[388], yn, 5, LCECHO) || yn[0] != 'y') return FULLUPDATE; snprintf(buf, sizeof(buf), - SHM->i18nstr[cuser.language][389], + I18N[389], cuser.userid, path, 51 - strlen(cuser.userid) - strlen(path), " ", fromhost, ptime->tm_mon + 1, ptime->tm_mday); @@ -1583,26 +1583,26 @@ del_range(int ent, fileheader_t *fhdr, char *direct) /* rocker.011018: 串接模式下還是不允許刪除比較好 */ if (currmode & MODE_SELECT) { - vmsg(SHM->i18nstr[cuser.language][390]); + vmsg(I18N[390]); return FULLUPDATE; } if ((currstat != READING) || (currmode & MODE_BOARD)) { - getdata(1, 0, SHM->i18nstr[cuser.language][391], num1, 6, DOECHO); + getdata(1, 0, I18N[391], num1, 6, DOECHO); inum1 = atoi(num1); if (inum1 <= 0) { - vmsg(SHM->i18nstr[cuser.language][392]); + vmsg(I18N[392]); return FULLUPDATE; } - getdata(1, 28, SHM->i18nstr[cuser.language][393], num2, 6, DOECHO); + getdata(1, 28, I18N[393], num2, 6, DOECHO); inum2 = atoi(num2); if (inum2 < inum1) { - vmsg(SHM->i18nstr[cuser.language][394]); + vmsg(I18N[394]); return FULLUPDATE; } getdata(1, 48, msg_sure_ny, num1, 3, LCECHO); if (*num1 == 'y') { - outmsg(SHM->i18nstr[cuser.language][395]); + outmsg(I18N[395]); refresh(); #ifdef SAFE_ARTICLE_DELETE if(bp && !(currmode & MODE_DIGEST) && bp->nuser > 20 ) @@ -1670,26 +1670,26 @@ del_post(int ent, fileheader_t * fhdr, char *direct) #define SIZE sizeof(badpost_reason) / sizeof(char *) if (not_owned && num > 0 && !(currmode & MODE_DIGEST)) { - getdata(1, 40, SHM->i18nstr[cuser.language][396], genbuf, 3, LCECHO); + getdata(1, 40, I18N[396], genbuf, 3, LCECHO); if(genbuf[0]=='y') { int i; char reason[64]; move(b_lines - 2, 0); for (i = 0; i < SIZE; i++) prints("%d.%s ", i + 1, badpost_reason[i]); - prints("%d.%s", i + 1, SHM->i18nstr[cuser.language][397]); - getdata(b_lines - 1, 0, SHM->i18nstr[cuser.language][398], reason, sizeof(reason), LCECHO); + prints("%d.%s", i + 1, I18N[397]); + getdata(b_lines - 1, 0, I18N[398], reason, sizeof(reason), LCECHO); i = reason[0] - '0'; if (i <= 0 || i > SIZE) - getdata(b_lines, 0, SHM->i18nstr[cuser.language][399], reason, sizeof(reason), DOECHO); + getdata(b_lines, 0, I18N[399], reason, sizeof(reason), DOECHO); else strcpy(reason, badpost_reason[i - 1]); if (!(inc_badpost(num, 1) % 10)){ - post_violatelaw(xuser.userid, SHM->i18nstr[cuser.language][400], SHM->i18nstr[cuser.language][401], SHM->i18nstr[cuser.language][402]); - mail_violatelaw(xuser.userid, SHM->i18nstr[cuser.language][403], SHM->i18nstr[cuser.language][404], SHM->i18nstr[cuser.language][405]); + post_violatelaw(xuser.userid, I18N[400], SHM->i18nstr[cuser.language][401], SHM->i18nstr[cuser.language][402]); + mail_violatelaw(xuser.userid, I18N[403], SHM->i18nstr[cuser.language][404], SHM->i18nstr[cuser.language][405]); xuser.userlevel |= PERM_VIOLATELAW; } - sprintf(genbuf,SHM->i18nstr[cuser.language][406], reason, fhdr->title); + sprintf(genbuf,I18N[406], reason, fhdr->title); mail_id(xuser.userid, genbuf, newpath, cuser.userid); } } @@ -1707,7 +1707,7 @@ del_post(int ent, fileheader_t * fhdr, char *direct) cuser.numposts--; if (!(currmode & MODE_DIGEST && currmode & MODE_BOARD)){ demoney(-fhdr->money); - vmsg(SHM->i18nstr[cuser.language][407], msg_del_ok, + vmsg(I18N[407], msg_del_ok, cuser.numposts, fhdr->money); } } @@ -1722,7 +1722,7 @@ show_filename(int ent, fileheader_t * fhdr, char *direct) { if(!HAS_PERM(PERM_SYSOP)) return DONOTHING; - vmsg(SHM->i18nstr[cuser.language][408], fhdr->filename); + vmsg(I18N[408], fhdr->filename); return PART_REDRAW; } @@ -1731,16 +1731,16 @@ view_postmoney(int ent, fileheader_t * fhdr, char *direct) { move(b_lines - 1, 0); if(currmode & MODE_SELECT){ - vmsg(SHM->i18nstr[cuser.language][409]); + vmsg(I18N[409]); return FULLUPDATE; } if(fhdr->filemode & FILE_ANONYMOUS) /* When the file is anonymous posted, fhdr->money is author. * see do_general() */ - prints(SHM->i18nstr[cuser.language][410], + prints(I18N[410], fhdr->money + currutmp->pid); else - vmsg(SHM->i18nstr[cuser.language][411], fhdr->money); + vmsg(I18N[411], fhdr->money); return FULLUPDATE; } @@ -1753,37 +1753,37 @@ tar_addqueue(int ent, fileheader_t * fhdr, char *direct) FILE *fp; char bakboard, bakman; clear(); - showtitle(SHM->i18nstr[cuser.language][412], BBSNAME); + showtitle(I18N[412], BBSNAME); move(2, 0); if (!((currmode & MODE_BOARD) || HAS_PERM(PERM_SYSOP))) { move(5, 10); - outs(SHM->i18nstr[cuser.language][413]); + outs(I18N[413]); pressanykey(); return FULLUPDATE; } snprintf(qfn, sizeof(qfn), BBSHOME "/jobspool/tarqueue.%s", currboard); if (access(qfn, 0) == 0) { - outs(SHM->i18nstr[cuser.language][414]); + outs(I18N[414]); pressanykey(); return FULLUPDATE; } - if (!getdata(4, 0, SHM->i18nstr[cuser.language][415], email, sizeof(email), DOECHO)) + if (!getdata(4, 0, I18N[415], email, sizeof(email), DOECHO)) return FULLUPDATE; /* check email -.-"" */ if (strstr(email, "@") == NULL || strstr(email, ".bbs@") != NULL) { move(6, 0); - outs(SHM->i18nstr[cuser.language][416]); + outs(I18N[416]); pressanykey(); return FULLUPDATE; } - getdata(6, 0, SHM->i18nstr[cuser.language][417], ans, sizeof(ans), LCECHO); + getdata(6, 0, I18N[417], ans, sizeof(ans), LCECHO); bakboard = (ans[0] == 'n' || ans[0] == 'N') ? 0 : 1; - getdata(7, 0, SHM->i18nstr[cuser.language][418], ans, sizeof(ans), LCECHO); + getdata(7, 0, I18N[418], ans, sizeof(ans), LCECHO); bakman = (ans[0] == 'y' || ans[0] == 'Y') ? 1 : 0; if (!bakboard && !bakman) { move(8, 0); - outs(SHM->i18nstr[cuser.language][419]); + outs(I18N[419]); pressanykey(); return FULLUPDATE; } @@ -1794,8 +1794,8 @@ tar_addqueue(int ent, fileheader_t * fhdr, char *direct) fclose(fp); move(10, 0); - outs(SHM->i18nstr[cuser.language][420]); - outs(SHM->i18nstr[cuser.language][421]); + outs(I18N[420]); + outs(I18N[421]); pressanykey(); return FULLUPDATE; } @@ -1825,7 +1825,7 @@ sequent_messages(fileheader_t * fptr) if (continue_flag) genbuf[0] = 'y'; else { - prints(SHM->i18nstr[cuser.language][422], + prints(I18N[422], currboard, fptr->owner, fptr->title); getdata(3, 0, "(Y/N/Quit) [Y]: ", genbuf, 3, LCECHO); } @@ -1838,7 +1838,7 @@ sequent_messages(fileheader_t * fptr) brc_addlist(fptr->filename); if (more(genbuf, YEA) == 0) - outmsg(SHM->i18nstr[cuser.language][423]); + outmsg(I18N[423]); continue_flag = 0; switch (igetch()) { @@ -1900,10 +1900,10 @@ b_note_edit_bname(int bid) outs(msg_cancel); pressanykey(); } else { - if (!getdata(2, 0, SHM->i18nstr[cuser.language][424], buf, 3, LCECHO) + if (!getdata(2, 0, I18N[424], buf, 3, LCECHO) || buf[0] != 'n') fh->bupdate = gettime(3, fh->bupdate ? fh->bupdate : now, - SHM->i18nstr[cuser.language][425]); + I18N[425]); else fh->bupdate = 0; substitute_record(fn_board, fh, sizeof(boardheader_t), bid); @@ -1950,7 +1950,7 @@ b_post_note() setbfile(buf, currboard, FN_POST_NOTE); if (more(buf, NA) == -1) more("etc/" FN_POST_NOTE, NA); - getdata(b_lines - 2, 0, SHM->i18nstr[cuser.language][426], yn, sizeof(yn), LCECHO); + getdata(b_lines - 2, 0, I18N[426], yn, sizeof(yn), LCECHO); if (yn[0] == 'y') vedit(buf, NA, NULL); else @@ -1960,7 +1960,7 @@ b_post_note() setbfile(buf, currboard, FN_POST_BID); if (more(buf, NA) == -1) more("etc/" FN_POST_BID, NA); - getdata(b_lines - 2, 0, SHM->i18nstr[cuser.language][427], yn, sizeof(yn), LCECHO); + getdata(b_lines - 2, 0, I18N[427], yn, sizeof(yn), LCECHO); if (yn[0] == 'y') vedit(buf, NA, NULL); else @@ -1993,7 +1993,7 @@ bh_title_edit() bp = getbcache(currbid); move(1, 0); clrtoeol(); - getdata_str(1, 0, SHM->i18nstr[cuser.language][428], genbuf, + getdata_str(1, 0, I18N[428], genbuf, BTLEN - 16, DOECHO, bp->title + 7); if (!genbuf[0]) @@ -2016,7 +2016,7 @@ b_notes() if (more(buf, NA) == -1) { clear(); move(4, 20); - outs(SHM->i18nstr[cuser.language][429]); + outs(I18N[429]); } pressanykey(); return FULLUPDATE; @@ -2079,15 +2079,15 @@ push_bottom(int ent, fileheader_t * fhdr, char *direct) setbottomtotal(currbid); // Ptt : will be remove when stable num = getbottomtotal(currbid); if(getans(fhdr->filemode & FILE_BOTTOM ? - SHM->i18nstr[cuser.language][430]: - SHM->i18nstr[cuser.language][431])!='y') return READ_REDRAW; + I18N[430]: + I18N[431])!='y') return READ_REDRAW; fhdr->filemode ^= FILE_BOTTOM; if(fhdr->filemode & FILE_BOTTOM) { sprintf(buf, "%s.bottom", direct); if(num >= 5) { - vmsg(SHM->i18nstr[cuser.language][432]); + vmsg(I18N[432]); return READ_REDRAW; } fhdr->money = ent | FHR_REFERENCE; @@ -2112,7 +2112,7 @@ good_post(int ent, fileheader_t * fhdr, char *direct) return DONOTHING; if(getans(fhdr->filemode & FILE_DIGEST ? - SHM->i18nstr[cuser.language][433] : SHM->i18nstr[cuser.language][434]) == 'n') + I18N[433] : SHM->i18nstr[cuser.language][434]) == 'n') return READ_REDRAW; if (fhdr->filemode & FILE_DIGEST) { @@ -2149,7 +2149,7 @@ good_post(int ent, fileheader_t * fhdr, char *direct) #ifdef GLOBAL_DIGEST if(!(getbcache(currbid)->brdattr & BRD_HIDE)) { - getdata(1, 0, SHM->i18nstr[cuser.language][435], genbuf2, 3, LCECHO); + getdata(1, 0, I18N[435], genbuf2, 3, LCECHO); if(genbuf2[0] == 'y') do_crosspost(GLOBAL_DIGEST, &digest, genbuf); } @@ -2200,8 +2200,8 @@ b_changerecommend(int ent, fileheader_t * fhdr, char *direct) bp = getbcache(currbid); bp->brdattr ^= BRD_NORECOMMEND; substitute_record(fn_board, bp, sizeof(boardheader_t), currbid); - vmsg(SHM->i18nstr[cuser.language][457], - (bp->brdattr & BRD_NORECOMMEND) ? SHM->i18nstr[cuser.language][458] : SHM->i18nstr[cuser.language][459]); + vmsg(I18N[457], + (bp->brdattr & BRD_NORECOMMEND) ? I18N[458] : SHM->i18nstr[cuser.language][459]); return FULLUPDATE; } @@ -2219,19 +2219,19 @@ change_hidden(int ent, fileheader_t * fhdr, char *direct) bp = getbcache(currbid); if (((bp->brdattr & BRD_HIDE) && (bp->brdattr & BRD_POSTMASK))) { - if (getans(SHM->i18nstr[cuser.language][460]) != 'y') + if (getans(I18N[460]) != 'y') return FULLUPDATE; bp->brdattr &= ~BRD_HIDE; bp->brdattr &= ~BRD_POSTMASK; - outs(SHM->i18nstr[cuser.language][461]); + outs(I18N[461]); board_hidden_status = 0; hbflreload(currbid); } else { - if (getans(SHM->i18nstr[cuser.language][462]) != 'y') + if (getans(I18N[462]) != 'y') return FULLUPDATE; bp->brdattr |= BRD_HIDE; bp->brdattr |= BRD_POSTMASK; - outs(SHM->i18nstr[cuser.language][463]); + outs(I18N[463]); board_hidden_status = 1; } substitute_record(fn_board, bp, sizeof(boardheader_t), currbid); @@ -2252,15 +2252,15 @@ change_counting(int ent, fileheader_t * fhdr, char *direct) return FULLUPDATE; if (bp->brdattr & BRD_BMCOUNT) { - if (getans(SHM->i18nstr[cuser.language][464]) != 'y') + if (getans(I18N[464]) != 'y') return FULLUPDATE; bp->brdattr &= ~BRD_BMCOUNT; - outs(SHM->i18nstr[cuser.language][465]); + outs(I18N[465]); } else { - if (getans(SHM->i18nstr[cuser.language][466]) != 'y') + if (getans(I18N[466]) != 'y') return FULLUPDATE; bp->brdattr |= BRD_BMCOUNT; - outs(SHM->i18nstr[cuser.language][467]); + outs(I18N[467]); } substitute_record(fn_board, bp, sizeof(boardheader_t), currbid); pressanykey(); diff --git a/mbbsd/guess.c b/mbbsd/guess.c index 9c2aba5f..6bfa9072 100644 --- a/mbbsd/guess.c +++ b/mbbsd/guess.c @@ -8,16 +8,16 @@ show_table(char TABLE[], char ifcomputer) int i; move(0, 35); - prints("\033[1;44;33m 【 猜數字 】 \033[m"); + prints(SHM->i18nstr[cuser.language][1139]); move(8, 1); - prints("\033[1;44;36m目 前 倍 率\033[m\n"); + prints(SHM->i18nstr[cuser.language][1140]); prints("\033[1;33m=================\033[m\n"); if (ifcomputer) { - prints("贏電腦: 2 倍\n"); - prints("輸電腦: 0 倍\n"); + prints(SHM->i18nstr[cuser.language][1141]); + prints(SHM->i18nstr[cuser.language][1142]); } else { for (i = 1; i <= 6; i++) - prints("第%d次, %02d倍\n", i, TABLE[i]); + prints(SHM->i18nstr[cuser.language][1143], i, TABLE[i]); } prints("\033[33m=================\033[m"); } @@ -29,9 +29,9 @@ get_money(void) char data[20]; move(1, 0); - prints("您目前有:%d Ptt$", cuser.money); + prints(SHM->i18nstr[cuser.language][1144], cuser.money); do { - getdata(2, 0, "要賭多少(5-10或按q離開): ", data, 9, LCECHO); + getdata(2, 0, SHM->i18nstr[cuser.language][1145], data, 9, LCECHO); money = 0; if (data[0] == 'q' || data[0] == 'Q') { unlockutmpmode(); @@ -53,7 +53,7 @@ get_money(void) move(1, 0); clrtoeol(); reload_money(); - prints("您目前有:%d Ptt$", cuser.money - money); + prints(SHM->i18nstr[cuser.language][1146], cuser.money - money); return money; } @@ -78,7 +78,7 @@ static char * get_data(char data[5], int count) { while (1) { - getdata(6, 0, "輸入四位數字(不重複): ", data, 5, LCECHO); + getdata(6, 0, SHM->i18nstr[cuser.language][1147], data, 5, LCECHO); if (check_data(data) == 1) break; } @@ -173,7 +173,7 @@ computer(int correct, int total, char flag[], int n[]) if (k == 40) { move(total + 8, 25); snprintf(data, sizeof(data), "%04d", guess); - prints("%s => 猜中了!!", data); + prints(SHM->i18nstr[cuser.language][1148], data); return 1; } else { move(total + 8, 25); @@ -227,28 +227,28 @@ guess_main() FILE *file; clear(); - showtitle("猜數字", BBSName); + showtitle(SHM->i18nstr[cuser.language][1149], BBSName); lockreturn0(GUESSNUM, LOCK_MULTI); reload_money(); if (cuser.money < 5) { clear(); move(12, 35); - prints("錢不夠啦 至少要 5 Ptt$"); + prints(SHM->i18nstr[cuser.language][1150]); unlockutmpmode(); pressanykey(); return 1; } if ((money = get_money()) == 0) return 1; - vice(money, "猜數字"); + vice(money, SHM->i18nstr[cuser.language][1151]); Diff_Random(answer); move(2, 0); clrtoeol(); - prints("您下注 :%lu Ptt$", money); + prints(SHM->i18nstr[cuser.language][1152], money); - getdata_str(4, 0, "您要和電腦比賽嗎? <y/n>[y]:", + getdata_str(4, 0, SHM->i18nstr[cuser.language][1153], ifcomputer, sizeof(ifcomputer), LCECHO, "y"); if (ifcomputer[0] == 'y') { ifcomputer[0] = 1; @@ -259,17 +259,17 @@ guess_main() } if (ifcomputer[0]) { do { - getdata(5, 0, "請輸入您要讓電腦猜的數字: ", + getdata(5, 0, SHM->i18nstr[cuser.language][1154], yournum, sizeof(yournum), LCECHO); } while (!legal(atoi(yournum))); move(8, 25); - prints("電腦猜"); + prints(SHM->i18nstr[cuser.language][1155]); flag = malloc(sizeof(char) * 10000); n = malloc(sizeof(int) * 1500); initcomputer(flag); } move(8, 55); - prints("你猜"); + prints(SHM->i18nstr[cuser.language][1156]); while (((!computerwin || !youwin) && count < 10 && (ifcomputer[0])) || (!ifcomputer[0] && count < 10 && !youwin)) { if (!computerwin && ifcomputer[0]) { @@ -278,7 +278,7 @@ guess_main() computerwin = 1; } move(20, 55); - prints("第 %d 次機會 ", count + 1); + prints(SHM->i18nstr[cuser.language][1157], count + 1); if (!youwin) { ++count; if (guess_play(get_data(data, count), answer, count)) @@ -290,34 +290,33 @@ guess_main() free(n); if (ifcomputer[0]) { if (count > c_count) { - prints("你輸給電腦了"); + prints(SHM->i18nstr[cuser.language][1158]); move(18, 35); - prints("你賠了 %lu ", money); + prints(SHM->i18nstr[cuser.language][1159], money); if ((file = fopen(LOGPASS, "a"))) { - fprintf(file, "電腦第%d次猜中, ", c_count); + fprintf(file, SHM->i18nstr[cuser.language][1160], c_count); if (youwin) - fprintf(file, "%s 第%d次猜中, ", cuser.userid, count); + fprintf(file, SHM->i18nstr[cuser.language][1161], cuser.userid, count); else - fprintf(file, "%s 沒猜中, ", cuser.userid); - fprintf(file, "電腦賺走了%s %ld Ptt$\n", cuser.userid, money); + fprintf(file, SHM->i18nstr[cuser.language][1162], cuser.userid); + fprintf(file, SHM->i18nstr[cuser.language][1163], cuser.userid, money); fclose(file); } } else if (count < c_count) { - prints("真厲害, 讓你賺到囉"); + prints(SHM->i18nstr[cuser.language][1164]); move(18, 35); - prints("你賺走了 %lu ", money * 2); + prints(SHM->i18nstr[cuser.language][1165], money * 2); demoney(money * 2); if ((file = fopen(LOGPASS, "a"))) { - fprintf(file, "id: %s, 第%d次猜中, 電腦第%d次猜中, " - "贏了電腦 %ld Ptt$\n", cuser.userid, count, + fprintf(file, SHM->i18nstr[cuser.language][1166], cuser.userid, count, c_count, money * 2); fclose(file); } } else { - prints("真厲害, 和電腦打成平手了, 拿回本錢%lu\n", money); + prints(SHM->i18nstr[cuser.language][1167], money); demoney(money); if ((file = fopen(LOGPASS, "a"))) { - fprintf(file, "id: %s 和電腦打成了平手\n", cuser.userid); + fprintf(file, SHM->i18nstr[cuser.language][1168], cuser.userid); fclose(file); } } @@ -328,26 +327,26 @@ guess_main() if (youwin) { demoney(TABLE[count] * money); if (count < 5) { - prints("真厲害, 錢被你賺走了"); + prints(SHM->i18nstr[cuser.language][1169]); if ((file = fopen(LOGPASS, "a"))) { - fprintf(file, "id: %s, 第%d次猜中, 贏了 %ld Ptt$\n", + fprintf(file, SHM->i18nstr[cuser.language][1170], cuser.userid, count, TABLE[count] * money); fclose(file); } } else if (count > 5) { - prints("唉, 太多次才猜出來了"); + prints(SHM->i18nstr[cuser.language][1171]); if ((file = fopen(LOGPASS, "a"))) { - fprintf(file, "id: %s, 第%d次才猜中, 賠了 %ld Ptt$\n", + fprintf(file, SHM->i18nstr[cuser.language][1172], cuser.userid, count, money); fclose(file); } } else { - prints("五次猜出來, 還你本錢吧"); + prints(SHM->i18nstr[cuser.language][1173]); move(18, 35); clrtoeol(); - prints("你拿回了%lu Ptt$\n", money); + prints(SHM->i18nstr[cuser.language][1174], money); if ((file = fopen(LOGPASS, "a"))) { - fprintf(file, "id: %s, 第%d次猜中, 拿回了本錢 %lu Ptt$\n", + fprintf(file, SHM->i18nstr[cuser.language][1175], cuser.userid, count, money); fclose(file); } @@ -357,11 +356,11 @@ guess_main() return 1; } move(17, 35); - prints("嘿嘿 標準答案是 %s ", answer); + prints(SHM->i18nstr[cuser.language][1176], answer); move(18, 35); - prints("下次再來吧"); + prints(SHM->i18nstr[cuser.language][1177]); if ((file = fopen(BBSHOME "/etc/loseguess.log", "a"))) { - fprintf(file, "id: %s 賭了 %ld Ptt$\n", cuser.userid, money); + fprintf(file, SHM->i18nstr[cuser.language][1178], cuser.userid, money); fclose(file); } unlockutmpmode(); diff --git a/mbbsd/talk.c b/mbbsd/talk.c index f8bd81f1..973835b4 100644 --- a/mbbsd/talk.c +++ b/mbbsd/talk.c @@ -3,12 +3,11 @@ #define QCAST int (*)(const void *, const void *) -static char *IdleTypeTable[] = { - "偶在花呆啦", "情人來電", "覓食中", "拜見周公", "假死狀態", "我在思考" -}; -static char *sig_des[] = { - "鬥雞", "聊天", "", "下棋", "象棋", "暗棋" -}; +//#define sig_des [(a)] (SHM->i18nstr[cuser.language][1896 + (a)]) +#define sig_des(a) (SHM->i18nstr[cuser.language][1896 + (a)]) +/*static char *sig_des[] = { + SHM->i18nstr[cuser.language][1896], SHM->i18nstr[cuser.language][1897], "", SHM->i18nstr[cuser.language][1898], SHM->i18nstr[cuser.language][1899], SHM->i18nstr[cuser.language][1900] +};*/ #define MAX_SHOW_MODE 4 #define M_INT 15 /* monitor mode update interval */ @@ -58,7 +57,7 @@ iswritable_stat(userinfo_t * uentp, int fri_stat) int isvisible_stat(userinfo_t * me, userinfo_t * uentp, int fri_stat) { - if (!uentp || uentp->userid[0] == 0) + if (uentp->userid[0] == 0) return 0; if (PERM_HIDE(uentp) && !(PERM_HIDE(me))) /* 對方紫色隱形而你沒有 */ @@ -78,7 +77,7 @@ char * modestring(userinfo_t * uentp, int simple) { static char modestr[40]; - char *notonline = "不在站上"; + char *notonline = SHM->i18nstr[cuser.language][1901]; register int mode = uentp->mode; register char *word; int fri_stat; @@ -102,12 +101,12 @@ modestring(userinfo_t * uentp, int simple) } else if (!mode && *uentp->chatid == 1) { if (!simple) snprintf(modestr, sizeof(modestr), - "回應 %s", getuserid(uentp->destuid)); + SHM->i18nstr[cuser.language][1902], getuserid(uentp->destuid)); else - snprintf(modestr, sizeof(modestr), "回應呼叫"); + snprintf(modestr, sizeof(modestr), SHM->i18nstr[cuser.language][1903]); } else if (!mode && *uentp->chatid == 3) - snprintf(modestr, sizeof(modestr), "水球準備中"); + snprintf(modestr, sizeof(modestr), SHM->i18nstr[cuser.language][1904]); else if ( #ifdef NOKILLWATERBALL uentp->msgcount > 0 @@ -117,40 +116,40 @@ modestring(userinfo_t * uentp, int simple) ) if (uentp->msgcount < 10) { char *cnum[10] = - {"", "一", "兩", "三", "四", "五", "六", "七", - "八", "九"}; + {"", SHM->i18nstr[cuser.language][1905], SHM->i18nstr[cuser.language][1906], SHM->i18nstr[cuser.language][1907], SHM->i18nstr[cuser.language][1908], SHM->i18nstr[cuser.language][1909], SHM->i18nstr[cuser.language][1910], SHM->i18nstr[cuser.language][1911], + SHM->i18nstr[cuser.language][1912], SHM->i18nstr[cuser.language][1913]}; snprintf(modestr, sizeof(modestr), - "中%s顆水球", cnum[(int)(uentp->msgcount)]); + SHM->i18nstr[cuser.language][1914], cnum[(int)(uentp->msgcount)]); } else - snprintf(modestr, sizeof(modestr), "不行了 @_@"); + snprintf(modestr, sizeof(modestr), SHM->i18nstr[cuser.language][1915]); else if (!mode) return (uentp->destuid == 6) ? uentp->chatid : - IdleTypeTable[(0 <= uentp->destuid && uentp->destuid < 6) ? - uentp->destuid : 0]; + SHM->i18nstr[cuser.language][1890 + ((0 <= uentp->destuid && uentp->destuid < 6) ? + uentp->destuid : 0)]; else if (simple) return word; else if (uentp->in_chat && mode == CHATING) snprintf(modestr, sizeof(modestr), "%s (%s)", word, uentp->chatid); else if (mode == TALK) { if (!isvisible_uid(uentp->destuid)) /* Leeym 對方(紫色)隱形 */ - snprintf(modestr, sizeof(modestr), "%s", "交談 空氣"); + snprintf(modestr, sizeof(modestr), "%s", SHM->i18nstr[cuser.language][1916]); /* Leeym * 大家自己發揮吧! */ else snprintf(modestr, sizeof(modestr), "%s %s", word, getuserid(uentp->destuid)); } else if (mode == M_FIVE) { if (!isvisible_uid(uentp->destuid)) - snprintf(modestr, sizeof(modestr), "%s", "五子棋 空氣"); + snprintf(modestr, sizeof(modestr), "%s", SHM->i18nstr[cuser.language][1917]); else snprintf(modestr, sizeof(modestr), "%s %s", word, getuserid(uentp->destuid)); } else if (mode == CHESSWATCHING) { - snprintf(modestr, sizeof(modestr), "觀棋"); + snprintf(modestr, sizeof(modestr), SHM->i18nstr[cuser.language][1918]); } else if (mode == CHC) { if (isvisible_uid(uentp->destuid)) - snprintf(modestr, sizeof(modestr), "%s", "下象棋"); + snprintf(modestr, sizeof(modestr), "%s", SHM->i18nstr[cuser.language][1919]); else snprintf(modestr, sizeof(modestr), - "下象棋 %s", getuserid(uentp->destuid)); + SHM->i18nstr[cuser.language][1920], getuserid(uentp->destuid)); } else if (mode != PAGE && mode != TQUERY) return word; else @@ -323,7 +322,7 @@ my_kick(userinfo_t * uentp) log_usies("KICK ", genbuf); if ((uentp->pid <= 0 || kill(uentp->pid, SIGHUP) == -1) && (errno == ESRCH)) purge_utmp(uentp); - outs("踢出去囉"); + outs(SHM->i18nstr[cuser.language][1921]); } else outs(msg_cancel); pressanykey(); @@ -337,12 +336,12 @@ chicken_query(char *userid) time_diff(&(xuser.mychicken)); if (!isdeadth(&(xuser.mychicken))) { show_chicken_data(&(xuser.mychicken), NULL); - prints("\n\n以上是 %s 的寵物資料..", userid); + prints(SHM->i18nstr[cuser.language][1922], userid); } } else { move(1, 0); clrtobot(); - prints("\n\n%s 並沒有養寵物..", userid); + prints(SHM->i18nstr[cuser.language][1923], userid); } pressanykey(); } @@ -356,8 +355,8 @@ my_query(char *uident) unsigned long int j; userinfo_t *uentp; const char *money[10] = - {"債台高築", "赤貧", "清寒", "普通", "小康", - "小富", "中富", "大富翁", "富可敵國", "比爾蓋\天"}; + {SHM->i18nstr[cuser.language][1924], SHM->i18nstr[cuser.language][1925], SHM->i18nstr[cuser.language][1926], SHM->i18nstr[cuser.language][1927], SHM->i18nstr[cuser.language][1928], + SHM->i18nstr[cuser.language][1929], SHM->i18nstr[cuser.language][1930], SHM->i18nstr[cuser.language][1931], SHM->i18nstr[cuser.language][1932], SHM->i18nstr[cuser.language][1933]}; const char *sex[8] = {MSG_BIG_BOY, MSG_BIG_GIRL, MSG_LITTLE_BOY, MSG_LITTLE_GIRL, @@ -377,7 +376,7 @@ my_query(char *uident) j = muser.money; for (i = 0; i < 10 && j > 10; i++) j /= 10; - prints("《ID暱稱》%s(%s)%*s《經濟狀況》%s", + prints(SHM->i18nstr[cuser.language][1934], muser.userid, muser.username, 26 - strlen(muser.userid) - strlen(muser.username), "", @@ -386,34 +385,33 @@ my_query(char *uident) prints(" ($%d)", muser.money); prints("\n"); - prints("《上站次數》%d次", muser.numlogins); + prints(SHM->i18nstr[cuser.language][1935], muser.numlogins); move(2, 40); #ifdef ASSESS - prints("《文章篇數》%d篇 (優:%d/劣:%d)\n", muser.numposts, muser.goodpost, muser.badpost); + prints(SHM->i18nstr[cuser.language][1936], muser.numposts, muser.goodpost, muser.badpost); #else - prints("《文章篇數》%d篇\n", muser.numposts); + prints(SHM->i18nstr[cuser.language][1937], muser.numposts); #endif - prints("\033[1;33m《目前動態》%-28.28s\033[m", + prints(SHM->i18nstr[cuser.language][1938], (uentp && isvisible_stat(currutmp, uentp, fri_stat)) ? - modestring(uentp, 0) : "不在站上"); + modestring(uentp, 0) : SHM->i18nstr[cuser.language][1939]); outs(((uentp && uentp->mailalert) || load_mailalert(muser.userid)) - ? "《私人信箱》有新進信件還沒看\n" : - "《私人信箱》所有信件都看過了\n"); - prints("《上次上站》%-28.28s《上次故鄉》%s\n", + ? SHM->i18nstr[cuser.language][1940] : + SHM->i18nstr[cuser.language][1941]); + prints(SHM->i18nstr[cuser.language][1942], Cdate(&muser.lastlogin), - (muser.lasthost[0] ? muser.lasthost : "(不詳)")); - prints("《五子棋戰績》%3d 勝 %3d 敗 %3d 和 " - "《象棋戰績》%3d 勝 %3d 敗 %3d 和\n", + (muser.lasthost[0] ? muser.lasthost : SHM->i18nstr[cuser.language][1943])); + prints(SHM->i18nstr[cuser.language][1944], muser.five_win, muser.five_lose, muser.five_tie, muser.chc_win, muser.chc_lose, muser.chc_tie); #ifdef ASSESS - prints("《競標評比》 優 %d / 劣 %d", muser.goodsale, muser.badsale); + prints(SHM->i18nstr[cuser.language][1945], muser.goodsale, muser.badsale); move(6, 40); #endif if ((uentp && ((fri_stat & HFM) || strcmp(muser.userid,cuser.userid) == 0) && !uentp->invisible)) - prints("《 性 別 》%-28.28s\n", sex[muser.sex % 8]); + prints(SHM->i18nstr[cuser.language][1946], sex[muser.sex % 8]); showplans(uident); pressanykey(); @@ -441,11 +439,11 @@ water_scr(water_t * tw, int which, char type) prints(" "); move(16 + i, 4); if (tw->msg[(tw->top - i + 4) % 5].last_call_in[0] != 0) - prints("\033[0m \033[1;%d;44m★%-64s\033[0m \n", + prints(SHM->i18nstr[cuser.language][1947], colors[i], tw->msg[(tw->top - i + 4) % 5].last_call_in); else - prints("\033[0m \n"); + prints(SHM->i18nstr[cuser.language][1948]); } move(21, 4); @@ -457,14 +455,14 @@ water_scr(water_t * tw, int which, char type) move(0, 0); prints(" "); move(0, 0); - prints("\033[0m反擊 %s:", tw->userid); + prints(SHM->i18nstr[cuser.language][1949], tw->userid); clrtoeol(); move(0, strlen(tw->userid) + 6); } else { move(8 + which, 28); prints("123456789012345678901234567890"); move(8 + which, 28); - prints("\033[1;37;44m %c %-13s \033[0m", + prints(SHM->i18nstr[cuser.language][1950], tw->uin ? ' ' : 'x', tw->userid); } @@ -490,7 +488,7 @@ my_write2(void) //init screen move(7, 28); - prints("\033[1;33;46m ↑ 水球反擊對象 ↓\033[0m"); + prints(SHM->i18nstr[cuser.language][1951]); for (i = 0; i < 5; ++i) if (swater[i] == NULL || swater[i]->pid == 0) break; @@ -502,11 +500,9 @@ my_write2(void) water_scr(swater[i], i, 0); } move(15, 4); - prints("\033[0m \033[1;35m◇\033[1;36m────────────────" - "─────────────────\033[1;35m◇\033[0m "); + prints(SHM->i18nstr[cuser.language][1952]); move(22, 4); - prints(" \033[1;35m◇\033[1;36m────────────────" - "─────────────────\033[1;35m◇\033[0m "); + prints(SHM->i18nstr[cuser.language][1953]); water_scr(swater[0], 0, 1); refresh(); @@ -551,7 +547,7 @@ my_write2(void) move(0, 0); prints("\033[m"); clrtoeol(); - snprintf(genbuf, sizeof(genbuf), "攻擊 %s:", tw->userid); + snprintf(genbuf, sizeof(genbuf), SHM->i18nstr[cuser.language][1954], tw->userid); if (!oldgetdata(0, 0, genbuf, msg, 80 - strlen(tw->userid) - 6, DOECHO)) break; @@ -592,7 +588,7 @@ my_write(pid_t pid, char *prompt, char *id, int flag, userinfo_t * puin) strlcpy(destid, id, sizeof(destid)); if (!uin && !(flag == 0 && water_which->count > 0)) { - vmsg("糟糕! 對方已落跑了(不在站上)! "); + vmsg(SHM->i18nstr[cuser.language][1955]); watermode = -1; return 0; } @@ -606,6 +602,9 @@ my_write(pid_t pid, char *prompt, char *id, int flag, userinfo_t * puin) /* 一般水球 */ watermode = 0; if (!(len = getdata(0, 0, prompt, msg, 56, DOECHO))) { + outmsg(SHM->i18nstr[cuser.language][1956]); + clrtoeol(); + refresh(); currutmp->chatid[0] = c0; currutmp->mode = mode0; currstat = currstat0; @@ -627,7 +626,7 @@ my_write(pid_t pid, char *prompt, char *id, int flag, userinfo_t * puin) strip_ansi(msg, msg, STRIP_ALL); if (uin && *uin->userid && (flag == 0 || flag == 4)) { - snprintf(buf, sizeof(buf), "丟給 %s : %s [Y/n]?", uin->userid, msg); + snprintf(buf, sizeof(buf), SHM->i18nstr[cuser.language][1957], uin->userid, msg); getdata(0, 0, buf, genbuf, 3, LCECHO); if (genbuf[0] == 'n') { currutmp->chatid[0] = c0; @@ -639,7 +638,7 @@ my_write(pid_t pid, char *prompt, char *id, int flag, userinfo_t * puin) } watermode = -1; if (!uin || !*uin->userid || strcasecmp(destid, uin->userid)) { - vmsg("糟糕! 對方已落跑了(不在站上)! "); + vmsg(SHM->i18nstr[cuser.language][1959]); currutmp->chatid[0] = c0; currutmp->mode = mode0; currstat = currstat0; @@ -670,7 +669,7 @@ my_write(pid_t pid, char *prompt, char *id, int flag, userinfo_t * puin) uin->pager == 2 || (uin->pager == 4 && !(fri_stat & HFM)))) - outmsg("\033[1;33;41m糟糕! 對方防水了! \033[37m~>_<~\033[m"); + outmsg(SHM->i18nstr[cuser.language][1960]); else { int write_pos = uin->msgcount; /* try to avoid race */ if ( write_pos < (MAX_MSGS - 1) ) { /* race here */ @@ -685,7 +684,7 @@ my_write(pid_t pid, char *prompt, char *id, int flag, userinfo_t * puin) sizeof(uin->msgs[write_pos].last_call_in)); uin->pager = pager0; } else if (flag != 2) - outmsg("\033[1;33;41m糟糕! 對方不行了! (收到太多水球) \033[37m@_@\033[m"); + outmsg(SHM->i18nstr[cuser.language][1961]); if (uin->msgcount >= 1 && #ifdef NOKILLWATERBALL @@ -694,11 +693,11 @@ my_write(pid_t pid, char *prompt, char *id, int flag, userinfo_t * puin) (uin->pid <= 0 || kill(uin->pid, SIGUSR2) == -1) #endif && flag != 2) - outmsg("\033[1;33;41m糟糕! 沒打中! \033[37m~>_<~\033[m"); + outmsg(SHM->i18nstr[cuser.language][1962]); else if (uin->msgcount == 1 && flag != 2) - outmsg("\033[1;33;44m水球砸過去了! \033[37m*^o^*\033[m"); + outmsg(SHM->i18nstr[cuser.language][1963]); else if (uin->msgcount > 1 && uin->msgcount < MAX_MSGS && flag != 2) - outmsg("\033[1;33;44m再補上一粒! \033[37m*^o^*\033[m"); + outmsg(SHM->i18nstr[cuser.language][1964]); } clrtoeol(); @@ -739,10 +738,10 @@ t_display_new(void) if (water[0].count && watermode > 0) { move(1, 0); - outs("───────水─球─回─顧───"); + outs(SHM->i18nstr[cuser.language][1965]); outs(WATERMODE(WATER_ORIG) ? - "──────用[Ctrl-R Ctrl-T]鍵切換─────" : - "用[Ctrl-R Ctrl-T Ctrl-F Ctrl-G ]鍵切換────"); + SHM->i18nstr[cuser.language][1966] : + SHM->i18nstr[cuser.language][1967]); if (WATERMODE(WATER_NEW)) { move(2, 0); clrtoeol(); @@ -763,7 +762,7 @@ t_display_new(void) } else prints(" "); else - prints("%s 全部 \033[m", + prints(SHM->i18nstr[cuser.language][1968], water_which == &water[0] ? "\033[1;33;47m " : " " ); @@ -783,8 +782,7 @@ t_display_new(void) water_which->msg[a].last_call_in, len, ""); else - prints("\033[1;44m>\033[1;33;47m%s " - "\033[37;45m %s \033[m%*s", + prints("\033[1;44m>\033[1;33;47m%s \033[37;45m %s \033[m%*s", water_which->msg[a].userid, water_which->msg[a].last_call_in, len, ""); @@ -797,8 +795,7 @@ t_display_new(void) i++; } move(i + off, 0); - outs("──────────────────────" - "─────────────────"); + outs(SHM->i18nstr[cuser.language][1969]); if (WATERMODE(WATER_NEW)) while (i++ <= water[0].count) { move(i + off, 0); @@ -819,10 +816,8 @@ t_display(void) setuserfile(genbuf, fn_writelog); if (more(genbuf, YEA) != -1) { move(b_lines - 4, 0); - outs("\033[1;33;45m★現在 Ptt提供創新的水球整理程式★\033[m\n" - "您將水球存至信箱後, 在【郵件選單】該信件前按 u,\n" - "系統即會將您的水球紀錄重新整理後寄送給您唷! \n"); - getdata(b_lines - 1, 0, "清除(C) 移至備忘錄(M) 保留(R) (C/M/R)?[R]", + outs(SHM->i18nstr[cuser.language][1970]); + getdata(b_lines - 1, 0, SHM->i18nstr[cuser.language][1971], ans, sizeof(ans), LCECHO); if (*ans == 'm') { fileheader_t mymail; @@ -832,8 +827,8 @@ t_display(void) stampfile(buf, &mymail); mymail.filemode = FILE_READ ; - strlcpy(mymail.owner, "[備.忘.錄]", sizeof(mymail.owner)); - strlcpy(mymail.title, "熱線記錄", sizeof(mymail.title)); + strlcpy(mymail.owner, SHM->i18nstr[cuser.language][1972], sizeof(mymail.owner)); + strlcpy(mymail.title, SHM->i18nstr[cuser.language][1973], sizeof(mymail.title)); sethomedir(title, cuser.userid); Rename(genbuf, buf); append_record(title, &mymail, sizeof(mymail)); @@ -1013,7 +1008,7 @@ do_talk(int fd) setutmpmode(TALK); ch = 58 - strlen(save_page_requestor); - snprintf(genbuf, sizeof(genbuf), "%s【%s", cuser.userid, cuser.username); + snprintf(genbuf, sizeof(genbuf), SHM->i18nstr[cuser.language][1974], cuser.userid, cuser.username); i = ch - strlen(genbuf); if (i >= 0) i = (i >> 1) + 1; @@ -1025,8 +1020,7 @@ do_talk(int fd) data[i] = '\0'; snprintf(mid_line, sizeof(mid_line), - "\033[1;46;37m 談天說地 \033[45m%s%s】" - " 與 %s%s\033[0m", data, genbuf, save_page_requestor, data); + SHM->i18nstr[cuser.language][1975], data, genbuf, save_page_requestor, data); memset(&mywin, 0, sizeof(mywin)); memset(&itswin, 0, sizeof(itswin)); @@ -1057,7 +1051,7 @@ do_talk(int fd) break; move(b_lines, 0); clrtoeol(); - outs("再按一次 Ctrl-C 就正式中止談話囉!"); + outs(SHM->i18nstr[cuser.language][1976]); im_leaving = 1; continue; } @@ -1098,13 +1092,13 @@ do_talk(int fd) char ans[4]; int i; - fprintf(flog, "\n\033[33;44m離別畫面 [%s] ... \033[m\n", + fprintf(flog, SHM->i18nstr[cuser.language][1977], Cdatelite(&now)); for (i = 0; i < scr_lns; i++) fprintf(flog, "%.*s\n", big_picture[i].len, big_picture[i].data); fclose(flog); more(fpath, NA); - getdata(b_lines - 1, 0, "清除(C) 移至備忘錄(M). (C/M)?[C]", + getdata(b_lines - 1, 0, SHM->i18nstr[cuser.language][1978], ans, sizeof(ans), LCECHO); if (*ans == 'm') { fileheader_t mymail; @@ -1113,9 +1107,9 @@ do_talk(int fd) sethomepath(genbuf, cuser.userid); stampfile(genbuf, &mymail); mymail.filemode = FILE_READ ; - strlcpy(mymail.owner, "[備.忘.錄]", sizeof(mymail.owner)); + strlcpy(mymail.owner, SHM->i18nstr[cuser.language][1979], sizeof(mymail.owner)); snprintf(mymail.title, sizeof(mymail.title), - "對話記錄 \033[1;36m(%s)\033[m", + SHM->i18nstr[cuser.language][1980], getuserid(currutmp->destuid)); sethomedir(title, cuser.userid); Rename(fpath, genbuf); @@ -1164,7 +1158,7 @@ int make_connection_to_somebody(userinfo_t *uin, int timeout){ if (pid > 0) kill(pid, SIGUSR1); clear(); - prints("正呼叫 %s.....\n鍵入 Ctrl-D 中止....", uin->userid); + prints(SHM->i18nstr[cuser.language][1981], uin->userid); listen(sock, 1); add_io(sock, timeout); @@ -1176,7 +1170,7 @@ int make_connection_to_somebody(userinfo_t *uin, int timeout){ if (!ch && uin->chatid[0] == 1 && uin->destuip == currutmp - &SHM->uinfo[0]) { bell(); - outmsg("對方回應中..."); + outmsg(SHM->i18nstr[cuser.language][1982]); refresh(); } else if (ch == EDITING || ch == TALK || ch == CHATING || ch == PAGE || ch == MAILALL || ch == MONITOR || @@ -1186,7 +1180,7 @@ int make_connection_to_somebody(userinfo_t *uin, int timeout){ add_io(0, 0); close(sock); currutmp->sockactive = currutmp->destuid = 0; - vmsg("人家在忙啦"); + vmsg(SHM->i18nstr[cuser.language][1983]); unlockutmpmode(); return -1; } else { @@ -1194,7 +1188,7 @@ int make_connection_to_somebody(userinfo_t *uin, int timeout){ add_io(sock, 20); /* added for linux... achen */ #endif move(0, 0); - outs("再"); + outs(SHM->i18nstr[cuser.language][1984]); bell(); uin->destuip = currutmp - &SHM->uinfo[0]; @@ -1245,31 +1239,30 @@ my_talk(userinfo_t * uin, int fri_stat, char defact) kill(uin->pid, SIGUSR1); sock = make_connection_to_somebody(uin, 20); if (sock < 0) - vmsg("無法建立連線"); + vmsg(SHM->i18nstr[cuser.language][1985]); else { strlcpy(currutmp->mateid, uin->userid, sizeof(currutmp->mateid)); chc(sock, CHC_WATCH); } } else - outs("人家在忙啦"); + outs(SHM->i18nstr[cuser.language][1986]); } else if (!HAS_PERM(PERM_SYSOP) && (((fri_stat & HRM) && !(fri_stat & HFM)) || ((!uin->pager) && !(fri_stat & HFM)))) { - outs("對方關掉呼叫器了"); + outs(SHM->i18nstr[cuser.language][1987]); } else if (!HAS_PERM(PERM_SYSOP) && (((fri_stat & HRM) && !(fri_stat & HFM)) || uin->pager == 2)) { - outs("對方拔掉呼叫器了"); + outs(SHM->i18nstr[cuser.language][1988]); } else if (!HAS_PERM(PERM_SYSOP) && !(fri_stat & HFM) && uin->pager == 4) { - outs("對方只接受好友的呼叫"); + outs(SHM->i18nstr[cuser.language][1989]); } else if (!(pid = uin->pid) /* || (kill(pid, 0) == -1) */ ) { //resetutmpent(); outs(msg_usr_left); } else { showplans(uin->userid); - getdata(2, 0, "要和他(她) (T)談天(F)下五子棋(P)鬥寵物" - "(C)下象棋(D)下暗棋(N)沒事找錯人了?[N] ", genbuf, 4, LCECHO); + getdata(2, 0, SHM->i18nstr[cuser.language][1990], genbuf, 4, LCECHO); switch (*genbuf) { case 'y': case 't': @@ -1294,8 +1287,8 @@ my_talk(userinfo_t * uin, int fri_stat, char defact) if (!cuser.mychicken.name[0] || !xuser.mychicken.name[0]) error = 2; if (error) { - vmsg(error == 2 ? "並非兩人都養寵物" : - "有一方的寵物正在使用中"); + vmsg(error == 2 ? SHM->i18nstr[cuser.language][1991] : + SHM->i18nstr[cuser.language][1992]); return; } uin->sig = SIG_PK; @@ -1345,41 +1338,41 @@ my_talk(userinfo_t * uin, int fri_stat, char defact) } } else { move(9, 9); - outs("【回音】 "); + outs(SHM->i18nstr[cuser.language][1993]); switch (c) { case 'a': - outs("我現在很忙,請等一會兒再 call 我,好嗎?"); + outs(SHM->i18nstr[cuser.language][1994]); break; case 'b': - prints("對不起,我有事情不能跟你 %s....", sig_des[uin->sig]); + prints(SHM->i18nstr[cuser.language][1995], sig_des(uin->sig)); break; case 'd': - outs("我要離站囉..下次再聊吧.........."); + outs(SHM->i18nstr[cuser.language][1996]); break; case 'c': - outs("請不要吵我好嗎?"); + outs(SHM->i18nstr[cuser.language][1997]); break; case 'e': - outs("找我有事嗎?請先來信唷...."); + outs(SHM->i18nstr[cuser.language][1998]); break; case 'f': { char msgbuf[60]; read(msgsock, msgbuf, 60); - prints("對不起,我現在不能跟你 %s,因為\n", sig_des[uin->sig]); + prints(SHM->i18nstr[cuser.language][1999], sig_des(uin->sig)); move(10, 18); outs(msgbuf); } break; case '1': - prints("%s?先拿100銀兩來..", sig_des[uin->sig]); + prints(SHM->i18nstr[cuser.language][2000], sig_des(uin->sig)); break; case '2': - prints("%s?先拿1000銀兩來..", sig_des[uin->sig]); + prints(SHM->i18nstr[cuser.language][2001], sig_des(uin->sig)); break; default: - prints("我現在不想 %s 啦.....:)", sig_des[uin->sig]); + prints(SHM->i18nstr[cuser.language][2002], sig_des(uin->sig)); } close(msgsock); } @@ -1401,32 +1394,17 @@ t_showhelp() { clear(); - outs("\033[36m【 休閒聊天使用說明 】\033[m\n\n" - "(←)(e) 結束離開 (h) 看使用說明\n" - "(↑)/(↓)(n) 上下移動 (TAB) 切換排序方式\n" - "(PgUp)(^B) 上頁選單 ( )(PgDn)(^F) 下頁選單\n" - "(Hm)/($)(Ed) 首/尾 (S) 來源/好友描述/戰績 切換\n" - "(m) 寄信 (q/c) 查詢網友/寵物\n" - "(r) 閱\讀信件 (l/C) 看上次熱訊/切換隱身\n" - "(f) 全部/好友列表 (數字) 跳至該使用者\n" - "(p) 切換呼叫器 (g/i) 給錢/切換心情\n" - "(a/d/o) 好友 增加/刪除/修改 (/)(s) 網友ID/暱稱搜尋\n" - "(N) 修改暱稱"); + outs(SHM->i18nstr[cuser.language][2003]); if (HAS_PERM(PERM_PAGE)) { - outs("\n\n\033[36m【 交談專用鍵 】\033[m\n" - "(→)(t)(Enter) 跟他/她聊天\n" - "(w) 熱線 Call in\n" - "(^W)切換水球方式 一般 / 進階 / 未來\n" - "(b) 對好友廣播 (一定要在好友列表中)\n" - "(^R) 即時回應 (有人 Call in 你時)"); + outs(SHM->i18nstr[cuser.language][2004]); } if (HAS_PERM(PERM_SYSOP)) { - outs("\n\n\033[36m【 站長專用鍵 】\033[m\n\n"); - outs("(u)/(H) 設定使用者資料/切換隱形模式\n"); - outs("(K) 把壞蛋踢出去\n"); + outs(SHM->i18nstr[cuser.language][2005]); + outs(SHM->i18nstr[cuser.language][2006]); + outs(SHM->i18nstr[cuser.language][2007]); #if defined(SHOWBOARD) && defined(DEBUG) - outs("(Y) 顯示正在看什麼板\n"); + outs(SHM->i18nstr[cuser.language][2008]); #endif } pressanykey(); @@ -1715,10 +1693,10 @@ draw_pickup(int drawall, pickup_t * pickup, int pickup_way, int show_pid, int myfriend, int friendme, int bfriend, int badfriend) { char *msg_pickup_way[PICKUP_WAYS] = { - "嗨! 朋友", "網友代號", "網友動態", "發呆時間", "來自何方", " 五子棋 ", " 象棋 " + SHM->i18nstr[cuser.language][2009], SHM->i18nstr[cuser.language][2010], SHM->i18nstr[cuser.language][2011], SHM->i18nstr[cuser.language][2012], SHM->i18nstr[cuser.language][2013], SHM->i18nstr[cuser.language][2014], SHM->i18nstr[cuser.language][2015] }; char *MODE_STRING[MAX_SHOW_MODE] = { - "故鄉", "好友描述", "五子棋戰績", "象棋戰績" + SHM->i18nstr[cuser.language][2016], SHM->i18nstr[cuser.language][2017], SHM->i18nstr[cuser.language][2018], SHM->i18nstr[cuser.language][2019] }; char pagerchar[5] = "* -Wf"; @@ -1731,29 +1709,24 @@ draw_pickup(int drawall, pickup_t * pickup, int pickup_way, #endif if (drawall) { - showtitle((cuser.uflag & FRIEND_FLAG) ? "好友列表" : "休閒聊天", + showtitle((cuser.uflag & FRIEND_FLAG) ? SHM->i18nstr[cuser.language][2020] : SHM->i18nstr[cuser.language][2021], BBSName); - prints("\n" - "\033[7m %s P%c代號 %-17s%-17s%-13s%-10s\033[m\n", + prints(SHM->i18nstr[cuser.language][2022], show_uid ? "UID" : "No.", (HAS_PERM(PERM_SEECLOAK) || HAS_PERM(PERM_SYSOP)) ? 'C' : ' ', - "暱稱", + SHM->i18nstr[cuser.language][2023], MODE_STRING[show_mode], - show_board ? "Board" : "動態", - show_pid ? " PID" : "心情 發呆" + show_board ? "Board" : SHM->i18nstr[cuser.language][2024], + show_pid ? " PID" : SHM->i18nstr[cuser.language][2025] ); move(b_lines, 0); - outs("\033[31;47m(TAB/f)\033[30m排序/好友 \033[31m(t)\033[30m聊天 " - "\033[31m(a/d/o)\033[30m交友 \033[31m(q)\033[30m查詢 " - "\033[31m(w)\033[30m水球 \033[31m(m)\033[30m寄信 \033[31m(h)" - "\033[30m線上輔助 \033[m"); + outs(SHM->i18nstr[cuser.language][2026]); } move(1, 0); - prints(" 排序:[%s] 上站人數:%-4d\033[1;32m我的朋友:%-3d" - "\033[33m與我為友:%-3d\033[36m板友:%-4d\033[31m壞人:" - "%-2d\033[m\n", + prints(SHM->i18nstr[cuser.language][2027], msg_pickup_way[pickup_way], SHM->UTMPnumber, myfriend, friendme, currutmp->brc_id ? (bfriend + 1) : 0, badfriend); + for (i = 0, ch = page * nPickups + 1; i < nPickups; ++i, ++ch) { move(i + 3, 0); prints("a"); @@ -1765,7 +1738,7 @@ draw_pickup(int drawall, pickup_t * pickup, int pickup_way, continue; } if (!uentp->pid) { - prints("%5d < 離站中..>\n", ch); + prints(SHM->i18nstr[cuser.language][2028], ch); continue; } if (PERM_HIDE(uentp)) @@ -1792,14 +1765,13 @@ draw_pickup(int drawall, pickup_t * pickup, int pickup_way, #endif if ((uentp->userlevel & PERM_VIOLATELAW)) - memcpy(mind, "通緝", 4); + memcpy(mind, SHM->i18nstr[cuser.language][2029], 4); else if (uentp->birth) - memcpy(mind, "壽星", 4); + memcpy(mind, SHM->i18nstr[cuser.language][2030], 4); else memcpy(mind, uentp->mind, 4); mind[4] = 0; - prints("%5d %c%c%s%-13s%-17.16s\033[m%-17.16s%-13.13s" - "\33[33m%-4.4s\33[m%s\n", + prints("%5d %c%c%s%-13s%-17.16s\033[m%-17.16s%-13.13s\33[33m%-4.4s\33[m%s\n", /* list number or uid */ #ifdef SHOWUID @@ -1842,7 +1814,6 @@ draw_pickup(int drawall, pickup_t * pickup, int pickup_way, #endif ); - //refresh(); } } @@ -1851,7 +1822,7 @@ call_in(userinfo_t * uentp, int fri_stat) { if (iswritable_stat(uentp, fri_stat)) { char genbuf[60]; - snprintf(genbuf, sizeof(genbuf), "Call-In %s :", uentp->userid); + snprintf(genbuf, sizeof(genbuf), SHM->i18nstr[cuser.language][2031], uentp->userid); my_write(uentp->pid, genbuf, uentp->userid, 0, NULL); return 1; } @@ -1962,7 +1933,7 @@ userlist(void) if (HAS_PERM(PERM_SYSOP)) { char buf[100]; snprintf(buf, sizeof(buf), - "代號 [%s]:", currutmp->userid); + SHM->i18nstr[cuser.language][2032], currutmp->userid); if (!getdata(1, 0, buf, currutmp->userid, sizeof(buf), DOECHO)) strlcpy(currutmp->userid, cuser.userid, sizeof(currutmp->userid)); @@ -1974,7 +1945,7 @@ userlist(void) if (HAS_PERM(PERM_SYSOP)) { char buf[100]; - snprintf(buf, sizeof(buf), "故鄉 [%s]:", currutmp->from); + snprintf(buf, sizeof(buf), SHM->i18nstr[cuser.language][2033], currutmp->from); if (!getdata(1, 0, buf, currutmp->from, sizeof(currutmp->from), DOECHO)) strncpy(currutmp->from, buf, 23); @@ -2153,14 +2124,14 @@ userlist(void) char genbuf[60]; char ans[4]; - if (!getdata(0, 0, "廣播訊息:", genbuf, sizeof(genbuf), DOECHO)) + if (!getdata(0, 0, SHM->i18nstr[cuser.language][2034], genbuf, sizeof(genbuf), DOECHO)) break; - if (getdata(0, 0, "確定廣播? [Y]", + if (getdata(0, 0, SHM->i18nstr[cuser.language][2035], ans, sizeof(ans), LCECHO) && *ans == 'n') break; if (!(cuser.uflag & FRIEND_FLAG) && HAS_PERM(PERM_SYSOP)) { - getdata(1, 0, "再次確定站長廣播? [N]", + getdata(1, 0, SHM->i18nstr[cuser.language][2036], ans, sizeof(ans), LCECHO); if( *ans != 'y' && *ans != 'Y' ){ vmsg("abort"); @@ -2209,7 +2180,7 @@ userlist(void) int id; userec_t muser; strlcpy(currauthor, uentp->userid, sizeof(currauthor)); - stand_title("使用者設定"); + stand_title(SHM->i18nstr[cuser.language][2037]); move(1, 0); if ((id = getuser(uentp->userid)) > 0) { memcpy(&muser, &xuser, sizeof(muser)); @@ -2222,12 +2193,12 @@ userlist(void) case 'i':{ char mindbuf[5]; - getdata(b_lines - 1, 0, "現在的心情? ", + getdata(b_lines - 1, 0, SHM->i18nstr[cuser.language][2038], mindbuf, sizeof(mindbuf), DOECHO); - if (strcmp(mindbuf, "通緝") == 0) - vmsg("不可以把自己設通緝啦!"); - else if (strcmp(mindbuf, "壽星") == 0) - vmsg("你不是今天生日欸!"); + if (strcmp(mindbuf, SHM->i18nstr[cuser.language][2039]) == 0) + vmsg(SHM->i18nstr[cuser.language][2040]); + else if (strcmp(mindbuf, SHM->i18nstr[cuser.language][2041]) == 0) + vmsg(SHM->i18nstr[cuser.language][2042]); else memcpy(currutmp->mind, mindbuf, 4); } @@ -2261,7 +2232,7 @@ userlist(void) break; case 'a': if (HAS_PERM(PERM_LOGINOK) && !(fri_stat & IFH)) { - if (getans("確定要加入好友嗎 [N/y]") == 'y') { + if (getans(SHM->i18nstr[cuser.language][2043]) == 'y') { friend_add(uentp->userid, FRIEND_OVERRIDE,uentp->username); friend_load(FRIEND_OVERRIDE); } @@ -2271,7 +2242,7 @@ userlist(void) case 'd': if (HAS_PERM(PERM_LOGINOK) && (fri_stat & IFH)) { - if (getans("確定要刪除好友嗎 [N/y]") == 'y') { + if (getans(SHM->i18nstr[cuser.language][2044]) == 'y') { friend_delete(uentp->userid, FRIEND_OVERRIDE); friend_load(FRIEND_OVERRIDE); } @@ -2296,37 +2267,36 @@ userlist(void) case 'g': if (HAS_PERM(PERM_LOGINOK) && strcmp(uentp->userid, cuser.userid) != 0) { - char genbuf[10]; + char genbuf[10]; move(b_lines - 2, 0); - prints("要給 %s 多少錢呢? ", uentp->userid); - if (getdata(b_lines - 1, 0, "[銀行轉帳]: ", + prints(SHM->i18nstr[cuser.language][2045], uentp->userid); + if (getdata(b_lines - 1, 0, SHM->i18nstr[cuser.language][2046], genbuf, 7, LCECHO)) { clrtoeol(); if ((ch = atoi(genbuf)) <= 0 || ch <= give_tax(ch)){ redrawall = redraw = 1; break; } - if (getans("確定要給 %s %d Ptt 幣嗎? [N/y]", - uentp->userid, ch) != 'y'){ + sprintf(genbuf, SHM->i18nstr[cuser.language][2047], uentp->userid, ch); + if (getans(genbuf) != 'y'){ redrawall = redraw = 1; break; } reload_money(); if (ch > cuser.money) { - outs("\033[41m 現金不足~~\033[m"); + outs(SHM->i18nstr[cuser.language][2048]); } else { deumoney(uentp->uid, ch - give_tax(ch)); - log_file(FN_MONEY, 1, - "%s\t給%s\t%d\t%s\n", cuser.userid, - uentp->userid, ch, ctime(&currutmp->lastact)); + log_file(FN_MONEY, 1, SHM->i18nstr[cuser.language][2050], + cuser.userid,uentp->userid, ch,ctime(&currutmp->lastact)); mail_redenvelop(cuser.userid, uentp->userid, ch - give_tax(ch), 'Y'); - vmsg(" 嗯..還剩下 %d 錢..", demoney(-ch)); + vmsg(SHM->i18nstr[cuser.language][2049],demoney(-ch)); } } else { clrtoeol(); - vmsg(" 交易取消! "); + vmsg(SHM->i18nstr[cuser.language][2051]); } redrawall = redraw = 1; } @@ -2334,8 +2304,8 @@ userlist(void) case 'm': if (HAS_PERM(PERM_BASIC)) { - stand_title("寄 信"); - prints("[寄信] 收信人:%s", uentp->userid); + stand_title(SHM->i18nstr[cuser.language][2052]); + prints(SHM->i18nstr[cuser.language][2053], uentp->userid); my_send(uentp->userid); setutmpmode(LUSERS); redrawall = redraw = 1; @@ -2378,14 +2348,12 @@ userlist(void) case Ctrl('W'): if (HAS_PERM(PERM_LOGINOK)) { int tmp; - char *wm[3] = {"一般", "進階", "未來"}; + char *wm[3] = {SHM->i18nstr[cuser.language][2054], SHM->i18nstr[cuser.language][2055], SHM->i18nstr[cuser.language][2056]}; tmp = cuser.uflag2 & WATER_MASK; cuser.uflag2 -= tmp; tmp = (tmp + 1) % 3; cuser.uflag2 |= tmp; - vmsg("系統提供 一般 進階 未來 三種模式\n" - "在切換後請正常下線再重新登入, 以確保結構正確\n" - "目前切換到 %s 水球模式\n", wm[tmp]); + vmsg(SHM->i18nstr[cuser.language][2057], wm[tmp]); redrawall = redraw = 1; } break; @@ -2399,7 +2367,7 @@ userlist(void) break; case 'N': - oldgetdata(1, 0, "新的暱稱: ", + oldgetdata(1, 0, SHM->i18nstr[cuser.language][2058], cuser.username, sizeof(cuser.username), DOECHO); strcpy(currutmp->username, cuser.username); redrawall = redraw = 1; @@ -2452,8 +2420,7 @@ t_idle(void) char passbuf[PASSLEN]; setutmpmode(IDLE); - getdata(b_lines - 1, 0, "理由:[0]發呆 (1)接電話 (2)覓食 (3)打瞌睡 " - "(4)裝死 (5)羅丹 (6)其他 (Q)沒事?", genbuf, 3, DOECHO); + getdata(b_lines - 1, 0, SHM->i18nstr[cuser.language][2059], genbuf, 3, DOECHO); if (genbuf[0] == 'q' || genbuf[0] == 'Q') { currutmp->mode = mode0; currstat = stat0; @@ -2465,14 +2432,14 @@ t_idle(void) if (currutmp->destuid == 6) if (!cuser.userlevel || - !getdata(b_lines - 1, 0, "發呆的理由:", + !getdata(b_lines - 1, 0, SHM->i18nstr[cuser.language][2060], currutmp->chatid, sizeof(currutmp->chatid), DOECHO)) currutmp->destuid = 0; do { move(b_lines - 2, 0); clrtoeol(); - prints("(鎖定螢幕)發呆原因: %s", (currutmp->destuid != 6) ? - IdleTypeTable[currutmp->destuid] : currutmp->chatid); + prints(SHM->i18nstr[cuser.language][2061], (currutmp->destuid != 6) ? + SHM->i18nstr[cuser.language][1890 + currutmp->destuid] : currutmp->chatid); refresh(); getdata(b_lines - 1, 0, MSG_PASSWD, passbuf, sizeof(passbuf), NOECHO); passbuf[8] = '\0'; @@ -2492,7 +2459,7 @@ t_qchicken(void) { char uident[STRLEN]; - stand_title("查詢寵物"); + stand_title(SHM->i18nstr[cuser.language][2062]); usercomplete(msg_uid, uident); if (uident[0]) chicken_query(uident); @@ -2504,7 +2471,7 @@ t_query(void) { char uident[STRLEN]; - stand_title("查詢網友"); + stand_title(SHM->i18nstr[cuser.language][2063]); usercomplete(msg_uid, uident); if (uident[0]) my_query(uident); @@ -2522,7 +2489,7 @@ t_talk() * if (count_ulist() <= 1){ outs("目前線上只有您一人,快邀請朋友來光臨【" * BBSNAME "】吧!"); return XEASY; } */ - stand_title("打開話匣子"); + stand_title(SHM->i18nstr[cuser.language][2064]); generalnamecomplete(msg_uid, uident, sizeof(uident), SHM->UTMPnumber, completeutmp_compar, @@ -2540,9 +2507,9 @@ t_talk() /* multi-login check */ unum = 1; while ((ucount = count_logins(tuid, 0)) > 1) { - outs("(0) 不想 talk 了...\n"); + outs(SHM->i18nstr[cuser.language][2065]); count_logins(tuid, 1); - getdata(1, 33, "請選擇一個聊天對象 [0]:", genbuf, 4, DOECHO); + getdata(1, 33, SHM->i18nstr[cuser.language][2066], genbuf, 4, DOECHO); unum = atoi(genbuf); if (unum == 0) return 0; @@ -2568,7 +2535,7 @@ reply_connection_request(userinfo_t *uip) if (uip->mode != PAGE) { snprintf(genbuf, sizeof(genbuf), - "%s已停止呼叫,按Enter繼續...", page_requestor); + SHM->i18nstr[cuser.language][2067], page_requestor); getdata(0, 0, genbuf, buf, sizeof(buf), LCECHO); return -1; } @@ -2608,31 +2575,26 @@ talkreply(void) clear(); prints("\n\n"); - prints(" (Y) 讓我們 %s 吧!" - " (A) 我現在很忙,請等一會兒再 call 我\n", sig_des[sig]); - prints(" (N) 我現在不想 %s" - " (B) 對不起,我有事情不能跟你 %s\n", - sig_des[sig], sig_des[sig]); - prints(" (C) 請不要吵我好嗎?" - " (D) 我要離站囉..下次再聊吧.......\n"); - prints(" (E) 有事嗎?請先來信" - " (F) \033[1;33m我自己輸入理由好了...\033[m\n"); - prints(" (1) %s?先拿100銀兩來" - " (2) %s?先拿1000銀兩來..\n\n", sig_des[sig], sig_des[sig]); + prints(SHM->i18nstr[cuser.language][2068], sig_des(sig)); + prints(SHM->i18nstr[cuser.language][2069], + sig_des(sig), sig_des(sig)); + prints(SHM->i18nstr[cuser.language][2070]); + prints(SHM->i18nstr[cuser.language][2071]); + prints(SHM->i18nstr[cuser.language][2072], sig_des(sig), sig_des(sig)); getuser(uip->userid); currutmp->msgs[0].pid = uip->pid; strlcpy(currutmp->msgs[0].userid, uip->userid, sizeof(currutmp->msgs[0].userid)); - strlcpy(currutmp->msgs[0].last_call_in, "呼叫、呼叫,聽到請回答 (Ctrl-R)", + strlcpy(currutmp->msgs[0].last_call_in, SHM->i18nstr[cuser.language][2073], sizeof(currutmp->msgs[0].last_call_in)); - prints("對方來自 [%s],共上站 %d 次,文章 %d 篇\n", + prints(SHM->i18nstr[cuser.language][2074], uip->from, xuser.numlogins, xuser.numposts); showplans(uip->userid); show_call_in(0, 0); snprintf(genbuf, sizeof(genbuf), - "你想跟 %s %s啊?請選擇(Y/N/A/B/C/D/E/F/1/2)[N] ", - page_requestor, sig_des[sig]); + SHM->i18nstr[cuser.language][2075], + page_requestor, sig_des(sig)); getdata(0, 0, genbuf, buf, sizeof(buf), LCECHO); a = reply_connection_request(uip); @@ -2640,8 +2602,8 @@ talkreply(void) buf[0] = 'n'; write(a, buf, 1); if (buf[0] == 'f' || buf[0] == 'F') { - if (!getdata(b_lines, 0, "不能的原因:", genbuf, 60, DOECHO)) - strlcpy(genbuf, "不告訴你咧 !! ^o^", sizeof(genbuf)); + if (!getdata(b_lines, 0, SHM->i18nstr[cuser.language][2076], genbuf, 60, DOECHO)) + strlcpy(genbuf, SHM->i18nstr[cuser.language][2077], sizeof(genbuf)); write(a, genbuf, 60); } |