summaryrefslogtreecommitdiffstats
path: root/mbbsd/edit.c
diff options
context:
space:
mode:
authorpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2005-07-03 19:41:14 +0800
committerpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2005-07-03 19:41:14 +0800
commit728bd7471eb48701106ef65af331a0173a5d3903 (patch)
tree5614ac5380eb4aa86037040a66133dd2d0516a2d /mbbsd/edit.c
parentbec891156b90f32fb98e7375cad40aeaae174dec (diff)
downloadpttbbs-728bd7471eb48701106ef65af331a0173a5d3903.tar
pttbbs-728bd7471eb48701106ef65af331a0173a5d3903.tar.gz
pttbbs-728bd7471eb48701106ef65af331a0173a5d3903.tar.bz2
pttbbs-728bd7471eb48701106ef65af331a0173a5d3903.tar.lz
pttbbs-728bd7471eb48701106ef65af331a0173a5d3903.tar.xz
pttbbs-728bd7471eb48701106ef65af331a0173a5d3903.tar.zst
pttbbs-728bd7471eb48701106ef65af331a0173a5d3903.zip
- multi-signature browsing mode
- song order: quick abort git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2881 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/edit.c')
-rw-r--r--mbbsd/edit.c36
1 files changed, 29 insertions, 7 deletions
diff --git a/mbbsd/edit.c b/mbbsd/edit.c
index e1a1fa74..bcc8e28e 100644
--- a/mbbsd/edit.c
+++ b/mbbsd/edit.c
@@ -1445,11 +1445,10 @@ void
addsignature(FILE * fp, int ifuseanony)
{
FILE *fs;
- int i, num;
+ int i;
char buf[WRAPMARGIN + 1];
char fpath[STRLEN];
- static char msg[] = "請選擇簽名檔 (1-9, 0=不加 X=隨機)[X]: ";
char ch;
if (!strcmp(cuser.userid, STR_GUEST)) {
@@ -1458,10 +1457,33 @@ addsignature(FILE * fp, int ifuseanony)
return;
}
if (!ifuseanony) {
- num = showsignature(fpath, &i);
- if (num){
- msg[34] = ch = isdigit(cuser.signature) ? cuser.signature : 'X';
- getdata(0, 0, msg, buf, 4, DOECHO);
+
+ int browsing = 0;
+ SigInfo si;
+ memset(&si, 0, sizeof(si));
+
+browse_sigs:
+ showsignature(fpath, &i, &si);
+
+ if (si.max > 0){
+ unsigned char msg[64];
+
+ ch = isdigit(cuser.signature) ? cuser.signature : 'X';
+ sprintf(msg,
+ (browsing || (si.max > si.show_max)) ?
+ "請選擇簽名檔 (1-9, 0=不加 n=翻頁 x=隨機)[%c]: ":
+ "請選擇簽名檔 (1-9, 0=不加 x=隨機)[%c]: ",
+ ch);
+ getdata(0, 0, msg, buf, 4, LCECHO);
+
+ if(buf[0] == 'n')
+ {
+ si.show_start = si.show_max + 1;
+ if(si.show_start > si.max)
+ si.show_start = 0;
+ browsing = 1;
+ goto browse_sigs;
+ }
if (!buf[0])
buf[0] = ch;
@@ -1469,7 +1491,7 @@ addsignature(FILE * fp, int ifuseanony)
if (isdigit((int)buf[0]))
ch = buf[0];
else
- ch = '1' + random() % num;
+ ch = '1' + random() % si.max;
cuser.signature = buf[0];
if (ch != '0') {