From 4ec5f10deccbe863fa9f5159ad3680ba9b152540 Mon Sep 17 00:00:00 2001
From: in2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>
Date: Sun, 22 Jun 2003 15:12:59 +0000
Subject: COLORDATE

git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@960 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
---
 mbbsd/bbs.c        | 32 +++++++++++++++++---------------
 sample/pttbbs.conf |  3 +++
 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
 
+/* �Y�w�q, �h�b�峹�C�����ɭԤ��P����|�ФW���P�C�� */
+//#define COLORDATE
+
 /* �e�i���e�� */
 #define INSCREEN \
 "�e�i���e�� (�Ц� pttbbs.conf �ק�z���e�i���e��)"
-- 
cgit v1.2.3