summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/config.h2
-rw-r--r--include/proto.h4
-rw-r--r--mbbsd/calendar.c56
-rw-r--r--mbbsd/mbbsd.c15
-rw-r--r--mbbsd/more.c2
-rw-r--r--mbbsd/pmore.c2
-rw-r--r--mbbsd/var.c3
7 files changed, 52 insertions, 32 deletions
diff --git a/include/config.h b/include/config.h
index 849519d7..aec5b3df 100644
--- a/include/config.h
+++ b/include/config.h
@@ -260,7 +260,7 @@
#define MAX_SIGLINES (6) /* 簽名檔引入最大行數 */
#define MAX_CROSSNUM (9) /* 最多crosspost次數 */
#define MAX_REVIEW (7) /* 最多水球回顧 */
-#define NUMVIEWFILE (14) /* 進站畫面最多數 */
+#define NUMVIEWFILE (15) /* 進站畫面最多數 */
#define MAX_SWAPUSED (0.7) /* SWAP最高使用率 */
#define LOGINATTEMPTS (3) /* 最大進站失誤次數 */
#define WHERE /* 是否有故鄉功能 */
diff --git a/include/proto.h b/include/proto.h
index 7115a87d..a223ac78 100644
--- a/include/proto.h
+++ b/include/proto.h
@@ -419,9 +419,9 @@ void m_sob_brd(char *bname,char *fromdir);
#endif
/* old more */
-int more(char *fpath, int promptend);
+int more(const char *fpath, int promptend);
/* piaip's new pager, pmore.c */
-int pmore(char *fpath, int promptend);
+int pmore(const char *fpath, int promptend);
/* piaip's new telnet, telnet.c */
void telnet_init(void);
ssize_t tty_read(unsigned char *buf, size_t max);
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}
};