diff options
author | in2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2003-07-21 17:27:16 +0800 |
---|---|---|
committer | in2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2003-07-21 17:27:16 +0800 |
commit | 64645b9c47fb5d1656e50045130b052420cd8389 (patch) | |
tree | 69384e93918c1a2c7f90457ba7a660e470fa2888 /util | |
parent | 37216803e9b579cadccda9dffad98d41bd70d50f (diff) | |
download | pttbbs-64645b9c47fb5d1656e50045130b052420cd8389.tar pttbbs-64645b9c47fb5d1656e50045130b052420cd8389.tar.gz pttbbs-64645b9c47fb5d1656e50045130b052420cd8389.tar.bz2 pttbbs-64645b9c47fb5d1656e50045130b052420cd8389.tar.lz pttbbs-64645b9c47fb5d1656e50045130b052420cd8389.tar.xz pttbbs-64645b9c47fb5d1656e50045130b052420cd8389.tar.zst pttbbs-64645b9c47fb5d1656e50045130b052420cd8389.zip |
add BM
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@1073 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'util')
-rw-r--r-- | util/boardlist.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/util/boardlist.c b/util/boardlist.c index bb23393a..42fd707a 100644 --- a/util/boardlist.c +++ b/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"); |