From a8a50c21f53be98a231422550d368c0719b06e3a Mon Sep 17 00:00:00 2001 From: piaip Date: Sun, 24 Jul 2005 06:00:22 +0000 Subject: recommendation: a more elegant UI git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2949 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- mbbsd/bbs.c | 63 ++++++++++++++++++++++++------------------------------------ mbbsd/mail.c | 2 +- 2 files changed, 26 insertions(+), 39 deletions(-) diff --git a/mbbsd/bbs.c b/mbbsd/bbs.c index aafd8df2..4fc6c17b 100644 --- a/mbbsd/bbs.c +++ b/mbbsd/bbs.c @@ -1841,7 +1841,7 @@ recommend(int ent, fileheader_t * fhdr, const char *direct) }, *ctype_long[3] = { "值得推薦", "給它噓聲", - "只加註解" + "只加→註解" }; #endif int type, maxlength; @@ -1871,72 +1871,59 @@ recommend(int ent, fileheader_t * fhdr, const char *direct) type = 0; -#if 0 - /* scroll down */ - move(b_lines-1, 0); - scroll(); scroll(); scroll(); -#endif + move(b_lines, 0); clrtoeol(); - /* clear screen */ - move(b_lines-3, 0); - clrtobot(); - outs(MSG_SEPERATOR); + if (fhdr->recommend == 0 && strcmp(cuser.userid, fhdr->owner) == 0) + { + // owner recomment first time + type = 2; + scroll(); move(b_lines-1, 0); + outs("本人推薦第一次, 使用 → 加註方式\n"); + } +#ifndef DEBUG + else if (!(currmode & MODE_BOARD)&& now - lastrecommend < 90) + { + // too close + type = 2; + scroll(); move(b_lines-1, 0); + outs("推薦時間太近, 使用 → 加註方式\n"); + } +#endif #ifndef OLDRECOMMEND - if (!(bp->brdattr & BRD_NOBOO)) + else if (!(bp->brdattr & BRD_NOBOO)) { - move(b_lines-2, 0); outs(ANSI_COLOR(1) "您覺得這篇文章 "); prints("%s1.%s %s2.%s %s3.%s " ANSI_RESET "[1]? ", ctype_attr[0], ctype_long[0], ctype_attr[1], ctype_long[1], ctype_attr[2], ctype_long[2]); // poor BBS term has problem positioning with ANSI. - move(b_lines-2, 53); + move(b_lines, 55); type = igetch() - '1'; if(type < 0 || type > 2) type = 0; + move(b_lines, 0); clrtoeol(); } #endif - if (fhdr->recommend == 0 && strcmp(cuser.userid, fhdr->owner) == 0 && - type != 2) { - mouts(b_lines-1, 0, -#ifndef OLDRECOMMEND - "本人推薦或噓第一次, 改以 → 加註方式" -#else - "本人推薦, 改以 → 加註方式" -#endif - ); - type = 2; - } -#ifndef DEBUG - else if (!(currmode & MODE_BOARD)&& now - lastrecommend < 90 && type != 2) { - mouts(b_lines-1, 0,"推薦時間太近, 改以 → 加註方式"); - type = 2; - } -#endif if(type > 2 || type < 0) type = 0; #ifdef OLDRECOMMEND maxlength = 51 - strlen(cuser.userid); - move(b_lines-3, 0); - outs(" [推薦文章] 要說的話: "); // please keep this in even bytes sprintf(buf, "%s %s:", "→" , cuser.userid); #else + maxlength = 53 - strlen(cuser.userid); - strcpy(buf, ctype_long[type]); - move(b_lines-3, 0); - prints(" [%s] 請在下面打入想說的話: ", ctype_long[type]); // please keep this in even bytes sprintf(buf, "%s %s:", ctype[type], cuser.userid); #endif - if (!getdata(b_lines-2, 0, buf, msg, maxlength, DOECHO)) + if (!getdata(b_lines, 0, buf, msg, maxlength, DOECHO)) return FULLUPDATE; - if(getans("確定要%s嗎? 請仔細考慮[y/N]: ", - ctype[type]) != 'y') + scroll(); + if(getans("確定要%s嗎? 請仔細考慮[y/N]: ", ctype[type]) != 'y') return FULLUPDATE; STATINC(STAT_RECOMMEND); diff --git a/mbbsd/mail.c b/mbbsd/mail.c index 8d863d63..b2cab6b6 100644 --- a/mbbsd/mail.c +++ b/mbbsd/mail.c @@ -20,7 +20,7 @@ setforward(void) fscanf(fp, "%s", ip); // XXX check buffer size fclose(fp); } - getdata_buf(b_lines - 1, 0, "請輸入信箱自動轉寄的email地址:", + getdata_buf(b_lines - 1, 0, "請輸入自動轉寄的Email: ", ip, sizeof(ip), DOECHO); /* anti idiots */ -- cgit v1.2.3