summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pttbbs/include/proto.h2
-rw-r--r--pttbbs/include/pttstruct.h4
-rw-r--r--pttbbs/mbbsd/bbs.c48
-rw-r--r--pttbbs/mbbsd/board.c13
-rw-r--r--pttbbs/mbbsd/cal.c7
-rw-r--r--pttbbs/util/shmctl.c2
-rw-r--r--pttbbs/util/showboard.c2
7 files changed, 6 insertions, 72 deletions
diff --git a/pttbbs/include/proto.h b/pttbbs/include/proto.h
index 6e5faa3b..908fe9fd 100644
--- a/pttbbs/include/proto.h
+++ b/pttbbs/include/proto.h
@@ -162,10 +162,8 @@ void resolve_over18(void);
int resolve_over18_user(const userec_t *u);
char *get_restriction_reason(
unsigned int numlogindays,
- unsigned int numposts,
unsigned int badpost,
unsigned int limits_logins,
- unsigned int limits_posts,
unsigned int limits_badpost,
size_t sz_msg, char *msg);
diff --git a/pttbbs/include/pttstruct.h b/pttbbs/include/pttstruct.h
index fecff4e6..83039215 100644
--- a/pttbbs/include/pttstruct.h
+++ b/pttbbs/include/pttstruct.h
@@ -166,11 +166,11 @@ typedef struct boardheader_t { /* 256 bytes */
char pad1[3];
uint32_t brdattr; /* board的屬性 */
char chesscountry; /* 棋國 */
- uint8_t vote_limit_posts; /* 連署 : 文章篇數下限 */
+ uint8_t _vote_limit_posts; /* (已停用) 連署 : 文章篇數下限 */
uint8_t vote_limit_logins; /* 連署 : 登入次數下限 */
uint8_t pad2_1[1]; /* (已停用) 連署 : 註冊時間限制 */
time4_t bupdate; /* note update time */
- uint8_t post_limit_posts; /* 發表文章 : 文章篇數下限 */
+ uint8_t _post_limit_posts; /* (已停用) 發表文章 : 文章篇數下限 */
uint8_t post_limit_logins; /* 發表文章 : 登入次數下限 */
uint8_t pad2_2[1]; /* (已停用) 發表文章 : 註冊時間限制 */
uint8_t bvote; /* 正舉辦 Vote 數 */
diff --git a/pttbbs/mbbsd/bbs.c b/pttbbs/mbbsd/bbs.c
index 6b5a85a7..38ce2a6e 100644
--- a/pttbbs/mbbsd/bbs.c
+++ b/pttbbs/mbbsd/bbs.c
@@ -518,8 +518,8 @@ char* get_board_restriction_reason(int bid, size_t sz_msg, char *msg)
bp = getbcache(bid);
return get_restriction_reason(
- cuser.numlogindays, cuser.numposts, cuser.badpost,
- bp->post_limit_logins, bp->post_limit_posts, bp->post_limit_badpost,
+ cuser.numlogindays, cuser.badpost,
+ bp->post_limit_logins, bp->post_limit_badpost,
sz_msg, msg);
}
@@ -2403,7 +2403,6 @@ read_post(int ent, fileheader_t * fhdr, const char *direct)
void
editLimits(unsigned char *plogins,
- unsigned char *pposts,
unsigned char *pbadpost)
{
char genbuf[STRLEN];
@@ -2412,7 +2411,6 @@ editLimits(unsigned char *plogins,
// load var
unsigned char
logins = *plogins,
- posts = (pposts) ? *pposts : 0,
badpost = *pbadpost;
// query UI
@@ -2438,18 +2436,6 @@ editLimits(unsigned char *plogins,
logins = (unsigned char)(temp / 10);
move(y+1, 0); clrtobot();
- if (pposts) {
- y++;
- sprintf(genbuf, "%u", posts*10);
- do {
- getdata_buf(y, 0,
- "文章篇數下限 (0~2550,以10為單位,個位數字將自動捨去):",
- genbuf, 5, NUMECHO);
- temp = atoi(genbuf);
- } while (temp < 0 || temp > 2550);
- posts = (unsigned char)(temp / 10);
- }
-
y++;
sprintf(genbuf, "%u", 255 - badpost);
do {
@@ -2462,9 +2448,6 @@ editLimits(unsigned char *plogins,
// save var
*plogins = logins;
*pbadpost = badpost;
-
- if (pposts)
- *pposts = posts;
}
int
@@ -2489,18 +2472,9 @@ do_limitedit(int ent, fileheader_t * fhdr, const char *direct)
if ((HasUserPerm(PERM_SYSOP) || (HasUserPerm(PERM_SYSSUPERSUBOP) && GROUPOP())) && buf[0] == 'a') {
-#ifdef USE_POSTLIMIT_NUMPOSTS
editLimits(
&bp->post_limit_logins,
- &bp->post_limit_posts,
&bp->post_limit_badpost);
-#else
- editLimits(
- &bp->post_limit_logins,
- NULL,
- &bp->post_limit_badpost);
- bp->post_limit_posts = 0;
-#endif
assert(0<=currbid-1 && currbid-1<MAX_BOARD);
substitute_record(fn_board, bp, sizeof(boardheader_t), currbid);
@@ -2510,18 +2484,9 @@ do_limitedit(int ent, fileheader_t * fhdr, const char *direct)
}
else if (buf[0] == 'b') {
-#ifdef USE_POSTLIMIT_NUMPOSTS
- editLimits(
- &bp->vote_limit_logins,
- &bp->vote_limit_posts,
- &bp->vote_limit_badpost);
-#else
editLimits(
&bp->vote_limit_logins,
- NULL,
&bp->vote_limit_badpost);
- bp->vote_limit_posts = 0;
-#endif
assert(0<=currbid-1 && currbid-1<MAX_BOARD);
substitute_record(fn_board, bp, sizeof(boardheader_t), currbid);
@@ -2531,18 +2496,9 @@ do_limitedit(int ent, fileheader_t * fhdr, const char *direct)
}
else if ((fhdr->filemode & FILE_VOTE) && buf[0] == 'c') {
-#ifdef USE_POSTLIMIT_NUMPOSTS
editLimits(
&fhdr->multi.vote_limits.logins,
- &fhdr->multi.vote_limits.posts,
&fhdr->multi.vote_limits.badpost);
-#else
- editLimits(
- &fhdr->multi.vote_limits.logins,
- NULL,
- &fhdr->multi.vote_limits.badpost);
- fhdr->multi.vote_limits.posts = 0;
-#endif
// TODO fix race condition here.
substitute_ref_record(direct, fhdr, ent);
diff --git a/pttbbs/mbbsd/board.c b/pttbbs/mbbsd/board.c
index be209edd..6b492008 100644
--- a/pttbbs/mbbsd/board.c
+++ b/pttbbs/mbbsd/board.c
@@ -313,7 +313,6 @@ b_config(void)
while(!finished) {
// limits
uint8_t llogin = bp->post_limit_logins,
- lpost = bp->post_limit_posts,
lbp = bp->post_limit_badpost;
move(ytitle-1, 0);
@@ -448,7 +447,6 @@ b_config(void)
if (bp->brdattr & BRD_VOTEBOARD)
{
llogin = bp->vote_limit_logins;
- lpost = bp->vote_limit_posts;
lbp = bp->vote_limit_badpost;
}
@@ -463,17 +461,6 @@ b_config(void)
hasres = 1;
}
- if (lpost)
- {
- move_ansi(ipostres++, COLPOSTRES);
- i = (int)lpost * 10;
- attr = ((int)cuser.numposts < i) ? 1 : 0;
- if (attr) outs(ANSI_COLOR(1;31) "*");
- prints("各看板有效文章合計 %d 篇以上", i);
- if (attr) outs(ANSI_RESET);
- hasres = 1;
- }
-
if (lbp)
{
move_ansi(ipostres++, COLPOSTRES);
diff --git a/pttbbs/mbbsd/cal.c b/pttbbs/mbbsd/cal.c
index 1b108a30..e46b2e86 100644
--- a/pttbbs/mbbsd/cal.c
+++ b/pttbbs/mbbsd/cal.c
@@ -6,11 +6,9 @@
// comparison.
char *get_restriction_reason(
unsigned int numlogindays,
- unsigned int numposts,
unsigned int badpost,
unsigned int limits_logins,
- unsigned int limits_posts,
unsigned int limits_badpost,
size_t sz_msg, char *msg) {
@@ -23,11 +21,6 @@ char *get_restriction_reason(
limits_logins * 10, numlogindays);
return msg;
}
- if (numposts / 10 < limits_posts) {
- snprintf(msg, sz_msg, "各看板有效文章未滿 %d 篇(目前%d篇)",
- limits_posts * 10, numposts);
- return msg;
- }
#ifdef ASSESS
if (badpost > (255 - limits_badpost)) {
snprintf(msg, sz_msg, "劣文超過 %d 篇(目前%d篇)",
diff --git a/pttbbs/util/shmctl.c b/pttbbs/util/shmctl.c
index 69142dcf..0ad0674e 100644
--- a/pttbbs/util/shmctl.c
+++ b/pttbbs/util/shmctl.c
@@ -663,8 +663,8 @@ int listbrd(int argc, char **argv)
printf("\n");
- printf("post_limit_posts:\t%d\n", b.post_limit_posts);
printf("post_limit_logins:\t%d\n", b.post_limit_logins);
+ printf("post_limit_badpost:\t%d\n", b.post_limit_badpost);
printf("level:\t%d\n", b.level);
printf("gid:\t%d\n", b.gid);
printf("parent:\t%d\n", b.parent);
diff --git a/pttbbs/util/showboard.c b/pttbbs/util/showboard.c
index aac4fbee..53ecbed4 100644
--- a/pttbbs/util/showboard.c
+++ b/pttbbs/util/showboard.c
@@ -67,8 +67,8 @@ int main(int argc, char *argv[])
printf("title:\t%s\n", b.title);
printf("BM:\t%s\n", b.BM);
printf("brdattr:\t%08x\n", b.brdattr);
- printf("post_limit_posts:\t%d\n", b.post_limit_posts);
printf("post_limit_logins:\t%d\n", b.post_limit_logins);
+ printf("post_limit_badpost:\t%d\n", b.post_limit_badpost);
printf("level:\t%d\n", b.level);
printf("gid:\t%d\n", b.gid);
printf("parent:\t%d\n", b.parent);