From 29da9557a86842cee2ce3958cecb2b5c8721f18b Mon Sep 17 00:00:00 2001 From: piaip Date: Wed, 14 Sep 2005 18:21:36 +0000 Subject: make cplog compatible git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3168 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- mbbsd/bbs.c | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'mbbsd/bbs.c') diff --git a/mbbsd/bbs.c b/mbbsd/bbs.c index bda267b1..c69defc7 100644 --- a/mbbsd/bbs.c +++ b/mbbsd/bbs.c @@ -1347,7 +1347,7 @@ cross_post(int ent, fileheader_t * fhdr, const char *direct) /* add cp log. bp is currboard now. */ if(bp->brdattr & BRD_CPLOG) { - char buf[MAXPATHLEN]; + char buf[MAXPATHLEN], tail[STRLEN]; char bname[STRLEN] = ""; struct tm *ptime = localtime4(&now); int maxlength = 51 +2 - 6; @@ -1370,15 +1370,26 @@ cross_post(int ent, fileheader_t * fhdr, const char *direct) maxlength -= (strlen(cuser.userid) + strlen(bname)); +#ifdef GUESTRECOMMEND + snprintf(tail, sizeof(tail), + "%15s %02d/%02d", + fromhost, + ptime->tm_mon + 1, ptime->tm_mday); +#else + maxlength += (15 - 6); + snprintf(tail, sizeof(tail), + " %02d/%02d %02d:%02d", + ptime->tm_mon + 1, ptime->tm_mday, + ptime->tm_hour, ptime->tm_min); +#endif snprintf(buf, sizeof(buf), // ANSI_COLOR(32) <- system will add green "¡° " ANSI_COLOR(1;32) "%s" - ANSI_COLOR(0;32) - ":Âà¿ý¦Ü" - "%s" ANSI_RESET "%*s" - "%15s %02d/%02d\n", + ANSI_COLOR(0;32) ":Âà¿ý¦Ü" + "%s" ANSI_RESET "%*s%s\n" , cuser.userid, bname, maxlength, "", - fromhost, ptime->tm_mon + 1, ptime->tm_mday); + tail); + do_add_recommend(direct, fhdr, ent, buf, 2); } else #endif -- cgit v1.2.3