diff options
author | ptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2004-04-06 05:45:45 +0800 |
---|---|---|
committer | ptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2004-04-06 05:45:45 +0800 |
commit | 6b49f6bc1bf86a9bfa61e34afda72387126e2f53 (patch) | |
tree | 496f791a7ce500787c209d78eca93821d58e791b | |
parent | 2cbf4932a81de91bcc12a65eb314ff0c88d2a7ae (diff) | |
download | pttbbs-6b49f6bc1bf86a9bfa61e34afda72387126e2f53.tar pttbbs-6b49f6bc1bf86a9bfa61e34afda72387126e2f53.tar.gz pttbbs-6b49f6bc1bf86a9bfa61e34afda72387126e2f53.tar.bz2 pttbbs-6b49f6bc1bf86a9bfa61e34afda72387126e2f53.tar.lz pttbbs-6b49f6bc1bf86a9bfa61e34afda72387126e2f53.tar.xz pttbbs-6b49f6bc1bf86a9bfa61e34afda72387126e2f53.tar.zst pttbbs-6b49f6bc1bf86a9bfa61e34afda72387126e2f53.zip |
push bottom
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1701 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r-- | include/proto.h | 2 | ||||
-rw-r--r-- | include/pttstruct.h | 4 | ||||
-rw-r--r-- | mbbsd/bbs.c | 5 | ||||
-rw-r--r-- | mbbsd/cache.c | 17 | ||||
-rw-r--r-- | mbbsd/read.c | 1 |
5 files changed, 23 insertions, 6 deletions
diff --git a/include/proto.h b/include/proto.h index 46eab16c..8d90a1b0 100644 --- a/include/proto.h +++ b/include/proto.h @@ -114,6 +114,7 @@ int apply_boards(int (*func)(boardheader_t *)); int haspostperm(char *bname); void inbtotal(int bid, int add); void setbtotal(int bid); +void setbottomtotal(int bid); unsigned int safe_sleep(unsigned int seconds); int apply_ulist(int (*fptr)(userinfo_t *)); userinfo_t *search_ulistn(int uid, int unum); @@ -665,6 +666,7 @@ int passwd_apply(int (*fptr)(int, userec_t *)); void passwd_lock(); void passwd_unlock(); int passwd_update_money(int num); +int passwd_query_money(int num); int initcuser(char *userid); int freecuser(); diff --git a/include/pttstruct.h b/include/pttstruct.h index c8944e02..20260ad1 100644 --- a/include/pttstruct.h +++ b/include/pttstruct.h @@ -377,10 +377,12 @@ typedef struct { boardheader_t *HBcache[HOTBOARDCACHE]; #endif #if DIRCACHESIZE - fileheader_t dircache[MAX_BOARD][DIRCACHESIZE]; + // Ptt: dricache À³³§ï令¨¥ucache ¼öö̪ùù¬Ýݪ©©Á×קKmemory®öö¶O + fileheader_t dircache[MAX_BOARD][DIRCACHESIZE]; #endif time_t busystate_b[MAX_BOARD]; int total[MAX_BOARD]; + unsigned char n_bottom[MAX_BOARD]; /* number of bottom */ int hbfl[MAX_BOARD][MAX_FRIEND + 1]; time_t lastposttime[MAX_BOARD]; time_t Buptime; diff --git a/mbbsd/bbs.c b/mbbsd/bbs.c index 013616d1..8c7b432b 100644 --- a/mbbsd/bbs.c +++ b/mbbsd/bbs.c @@ -2325,8 +2325,8 @@ push_bottom(int ent, fileheader_t * fhdr, char *direct) setbfile(buf, currboard, ".BOTTOM"); num = get_num_records(buf, sizeof(fileheader_t)); if(getans(fhdr->filemode & FILE_BOTTOM ? - "¨ú®ø«n¤½½?(y/N)": - "¥[¤J«n¤½§i?(y/N)")!='y') return READ_REDRAW; + "¨ú®ø¸m©³¤½½§i?(y/N)": + "¥[¤J¸m©³¤½§i?(y/N)")!='y') return READ_REDRAW; fhdr->filemode ^= FILE_BOTTOM; if(fhdr->filemode & FILE_BOTTOM) { @@ -2349,6 +2349,7 @@ push_bottom(int ent, fileheader_t * fhdr, char *direct) delete_record(buf, sizeof(fileheader_t), i+1); } } + setbottomtotal(currbid); substitute_record(direct, fhdr, sizeof(fileheader_t), ent); return READ_REDRAW; } diff --git a/mbbsd/cache.c b/mbbsd/cache.c index 21319c8e..465a4195 100644 --- a/mbbsd/cache.c +++ b/mbbsd/cache.c @@ -698,8 +698,21 @@ getbtotal(int bid) { return SHM->total[bid - 1]; } +int +getbottomtotal(int bid) +{ + return SHM->n_bottom[bid-1]; +} void +setbottomtotal(int bid) +{ + boardheader_t *bh = getbcache(bid); + char genbuf[256]; + setbfile(genbuf, bh->brdname, ".BOTTOM"); + SHM->n_bottom[bid-1]=get_num_records(genbuf, sizeof(fileheader_t)); +} +void setbtotal(int bid) { boardheader_t *bh = getbcache(bid); @@ -707,9 +720,7 @@ setbtotal(int bid) char genbuf[256]; int num, fd; - snprintf(genbuf, sizeof(genbuf), - "boards/%c/%s/.DIR", bh->brdname[0], bh->brdname); - + setbfile(genbuf, bh->brdname, ".DIR"); if ((fd = open(genbuf, O_RDWR)) < 0) return; /* .DIR±¾¤F */ fstat(fd, &st); diff --git a/mbbsd/read.c b/mbbsd/read.c index f6b64313..fb3e15d2 100644 --- a/mbbsd/read.c +++ b/mbbsd/read.c @@ -819,6 +819,7 @@ i_read(int cmdmode, char *direct, void (*dotitle) (), void (*doentry) (), onekey if (bidcache > 0 && !(currmode & (MODE_SELECT | MODE_DIGEST))){ if( (last_line = getbtotal(currbid)) == 0 ){ setbtotal(currbid); + setbottomtotal(currbid); last_line = get_num_records(currdirect, FHSZ); } } |