summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2010-11-10 13:48:10 +0800
committerpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2010-11-10 13:48:10 +0800
commitfb577f5581c80013b531832456e4f59255ad8400 (patch)
tree0360163f97e2ee505ffdd6a6d0844f76e03e48e4
parent9f9334d2290b611d080595d445fd539ec0ff78f6 (diff)
downloadpttbbs-fb577f5581c80013b531832456e4f59255ad8400.tar
pttbbs-fb577f5581c80013b531832456e4f59255ad8400.tar.gz
pttbbs-fb577f5581c80013b531832456e4f59255ad8400.tar.bz2
pttbbs-fb577f5581c80013b531832456e4f59255ad8400.tar.lz
pttbbs-fb577f5581c80013b531832456e4f59255ad8400.tar.xz
pttbbs-fb577f5581c80013b531832456e4f59255ad8400.tar.zst
pttbbs-fb577f5581c80013b531832456e4f59255ad8400.zip
change the definition of MONEYNAME so message can be customizaed in a better way
git-svn-id: http://opensvn.csie.org/pttbbs/trunk@5233 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--pttbbs/include/config.h2
-rw-r--r--pttbbs/mbbsd/admin.c6
-rw-r--r--pttbbs/mbbsd/bbs.c22
-rw-r--r--pttbbs/mbbsd/cal.c15
-rw-r--r--pttbbs/mbbsd/chicken.c2
-rw-r--r--pttbbs/mbbsd/gamble.c6
-rw-r--r--pttbbs/mbbsd/mbbsd.c2
-rw-r--r--pttbbs/mbbsd/menu.c6
-rw-r--r--pttbbs/mbbsd/talk.c2
-rw-r--r--pttbbs/mbbsd/user.c11
-rw-r--r--pttbbs/sample/pttbbs.conf4
11 files changed, 41 insertions, 37 deletions
diff --git a/pttbbs/include/config.h b/pttbbs/include/config.h
index f5da026f..265a1495 100644
--- a/pttbbs/include/config.h
+++ b/pttbbs/include/config.h
@@ -21,7 +21,7 @@
/* 錢幣名,建議剛好 3 個字元。 詳見 sample/pttbbs.conf */
#ifndef MONEYNAME
-#define MONEYNAME "Ptt"
+#define MONEYNAME BBSMNAME "幣"
#endif
/* AID 顯示的站台名稱。 若 IP 太長請另行定義。 */
diff --git a/pttbbs/mbbsd/admin.c b/pttbbs/mbbsd/admin.c
index f5c002b0..b9f94f9b 100644
--- a/pttbbs/mbbsd/admin.c
+++ b/pttbbs/mbbsd/admin.c
@@ -971,7 +971,7 @@ adm_give_id_money(const char *user_id, int money, const char *mail_title)
prints("id:%s money:%d 不對吧!!", user_id, money);
pressanykey();
} else {
- snprintf(tt, sizeof(tt), "%s : %d " MONEYNAME " 幣", mail_title, money);
+ snprintf(tt, sizeof(tt), "%s : %d " MONEYNAME, mail_title, money);
mail_id(user_id, tt, "etc/givemoney.why", "[" BBSMNAME "銀行]");
}
}
@@ -1039,7 +1039,7 @@ give_money(void)
fprintf(fp2,"給 %s : %d\n", id, money);
count++;
}
- sprintf(buf, "(%d人:%d"MONEYNAME"幣)", count, count*money);
+ sprintf(buf, "(%d人:%d" MONEYNAME ")", count, count*money);
strcat(reason, buf);
} else {
if (!(fp = fopen("etc/givemoney.txt", "r+"))) {
@@ -1060,7 +1060,7 @@ give_money(void)
count++;
}
fclose(fp);
- sprintf(buf, "(%d人:%d"MONEYNAME"幣)", count, total_money);
+ sprintf(buf, "(%d人:%d" MONEYNAME ")", count, total_money);
strcat(reason, buf);
}
diff --git a/pttbbs/mbbsd/bbs.c b/pttbbs/mbbsd/bbs.c
index a3554988..8aee0c88 100644
--- a/pttbbs/mbbsd/bbs.c
+++ b/pttbbs/mbbsd/bbs.c
@@ -243,7 +243,7 @@ save_violatelaw(void)
if (cuser.money < (int)cuser.vl_count * 1000) {
snprintf(buf, sizeof(buf),
ANSI_COLOR(1;31) "這是你第 %d 次違反本站法規"
- "必須繳出 %d " MONEYNAME "幣;但你目前只有 %d ,數量不足!!"
+ "必須繳出 %d " MONEYNAME ";但你目前只有 %d ,數量不足!!"
ANSI_RESET, (int)cuser.vl_count, (int)cuser.vl_count * 1000,
cuser.money);
mvouts(22, 0, buf);
@@ -251,7 +251,7 @@ save_violatelaw(void)
return 0;
}
move(5, 0);
- prints("這是你第 %d 次違法 必須繳出 %d " MONEYNAME "幣\n\n",
+ prints("這是你第 %d 次違法 必須繳出 %d " MONEYNAME "\n\n",
cuser.vl_count, cuser.vl_count * 1000);
outs(ANSI_COLOR(1;37) "你知道嗎? 因為你的違法 "
"已經造成很多人的不便" ANSI_RESET "\n");
@@ -275,7 +275,7 @@ save_violatelaw(void)
log_filef("log/violation", LOG_CREAT,
"%s %s pay-violation error: race-conditionn hack?\n",
Cdate(&now), cuser.userid);
- vmsg(MONEYNAME "幣怎麼忽然不夠了? 試圖欺騙系統被查到將砍帳號!");
+ vmsg(MONEYNAME "怎麼忽然不夠了? 試圖欺騙系統被查到將砍帳號!");
return 0;
}
@@ -1301,9 +1301,10 @@ do_general(int garbage)
pay(-money, "%s 看板發文稿酬: %s", currboard, postfile.title);
pwcuIncNumPost();
addPost = 1;
- prints("這是您的第 %d 篇有效文章,獲得稿酬 %d " MONEYNAME "幣\n",
- cuser.numposts, money);
- prints("\n (若之後自行或被板主刪文則此次獲得的有效文章數及稿酬可能會被回收)\n\n");
+ prints("這是您的第 %d 篇有效文章,獲得稿酬 %d "
+ MONEYNAME "\n", cuser.numposts, money);
+ prints("\n (若之後自行或被板主刪文"
+ "則此次獲得的有效文章數及稿酬可能會被回收)\n\n");
} else {
// no money, no record.
outs("本篇不列入記錄,敬請包涵。");
@@ -2447,7 +2448,7 @@ hold_gamble(void)
move(6, 0);
snprintf(genbuf, sizeof(genbuf),
"\n請到 %s 板 按'f'參與賭博!\n\n"
- "一張 %d " MONEYNAME "幣, 這是%s的賭博\n%s%s\n",
+ "一張 %d " MONEYNAME ", 這是%s的賭博\n%s%s\n",
currboard,
i, i < 100 ? "小賭式" : i < 500 ? "平民級" :
i < 1000 ? "貴族級" : i < 5000 ? "富豪級" : "傾家蕩產",
@@ -3389,7 +3390,8 @@ del_post(int ent, fileheader_t * fhdr, char *direct)
if (!not_owned) {
reload_money();
if (cuser.money < del_fee) {
- vmsgf("您身上的" MONEYNAME "幣不夠,刪除此文要 %d " MONEYNAME "幣", del_fee);
+ vmsgf("您身上的" MONEYNAME "不夠,刪除此文要 %d "
+ MONEYNAME, del_fee);
return FULLUPDATE;
}
// after this, we cannot delay in !not_owned mode otherwise we'll get
@@ -3486,7 +3488,7 @@ del_post(int ent, fileheader_t * fhdr, char *direct)
pay(del_fee, "%s 看板 文章自刪清潔費: %s",
currboard, fhdr->title);
sendalert(cuser.userid, ALERT_PWD_PERM);
- prints("您的文章減為 %d 篇,支付清潔費 %d " MONEYNAME "幣\n",
+ prints("您的文章減為 %d 篇,支付清潔費 %d " MONEYNAME "\n",
cuser.numposts, del_fee);
}
pressanykey();
@@ -3667,7 +3669,7 @@ view_postinfo(int ent, const fileheader_t * fhdr, const char *direct, int crs_ln
if(m < 0)
prints("│ 特殊文章,無價格記錄");
else
- prints("│ 這一篇文章值 %d " MONEYNAME "幣", m);
+ prints("│ 這一篇文章值 %d " MONEYNAME, m);
}
prints("\n");
diff --git a/pttbbs/mbbsd/cal.c b/pttbbs/mbbsd/cal.c
index 3630fcd1..95836a8c 100644
--- a/pttbbs/mbbsd/cal.c
+++ b/pttbbs/mbbsd/cal.c
@@ -177,11 +177,11 @@ p_exmail(void)
reload_money();
if (cuser.money < n * 1000)
{
- vmsg("你的" MONEYNAME "幣不夠。");
+ vmsg("你的" MONEYNAME "不夠。");
return 0;
}
- if (vmsgf("你想購買 %d 封信箱 (要花 %d " MONEYNAME "幣), 確定嗎?[y/N] ",
+ if (vmsgf("你想購買 %d 封信箱 (要花 %d " MONEYNAME "), 確定嗎?[y/N] ",
n, n*1000) != 'y')
return 0;
@@ -215,7 +215,8 @@ mail_redenvelop(const char *from, const char *to, int money, char *fpath)
"標題: 招財進寶\n"
"時間: %s\n"
ANSI_COLOR(1;33) "親愛的 %s :\n\n" ANSI_RESET
- ANSI_COLOR(1;31) " 我包給你一個 %d " MONEYNAME "幣的大紅包喔 ^_^\n\n"
+ ANSI_COLOR(1;31) " 我包給你一個 %d " MONEYNAME
+ "的大紅包喔 ^_^\n\n"
" 禮輕情意重,請笑納...... ^_^" ANSI_RESET "\n"
#if defined(USE_RECENTPAY) || defined(LOG_RECENTPAY)
"\n 您可於下列位置找到最近的交易記錄:\n"
@@ -360,7 +361,7 @@ give_money_ui(const char *userid)
const char *uid_prompt = "這位幸運兒的id: ";
const char *alert_trade = "\n" ANSI_COLOR(0;1;31)
- "提醒您本站的虛擬 " MONEYNAME " 幣不應與其它虛擬或現實生活"
+ "提醒您本站的虛擬 " MONEYNAME " 不應與其它虛擬或現實生活"
"通用之貨幣進行交易\n"
"若查獲有使用者經由不法途徑取得再與其它使用者進行貨幣間之交易時\n"
"站方將直接扣回。為避免造成您個人損失,請三思而後行。"
@@ -368,7 +369,7 @@ give_money_ui(const char *userid)
// TODO prevent macros, we should check something here,
// like user pw/id/...
- vs_hdr("給予" MONEYNAME "幣");
+ vs_hdr("給予" MONEYNAME);
if (!HasBasicUserPerm(PERM_LOGINOK))
return -1;
@@ -397,7 +398,7 @@ give_money_ui(const char *userid)
m = 0;
money_buf[0] = 0;
- mvouts(2, 0, "要給他多少" MONEYNAME "幣呢? "
+ mvouts(2, 0, "要給他多少" MONEYNAME "呢? "
"(可按 TAB 切換輸入稅前/稅後金額, 稅率固定 10%)\n");
outs(" 請輸入金額: "); // (3, 0)
{
@@ -419,7 +420,7 @@ give_money_ui(const char *userid)
reload_money();
if (cuser.money < m) {
- vmsg("你沒有那麼多" MONEYNAME "幣喔!");
+ vmsg("你沒有那麼多" MONEYNAME "喔!");
return -1;
}
diff --git a/pttbbs/mbbsd/chicken.c b/pttbbs/mbbsd/chicken.c
index d84d398d..4ad037a7 100644
--- a/pttbbs/mbbsd/chicken.c
+++ b/pttbbs/mbbsd/chicken.c
@@ -194,7 +194,7 @@ new_chicken(void)
price = egg_price[(int)mychicken.type];
reload_money();
if (cuser.money < price) {
- vmsgf(MONEYNAME "幣不夠買蛋蛋(要 %d)", price);
+ vmsgf(MONEYNAME "不夠買蛋蛋(要 %d)", price);
return 0;
}
diff --git a/pttbbs/mbbsd/gamble.c b/pttbbs/mbbsd/gamble.c
index 4d1a5bcb..369f0fa2 100644
--- a/pttbbs/mbbsd/gamble.c
+++ b/pttbbs/mbbsd/gamble.c
@@ -359,7 +359,7 @@ openticket(int bid)
"開獎結果: %s \n\n"
"所有金額: %d 元 \n"
"中獎比例: %d張/%d張 (%f)\n"
- "每張中獎彩票可得 %d " MONEYNAME "幣 \n\n",
+ "每張中獎彩票可得 %d " MONEYNAME "\n\n",
Cdatelite(&now), betname[bet], total * price, ticket[bet], total,
(float)ticket[bet] / total, money);
@@ -383,14 +383,14 @@ openticket(int bid)
if (bet == 98 && mybet >= 0 && mybet < count) {
if (fp)
fprintf(fp, "%-*s 買了 %3d 張 %s, 退回 %5d 枚"
- MONEYNAME "幣\n",
+ MONEYNAME "\n",
IDLEN, userid, i, betname[mybet], money * i);
snprintf(buf, sizeof(buf),
"%s 賭場退費! $ %d", bh->brdname, money * i);
} else if (mybet == bet) {
if (fp)
fprintf(fp, "恭喜 %-*s 買了 %3d 張 %s, 獲得 %5d 枚"
- MONEYNAME "幣\n",
+ MONEYNAME "\n",
IDLEN, userid, i, betname[mybet], money * i);
snprintf(buf, sizeof(buf), "%s 中獎咧! $ %d", bh->brdname, money * i);
} else {
diff --git a/pttbbs/mbbsd/mbbsd.c b/pttbbs/mbbsd/mbbsd.c
index 33abb6c3..e5be8755 100644
--- a/pttbbs/mbbsd/mbbsd.c
+++ b/pttbbs/mbbsd/mbbsd.c
@@ -635,7 +635,7 @@ multi_user_check(void)
move(b_lines-6, 0); clrtobot();
outs("\n" ANSI_COLOR(1)
"注意: 您有其它連線已登入此帳號。\n"
- " 同時多次登入同個帳號可能導致文章數或" MONEYNAME "幣異常,\n"
+ " 同時多次登入同個帳號可能導致文章數或" MONEYNAME "異常,\n"
" 且本站不受理因多重登入造成的損失。" ANSI_RESET);
getdata(b_lines - 1, 0, "您想刪除其他重複登入的連線嗎?[Y/n] ",
diff --git a/pttbbs/mbbsd/menu.c b/pttbbs/mbbsd/menu.c
index cfc96520..4f49cf12 100644
--- a/pttbbs/mbbsd/menu.c
+++ b/pttbbs/mbbsd/menu.c
@@ -588,7 +588,7 @@ static const commands_t adminlist[] = {
{x_file,
PERM_SYSOP|PERM_VIEWSYSOP, "XXfile 編輯系統檔案"},
{x_admin_money, PERM_SYSOP|PERM_VIEWSYSOP,
- "MMoney " MONEYNAME "幣相關"},
+ "MMoney " MONEYNAME "相關"},
{u_list, PERM_SYSOP, "LLUsers List 列出註冊名單"},
{m_loginmsg, PERM_SYSOP, "GGMessage Login 進站水球"},
{NULL, 0, NULL}
@@ -683,7 +683,7 @@ static int u_view_recentpay()
clear();
mvouts(10, 5, "注意: 本記錄尚於測試中,可能會有未記錄到的交易記錄。");
mvouts(11, 5, " 此處內容僅供參考,實際" MONEYNAME
- "幣異動以站方內部資料為準");
+ "異動以站方內部資料為準");
pressanykey();
setuserfile(fn, FN_RECENTPAY);
return more(fn, YEA);
@@ -870,7 +870,7 @@ static const commands_t xyzlist[] = {
/* Ptt money menu */
static const commands_t moneylist[] = {
- {p_give, 0, "00Give 給其他人" MONEYNAME "幣"},
+ {p_give, 0, "00Give 給其他人" MONEYNAME},
{save_violatelaw, 0,"11ViolateLaw 繳罰單"},
{p_from, 0, "22From 暫時修改故鄉"},
{ordersong,0, "33OSong 動態點歌機"},
diff --git a/pttbbs/mbbsd/talk.c b/pttbbs/mbbsd/talk.c
index 536599a5..6a5d5a0b 100644
--- a/pttbbs/mbbsd/talk.c
+++ b/pttbbs/mbbsd/talk.c
@@ -1532,7 +1532,7 @@ static const char
" 好友廣播", " b (要在好友列表)",
" 回顧訊息", "l",
" 寄信給他", "m",
- " 給予" MONEYNAME "幣","g",
+ " 給予" MONEYNAME,"g",
NULL,
},
*hlp_talkmisc[] = {
diff --git a/pttbbs/mbbsd/user.c b/pttbbs/mbbsd/user.c
index 2071d938..c5d0820d 100644
--- a/pttbbs/mbbsd/user.c
+++ b/pttbbs/mbbsd/user.c
@@ -120,7 +120,7 @@ int u_cancelbadpost(void)
vmsg("我願意尊重與不歧視族群,不鬧板,尊重各板主權力[y/N]?")!='y' ||
vmsg("我願意謹慎發表有意義言論,不謾罵攻擊,不跨板廣告[y/N]?")!='y' )
{
- vmsg("回答有誤,刪除失敗。請仔細看站規與系統訊息並思考清楚後再來申請刪除.");
+ vmsg("回答有誤,刪除失敗。請仔細看清站規與系統訊息後再來申請刪除.");
return 0;
}
@@ -146,9 +146,10 @@ user_display(const userec_t * u, int adminmode)
clrtobot();
prints(
- " " ANSI_COLOR(30;41) "┴┬┴┬┴┬" ANSI_RESET " " ANSI_COLOR(1;30;45) " 使 用 者"
- " 資 料 "
- " " ANSI_RESET " " ANSI_COLOR(30;41) "┴┬┴┬┴┬" ANSI_RESET "\n");
+ " " ANSI_COLOR(30;41) "┴┬┴┬┴┬" ANSI_RESET
+ " " ANSI_COLOR(1;30;45) " 使 用 者" " 資 料 "
+ " " ANSI_RESET " " ANSI_COLOR(30;41) "┴┬┴┬┴┬" ANSI_RESET
+ "\n");
prints("\t代號暱稱: %s (%s)\n", u->userid, u->nickname);
prints("\t真實姓名: %s", u->realname);
#if FOREIGN_REG_DAY > 0
@@ -169,7 +170,7 @@ user_display(const userec_t * u, int adminmode)
outs("\n");
prints("\t電子信箱: %s\n", u->email);
- prints("\t銀行帳戶: %d " MONEYNAME "幣\n", u->money);
+ prints("\t銀行帳戶: %d " MONEYNAME "\n", u->money);
prints("\t生 日: %04i/%02i/%02i (%s滿18歲)\n",
u->year + 1900, u->month, u->day,
resolve_over18_user(u) ? "已" : "未");
diff --git a/pttbbs/sample/pttbbs.conf b/pttbbs/sample/pttbbs.conf
index ecfdf89a..f34f699d 100644
--- a/pttbbs/sample/pttbbs.conf
+++ b/pttbbs/sample/pttbbs.conf
@@ -35,11 +35,11 @@
* 請保持像 [Ptt系統警察] 這種仍能塞進 IDLEN 的格式
* 不然你的系統可能會有一堆作者切一半的系統信。
* BBSMNAME2 則是出現在部份選單裡,建議盡量照原格式 4 字元寬
- * MONEYNAME 是錢幣的名字,建議一樣三個字元內
+ * MONEYNAME 是錢幣的名字,建議五個字元內
*/
#define BBSMNAME "Ptt"
#define BBSMNAME2 "Ptt"
-#define MONEYNAME "Ptt"
+#define MONEYNAME "Ptt幣"
/* 定義系統資訊 */
#define BBSUSER "bbs"