summaryrefslogtreecommitdiffstats
path: root/mbbsd/bbs.c
diff options
context:
space:
mode:
authorpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2008-05-10 03:21:08 +0800
committerpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2008-05-10 03:21:08 +0800
commita4ba6b74f6dc61cec1a6b258e1609d9f7f7ef8a5 (patch)
treed2abd2d1aa673ad667e60b8029f0796d2e20a78f /mbbsd/bbs.c
parent961bf03bac8ac5264a028d3f580904bbd5b4e37f (diff)
downloadpttbbs-a4ba6b74f6dc61cec1a6b258e1609d9f7f7ef8a5.tar
pttbbs-a4ba6b74f6dc61cec1a6b258e1609d9f7f7ef8a5.tar.gz
pttbbs-a4ba6b74f6dc61cec1a6b258e1609d9f7f7ef8a5.tar.bz2
pttbbs-a4ba6b74f6dc61cec1a6b258e1609d9f7f7ef8a5.tar.lz
pttbbs-a4ba6b74f6dc61cec1a6b258e1609d9f7f7ef8a5.tar.xz
pttbbs-a4ba6b74f6dc61cec1a6b258e1609d9f7f7ef8a5.tar.zst
pttbbs-a4ba6b74f6dc61cec1a6b258e1609d9f7f7ef8a5.zip
- (internal) change 86400/... (seconds of day/month/...) to named constants.
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@4284 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/bbs.c')
-rw-r--r--mbbsd/bbs.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/mbbsd/bbs.c b/mbbsd/bbs.c
index 7e6d3f3e..1db06646 100644
--- a/mbbsd/bbs.c
+++ b/mbbsd/bbs.c
@@ -160,7 +160,7 @@ anticrosspost(void)
cuser.vl_count++;
mail_id(cuser.userid, "Cross-Post罰單",
"etc/crosspost.txt", BBSMNAME "警察部隊");
- if ((now - cuser.firstlogin) / 86400 < 14)
+ if ((now - cuser.firstlogin) / DAY_SECONDS < 14)
delete_allpost(cuser.userid);
kick_all(cuser.userid); // XXX: in2: wait for testing
u_exit("Cross Post");
@@ -183,7 +183,7 @@ save_violatelaw(void)
return 0;
}
- day = cuser.vl_count*3 - (now - cuser.timeviolatelaw)/86400;
+ day = cuser.vl_count*3 - (now - cuser.timeviolatelaw)/DAY_SECONDS;
if (day > 0) {
vmsgf("依照違規次數, 你還需要反省 %d 天才能繳罰單", day);
return 0;
@@ -381,7 +381,7 @@ int CheckPostRestriction(int bid)
bp = getbcache(bid);
// check first-login
- if (cuser.firstlogin > (now - (time4_t)bp->post_limit_regtime * 2592000))
+ if (cuser.firstlogin > (now - (time4_t)bp->post_limit_regtime * MONTH_SECONDS))
return 0;
if (cuser.numlogins / 10 < (unsigned int)bp->post_limit_logins)
return 0;
@@ -876,7 +876,7 @@ static void
setupbidinfo(bid_t *bidinfo)
{
char buf[PATHLEN];
- bidinfo->enddate = gettime(20, now+86400,"結束標案於");
+ bidinfo->enddate = gettime(20, now+DAY_SECONDS,"結束標案於");
do{
getdata_str(21, 0, "底價:", buf, 8, LCECHO, "1");
} while( (bidinfo->high = atoi(buf)) <= 0 );
@@ -1180,7 +1180,7 @@ do_general(int isbid)
if( !bp->level || (currbrdattr & BRD_POSTMASK))
{
- if ((now - cuser.firstlogin) / 86400 < 14)
+ if ((now - cuser.firstlogin) / DAY_SECONDS < 14)
do_crosspost("NEWIDPOST", &postfile, fpath, 0);
if (!(currbrdattr & BRD_HIDE) )
@@ -2034,11 +2034,11 @@ read_post(int ent, fileheader_t * fhdr, const char *direct)
int posttime=atoi(fhdr->filename+2);
if(posttime>now-12*3600)
STATINC(STAT_READPOST_12HR);
- else if(posttime>now-1*86400)
+ else if(posttime>now-1*DAY_SECONDS)
STATINC(STAT_READPOST_1DAY);
- else if(posttime>now-3*86400)
+ else if(posttime>now-3*DAY_SECONDS)
STATINC(STAT_READPOST_3DAY);
- else if(posttime>now-7*86400)
+ else if(posttime>now-7*DAY_SECONDS)
STATINC(STAT_READPOST_7DAY);
else
STATINC(STAT_READPOST_OLD);
@@ -2978,7 +2978,7 @@ recommend(int ent, fileheader_t * fhdr, const char *direct)
static int tolog = 0;
if( tolog == 0 )
tolog =
- (cuser.numlogins < 50 || (now - cuser.firstlogin) < 86400 * 7)
+ (cuser.numlogins < 50 || (now - cuser.firstlogin) < DAY_SECONDS * 7)
? 1 : 2;
if( tolog == 1 ){
FILE *fp;