diff options
author | in2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2003-10-21 21:06:49 +0800 |
---|---|---|
committer | in2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2003-10-21 21:06:49 +0800 |
commit | c60d38faeccf0c1ac1d17a89f95c97e6d04ca17c (patch) | |
tree | c3ef6f137585aad7a46594c9db63d04c57088ecb | |
parent | 556a5426573dbaf58a742fdc0da525bbe702fb66 (diff) | |
download | pttbbs-c60d38faeccf0c1ac1d17a89f95c97e6d04ca17c.tar pttbbs-c60d38faeccf0c1ac1d17a89f95c97e6d04ca17c.tar.gz pttbbs-c60d38faeccf0c1ac1d17a89f95c97e6d04ca17c.tar.bz2 pttbbs-c60d38faeccf0c1ac1d17a89f95c97e6d04ca17c.tar.lz pttbbs-c60d38faeccf0c1ac1d17a89f95c97e6d04ca17c.tar.xz pttbbs-c60d38faeccf0c1ac1d17a89f95c97e6d04ca17c.tar.zst pttbbs-c60d38faeccf0c1ac1d17a89f95c97e6d04ca17c.zip |
use isvisiableboard()
git-svn-id: http://opensvn.csie.org/pttbbs/trunk@1258 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r-- | pttbbs/util/hotboard.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/pttbbs/util/hotboard.c b/pttbbs/util/hotboard.c index ff4c0e88..3a895e5f 100644 --- a/pttbbs/util/hotboard.c +++ b/pttbbs/util/hotboard.c @@ -13,6 +13,13 @@ struct bs { boardheader_t *b; } *brd; +#define isvisiableboard(bptr) \ + ((bptr)->brdname[0] && \ + !(((bptr)->brdattr & (BRD_HIDE | BRD_TOP)) || \ + ((bptr)->level && !((bptr)->brdattr & BRD_POSTMASK) && \ + ((bptr)->level & \ + ~(PERM_BASIC|PERM_CHAT|PERM_PAGE|PERM_POST|PERM_LOGINOK))))) + int main(int argc, char **argv) { int ch, topn = 20, i, nbrds, j, k, nusers; @@ -40,8 +47,8 @@ int main(int argc, char **argv) nbrds = 1; for( i = 1 ; i < MAX_BOARD ; ++i ) - if( nbrds != topn || - (SHM->bcache[i].brdname[0] && + if( (isvisiableboard(&SHM->bcache[i])) && + (nbrds != topn || SHM->bcache[i].nuser > brd[nbrds - 1].nusers) ){ nusers = SHM->bcache[i].nuser; // no race ? |