作者ledia (contemplation)
看板PttSuggest
标题Re: 推文数搜寻
时间Thu Jun 2 02:05:43 2005
※ 引述《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
1F:推 markkkkkkkk:啊这个.....已经能用了吗? 我好像用不出来耶 59.114.162.230 06/11