summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2009-09-07 10:11:19 +0800
committerpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2009-09-07 10:11:19 +0800
commitd4d7b4113cf03c906f9d408526b0dee082adde53 (patch)
tree578ce1513299e5ab7abb764d1917ca0f746c0282
parente2a6b4b4502bd8926777c9b17747e65528422464 (diff)
downloadpttbbs-d4d7b4113cf03c906f9d408526b0dee082adde53.tar
pttbbs-d4d7b4113cf03c906f9d408526b0dee082adde53.tar.gz
pttbbs-d4d7b4113cf03c906f9d408526b0dee082adde53.tar.bz2
pttbbs-d4d7b4113cf03c906f9d408526b0dee082adde53.tar.lz
pttbbs-d4d7b4113cf03c906f9d408526b0dee082adde53.tar.xz
pttbbs-d4d7b4113cf03c906f9d408526b0dee082adde53.tar.zst
pttbbs-d4d7b4113cf03c906f9d408526b0dee082adde53.zip
* allow query old login number (for self only)
* merge latest git-svn-id: http://opensvn.csie.org/pttbbs/branches/pttbbs.pwcu@4816 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--include/common.h2
-rw-r--r--include/pttstruct.h3
-rw-r--r--mbbsd/bbs.c2
-rw-r--r--mbbsd/talk.c13
4 files changed, 15 insertions, 5 deletions
diff --git a/include/common.h b/include/common.h
index 59316fb3..d5400070 100644
--- a/include/common.h
+++ b/include/common.h
@@ -45,7 +45,7 @@
#define FN_BADLOGIN "logins.bad" // in BBSHOME & user directory
#define FN_RECENTLOGIN "logins.recent" // in user directory
#ifndef SZ_RECENTLOGIN
-#define SZ_RECENTLOGIN (32000)
+#define SZ_RECENTLOGIN (16000) // size of max recent log before rotation
#endif
diff --git a/include/pttstruct.h b/include/pttstruct.h
index 2e130628..deae733a 100644
--- a/include/pttstruct.h
+++ b/include/pttstruct.h
@@ -95,7 +95,8 @@ typedef struct userec_t {
char career[40]; /* 學歷職業 */
char phone[20]; /* 電話 */
- char chkpad1[52];
+ uint32_t old_numlogins; /* 轉換前的 numlogins, 備份檢視用 */
+ char chkpad1[48];
time4_t lastseen; /* 最近上站時間(隱身不計) */
time4_t chkpad2[2]; /* in case 有人忘了把 time4_t 調好... */
// 以上應為 sizeof(chicken_t) 同等大小
diff --git a/mbbsd/bbs.c b/mbbsd/bbs.c
index 2bcf9538..11ad652e 100644
--- a/mbbsd/bbs.c
+++ b/mbbsd/bbs.c
@@ -1133,7 +1133,7 @@ do_general(int garbage)
demoney(money);
pwcuIncNumPost();
addPost = 1;
- prints("這是您的第 %d 篇有效文章,稿酬 %d 元",
+ prints("這是您的第 %d 篇有效文章,獲得稿酬 %d 元",
cuser.numposts, money);
} else {
// no money, no record.
diff --git a/mbbsd/talk.c b/mbbsd/talk.c
index b11799c5..5c906e9c 100644
--- a/mbbsd/talk.c
+++ b/mbbsd/talk.c
@@ -436,6 +436,7 @@ my_query(const char *uident)
{
userec_t muser;
int tuid, fri_stat = 0;
+ int is_self = 0;
userinfo_t *uentp;
const char *sex[8] =
{MSG_BIG_BOY, MSG_BIG_GIRL,
@@ -454,6 +455,8 @@ my_query(const char *uident)
if ((uentp = (userinfo_t *) search_ulist(tuid)))
fri_stat = friend_stat(currutmp, uentp);
+ if (strcmp(muser.userid, cuser.userid) == 0)
+ is_self =1;
// ------------------------------------------------------------
@@ -465,17 +468,23 @@ my_query(const char *uident)
prints( "《經濟狀況》%s",
money_level(muser.money));
- if (uentp && ((fri_stat & HFM && !uentp->invisible) || strcmp(muser.userid,cuser.userid) == 0))
+ if (uentp && ((fri_stat & HFM && !uentp->invisible) || is_self))
prints(" ($%d)", muser.money);
outc('\n');
// ------------------------------------------------------------
prints("《" STR_LOGINDAYS "》%d " STR_LOGINDAYS_QTY, muser.numlogindays);
+
+ if (is_self && muser.old_numlogins)
+ prints(" (舊值: %d) ", muser.old_numlogins);
+ else
+ {
#ifdef SHOW_LOGINOK
if (!(muser.userlevel & PERM_LOGINOK))
outs(" (尚未通過認證)");
#endif
+ }
move(vgety(), 40);
prints("《有效文章》%d 篇", muser.numposts);
@@ -514,7 +523,7 @@ my_query(const char *uident)
muser.five_win, muser.five_lose, muser.five_tie,
muser.chc_win, muser.chc_lose, muser.chc_tie);
- if ((uentp && ((fri_stat & HFM) || strcmp(muser.userid,cuser.userid) == 0) && !uentp->invisible))
+ if ((uentp && ((fri_stat & HFM) || is_self) && !uentp->invisible))
prints("《 性 別 》%-28.28s\n", sex[muser.sex % 8]);
showplans_userec(&muser);