summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2003-06-22 23:12:59 +0800
committerin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2003-06-22 23:12:59 +0800
commit4ec5f10deccbe863fa9f5159ad3680ba9b152540 (patch)
tree55121a8c08547a4a15e9c95bf83c49b423148009
parent6b2171aa7ae678b5456d21ce9a8940af486ac155 (diff)
downloadpttbbs-4ec5f10deccbe863fa9f5159ad3680ba9b152540.tar
pttbbs-4ec5f10deccbe863fa9f5159ad3680ba9b152540.tar.gz
pttbbs-4ec5f10deccbe863fa9f5159ad3680ba9b152540.tar.bz2
pttbbs-4ec5f10deccbe863fa9f5159ad3680ba9b152540.tar.lz
pttbbs-4ec5f10deccbe863fa9f5159ad3680ba9b152540.tar.xz
pttbbs-4ec5f10deccbe863fa9f5159ad3680ba9b152540.tar.zst
pttbbs-4ec5f10deccbe863fa9f5159ad3680ba9b152540.zip
COLORDATE
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@960 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-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 修改您的前進站畫面)"