[問題] 強制閱讀公告

看板PttCurrent作者 (莫里斯)時間18年前 (2008/01/10 04:51), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/1
參考ptt2舊文章 然後根據現在的函式做過修改後 登入後就會斷線,不知道是哪個地方出了問題 還請各位指教 void force_board(char *bname) { boardheader_t *bh; int i; if(!cuser.userlevel) return; /* guest skip force read */ if(bname[0] == '\0' || !(i = getbnum(bname))) return; /* 檢查看板是否存在, 既然是強迫讀取, 要考慮嗎? */ bh = getbcache(i); - if (!Ben_Perm(bh)) + if (!HasBoardPerm(bh)) return; /* 檢查權限是否足夠, 既然是強迫讀取, 要考慮嗎? */ currbid = i; - load_brdbuf(); + save_brdbuf(); nbrd = (boardstat_t *) MALLOC(sizeof(boardstat_t)); addnewbrdstat((int)(bh - bcache), 1); - brc_initial(bname); + brc_initial_board(bname); check_newpost(nbrd); while (nbrd->myattr & NBRD_UNREAD) { - vmsg("%s 板有新公告, 看完公告再離開吧... ^^", bname); + vmsg("此板有新公告, 看完公告再離開吧... ^^"); brc_initial_board(bname); Read(); check_newpost(nbrd); } free(nbrd); } -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.135.8.196
文章代碼(AID): #17XJFP6u (PttCurrent)