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
commita5d2454cc5f2c3059e8e445f25d1728f60c2cb6d (patch)
tree5e78fda0007879d2f7fed22da3a85c0d1a52c4cb
parent61ce3e8ac1d4bc621391f7319415dd0a620c8f22 (diff)
downloadpttbbs-a5d2454cc5f2c3059e8e445f25d1728f60c2cb6d.tar
pttbbs-a5d2454cc5f2c3059e8e445f25d1728f60c2cb6d.tar.gz
pttbbs-a5d2454cc5f2c3059e8e445f25d1728f60c2cb6d.tar.bz2
pttbbs-a5d2454cc5f2c3059e8e445f25d1728f60c2cb6d.tar.lz
pttbbs-a5d2454cc5f2c3059e8e445f25d1728f60c2cb6d.tar.xz
pttbbs-a5d2454cc5f2c3059e8e445f25d1728f60c2cb6d.tar.zst
pttbbs-a5d2454cc5f2c3059e8e445f25d1728f60c2cb6d.zip
COLORDATE
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk@960 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--pttbbs/mbbsd/bbs.c32
-rw-r--r--pttbbs/sample/pttbbs.conf3
2 files changed, 20 insertions, 15 deletions
diff --git a/pttbbs/mbbsd/bbs.c b/pttbbs/mbbsd/bbs.c
index 7e3e11f8..1169f764 100644
--- a/pttbbs/mbbsd/bbs.c
+++ b/pttbbs/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/pttbbs/sample/pttbbs.conf b/pttbbs/sample/pttbbs.conf
index b76d0ef4..982f0007 100644
--- a/pttbbs/sample/pttbbs.conf
+++ b/pttbbs/sample/pttbbs.conf
@@ -92,6 +92,9 @@
請參閱 pttbbs/blog/ */
//#define BLOG
+/* 若定義, 則在文章列表的時候不同日期會標上不同顏色 */
+//#define COLORDATE
+
/* 前進站畫面 */
#define INSCREEN \
"前進站畫面 (請至 pttbbs.conf 修改您的前進站畫面)"