diff options
author | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2010-11-07 16:25:10 +0800 |
---|---|---|
committer | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2010-11-07 16:25:10 +0800 |
commit | 677730185c30d0f88cdf345f5a3e5f94f66e1b57 (patch) | |
tree | 50f00f33225222df587008894c7c373996f7c174 | |
parent | 090d810565ac19840c83021cac21bb64025fff68 (diff) | |
download | pttbbs-677730185c30d0f88cdf345f5a3e5f94f66e1b57.tar pttbbs-677730185c30d0f88cdf345f5a3e5f94f66e1b57.tar.gz pttbbs-677730185c30d0f88cdf345f5a3e5f94f66e1b57.tar.bz2 pttbbs-677730185c30d0f88cdf345f5a3e5f94f66e1b57.tar.lz pttbbs-677730185c30d0f88cdf345f5a3e5f94f66e1b57.tar.xz pttbbs-677730185c30d0f88cdf345f5a3e5f94f66e1b57.tar.zst pttbbs-677730185c30d0f88cdf345f5a3e5f94f66e1b57.zip |
add 'v' so user can set read/unread inside post list
git-svn-id: http://opensvn.csie.org/pttbbs/trunk@5225 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r-- | pttbbs/include/proto.h | 1 | ||||
-rw-r--r-- | pttbbs/mbbsd/acl.c | 8 | ||||
-rw-r--r-- | pttbbs/mbbsd/bbs.c | 34 | ||||
-rw-r--r-- | pttbbs/mbbsd/brc.c | 7 |
4 files changed, 45 insertions, 5 deletions
diff --git a/pttbbs/include/proto.h b/pttbbs/include/proto.h index e22addd8..cd059fe1 100644 --- a/pttbbs/include/proto.h +++ b/pttbbs/include/proto.h @@ -115,6 +115,7 @@ int brc_unread_time(int bid, time4_t ftime,time4_t modified); void brc_addlist(const char* fname, time4_t modified); void brc_update(void); void brc_toggle_all_read(int bid, int is_all_read); +void brc_toggle_read(int bid, time4_t newtime); /* cache */ unsigned int getutmpmode(void); diff --git a/pttbbs/mbbsd/acl.c b/pttbbs/mbbsd/acl.c index bb94a9fb..4dcf6758 100644 --- a/pttbbs/mbbsd/acl.c +++ b/pttbbs/mbbsd/acl.c @@ -167,11 +167,11 @@ edit_banned_list_for_board(const char *board) { " - 除非想提前解除或發現設錯,此時可用(D)先刪除然後再用(A)重新設定\n" " - 想確認是否設錯或查某個使用者是不是仍在水桶中,可用(S)來檢查\n" " 另外也可用(L)看設定歷史記錄 (此記錄原則上系統不會清除)\n" - " 註: = 目前沒有[永久水桶]的設定,若有需要請設個 10年或 20年\n" - " = 目前新增/解除不會寄信通知,另外請注意" ANSI_COLOR(1;33) + " - 目前沒有[永久水桶]的設定,若有需要請設個 10年或 20年\n" + " - 目前新增/解除不會寄信通知,另外請注意" ANSI_COLOR(1;33) "帳號被砍後水桶會自動解除\n" ANSI_RESET - " = 水桶自動解除不會出現在記錄裡,只有手動提前解除的才會\n" -ANSI_COLOR(1) " = 想查看某使用者為何被水桶可用(S)或是(L)再用 / 搜尋\n" + " - 水桶自動解除不會出現在記錄裡,只有手動提前解除的才會\n" +ANSI_COLOR(1) " - 想查看某使用者為何被水桶可用(S)或是(L)再用 / 搜尋\n" ANSI_RESET "" #ifdef WATERBAN_UPGRADE_TIME_STR // enable and change this if you've just made an upgrade diff --git a/pttbbs/mbbsd/bbs.c b/pttbbs/mbbsd/bbs.c index 15b992b1..2e22c40f 100644 --- a/pttbbs/mbbsd/bbs.c +++ b/pttbbs/mbbsd/bbs.c @@ -4082,6 +4082,38 @@ b_help(void) return FULLUPDATE; } +static int +b_mark_read_unread(int ent, const fileheader_t * fhdr, const char *direct) { + char ans[3]; + time4_t curr; + move(b_lines-4, 0); clrtobot(); + outs("\n設定已讀未讀記錄 (注意: 文章設為已讀後不會再出現修改記號 '~')\n"); + getdata(b_lines-1, 0, + "設定所有文章 (U)未讀 (V)已讀 (W)前已讀後未讀 (Q)取消?[Q] ", + ans, sizeof(ans), LCECHO); + + switch(*ans) { + case 'u': + brc_toggle_all_read(currbid, 0); + break; + case 'v': + brc_toggle_all_read(currbid, 1); + break; + case 'w': + // XXX dirty hack: file name timestamp in [2] + curr = atoi(fhdr->filename + 2); + if (curr > 1 && curr <= now) { + brc_toggle_read(currbid, curr); + } else { + vmsg("請改用其它文章設定當參考點"); + } + break; + default: + break; + } + return FULLUPDATE; +} + #ifdef USE_COOLDOWN int check_cooldown(boardheader_t *bp) @@ -4268,7 +4300,7 @@ const onekey_t read_comms[] = { #else { 0, NULL }, // 'u' #endif - { 0, NULL }, // 'v' + { 1, b_mark_read_unread }, // 'v' { 1, b_call_in }, // 'w' { 1, old_cross_post }, // 'x' { 1, reply_post }, // 'y' diff --git a/pttbbs/mbbsd/brc.c b/pttbbs/mbbsd/brc.c index 7de71072..c345468e 100644 --- a/pttbbs/mbbsd/brc.c +++ b/pttbbs/mbbsd/brc.c @@ -483,6 +483,13 @@ brc_toggle_all_read(int bid, int is_all_read) } void +brc_toggle_read(int bid, time4_t newtime) +{ + brc_initialize(); + brc_trunc(bid, newtime); +} + +void brc_addlist(const char *fname, time4_t modified) { int n, i; |