summaryrefslogtreecommitdiffstats
path: root/mbbsd/voteboard.c
diff options
context:
space:
mode:
authorwens <wens@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2005-03-03 21:14:59 +0800
committerwens <wens@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2005-03-03 21:14:59 +0800
commitfea64042f0f66b989215dfdf644dade15b2b6be1 (patch)
treec4ce862fecd857f32e5ceafbb4659145c1097d69 /mbbsd/voteboard.c
parentc8e482734eccf9567c8ca19edd126ab3d9d6404c (diff)
downloadpttbbs-fea64042f0f66b989215dfdf644dade15b2b6be1.tar
pttbbs-fea64042f0f66b989215dfdf644dade15b2b6be1.tar.gz
pttbbs-fea64042f0f66b989215dfdf644dade15b2b6be1.tar.bz2
pttbbs-fea64042f0f66b989215dfdf644dade15b2b6be1.tar.lz
pttbbs-fea64042f0f66b989215dfdf644dade15b2b6be1.tar.xz
pttbbs-fea64042f0f66b989215dfdf644dade15b2b6be1.tar.zst
pttbbs-fea64042f0f66b989215dfdf644dade15b2b6be1.zip
add regtime to post & vote limits
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2573 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/voteboard.c')
-rw-r--r--mbbsd/voteboard.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/mbbsd/voteboard.c b/mbbsd/voteboard.c
index 443b4d4b..73cc0742 100644
--- a/mbbsd/voteboard.c
+++ b/mbbsd/voteboard.c
@@ -165,10 +165,11 @@ do_voteboard(int type)
vmsg("對不起,您目前無法在此發表文章!");
return FULLUPDATE;
}
- if ( cuser.numlogins < ((unsigned int)(bcache[currbid - 1].vote_limit_logins) * 10) ||
+ if ( cuser.firstlogin > (now - (time4_t)bcache[currbid - 1].vote_limit_regtime * 2592000) ||
+ cuser.numlogins < ((unsigned int)(bcache[currbid - 1].vote_limit_logins) * 10) ||
cuser.numposts < ((unsigned int)(bcache[currbid - 1].vote_limit_posts) * 10) ) {
move(5, 10);
- vmsg("你的上站數/文章數不足喔!");
+ vmsg("你不夠資深喔!");
return FULLUPDATE;
}
move(0, 0);
@@ -345,8 +346,9 @@ do_voteboard(int type)
votefile.filemode |= FILE_VOTE;
/* use lower 16 bits of 'money' to store limits */
/* lower 8 bits are posts, higher 8 bits are logins */
- votefile.multi.vote_limits.logins = (unsigned int)bcache[currbid - 1].vote_limit_logins;
- votefile.multi.vote_limits.posts = (unsigned int)bcache[currbid - 1].vote_limit_posts;
+ votefile.multi.vote_limits.regtime = bcache[currbid - 1].vote_limit_regtime;
+ votefile.multi.vote_limits.logins = bcache[currbid - 1].vote_limit_logins;
+ votefile.multi.vote_limits.posts = bcache[currbid - 1].vote_limit_posts;
setbdir(genbuf, currboard);
if (append_record(genbuf, &votefile, sizeof(votefile)) != -1)
setbtotal(currbid);