diff options
author | wens <wens@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2007-12-05 00:52:47 +0800 |
---|---|---|
committer | wens <wens@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2007-12-05 00:52:47 +0800 |
commit | 5389a0dd087aaed29cc6e11f5623aef4bb9accf4 (patch) | |
tree | 26fcc78f312b3e090dabbead55d83c84003f45b8 /mbbsd | |
parent | 56abc87c416464be55ab90ea63ed8be3a09f00fe (diff) | |
download | pttbbs-5389a0dd087aaed29cc6e11f5623aef4bb9accf4.tar pttbbs-5389a0dd087aaed29cc6e11f5623aef4bb9accf4.tar.gz pttbbs-5389a0dd087aaed29cc6e11f5623aef4bb9accf4.tar.bz2 pttbbs-5389a0dd087aaed29cc6e11f5623aef4bb9accf4.tar.lz pttbbs-5389a0dd087aaed29cc6e11f5623aef4bb9accf4.tar.xz pttbbs-5389a0dd087aaed29cc6e11f5623aef4bb9accf4.tar.zst pttbbs-5389a0dd087aaed29cc6e11f5623aef4bb9accf4.zip |
- general code refine: remove all hard-coded "Ptt" message string and
use macro BBSMNAME/BBSMNAME2 instead
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3628 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd')
-rw-r--r-- | mbbsd/bbs.c | 56 | ||||
-rw-r--r-- | mbbsd/cal.c | 2 | ||||
-rw-r--r-- | mbbsd/chicken.c | 15 | ||||
-rw-r--r-- | mbbsd/edit.c | 2 | ||||
-rw-r--r-- | mbbsd/gamble.c | 4 | ||||
-rw-r--r-- | mbbsd/kaede.c | 1 | ||||
-rw-r--r-- | mbbsd/menu.c | 28 | ||||
-rw-r--r-- | mbbsd/screen.c | 4 | ||||
-rw-r--r-- | mbbsd/syspost.c | 4 | ||||
-rw-r--r-- | mbbsd/talk.c | 10 | ||||
-rw-r--r-- | mbbsd/user.c | 10 | ||||
-rw-r--r-- | mbbsd/var.c | 4 | ||||
-rw-r--r-- | mbbsd/voteboard.c | 2 |
13 files changed, 77 insertions, 65 deletions
diff --git a/mbbsd/bbs.c b/mbbsd/bbs.c index ad101bb5..934cf3e9 100644 --- a/mbbsd/bbs.c +++ b/mbbsd/bbs.c @@ -68,12 +68,13 @@ anticrosspost(void) ANSI_COLOR(37;45) "cross post �峹 " ANSI_COLOR(37) " %s" ANSI_RESET "\n", cuser.userid, ctime4(&now)); - post_violatelaw(cuser.userid, "Ptt�t��ĵ��", "Cross-post", "�@��B��"); + post_violatelaw(cuser.userid, BBSMNAME "�t��ĵ��", + "Cross-post", "�@��B��"); cuser.userlevel |= PERM_VIOLATELAW; cuser.timeviolatelaw = now; cuser.vl_count++; mail_id(cuser.userid, "Cross-Post�@��", - "etc/crosspost.txt", "Pttĵ���"); + "etc/crosspost.txt", BBSMNAME "ĵ���"); if ((now - cuser.firstlogin) / 86400 < 14) delete_allpost(cuser.userid); kick_all(cuser.userid); // XXX: in2: wait for testing @@ -349,33 +350,31 @@ readdoent(int num, fileheader_t * ent) if ((currmode & MODE_BOARD) && (ent->filemode & FILE_DIGEST)) type = (type == ' ') ? '*' : '#'; - else if (currmode & MODE_BOARD || HasUserPerm(PERM_LOGINOK)) { + else if (currmode & MODE_BOARD || HasUserPerm(PERM_LOGINOK)) + { if (ent->filemode & FILE_MARKED) - { - if(ent->filemode & FILE_SOLVED) - type = '!'; - else + { + if(ent->filemode & FILE_SOLVED) + type = '!'; + else if (isunread == 0) + type = 'm'; + else if (isunread == 1) + type = 'M'; + else if (isunread == 2 && + !(cuser.uflag & NO_MODMARK_FLAG)) { - if (isunread == 0) - type = 'm'; - else if (isunread == 1) - type = 'M'; - else if (isunread == 2) + if (cuser.uflag & COLORED_MODMARK) { - // modified mark - if (!(cuser.uflag & NO_MODMARK_FLAG)) - { - if (cuser.uflag & COLORED_MODMARK) - { - typeattr = ANSI_COLOR(36); - type = 'm'; - } else { - type = '='; - } - } + typeattr = ANSI_COLOR(36); + type = 'm'; + } else { + // some user suggests 'n' for shaping like 'm'. + // also makes sense. + // type = 'n'; // 'N' + type = '='; } } - } + } else if (TagNum && !Tagger(atoi(ent->filename + 2), 0, TAG_NIN)) type = 'D'; else if (ent->filemode & FILE_SOLVED) @@ -432,6 +431,7 @@ readdoent(int num, fileheader_t * ent) else /* recently we found that many boards have >10k articles, * so it's better to use 5+2 (2 for cursor marker) here. + * XXX if we are in big term, enlarge here. */ prints("%7d", num); @@ -2809,8 +2809,10 @@ del_post(int ent, fileheader_t * fhdr, char *direct) if (!(inc_badpost(userid, 1) % 5)){ userec_t xuser; - post_violatelaw(userid, "Ptt �t��ĵ��", "�H��֭p 5 �g", "�@��@�i"); - mail_violatelaw(userid, "Ptt �t��ĵ��", "�H��֭p 5 �g", "�@��@�i"); + post_violatelaw(userid, BBSMNAME " �t��ĵ��", + "�H��֭p 5 �g", "�@��@�i"); + mail_violatelaw(userid, BBSMNAME " �t��ĵ��", + "�H��֭p 5 �g", "�@��@�i"); kick_all(userid); passwd_query(tusernum, &xuser); xuser.money = moneyof(tusernum); @@ -2831,7 +2833,7 @@ del_post(int ent, fileheader_t * fhdr, char *direct) setbpath(report_path, BAD_POST_RECORD); stampfile(report_path, &report_fh); - strcpy(report_fh.owner, "[Pttĵ�]"); + strcpy(report_fh.owner, "[" BBSMNAME "ĵ�]"); snprintf(report_fh.title, sizeof(report_fh.title), "%s �O %s �O�D���� %s �@�g�H��", currboard, cuser.userid, userid); diff --git a/mbbsd/cal.c b/mbbsd/cal.c index b99d89e4..d44b5b58 100644 --- a/mbbsd/cal.c +++ b/mbbsd/cal.c @@ -91,7 +91,7 @@ vice(int money, const char *item) } snprintf(buf, sizeof(buf), "%s ��F$%d �s��[%08d]", item, money, viceserial); - mail_id(cuser.userid, buf, "etc/vice.txt", "Ptt�g�ٳ�"); + mail_id(cuser.userid, buf, "etc/vice.txt", BBSMNAME "�g�ٳ�"); return 0; } diff --git a/mbbsd/chicken.c b/mbbsd/chicken.c index f73d8c5a..6fcffba3 100644 --- a/mbbsd/chicken.c +++ b/mbbsd/chicken.c @@ -105,7 +105,8 @@ new_chicken(void) clear(); move(2, 0); - outs("�w����{ " ANSI_COLOR(33) "��" ANSI_COLOR(37;44) " Ptt�d������ " ANSI_COLOR(33;40) "��" ANSI_RESET ".. " + outs("�w����{ " ANSI_COLOR(33) "��" ANSI_COLOR(37;44) " " + BBSMNAME "�d������ " ANSI_COLOR(33;40) "��" ANSI_RESET ".. " "�ثe�J���G\n" "(a)�p�� $5 (b)���֤k $25 (c)�i�h $30 (d)�j�� $40 " "(e)���s $80\n" @@ -203,7 +204,7 @@ show_chicken_data(chicken_t * thechicken, chicken_t * pkchicken) /* Ptt:debug */ thechicken->type %= NUM_KINDS; clear(); - showtitle(pkchicken ? "��tt������" : "��tt�i����", BBSName); + showtitle(pkchicken ? BBSMNAME2 "������" : BBSMNAME2 "�i����", BBSName); move(1, 0); show_chicken_stat(thechicken, age); @@ -833,15 +834,17 @@ recover_chicken(chicken_t * thechicken) thechicken->satis = 2; vice(money, "�F�ɦu��"); snprintf(buf, sizeof(buf), - ANSI_COLOR(33;44) "���F�ɦu��" ANSI_COLOR(37;45) " OK�F �O�o���L�I�F�� " - "���M�i�ॢ�� ���b�ڤ]����Ptt ���A%d�N�n " ANSI_RESET, money); + ANSI_COLOR(33;44) "���F�ɦu��" ANSI_COLOR(37;45) + " OK�F �O�o���L�I�F�� ���M�i�ॢ�� " + "���b�ڤ]����BBS ���A%d�N�n " ANSI_RESET, money); outmsg(buf); bell(); igetch(); return 1; } - outmsg(ANSI_COLOR(33;44) "���F�ɦu��" ANSI_COLOR(37;45) " ���M���ڧ|�H! �o�~�Y�R�u���ȿ� " - "���D�ڦA�ӧ�A �A�A�]�S���|�F " ANSI_RESET); + outmsg(ANSI_COLOR(33;44) "���F�ɦu��" ANSI_COLOR(37;45) + " ���M���ڧ|�H! �o�~�Y�R�u���ȿ� " + "���D�ڦA�ӧ�A �A�A�]�S���|�F " ANSI_RESET); bell(); igetch(); thechicken->lastvisit = 0; diff --git a/mbbsd/edit.c b/mbbsd/edit.c index 8063b0cf..c2bdfe6a 100644 --- a/mbbsd/edit.c +++ b/mbbsd/edit.c @@ -2793,7 +2793,7 @@ vedit(char *fpath, int saveheader, int *islocal) log_file("etc/illegal_money", LOG_CREAT | LOG_VF, ANSI_COLOR(1;33;46) "%s " ANSI_COLOR(37;45) " �ξ����H�o���峹 " ANSI_COLOR(37) " %s" ANSI_RESET "\n", cuser.userid, ctime4(&now)); - post_violatelaw(cuser.userid, "Ptt�t��ĵ��", + post_violatelaw(cuser.userid, BBSMNAME "�t��ĵ��", "�ξ����H�o���峹", "�j������"); abort_bbs(0); */ diff --git a/mbbsd/gamble.c b/mbbsd/gamble.c index 049bda74..3229b906 100644 --- a/mbbsd/gamble.c +++ b/mbbsd/gamble.c @@ -38,7 +38,7 @@ show_ticket_data(char betname[MAX_ITEM][MAX_ITEM_LEN],const char *direct, int *p } else showtitle(genbuf, BBSNAME); } else - showtitle("Ptt��L", BBSNAME); + showtitle(BBSMNAME "��L", BBSNAME); move(2, 0); snprintf(genbuf, sizeof(genbuf), "%s/" FN_TICKET_ITEMS, direct); if (!(fp = fopen(genbuf, "r"))) { @@ -349,7 +349,7 @@ openticket(int bid) if ((uid = searchuser(userid, userid)) == 0) continue; deumoney(uid, money * i); - mail_id(userid, buf, "etc/ticket.win", "Ptt���"); + mail_id(userid, buf, "etc/ticket.win", BBSMNAME "���"); } fclose(fp1); } diff --git a/mbbsd/kaede.c b/mbbsd/kaede.c index c4a9768b..bc08ae3d 100644 --- a/mbbsd/kaede.c +++ b/mbbsd/kaede.c @@ -86,7 +86,6 @@ Rename(const char *src, const char *dst) if (rename(src, dst) == 0) return 0; if (!strchr(src, ';') && !strchr(dst, ';')) - // Ptt �������`���O // XXX �o�ˬO������ { pid_t pid = fork(); if (pid == 0) diff --git a/mbbsd/menu.c b/mbbsd/menu.c index 33538753..ac31b010 100644 --- a/mbbsd/menu.c +++ b/mbbsd/menu.c @@ -149,7 +149,7 @@ show_status(void) "�ͤ�n�Ыȭ�" : SHM->today_is, SHM->UTMPnumber, cuser.userid); outmsg(mystatus); - i = strlen(mystatus) - (3*7+25); + i = strlen(mystatus) - (3*7+25); // 3 = ANSI_COLOR, 25 = stuff inside sprintf(mystatus, "[����]" ANSI_COLOR(31) "%s ", msgs[currutmp->pager]); outslr("", i, mystatus, strlen(msgs[currutmp->pager]) + 7); @@ -557,7 +557,7 @@ int main_menu(void) { } static int p_money() { - domenu(M_PSALE, "��tt�q�c��", '0', moneylist); + domenu(M_PSALE, BBSMNAME2 "�q�c��", '0', moneylist); return 0; }; @@ -572,7 +572,7 @@ const static commands_t jceelist[] = { }; static int m_jcee() { - domenu(M_JCEE, "��tt�d�]�t��", '0', jceelist); + domenu(M_JCEE, BBSMNAME2 "�d�]�t��", '0', jceelist); return 0; } #endif @@ -593,13 +593,17 @@ static const commands_t playlist[] = { /* {x_weather,0 , "WWeather �i ��H�w�� �j"}, */ /* XXX �a���F */ /* {x_stock,0 , "SStock �i �ѥ��污 �j"},*/ - {forsearch,PERM_LOGINOK, "SSearchEngine�i" ANSI_COLOR(1;35) " ��tt�j�M�� " ANSI_RESET "�j"}, + {forsearch,PERM_LOGINOK, "SSearchEngine�i" ANSI_COLOR(1;35) " " + BBSMNAME2 "�j�M�� " ANSI_RESET "�j"}, {topsong,PERM_LOGINOK, "TTop Songs �i" ANSI_COLOR(1;32) " �I�q�Ʀ�] " ANSI_RESET "�j"}, - {p_money,PERM_LOGINOK, "PPay �i" ANSI_COLOR(1;31) " ��tt�q�c�� " ANSI_RESET "�j"}, + {p_money,PERM_LOGINOK, "PPay �i" ANSI_COLOR(1;31) " " + BBSMNAME2 "�q�c�� " ANSI_RESET "�j"}, {chicken_main,PERM_LOGINOK, "CChicken " - "�i" ANSI_COLOR(1;34) " ��tt�i���� " ANSI_RESET "�j"}, - {playground,PERM_LOGINOK, "AAmusement �i" ANSI_COLOR(1;33) " ��tt�C�ֳ� " ANSI_RESET "�j"}, - {chessroom, PERM_LOGINOK, "BBChess �i" ANSI_COLOR(1;34) " ��tt�Ѱ| " ANSI_RESET "�j"}, + "�i" ANSI_COLOR(1;34) " " BBSMNAME2 "�i���� " ANSI_RESET "�j"}, + {playground,PERM_LOGINOK, "AAmusement �i" ANSI_COLOR(1;33) " " + BBSMNAME2 "�C�ֳ� " ANSI_RESET "�j"}, + {chessroom, PERM_LOGINOK, "BBChess �i" ANSI_COLOR(1;34) " " + BBSMNAME2 "�Ѱ| " ANSI_RESET "�j"}, {NULL, 0, NULL} }; @@ -617,7 +621,7 @@ static const commands_t chesslist[] = { }; static int chessroom() { - domenu(M_CHC, "��tt�Ѱ|", '1', chesslist); + domenu(M_CHC, BBSMNAME2 "�Ѱ|", '1', chesslist); return 0; } @@ -626,7 +630,7 @@ static const commands_t plist[] = { /* {p_ticket_main, PERM_LOGINOK,"00Pre �i �`�ξ� �j"}, {alive, PERM_LOGINOK, "00Alive �i �q���� �j"}, */ - {ticket_main, PERM_LOGINOK, "11Gamble �i ��tt��� �j"}, + {ticket_main, PERM_LOGINOK, "11Gamble �i " BBSMNAME2 "��� �j"}, {guess_main, PERM_LOGINOK, "22Guess number�i �q�Ʀr �j"}, {othello_main, PERM_LOGINOK, "33Othello �i �¥մ� �j"}, // {dice_main, PERM_LOGINOK, "44Dice �i ����l �j"}, @@ -638,7 +642,7 @@ static const commands_t plist[] = { }; static int playground() { - domenu(M_AMUSE, "��tt�C�ֳ�",'1',plist); + domenu(M_AMUSE, BBSMNAME2 "�C�ֳ�",'1',plist); return 0; } @@ -651,7 +655,7 @@ static const commands_t slist[] = { }; static int forsearch() { - domenu(M_SREG, "��tt�j�M��", '1', slist); + domenu(M_SREG, BBSMNAME2 "�j�M��", '1', slist); return 0; } diff --git a/mbbsd/screen.c b/mbbsd/screen.c index a9af6747..e508ece2 100644 --- a/mbbsd/screen.c +++ b/mbbsd/screen.c @@ -401,7 +401,9 @@ outs_n(const char *str, int n) outc(*str++); } } -// + +// XXX left-right (for large term) +// TODO someday please add ANSI detection version void outslr(const char *left, int leftlen, const char *right, int rightlen) { diff --git a/mbbsd/syspost.c b/mbbsd/syspost.c index 13e71390..029c23a7 100644 --- a/mbbsd/syspost.c +++ b/mbbsd/syspost.c @@ -114,7 +114,7 @@ post_violatelaw(const char *crime, const char *police, const char *reason, const police, crime, reason, result); if (!strstr(police, "ĵ��")) { - post_msg("PoliceLog", title, msg, "[Ptt�k�|]"); + post_msg("PoliceLog", title, msg, "[" BBSMNAME "�k�|]"); snprintf(msg, sizeof(msg), ANSI_COLOR(1;32) "%s" ANSI_RESET "�P�M�G\n" @@ -123,7 +123,7 @@ post_violatelaw(const char *crime, const char *police, const char *reason, const "����ĵ��", crime, reason, result); } - post_msg("ViolateLaw", title, msg, "[Ptt�k�|]"); + post_msg("ViolateLaw", title, msg, "[" BBSMNAME "�k�|]"); } void diff --git a/mbbsd/talk.c b/mbbsd/talk.c index b518f1a7..31694b34 100644 --- a/mbbsd/talk.c +++ b/mbbsd/talk.c @@ -1083,10 +1083,12 @@ t_display(void) if (more(genbuf, YEA) != -1) { move(b_lines - 4, 0); clrtobot(); - outs(ANSI_COLOR(1;33;45) "���{�b Ptt���ѳзs�����y��z�{����" ANSI_RESET "\n" - "�z�N���y�s�ܫH�c��, �b�i�l����j�ӫH��e�� u,\n" - "�t�ΧY�|�N�z�����y�������s��z��H�e���z��! \n"); - getdata(b_lines - 1, 0, "�M��(C) ���ܳƧѿ�(M) �O�d(R) (C/M/R)?[R]", + + outs(ANSI_COLOR(1;33;45) "�����y��z�{�� " ANSI_RESET "\n" + "�����z: �i�N���y�s�J�H�c(M)��, ��i�l����j�ӫH��e�� u,\n" + "�t�η|�N���y�������s��z��H�e���z��! " ANSI_RESET "\n"); + + getdata(b_lines - 1, 0, "�M��(C) �s�J�H�c(M) �O�d(R) (C/M/R)?[R]", ans, sizeof(ans), LCECHO); if (*ans == 'm') { fileheader_t mymail; diff --git a/mbbsd/user.c b/mbbsd/user.c index 29b6d030..c8a7943b 100644 --- a/mbbsd/user.c +++ b/mbbsd/user.c @@ -236,7 +236,7 @@ mail_violatelaw(const char *crime, const char *police, const char *reason, const stampfile(genbuf, &fhdr); if (!(fp = fopen(genbuf, "w"))) return; - fprintf(fp, "�@��: [Pttĵ�]\n" + fprintf(fp, "�@��: [" BBSMNAME "ĵ�]\n" "���D: [���i] �H�k���i\n" "�ɶ�: %s\n" ANSI_COLOR(1;32) "%s" ANSI_RESET "�P�M�G\n " ANSI_COLOR(1;32) "%s" ANSI_RESET @@ -245,7 +245,7 @@ mail_violatelaw(const char *crime, const char *police, const char *reason, const ctime4(&now), police, crime, reason, result); fclose(fp); strcpy(fhdr.title, "[���i] �H�k�P�M���i"); - strcpy(fhdr.owner, "[Pttĵ�]"); + strcpy(fhdr.owner, "[" BBSMNAME "ĵ�]"); sethomedir(genbuf, crime); append_record(genbuf, &fhdr, sizeof(fhdr)); } @@ -337,7 +337,7 @@ void Customize(void) static const char* desc1[] = { "�ʺA�ݪO", "���ä峹�ק�Ÿ�(����/�פ�) (~)", - "��αm��ק�Ÿ� (+)", + "��Φ�m�N���ק�Ÿ� (+)", #ifdef DBCSAWARE "�۰ʰ������줸�r��(�p��������)", #endif @@ -355,7 +355,7 @@ void Customize(void) static const char* desc2[] = { "�ڦ����~�H", "�s�O�۰ʶi�ڪ��̷R", - "�����ܦ���ܧڪ��̷R", + "�����ܧڪ��̷R", 0, }; @@ -1117,7 +1117,7 @@ showplans_userec(userec_t *user) if(user->userlevel & PERM_VIOLATELAW) { - outs(" \033[1;31m���H�H�W �|��ú��@��\033[m"); + outs(" " ANSI_COLOR(1;31) "���H�H�W �|��ú��@��" ANSI_RESET); return; } diff --git a/mbbsd/var.c b/mbbsd/var.c index ecf91169..2b5e006e 100644 --- a/mbbsd/var.c +++ b/mbbsd/var.c @@ -195,7 +195,7 @@ char * const ModeTypeTable[MAX_MODES] = { "�����ݪO", /* CLASS */ "Play���", /* PMENU */ "�s�S�O�W��", /* NMENU */ - "��tt�q�c��", /* PSALE */ + BBSMNAME2 "�q�c��", /* PSALE */ "�o���峹", /* POSTING */ "�ݪO�C��", /* READBRD */ "�\\Ū�峹", /* READING */ @@ -263,7 +263,7 @@ char * const ModeTypeTable[MAX_MODES] = { "�U�H��", /* CHC */ "�U�t��", /* DARK */ "NBA�j�q��", /* TMPJACK */ - "��tt�d�]�t��", /* JCEE */ + BBSMNAME2 "�d�]�t��", /* JCEE */ "���s�峹", /* REEDIT */ "������", /* BLOGGING */ "�ݴ�", /* CHESSWATCHING */ diff --git a/mbbsd/voteboard.c b/mbbsd/voteboard.c index 1e983391..3d28fe16 100644 --- a/mbbsd/voteboard.c +++ b/mbbsd/voteboard.c @@ -215,7 +215,7 @@ do_voteboard(int type) } move(0, 0); clrtobot(); - outs("�z���b�ϥ� PTT ���s�p�t��\n"); + outs("�z���b�ϥ�" BBSNAME "���s�p�t��\n"); outs("���s�p�t�αN�߰ݱz�@�ǰ��D�A�Фp�ߦ^���~��}�l�s�p\n"); outs("���N���X�s�p�ת̡A�N�Q�C�J�����w��ϥΪ̳�\n"); move(4, 0); |