diff options
author | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2005-08-06 15:19:10 +0800 |
---|---|---|
committer | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2005-08-06 15:19:10 +0800 |
commit | 1f6dede4cd2f7f35a2a768ec4c1f75aba51b71dd (patch) | |
tree | 98ceb21b715bce54541771c954e0bda179e8fd9a /mbbsd/read.c | |
parent | 84eb7263b74d4a83a3ab4636557e1584675841bb (diff) | |
download | pttbbs-1f6dede4cd2f7f35a2a768ec4c1f75aba51b71dd.tar pttbbs-1f6dede4cd2f7f35a2a768ec4c1f75aba51b71dd.tar.gz pttbbs-1f6dede4cd2f7f35a2a768ec4c1f75aba51b71dd.tar.bz2 pttbbs-1f6dede4cd2f7f35a2a768ec4c1f75aba51b71dd.tar.lz pttbbs-1f6dede4cd2f7f35a2a768ec4c1f75aba51b71dd.tar.xz pttbbs-1f6dede4cd2f7f35a2a768ec4c1f75aba51b71dd.tar.zst pttbbs-1f6dede4cd2f7f35a2a768ec4c1f75aba51b71dd.zip |
article money system upgrade again
now fully works(hope so).
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2999 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/read.c')
-rw-r--r-- | mbbsd/read.c | 30 |
1 files changed, 11 insertions, 19 deletions
diff --git a/mbbsd/read.c b/mbbsd/read.c index 3f3046ad..70579d49 100644 --- a/mbbsd/read.c +++ b/mbbsd/read.c @@ -418,7 +418,7 @@ select_read(const keeploc_t * locmem, int sr_mode) fileheader_t fhs[READSIZE]; char newdirect[MAXPATHLEN]; char keyword[TTLEN + 1] = ""; - char genbuf[MAXPATHLEN], *p = strstr(currdirect, "SR."); + char genbuf[MAXPATHLEN], *p = strstr(currdirect, "SR."); static int _mode = 0; int len, fd, fr, i, count=0, reference = 0, n_recommend = 0, n_money=0; @@ -461,21 +461,9 @@ select_read(const keeploc_t * locmem, int sr_mode) } else if (sr_mode & RS_MONEY) { - /* 增加條件應該不會動? - Ptt: still happens. - piaip: this does NOT work. multi is occupied by ref unless - we do recursive ref search. - */ -#if 0 - if (currmode & MODE_SELECT) - { - vmsg("請先離開目前的選擇/搜尋模式再搜尋文章價格"); - return READ_REDRAW; - } -#endif if(currstat == RMAIL || ( !getdata(b_lines, 0, - (currmode & MODE_SELECT) ? // 先留著吧,雖然應該不用 + (currmode & MODE_SELECT) ? "增加條件 文章價格: ":"搜尋價格高於多少的文章: ", keyword, 7, LCECHO) || (n_money = atoi(keyword)) <= 0 )) return READ_REDRAW; @@ -534,6 +522,9 @@ select_read(const keeploc_t * locmem, int sr_mode) } } +#ifdef DEBUG + vmsgf("search: %s", currdirect); +#endif while( (len = read(fr, fhs, sizeof(fhs))) > 0 ){ len /= sizeof(fileheader_t); for( i = 0 ; i < len ; ++i ){ @@ -559,17 +550,17 @@ select_read(const keeploc_t * locmem, int sr_mode) else if ((sr_mode & RS_RECOMMEND) && fhs[i].recommend < n_recommend ) continue; - else if ((sr_mode & RS_MONEY) && - // see view_postmoney - ((fhs[i].filemode & (FILE_BOTTOM|FILE_ANONYMOUS)) || - (fhs[i].multi.money < n_money))) + /* please put money test in last */ + else if ((sr_mode & RS_MONEY) && + query_file_money(fhs+i) < n_money) continue; - ++count; + if(p == NULL) { fhs[i].multi.refer.flag = 1; fhs[i].multi.refer.ref = reference; } + ++count; write(fd, &fhs[i], sizeof(fileheader_t)); } } // end while @@ -582,6 +573,7 @@ select_read(const keeploc_t * locmem, int sr_mode) if(count) { strlcpy(currdirect, newdirect, sizeof(currdirect)); currmode |= MODE_SELECT; + currsrmode |= sr_mode; return NEWDIRECT; } return READ_REDRAW; |