diff options
author | wens <wens@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2004-11-20 21:51:14 +0800 |
---|---|---|
committer | wens <wens@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2004-11-20 21:51:14 +0800 |
commit | 9c94a379cb7b1d079553e175539eb7473d2f438e (patch) | |
tree | 07fa794de707869a0d49ffe25b52dfeea0fc80d4 /mbbsd | |
parent | 8aac813144a26bd5a9e6f89c9e470fff36404183 (diff) | |
download | pttbbs-9c94a379cb7b1d079553e175539eb7473d2f438e.tar pttbbs-9c94a379cb7b1d079553e175539eb7473d2f438e.tar.gz pttbbs-9c94a379cb7b1d079553e175539eb7473d2f438e.tar.bz2 pttbbs-9c94a379cb7b1d079553e175539eb7473d2f438e.tar.lz pttbbs-9c94a379cb7b1d079553e175539eb7473d2f438e.tar.xz pttbbs-9c94a379cb7b1d079553e175539eb7473d2f438e.tar.zst pttbbs-9c94a379cb7b1d079553e175539eb7473d2f438e.zip |
added vote board limits for BM using key 'C'
fixed no mail alert when replying to board and mail
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2342 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd')
-rw-r--r-- | mbbsd/bbs.c | 5 | ||||
-rw-r--r-- | mbbsd/voteboard.c | 64 |
2 files changed, 68 insertions, 1 deletions
diff --git a/mbbsd/bbs.c b/mbbsd/bbs.c index 3c1a8906..26c5852e 100644 --- a/mbbsd/bbs.c +++ b/mbbsd/bbs.c @@ -4,6 +4,7 @@ #define WHEREAMI_LEVEL 16 static int recommend(int ent, fileheader_t * fhdr, char *direct); +int mailalert(char *userid); #ifdef ASSESS static char * const badpost_reason[] = { @@ -733,6 +734,8 @@ do_general(int isbid) sethomedir(genbuf, quote_user); if (append_record(genbuf, &postfile, sizeof(postfile)) == -1) msg = err_uid; + else + mailalert(quote_user); } outs(msg); curredit ^= EDIT_BOTH; @@ -2417,7 +2420,7 @@ const onekey_t read_comms[] = { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, // 'A' 65 bh_title_edit, // 'B' - NULL, // 'C' + do_votelimitedit, // 'C' del_range, // 'D' edit_post, // 'E' NULL, // 'F' diff --git a/mbbsd/voteboard.c b/mbbsd/voteboard.c index 341f6911..852b297b 100644 --- a/mbbsd/voteboard.c +++ b/mbbsd/voteboard.c @@ -2,6 +2,59 @@ #include "bbs.h" #define VOTEBOARD "NewBoard" +int +do_votelimitedit(int ent, fileheader_t * fhdr, char *direct) +{ + char genbuf[256]; + int temp; + boardheader_t *bp = NULL; + + if (!((currmode & MODE_BOARD) || HAS_PERM(PERM_SYSOP))) + return DONOTHING; + bp = getbcache(currbid); + getdata(23, 0, "э (A)セ絞 (B)セ箇砞硈竝 (C)[C]", genbuf, 3, LCECHO); + if (genbuf[0] == 'a' || genbuf[0] == 'A') { + sprintf(genbuf, "%u", ((fhdr->money >> 8) & 0xF) * 10); + do { + getdata_buf(23, 0, "Ω计 (0~2550)", genbuf, 5, LCECHO); + temp = atoi(genbuf); + } while (temp < 0 || temp > 2550); + temp /= 10; + fhdr->money = (fhdr->money & ~(0xF0)) | (temp << 8); + + sprintf(genbuf, "%u", (fhdr->money & 0xF) * 10); + do { + getdata_buf(23, 0, "ゅ彻絞计 (0~2550)", genbuf, 5, LCECHO); + temp = atoi(genbuf); + } while (temp < 0 || temp > 2550); + temp /= 10; + fhdr->money = (fhdr->money & ~(0xF)) | temp; + substitute_ref_record(direct, fhdr, ent); + vmsg("эЧΘ"); + return FULLUPDATE; + } + else if (genbuf[0] == 'b' || genbuf[0] == 'B') { + sprintf(genbuf, "%u", bp->limit_logins * 10); + do { + getdata_buf(23, 0, "Ω计 (0~2550)", genbuf, 5, LCECHO); + temp = atoi(genbuf); + } while (temp < 0 || temp > 2550); + bp->limit_logins = (unsigned char)(temp / 10); + + sprintf(genbuf, "%u", bp->limit_posts * 10); + do { + getdata_buf(23, 0, "ゅ彻絞计 (0~2550)", genbuf, 5, LCECHO); + temp = atoi(genbuf); + } while (temp < 0 || temp > 2550); + bp->limit_posts = (unsigned char)(temp / 10); + substitute_record(fn_board, bp, sizeof(boardheader_t), currbid); + log_usies("SetBoard", bp->brdname); + vmsg("эЧΘ"); + return FULLUPDATE; + } + vmsg("э"); + return FULLUPDATE; +} void do_voteboardreply(fileheader_t * fhdr) @@ -25,6 +78,12 @@ do_voteboardreply(fileheader_t * fhdr) vmsg("癸ぃ癬眤ヘ玡礚猭祇ゅ彻"); return; } + len = fhdr->money; + if ( cuser.numlogins < (((len >> 8) & 0xF) * 10) || cuser.numposts < ((len & 0xF) * 10) ) { + move(5, 10); + vmsg("计/ゅ彻计ぃì翅"); + return; + } setbpath(fpath, currboard); stampfile(fpath, &votefile); @@ -331,6 +390,11 @@ do_voteboard(int type) strlcpy(votefile.owner, cuser.userid, sizeof(votefile.owner)); strlcpy(votefile.title, title, sizeof(votefile.title)); votefile.filemode |= FILE_VOTE; + temp = getbnum(currboard); + /* use lower 16 bits of 'money' to store limits */ + /* lower 8 bits are logins, higher 8 bits are posts */ + votefile.money = ( ((unsigned int)(bcache[temp - 1].limit_logins) << 8) | + (unsigned int)(bcache[temp - 1].limit_posts) ); setbdir(genbuf, currboard); if (append_record(genbuf, &votefile, sizeof(votefile)) != -1) setbtotal(currbid); |