diff options
author | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2009-09-20 09:38:48 +0800 |
---|---|---|
committer | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2009-09-20 09:38:48 +0800 |
commit | 957ea1f8abba31347a88cd0de6391c3d7825ca06 (patch) | |
tree | 4de6d9dcd720b7cdb7b8c5d37253a491c85195d7 | |
parent | b348044d6fff9e4269830357026329f439d50de7 (diff) | |
download | pttbbs-957ea1f8abba31347a88cd0de6391c3d7825ca06.tar pttbbs-957ea1f8abba31347a88cd0de6391c3d7825ca06.tar.gz pttbbs-957ea1f8abba31347a88cd0de6391c3d7825ca06.tar.bz2 pttbbs-957ea1f8abba31347a88cd0de6391c3d7825ca06.tar.lz pttbbs-957ea1f8abba31347a88cd0de6391c3d7825ca06.tar.xz pttbbs-957ea1f8abba31347a88cd0de6391c3d7825ca06.tar.zst pttbbs-957ea1f8abba31347a88cd0de6391c3d7825ca06.zip |
* allow setting default value for site like ptt2
git-svn-id: http://opensvn.csie.org/pttbbs/trunk@4866 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r-- | pttbbs/mbbsd/register.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/pttbbs/mbbsd/register.c b/pttbbs/mbbsd/register.c index f9735276..6a0d9599 100644 --- a/pttbbs/mbbsd/register.c +++ b/pttbbs/mbbsd/register.c @@ -627,12 +627,16 @@ query_adbanner_usong_pref_changed(const userec_t *u, char force_yn) { char old = (cuser.uflag & ADBANNER_USONG_FLAG) ? 1 : 0, new = 0, + defyes = 0, ans = 1; assert(u); if ( !(u->uflag & ADBANNER_FLAG) ) return 0; +#ifdef ADBANNER_DEFAULT_YES + defyes = ADBANNER_DEFAULT_YES; +#endif vs_hdr("�ʺA�ݪO�߱��I����ܳ]�w"); // draw a box here outs( @@ -648,10 +652,19 @@ query_adbanner_usong_pref_changed(const userec_t *u, char force_yn) vs_rectangle_simple(1, 1, 78, MAX_ADBANNER_HEIGHT); do { + // alert if not first rounod if (ans != 1) { move(b_lines-2, 0); outs("�нT���J y �� n�C"); bell(); } - ans = vansf("�аݱz�Ʊ�b�ʺA�i�ܰϬݨ�Ӧۨ䥦�ϥΪ̪��߱��I����? [y/%c]: ", force_yn ? 'n':'N'); - if ((!force_yn) && ans != 'y') - ans = 'n'; + ans = vansf("�аݱz�Ʊ�b�ʺA�i�ܰϬݨ�Ӧۨ䥦�ϥΪ̪��߱��I����? %s: ", + force_yn ? "[y/n]" : defyes ? "[Y/n]" : "[y/N]"); + + // adjust answers + if (!force_yn) + { + if (defyes && ans != 'n') + ans = 'y'; + else if (!defyes && ans != 'y') + ans = 'n'; + } } while (ans != 'y' && ans != 'n'); if (ans == 'y') |