From 850ea1b719c582d0a511aa1b5eca5f6b2a0173a0 Mon Sep 17 00:00:00 2001 From: ptt Date: Sat, 25 May 2002 06:12:12 +0000 Subject: *** empty log message *** git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@213 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- include/pttstruct.h | 3 ++- mbbsd/board.c | 25 +++++++++++++++++++------ mbbsd/var.c | 4 ++-- 3 files changed, 23 insertions(+), 9 deletions(-) diff --git a/include/pttstruct.h b/include/pttstruct.h index c6e309cd..143a9f60 100644 --- a/include/pttstruct.h +++ b/include/pttstruct.h @@ -1,4 +1,4 @@ -/* $Id: pttstruct.h,v 1.9 2002/05/24 17:48:19 ptt Exp $ */ +/* $Id: pttstruct.h,v 1.10 2002/05/25 06:12:12 ptt Exp $ */ #ifndef INCLUDE_STRUCT_H #define INCLUDE_STRUCT_H @@ -129,6 +129,7 @@ typedef struct boardheader_t { #define BRD_BAD 00400 /* 違法改進中看板 */ #define BRD_VOTEBOARD 01000 /* 連署機看板 */ #define BRD_WARNDEL 02000 /* 已警告要廢除的看板 */ +#define BRD_TOP 04000 /* 熱門看板的群組 設群組板才有用*/ #define TTLEN 64 /* Length of title */ #define FNLEN 33 /* Length of filename */ diff --git a/mbbsd/board.c b/mbbsd/board.c index 58c01601..56ca1f01 100644 --- a/mbbsd/board.c +++ b/mbbsd/board.c @@ -1,4 +1,4 @@ -/* $Id: board.c,v 1.16 2002/05/24 19:05:47 ptt Exp $ */ +/* $Id: board.c,v 1.17 2002/05/25 06:11:38 ptt Exp $ */ #include #include #include @@ -427,6 +427,10 @@ static boardstat_t * addnewbrdstat(int n, int state) return ptr; } +static int cmpboardname(boardstat_t *brd, boardstat_t *tmp) { + return brd->bh->nuser- tmp->bh->nuser; +} + static void load_boards(char *key) { boardheader_t *bptr = NULL; int type=cuser.uflag & BRDSORT_FLAG?1:0; @@ -440,7 +444,7 @@ static void load_boards(char *key) { load_uidofgid(class_bid,type); } brdnum = 0; - if(class_bid==0) + if(class_bid<=0) { nbrd = (boardstat_t *)malloc(numboards * sizeof(boardstat_t)); for(i=0 ; i < numboards; i++) @@ -452,9 +456,12 @@ static void load_boards(char *key) { !((state = Ben_Perm(bptr)) || (currmode & MODE_MENU)) || (yank_flag == 0 && !(favbuf[n]&BRD_FAV)) || (yank_flag == 1 && !zapbuf[n]) || - (key[0] && !strcasestr(bptr->title, key)) + (key[0] && !strcasestr(bptr->title, key)) || + (class_bid=-1 && !bptr->nuser) ) continue; addnewbrdstat(n, state); + if(class_bid=-1) + qsort(nbrd, brdnum, sizeof(boardstat_t), cmpboardname); } } else @@ -617,10 +624,12 @@ static void show_brdlist(int head, int clsflag, int newflag) { if (ptr->bh->brdattr & BRD_BAD) prints(" X "); - else if(ptr->bh->nuser>30) + else if(ptr->bh->nuser>=100) prints("\033[1;31mHOT\033[m"); - else if(ptr->bh->nuser>0) + else if(ptr->bh->nuser>50) prints("\033[1;31m%2d\033[m ",ptr->bh->nuser); + else if(ptr->bh->nuser>0) + prints("\033[1;33m%2d\033[m ",ptr->bh->nuser); else prints(" %c ", ptr->bh->bvote? 'V':' '); prints("%.13s", ptr->bh->BM); refresh(); @@ -1059,7 +1068,11 @@ static void choose_board(int newflag) { currmodetmp =currmode; tmp1=num; num=0; - class_bid = ptr->bid; + if(!(ptr->bh->brdattr & BRD_TOP)) + class_bid = ptr->bid; + else + class_bid = -1; /* 熱門群組用 */ + if (!(currmode & MODE_MENU))/*如果還沒有小組長權限 */ set_menu_BM(ptr->bh->BM); diff --git a/mbbsd/var.c b/mbbsd/var.c index 866ce063..ff2febf0 100644 --- a/mbbsd/var.c +++ b/mbbsd/var.c @@ -1,4 +1,4 @@ -/* $Id: var.c,v 1.3 2002/05/14 15:08:48 ptt Exp $ */ +/* $Id: var.c,v 1.4 2002/05/25 06:11:38 ptt Exp $ */ #include #include #include "config.h" @@ -51,7 +51,7 @@ char *str_permboard[] = { "預設匿名版", /* BRD_DEFAULTANONYMOUS */ "違法改進中看版", /* BRD_BAD */ "連署專用看版", /* BRD_VOTEBOARD */ - "沒想到", + "熱門看板群組", /* BRD_TOP */ "沒想到", "沒想到", "沒想到", -- cgit v1.2.3