static int malloc_board(struct board_t *binfr) { int rank; if (cp) { if (!can_see_board(&(binfr->bhr), cp->userlevel)) return -1; } else { if (!can_see_board(&(binfr->bhr), 0)) return -1; } if (num_brds >= num_alloc_brds) /* lthuang: 99/08/20 debug */ return -1; rank = binfr->rank; if (rank < 1 || rank > num_alloc_brds) /* debug */ return -1; if (cp && !(binfr->bhr.brdtype & BRD_UNZAP) && (ZapRC_IsZapped(binfr->bhr.bid, binfr->bhr.ctime) && (cp->flags[0] & YANK_FLAG))) return -1; all_brds[rank - 1].enter_cnt = 0; #ifdef USE_VOTE if (cp) all_brds[rank - 1].voting = is_new_vote(binfr->bhr.filename, cp->lastlogin); #endif all_brds[rank - 1].bcur = 0; /* init */ all_brds[rank - 1].bhr = &(binfr->bhr); all_brds[rank - 1].binfr = binfr; num_brds++; return 0; }
static int bcmd_zap(int ent, struct BoardList *bent, char *direct) { if (curuser.userlevel) /* guest cannot zap board */ { if (bent->bhr) { if (ZapRC_ValidBid(bent->bhr->bid)) { if (ZapRC_IsZapped(bent->bhr->bid, bent->bhr->ctime)) ZapRC_DoUnZap(bent->bhr->bid); else ZapRC_DoZap(bent->bhr->bid); sethomefile(genbuf, curuser.userid, UFNAME_ZAPRC); ZapRC_Update(genbuf); return C_LINE; } } } return C_NONE; }
static void board_entry(int x, struct BoardList ent[], int idx, int top, int last, int rows) { int num; struct BoardList *be1; CLASSHEADER *chr; be1 = &(ent[top - idx]); for (num = top; num <= last && (num - top) < rows; num++, be1++) { if (be1->bhr == NULL) { chr = search_class_by_cid(be1->cid); prints(" %3d %s\n", num, chr->bn); } else { prints(" %c%4d %-16.16s %4s %2s%1s%3d %-28.28s %-12.12s\n", ZapRC_IsZapped(be1->bhr->bid, be1->bhr->ctime) ? '*' : ' ', (show_numposts && in_board) ? be1->binfr->numposts : num, be1->bhr->filename, (be1->bhr->brdtype & BRD_NEWS) ? _msg_board_3 : "", #ifdef USE_IDENT (be1->bhr->brdtype & BRD_IDENT) ? _str_marker : #endif "", #ifdef USE_VOTE (be1->voting) ? "[1;36mV[m" : #endif "", be1->bhr->level, be1->bhr->title, be1->bhr->owner); } } }