summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2003-07-21 17:27:16 +0800
committerin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2003-07-21 17:27:16 +0800
commit757ddf2c2c6ef87af84cab5583fc53f513a7285d (patch)
tree7eed40a7d5a61ffe91916224d1db128efd508a1d
parent483d8cd52226af689a5f2a3a4265fe4b6700c69d (diff)
downloadpttbbs-757ddf2c2c6ef87af84cab5583fc53f513a7285d.tar
pttbbs-757ddf2c2c6ef87af84cab5583fc53f513a7285d.tar.gz
pttbbs-757ddf2c2c6ef87af84cab5583fc53f513a7285d.tar.bz2
pttbbs-757ddf2c2c6ef87af84cab5583fc53f513a7285d.tar.lz
pttbbs-757ddf2c2c6ef87af84cab5583fc53f513a7285d.tar.xz
pttbbs-757ddf2c2c6ef87af84cab5583fc53f513a7285d.tar.zst
pttbbs-757ddf2c2c6ef87af84cab5583fc53f513a7285d.zip
add BM
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk@1073 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--pttbbs/util/boardlist.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/pttbbs/util/boardlist.c b/pttbbs/util/boardlist.c
index bb23393a..42fd707a 100644
--- a/pttbbs/util/boardlist.c
+++ b/pttbbs/util/boardlist.c
@@ -1,4 +1,4 @@
-/* $Id: boardlist.c,v 1.3 2003/07/11 10:13:49 in2 Exp $ */
+/* $Id: boardlist.c,v 1.4 2003/07/21 09:27:16 in2 Exp $ */
/* 這是用來將樹狀分類輸出成 perl module (可以給像是 man/ 使用) */
#include "bbs.h"
@@ -46,6 +46,8 @@ char *skipEscape(char *s)
void dumpclass(int bid)
{
boardheader_t *bptr;
+ char BM[IDLEN * 3 + 3], *p;
+
bptr = &bcache[bid];
if (bptr->firstchild[0] == NULL || bptr->childcount <= 0)
load_uidofgid(bid + 1, 0); /* 因為這邊 bid從 0開始, 所以再 +1 回來 */
@@ -58,9 +60,17 @@ void dumpclass(int bid)
~(PERM_BASIC|PERM_CHAT|PERM_PAGE|PERM_POST|PERM_LOGINOK))) )
continue;
- printf(" [%5d, '%s', '%s'], \n",
+ printf(" [%5d, '%s', '%s', [",
(bptr->brdattr & BRD_GROUPBOARD) ? bptr - bcache : -1,
bptr->brdname, skipEscape(&bptr->title[7]));
+ strlcpy(BM, bptr->BM, sizeof(BM));
+ for( p = BM ; *p != 0 ; ++p )
+ if( !isalpha(*p) && !isdigit(*p) )
+ *p = ' ';
+ for( p = strtok(BM, " ") ; p != NULL ; p = strtok(NULL, " ") ){
+ printf("'%s',", p);
+ }
+ printf("]],\n");
}
printf(" ],\n");