summaryrefslogtreecommitdiffstats
path: root/mbbsd
diff options
context:
space:
mode:
authorwens <wens@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2006-07-25 23:17:18 +0800
committerwens <wens@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2006-07-25 23:17:18 +0800
commite8b7db8875e3cba60b0ec8742b0cb7cc63c0bbde (patch)
tree1ba549a3702ad232a795c1527ef73fdf274eebe5 /mbbsd
parent540472d231db4088e050b32737dee45f3ed07235 (diff)
downloadpttbbs-e8b7db8875e3cba60b0ec8742b0cb7cc63c0bbde.tar
pttbbs-e8b7db8875e3cba60b0ec8742b0cb7cc63c0bbde.tar.gz
pttbbs-e8b7db8875e3cba60b0ec8742b0cb7cc63c0bbde.tar.bz2
pttbbs-e8b7db8875e3cba60b0ec8742b0cb7cc63c0bbde.tar.lz
pttbbs-e8b7db8875e3cba60b0ec8742b0cb7cc63c0bbde.tar.xz
pttbbs-e8b7db8875e3cba60b0ec8742b0cb7cc63c0bbde.tar.zst
pttbbs-e8b7db8875e3cba60b0ec8742b0cb7cc63c0bbde.zip
add badposts as post/vote limit
show post limits on board config git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3386 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd')
-rw-r--r--mbbsd/bbs.c40
-rw-r--r--mbbsd/mail.c1
-rw-r--r--mbbsd/voteboard.c8
3 files changed, 47 insertions, 2 deletions
diff --git a/mbbsd/bbs.c b/mbbsd/bbs.c
index 961074bd..6f8ecbe4 100644
--- a/mbbsd/bbs.c
+++ b/mbbsd/bbs.c
@@ -698,6 +698,7 @@ do_general(int isbid)
#ifndef DEBUG
if ( !((currmode & MODE_BOARD) || HasUserPerm(PERM_SYSOP)) &&
(cuser.firstlogin > (now - (time4_t)bcache[currbid - 1].post_limit_regtime * 2592000) ||
+ cuser.badpost > ((unsigned int)(bcache[currbid - 1].post_limit_badpost)) ||
cuser.numlogins < ((unsigned int)(bcache[currbid - 1].post_limit_logins) * 10) ||
cuser.numposts < ((unsigned int)(bcache[currbid - 1].post_limit_posts) * 10)) ) {
move(5, 10);
@@ -985,6 +986,7 @@ do_generalboardreply(/*const*/ fileheader_t * fhdr)
assert(0<=currbid-1 && currbid-1<MAX_BOARD);
if ( !((currmode & MODE_BOARD) || HasUserPerm(PERM_SYSOP)) &&
(cuser.firstlogin > (now - (time4_t)bcache[currbid - 1].post_limit_regtime * 2592000) ||
+ cuser.badpost > ((unsigned int)(bcache[currbid - 1].post_limit_badpost)) ||
cuser.numlogins < ((unsigned int)(bcache[currbid - 1].post_limit_logins) * 10) ||
cuser.numposts < ((unsigned int)(bcache[currbid - 1].post_limit_posts) * 10)) ) {
getdata(b_lines - 1, 0, "▲ 回應至 (M)作者信箱 (Q)取消?[M] ",
@@ -1345,6 +1347,7 @@ cross_post(int ent, fileheader_t * fhdr, const char *direct)
if ( !((currmode & MODE_BOARD) || HasUserPerm(PERM_SYSOP)) &&
(cuser.firstlogin > (now - (time4_t)bcache[author - 1].post_limit_regtime * 2592000) ||
+ cuser.badpost > ((unsigned int)(bcache[currbid - 1].post_limit_badpost)) ||
cuser.numlogins < ((unsigned int)(bcache[author - 1].post_limit_logins) * 10) ||
cuser.numposts < ((unsigned int)(bcache[author - 1].post_limit_posts) * 10)) ) {
vmsg("你不夠資深喔!");
@@ -1591,6 +1594,14 @@ do_limitedit(int ent, fileheader_t * fhdr, const char *direct)
temp = atoi(genbuf);
} while (temp < 0 || temp > 2550);
bp->post_limit_posts = (unsigned char)(temp / 10);
+
+ sprintf(genbuf, "%u", bp->post_limit_badpost);
+ do {
+ getdata_buf(b_lines - 1, 0, "劣文篇數上限 (0~255):", genbuf, 5, LCECHO);
+ temp = atoi(genbuf);
+ } while (temp < 0 || temp > 255);
+ bp->post_limit_badpost = (unsigned char)temp;
+
assert(0<=currbid-1 && currbid-1<MAX_BOARD);
substitute_record(fn_board, bp, sizeof(boardheader_t), currbid);
log_usies("SetBoard", bp->brdname);
@@ -1618,6 +1629,14 @@ do_limitedit(int ent, fileheader_t * fhdr, const char *direct)
temp = atoi(genbuf);
} while (temp < 0 || temp > 2550);
bp->vote_limit_posts = (unsigned char)(temp / 10);
+
+ sprintf(genbuf, "%u", bp->vote_limit_badpost);
+ do {
+ getdata_buf(b_lines - 1, 0, "劣文篇數上限 (0~255):", genbuf, 5, LCECHO);
+ temp = atoi(genbuf);
+ } while (temp < 0 || temp > 255);
+ bp->vote_limit_badpost = (unsigned char)temp;
+
assert(0<=currbid-1 && currbid-1<MAX_BOARD);
substitute_record(fn_board, bp, sizeof(boardheader_t), currbid);
log_usies("SetBoard", bp->brdname);
@@ -1647,6 +1666,14 @@ do_limitedit(int ent, fileheader_t * fhdr, const char *direct)
} while (temp < 0 || temp > 2550);
temp /= 10;
fhdr->multi.vote_limits.posts = (unsigned char)temp;
+
+ sprintf(genbuf, "%u", (unsigned int)(fhdr->multi.vote_limits.badpost));
+ do {
+ getdata_buf(b_lines - 1, 0, "劣文篇數上限 (0~255):", genbuf, 5, LCECHO);
+ temp = atoi(genbuf);
+ } while (temp < 0 || temp > 255);
+ fhdr->multi.vote_limits.badpost = (unsigned char)temp;
+
substitute_ref_record(direct, fhdr, ent);
vmsg("修改完成!");
return FULLUPDATE;
@@ -2181,6 +2208,7 @@ recommend(int ent, fileheader_t * fhdr, const char *direct)
#ifndef DEBUG
if ( !((currmode & MODE_BOARD) || HasUserPerm(PERM_SYSOP)) &&
(cuser.firstlogin > (now - (time4_t)bcache[currbid - 1].post_limit_regtime * 2592000) ||
+ cuser.badpost > ((unsigned int)(bcache[currbid - 1].post_limit_badpost)) ||
cuser.numlogins < ((unsigned int)(bcache[currbid - 1].post_limit_logins) * 10) ||
cuser.numposts < ((unsigned int)(bcache[currbid - 1].post_limit_posts) * 10)) ) {
move(5, 10);
@@ -3073,6 +3101,18 @@ b_config(void)
" 回文",
(bp->brdattr & BRD_NOREPLY) ? "不可以" : "可以" );
+ move(b_lines - 10, 56);
+ prints("發文限制");
+ move(b_lines - 9, 58);
+ prints("上站次數 %d 次以上", (int)bp->post_limit_logins * 10);
+ move(b_lines - 8, 58);
+ prints("文章篇數 %d 篇以上", (int)bp->post_limit_posts * 10);
+ move(b_lines - 7, 58);
+ prints("註冊時間 %d 個月以上", (int)bp->post_limit_regtime);
+ move(b_lines - 6, 58);
+ prints("劣文篇數 %d 篇以下", (int)bp->post_limit_badpost);
+ move(b_lines, 0);
+
if (!((currmode & MODE_BOARD) || HasUserPerm(PERM_SYSOP)))
{
vmsg("您對此板無管理權限");
diff --git a/mbbsd/mail.c b/mbbsd/mail.c
index 52b03cbb..1fca15ee 100644
--- a/mbbsd/mail.c
+++ b/mbbsd/mail.c
@@ -1291,6 +1291,7 @@ mail_cross_post(int ent, fileheader_t * fhdr, const char *direct)
assert(0<=ent-1 && ent-1<MAX_BOARD);
if ( !(HasUserPerm(PERM_SYSOP)) &&
(cuser.firstlogin > (now - (time4_t)bcache[ent - 1].post_limit_regtime * 2592000) ||
+ cuser.badpost > ((unsigned int)(bcache[ent - 1].post_limit_badpost)) ||
cuser.numlogins < ((unsigned int)(bcache[ent - 1].post_limit_logins) * 10) ||
cuser.numposts < ((unsigned int)(bcache[ent - 1].post_limit_posts) * 10)) ) {
move(5, 10);
diff --git a/mbbsd/voteboard.c b/mbbsd/voteboard.c
index b85253aa..6a79a46a 100644
--- a/mbbsd/voteboard.c
+++ b/mbbsd/voteboard.c
@@ -24,10 +24,12 @@ do_voteboardreply(const fileheader_t * fhdr)
vmsg("對不起,您目前無法在此發表文章!");
return;
}
- if ( cuser.numlogins < ((unsigned int)(fhdr->multi.vote_limits.logins) * 10) ||
+ if (cuser.firstlogin > (now - (time4_t)fhdr->multi.vote_limits.regtime * 2592000) ||
+ cuser.badpost > ((unsigned int)(fhdr->multi.vote_limits.badpost)) ||
+ cuser.numlogins < ((unsigned int)(fhdr->multi.vote_limits.logins) * 10) ||
cuser.numposts < ((unsigned int)(fhdr->multi.vote_limits.posts) * 10) ) {
move(5, 10);
- vmsg("你的上站數/文章數不足喔!");
+ vmsg("你不夠資深喔!");
return;
}
setbpath(fpath, currboard);
@@ -166,6 +168,7 @@ do_voteboard(int type)
return FULLUPDATE;
}
if ( cuser.firstlogin > (now - (time4_t)bcache[currbid - 1].vote_limit_regtime * 2592000) ||
+ cuser.badpost > ((unsigned int)(bcache[currbid - 1].vote_limit_badpost)) ||
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);
@@ -350,6 +353,7 @@ do_voteboard(int type)
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;
+ votefile.multi.vote_limits.badpost = bcache[currbid - 1].vote_limit_badpost;
setbdir(genbuf, currboard);
if (append_record(genbuf, &votefile, sizeof(votefile)) != -1)
setbtotal(currbid);