summaryrefslogtreecommitdiffstats
path: root/mbbsd
diff options
context:
space:
mode:
author(no author) <(no author)@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2003-09-22 11:40:29 +0800
committer(no author) <(no author)@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2003-09-22 11:40:29 +0800
commit3a7af3221ed2a70108e4fa3e2556e0f39de8798a (patch)
tree1972e2077eaf37d783b15c8f13492dd999ebc445 /mbbsd
parent8b1a18c752564f0637dc8fff91a1633b649024e8 (diff)
downloadpttbbs-3a7af3221ed2a70108e4fa3e2556e0f39de8798a.tar
pttbbs-3a7af3221ed2a70108e4fa3e2556e0f39de8798a.tar.gz
pttbbs-3a7af3221ed2a70108e4fa3e2556e0f39de8798a.tar.bz2
pttbbs-3a7af3221ed2a70108e4fa3e2556e0f39de8798a.tar.lz
pttbbs-3a7af3221ed2a70108e4fa3e2556e0f39de8798a.tar.xz
pttbbs-3a7af3221ed2a70108e4fa3e2556e0f39de8798a.tar.zst
pttbbs-3a7af3221ed2a70108e4fa3e2556e0f39de8798a.zip
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1193 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd')
-rw-r--r--mbbsd/bbs.c91
1 files changed, 77 insertions, 14 deletions
diff --git a/mbbsd/bbs.c b/mbbsd/bbs.c
index 85c894a6..82051438 100644
--- a/mbbsd/bbs.c
+++ b/mbbsd/bbs.c
@@ -448,8 +448,9 @@ do_allpost(fileheader_t *postfile, const char *fpath, const char *owner)
}
static int
-do_general()
+do_general(int isbid)
{
+ bid_t bidinfo;
fileheader_t postfile;
char fpath[80], buf[80];
int aborted, defanony, ifuseanony;
@@ -489,21 +490,51 @@ do_general()
#endif
#endif
- setbfile(genbuf, currboard, FN_POST_NOTE);
+ if(!isbid)
+ setbfile(genbuf, currboard, FN_POST_NOTE);
+ else
+ setbfile(genbuf, currboard, FN_POST_BID);
if (more(genbuf, NA) == -1)
- more("etc/" FN_POST_NOTE, NA);
-
+ {
+ if(!isbid)
+ more("etc/" FN_POST_NOTE, NA);
+ else
+ more("etc/" FN_POST_BID, NA);
+ }
move(19, 0);
- prints("�o���峹��i\033[33m %s\033[m �j \033[32m%s\033[m �ݪO\n\n",
+ prints("%s��i\033[33m %s\033[m �j \033[32m%s\033[m �ݪO\n",
+ isbid?"���}�ۼ�":"�o���峹",
currboard, bp->title + 7);
-
+ if(isbid)
+ {
+ prints("�]�w�����:");
+ bidinfo.enddate = gettime(20, now+86400);
+ do
+ getdata_str(21,0,"����:",buf, 8, LCECHO, "1");
+ while((bidinfo.enddate=postfile.money=atoi(buf))<=0);
+ do
+ getdata_str(21,0, "�C�ЦܤּW�[�h��:",buf, 5, LCECHO, "1");
+ while((bidinfo.increment=atoi(buf))<=0);
+ getdata_str(22,0,
+ "�I�ڤ覡: 1.Ptt�� 2.�l���λȦ���b 3.�䲼�ιq�� 4.�l���f��I�� [1]:",
+ buf, 3, LCECHO,"1");
+ bidinfo.payby=(buf[0]-'1');
+ if(bidinfo.payby<0 ||bidinfo.payby>3)bidinfo.payby=0;
+ getdata_str(23,0, "�B�O(0:�K�B�O�Τ夤����)[0]:", buf, 6, LCECHO, "0");
+ bidinfo.shipping = atoi(buf);
+ if(bidinfo.shipping<0) bidinfo.shipping=0;
+ postfile.filemode |= FILE_BID ;
+ move(20,0);
+ clrtobot();
+ }
if (quote_file[0])
do_reply_title(20, currtitle);
else {
- getdata(21, 0,
- "�����G1.���D 2.��ij 3.�Q�� 4.�߱o 5.���� 6.���i 7.���� (1-7�Τ���)",
+ getdata(21, 0,
+ "�����G1.���D 2.��ij 3.�Q�� 4.�߱o 5.���� 6.���i 7.���� (1-7�Τ���)",
save_title, 3, LCECHO);
+
local_article = save_title[0] - '1';
if (local_article >= 0 && local_article <= 6)
snprintf(save_title, sizeof(save_title),
@@ -556,13 +587,18 @@ do_general()
#endif
/* �� */
aborted = (aborted > MAX_POST_MONEY * 2) ? MAX_POST_MONEY : aborted / 2;
- postfile.money = aborted;
+ if(!isbid)
+ postfile.money = aborted;
strlcpy(postfile.owner, owner, sizeof(postfile.owner));
strlcpy(postfile.title, save_title, sizeof(postfile.title));
if (islocal) /* local save */
postfile.filemode = FILE_LOCAL;
setbdir(buf, currboard);
+ if(isbid)
+ {
+ append_record(buf, &postfile, sizeof(postfile));
+ }
if (append_record(buf, &postfile, sizeof(postfile)) != -1) {
setbtotal(currbid);
@@ -582,9 +618,14 @@ do_general()
aborted = (aborted > MAX_POST_MONEY) ? MAX_POST_MONEY : aborted;
#endif
if (strcmp(currboard, "Test") && !ifuseanony) {
- prints("�o�O�z���� %d �g�峹�C �Z�S %d �ȡC",
- ++cuser.numposts, aborted);
- demoney(aborted);
+ prints("�o�O�z���� %d �g�峹�C",++cuser.numposts);
+ if(!isbid)
+ {
+ prints(" �Z�S %d �ȡC",aborted);
+ demoney(aborted);
+ }
+ else
+ prints("�ۼФ峹�S���Z�S�C");
passwd_update(usernum, &cuser); /* post �� */
} else
outs("���իH�󤣦C�J�����A�q�Х]�[�C");
@@ -634,7 +675,18 @@ do_post()
if (bp->brdattr & BRD_VOTEBOARD)
return do_voteboard();
else if (!(bp->brdattr & BRD_GROUPBOARD))
- return do_general();
+ return do_general(0);
+ touchdircache(currbid);
+ return 0;
+}
+
+int
+do_post_openbid()
+{
+ boardheader_t *bp;
+ bp = getbcache(currbid);
+ if (!bp->brdattr & BRD_VOTEBOARD)
+ return do_general(1);
touchdircache(currbid);
return 0;
}
@@ -1709,7 +1761,6 @@ static int
b_post_note()
{
char buf[200], yn[3];
-
if (currmode & MODE_BOARD) {
setbfile(buf, currboard, FN_POST_NOTE);
if (more(buf, NA) == -1)
@@ -1719,6 +1770,17 @@ b_post_note()
vedit(buf, NA, NULL);
else
unlink(buf);
+
+
+ setbfile(buf, currboard, FN_POST_BID);
+ if (more(buf, NA) == -1)
+ more("etc/" FN_POST_BID, NA);
+ getdata(b_lines - 2, 0, "�O�_�n�Φۭqbid�`�N�ƶ�?", yn, sizeof(yn), LCECHO);
+ if (yn[0] == 'y')
+ vedit(buf, NA, NULL);
+ else
+ unlink(buf);
+
return FULLUPDATE;
}
return 0;
@@ -2073,6 +2135,7 @@ struct onekey_t read_comms[] = {
{'y', reply_post},
{'z', b_man},
{Ctrl('P'), do_post},
+ {Ctrl('O'), do_post_openbid},
{Ctrl('W'), whereami},
{'\0', NULL}
};