diff options
author | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2008-04-13 19:50:24 +0800 |
---|---|---|
committer | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2008-04-13 19:50:24 +0800 |
commit | 6d6273c57b2a35a2d71c778de11643376b5eb015 (patch) | |
tree | 653af56c3c279496cef16884e95fad547b5df08a /mbbsd | |
parent | afd40b73c635e700c5ba4dda6a3e162c78ea52cd (diff) | |
download | pttbbs-6d6273c57b2a35a2d71c778de11643376b5eb015.tar pttbbs-6d6273c57b2a35a2d71c778de11643376b5eb015.tar.gz pttbbs-6d6273c57b2a35a2d71c778de11643376b5eb015.tar.bz2 pttbbs-6d6273c57b2a35a2d71c778de11643376b5eb015.tar.lz pttbbs-6d6273c57b2a35a2d71c778de11643376b5eb015.tar.xz pttbbs-6d6273c57b2a35a2d71c778de11643376b5eb015.tar.zst pttbbs-6d6273c57b2a35a2d71c778de11643376b5eb015.zip |
- add calendar in login view
- add color help in calendar help
- change param of more path to const
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@4157 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd')
-rw-r--r-- | mbbsd/calendar.c | 56 | ||||
-rw-r--r-- | mbbsd/mbbsd.c | 15 | ||||
-rw-r--r-- | mbbsd/more.c | 2 | ||||
-rw-r--r-- | mbbsd/pmore.c | 2 | ||||
-rw-r--r-- | mbbsd/var.c | 3 |
5 files changed, 49 insertions, 29 deletions
diff --git a/mbbsd/calendar.c b/mbbsd/calendar.c index c8ad6994..ba290aa2 100644 --- a/mbbsd/calendar.c +++ b/mbbsd/calendar.c @@ -73,30 +73,14 @@ ParseColor(const char *color) char *str; int val; } c[] = { - { - "black", 0 - }, - { - "red", 1 - }, - { - "green", 2 - }, - { - "yellow", 3 - }, - { - "blue", 4 - }, - { - "magenta", 5 - }, - { - "cyan", 6 - }, - { - "white", 7 - } + { "black", 0 }, + { "red", 1 }, + { "green", 2 }, + { "yellow", 3 }, + { "blue", 4 }, + { "magenta", 5 }, + { "cyan", 6 }, + { "white", 7 } }; int i; @@ -292,7 +276,29 @@ u_editcalendar(void) move(1, 0); clrtoln(b_lines); move(3, 0); - prints("行事曆格式說明:\n編輯時以一行為單位,如:\n\n# 井號開頭的是註解\n2006/05/04 red 上批踢踢!\n\n其中的 red 是指表示的顏色。"); + prints("行事曆格式說明:\n編輯時以一行為單位,如:\n\n" + "# 井號開頭的是註解\n2006/05/04 red 上批踢踢!\n\n" + "其中的 red 是指表示的顏色。\n" + "目前可用的顏色為:\n " + ANSI_COLOR(1;30) "black " + ANSI_COLOR(31) "red " + ANSI_COLOR(32) "green " + ANSI_COLOR(33) "yellow " + ANSI_COLOR(34) "blue " + ANSI_COLOR(35) "magenta " + ANSI_COLOR(36) "cyan " + ANSI_COLOR(37) "white " + ANSI_RESET "\n " + ANSI_COLOR(1;30;47) "black " + ANSI_COLOR(31) "red " + ANSI_COLOR(32) "green " + ANSI_COLOR(33) "yellow " + ANSI_COLOR(34) "blue " + ANSI_COLOR(35) "magenta " + ANSI_COLOR(36) "cyan " + ANSI_COLOR(37) "white " + ANSI_RESET + ); pressanykey(); } return 0; diff --git a/mbbsd/mbbsd.c b/mbbsd/mbbsd.c index 7174bba8..72b40cc5 100644 --- a/mbbsd/mbbsd.c +++ b/mbbsd/mbbsd.c @@ -1292,8 +1292,21 @@ user_login(void) } for (i = 0; i < NUMVIEWFILE; i++) + { if ((cuser.loginview >> i) & 1) - more(loginview_file[(int)i][0], YEA); + { + const char *fn = loginview_file[(int)i][0]; + if (*fn == '@') // special + { + // since only one special now, let's write directly... + if (strcmp(fn, "@calendar") == 0) + calendar(); + } else { + // use NA+pause or YEA? + more(fn, YEA); + } + } + } } static void diff --git a/mbbsd/more.c b/mbbsd/more.c index 7110971e..18244e6b 100644 --- a/mbbsd/more.c +++ b/mbbsd/more.c @@ -2,7 +2,7 @@ #include "bbs.h" /* use new pager: piaip's more. */ -int more(char *fpath, int promptend) +int more(const char *fpath, int promptend) { int r = pmore(fpath, promptend); diff --git a/mbbsd/pmore.c b/mbbsd/pmore.c index 9dc90a20..8bf14636 100644 --- a/mbbsd/pmore.c +++ b/mbbsd/pmore.c @@ -1939,7 +1939,7 @@ PMORE_UINAV_FORWARDLINE() * piaip's more, a replacement for old more */ int -pmore(char *fpath, int promptend) +pmore(const char *fpath, int promptend) { int flExit = 0, retval = 0; int ch = 0; diff --git a/mbbsd/var.c b/mbbsd/var.c index 38b2ddbc..2ae88492 100644 --- a/mbbsd/var.c +++ b/mbbsd/var.c @@ -75,7 +75,7 @@ const char * const str_permboard[] = { "禁止快速推文", /* BRD_NOFASTRECMD */ "推文記錄 IP", /* BRD_IPLOGRECMD */ "十八禁", /* BRD_OVER18 */ - "沒想到", + "對齊式推文", /* BRD_ALIGNEDCMT */ "沒想到", "沒想到", "沒想到", @@ -142,6 +142,7 @@ char * const loginview_file[NUMVIEWFILE][2] = { {"etc/history", "歷史上的今天"}, {"etc/topboardman", "精華區排行榜"}, {"etc/topboard.tmp", "看板人氣排行榜"}, + {"@calendar", "個人行事曆"}, {NULL, NULL} }; |