summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mbbsd/bbs.c32
-rw-r--r--sample/pttbbs.conf3
2 files changed, 20 insertions, 15 deletions
diff --git a/mbbsd/bbs.c b/mbbsd/bbs.c
index 7e3e11f8..1169f764 100644
--- a/mbbsd/bbs.c
+++ b/mbbsd/bbs.c
@@ -1,4 +1,4 @@
-/* $Id: bbs.c,v 1.98 2003/06/22 14:39:34 in2 Exp $ */
+/* $Id: bbs.c,v 1.99 2003/06/22 15:12:59 in2 Exp $ */
#include "bbs.h"
static int recommend(int ent, fileheader_t * fhdr, char *direct);
@@ -181,22 +181,24 @@ readdoent(int num, fileheader_t * ent)
isonline = 1;
#endif
+ prints(
+#ifdef COLORDATE
+ "%6d %c\033[1;32m%c\033[%dm%-6s\033[m\033[%dm%-13.12s",
+#else
+ "%6d %c\033[1;32m%c\033[m%-6s\033[%dm%-13.12s",
+#endif
+ num, type, ent->recommend ? ent->recommend + '0' : ' ',
+#ifdef COLORDATE
+ (ent->date[3] + ent->date[4]) % 7 + 31,
+#endif
+ ent->date, isonline, ent->owner);
+
if (strncmp(currtitle, title, TTLEN))
- prints("%6d %c\033[1;32m%c\033[m%-6s\033[%dm%-13.12s\033[m%s "
- "\033[1m%.*s\033[m%s\n", num, type,
- ent->recommend ? ent->recommend + '0' : ' ',
- ent->date,
- isonline,
- ent->owner, mark,
- special ? 6 : 0, title, special ? title + 6 : title);
+ prints("\033[m%s \033[1m%.*s\033[m%s\n",
+ mark, special ? 6 : 0, title, special ? title + 6 : title);
else
- prints("%6d %c\033[1;32m%c\033[m%-6s\033[%dm%-13.12s\033[1;3%cm%s "
- "%s\033[m\n", num, type,
- ent->recommend ? ent->recommend + '0' : ' ',
- ent->date,
- isonline,
- ent->owner, color, mark,
- title);
+ prints("\033[1;3%cm%s %s\033[m\n",
+ color, mark, title);
}
int
diff --git a/sample/pttbbs.conf b/sample/pttbbs.conf
index b76d0ef4..982f0007 100644
--- a/sample/pttbbs.conf
+++ b/sample/pttbbs.conf
@@ -92,6 +92,9 @@
請參閱 pttbbs/blog/ */
//#define BLOG
+/* 若定義, 則在文章列表的時候不同日期會標上不同顏色 */
+//#define COLORDATE
+
/* 前進站畫面 */
#define INSCREEN \
"前進站畫面 (請至 pttbbs.conf 修改您的前進站畫面)"