From 167a997af62b12fac966cf89d53bbe7ebaa27f81 Mon Sep 17 00:00:00 2001 From: piaip Date: Sun, 30 Mar 2008 08:06:40 +0000 Subject: - read: add 'search for "s"' in G search - user: print reg date in userinfo. git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@4043 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- mbbsd/read.c | 24 ++++++++++++++++++++---- mbbsd/user.c | 3 ++- 2 files changed, 22 insertions(+), 5 deletions(-) (limited to 'mbbsd') diff --git a/mbbsd/read.c b/mbbsd/read.c index 85347d9e..3de710aa 100644 --- a/mbbsd/read.c +++ b/mbbsd/read.c @@ -551,7 +551,7 @@ select_read(const keeploc_t * locmem, int sr_mode) } else { // Ptt: only once for these modes. - if(!first_select && _mode & sr_mode & (RS_TITLE | RS_NEWPOST | RS_MARK)) + if(!first_select && _mode & sr_mode & (RS_TITLE | RS_NEWPOST | RS_MARK | RS_SOLVED)) return DONOTHING; if(sr_mode & RS_TITLE) { @@ -608,7 +608,7 @@ select_read(const keeploc_t * locmem, int sr_mode) } /* mark and recommend shouldn't incremental select */ - if(sr_mode & (RS_MARK | RS_RECOMMEND)) + if(sr_mode & (RS_MARK | RS_RECOMMEND | RS_SOLVED)) inc = 0; if(reload) { @@ -652,6 +652,9 @@ select_read(const keeploc_t * locmem, int sr_mode) if( (sr_mode & RS_MARK) && !(fhs[i].filemode & FILE_MARKED) ) continue; + if( (sr_mode & RS_SOLVED) && + !(fhs[i].filemode & FILE_SOLVED) ) + continue; else if((sr_mode & RS_NEWPOST) && !strncmp(fhs[i].title, "Re:", 3)) continue; @@ -708,7 +711,6 @@ i_read_key(const onekey_t * rcmdlist, keeploc_t * locmem, { int mode = DONOTHING, num, new_top=10; int ch, new_ln = locmem->crs_ln, lastmode = DONOTHING; - char direct[60]; static char default_ch = 0; do { @@ -894,7 +896,20 @@ i_read_key(const onekey_t * rcmdlist, keeploc_t * locmem, break; case 'G': - mode = select_read(locmem, RS_MARK); + // special types + switch(getans( currmode & MODE_SELECT ? + "增加條件 標記(m/s)[m]: ": + "搜尋標記(m/s)[m]: ")) + { + case 's': + mode = select_read(locmem, RS_SOLVED); + break; + + default: + case 'm': + mode = select_read(locmem, RS_MARK); + break; + } break; case '/': @@ -1098,6 +1113,7 @@ i_read_key(const onekey_t * rcmdlist, keeploc_t * locmem, if(!rcmdlist[ch - 1].needitem) mode = (*func)(); else if( num > 0 ){ + char direct[60]; sprintf(direct,"%s.bottom", currdirect); mode= (*func)(num, &headers[locmem->crs_ln-locmem->top_ln], direct, locmem->crs_ln - locmem->top_ln); diff --git a/mbbsd/user.c b/mbbsd/user.c index 4893d406..cbbcd96b 100644 --- a/mbbsd/user.c +++ b/mbbsd/user.c @@ -169,7 +169,8 @@ user_display(const userec_t * u, int adminmode) prints(" 小 天 使: %s\n", u->myangel[0] ? u->myangel : "無"); #endif - prints(" 註冊日期: %s", ctime4(&u->firstlogin)); + prints(" 註冊日期: %s (已滿%d天)", + ctime4(&u->firstlogin), (now-u->firstlogin)/86400); prints(" 前次光臨: %s", ctime4(&u->lastlogin)); prints(" 上站文章: %d 次 / %d 篇\n", u->numlogins, u->numposts); -- cgit v1.2.3