看板 PttSuggest 關於我們 聯絡資訊
※ 引述《ledia (contemplation)》之銘言: : 讓使用者輸入一個數字當下限 : 可以搜出推文數大於這個數字的 : 我想應該不少人會想有這樣的功能? : 問 in2 他是說不錯,但是 patch welcome .... - -; : 看那邊的 code 覺得應該不難改 : 先 post 出來以防止忘掉 希望沒有改爛什麼 orz 多用到了 'Z' 這個按鍵 幾乎每個鍵都有功能了的樣子... http://www.csie.ntu.edu.tw/~r92012/ptt/read.c.2.diff http://www.csie.ntu.edu.tw/~r92012/ptt/modes.h.diff or Index: read.c =================================================================== --- read.c (revision 2715) +++ read.c (working copy) @@ -393,7 +393,7 @@ char keyword[TTLEN + 1] = ""; char genbuf[MAXPATHLEN], *p = strstr(currdirect, "SR."); static int _mode = 0; - int len, fd, fr, i, count=0, reference = 0; + int len, fd, fr, i, count=0, reference = 0, n_push; fileheader_t *fh = &headers[locmem->crs_ln - locmem->top_ln]; STATINC(STAT_SELECTREAD); @@ -415,7 +415,15 @@ "%s:%s\n", currboard, keyword); #endif } - else + else if (sr_mode & RS_PUSH) + { + if(currstat != RMAIL && + !getdata(b_lines, 0, + currmode & MODE_SELECT ? "增加條件 推文數:":"最低推數:", + keyword, 7, LCECHO) || (n_push = atoi(keyword)) <= 0 ) + return READ_REDRAW; + } + else { if(p && _mode & sr_mode & (RS_TITLE | RS_NEWPOST | RS_MARK)) return DONOTHING; @@ -465,6 +473,9 @@ else if(sr_mode & RS_TITLE && strcmp(subject(fhs[i].title), keyword)) continue; + else if (sr_mode & RS_PUSH && + fhs[i].recommend < n_push ) + continue; ++count; if(p == NULL) { @@ -544,7 +555,11 @@ case Ctrl('H'): mode = select_read(locmem, RS_NEWPOST); break; - + + case 'Z': + mode = select_read(locmen, RS_PUSH); + break; + case 'a': case 'A': mode = select_read(locmem, RS_AUTHOR); --- modes.h Thu Jun 2 01:58:15 2005 +++ mod.h Thu Jun 2 01:57:48 2005 @@ -1,4 +1,4 @@ -/* $Id: modes.h 2725 2005-05-16 18:36:27Z kcwu $ */ +/* $Id: modes.h 2235 2004-10-09 10:19:34Z kcwu $ */ #ifndef INCLUDE_MODES_H #define INCLUDE_MODES_H @@ -136,6 +136,7 @@ #define RS_MARK 0x20 /* search the first article */ #define RS_AUTHOR 0x40 /* search author's article */ #define RS_NEWPOST 0x80 /* search new posts */ +#define RS_PUSH 0x100 /* search articale by push threshold */ #define CURSOR_FIRST (RS_TITLE | RS_FIRST) #define CURSOR_NEXT (RS_TITLE | RS_FORWARD) -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.112.30.55
markkkkkkkk:啊這個.....已經能用了嗎? 我好像用不出來耶 59.114.162.230 06/11