summaryrefslogtreecommitdiffstats
path: root/mbbsd
diff options
context:
space:
mode:
authorvictor <victor@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2003-11-22 18:56:32 +0800
committervictor <victor@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2003-11-22 18:56:32 +0800
commit011c20190d1584a43153c11c29d64a1668f6870e (patch)
tree01f9fa7f9707a4902b8f219cf3961e0e6ea326f6 /mbbsd
parent5dd7badd83114e9d401b35519658111af372f23f (diff)
downloadpttbbs-011c20190d1584a43153c11c29d64a1668f6870e.tar
pttbbs-011c20190d1584a43153c11c29d64a1668f6870e.tar.gz
pttbbs-011c20190d1584a43153c11c29d64a1668f6870e.tar.bz2
pttbbs-011c20190d1584a43153c11c29d64a1668f6870e.tar.lz
pttbbs-011c20190d1584a43153c11c29d64a1668f6870e.tar.xz
pttbbs-011c20190d1584a43153c11c29d64a1668f6870e.tar.zst
pttbbs-011c20190d1584a43153c11c29d64a1668f6870e.zip
fix 't' for admin
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1361 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd')
-rw-r--r--mbbsd/board.c50
-rw-r--r--mbbsd/fav.c4
2 files changed, 31 insertions, 23 deletions
diff --git a/mbbsd/board.c b/mbbsd/board.c
index a1c93c78..112c12b5 100644
--- a/mbbsd/board.c
+++ b/mbbsd/board.c
@@ -1002,7 +1002,13 @@ choose_board(int newflag)
case 't':
ptr = &nbrd[num];
if (yank_flag == 0 && get_fav_type(&nbrd[0]) != 0) {
- fav_tag(nbrd[num].bid, get_fav_type(ptr), 2);
+ fav_tag(ptr->bid, get_fav_type(ptr), 2);
+ }
+ else if (yank_flag != 0) {
+ /* 恨瞶ノ tag */
+ fav_type_t *ft = fav_add_board(ptr->bid);
+ set_attr(ft, FAVH_FAV, 0); // turn off FAVH_FAV
+ set_attr(ft, FAVH_ADM_TAG, 1); // turn on FAVH_ADM_TAG
}
ptr->myattr ^= BRD_TAG;
head = 9999;
@@ -1082,16 +1088,14 @@ choose_board(int newflag)
case Ctrl('P'):
if (class_bid != 0 &&
(HAS_PERM(PERM_SYSOP) || (currmode & MODE_MENU))) {
- for (tmp = 0; tmp < brdnum; tmp++) {
- short bid = nbrd[tmp].bid;
+ fav_t *fav = get_current_fav();
+ for (tmp = 0; tmp < fav->DataTail; tmp++) {
+ short bid;
boardheader_t *bh = &bcache[ bid - 1 ];
- /*
- if (!(fav->b[tmp].attr & BRD_TAG) || bh->gid == class_bid)
- continue;
- */
- if( !(nbrd[tmp].myattr & BRD_TAG) )
+ if( !is_set_attr(&fav->favh[tmp], FAVH_ADM_TAG))
continue;
- nbrd[tmp].myattr &= ~BRD_TAG;
+ bid = fav_getid(&fav->favh[tmp]);
+ set_attr(&fav->favh[tmp], FAVH_ADM_TAG, 0);
if (bh->gid != class_bid) {
bh->gid = class_bid;
substitute_record(FN_BOARD, bh,
@@ -1231,25 +1235,25 @@ choose_board(int newflag)
break;
#endif
case 'Z':
- if (!HAS_PERM(PERM_BASIC))
- break;
- char genbuf[256];
- sprintf(genbuf, "絋﹚璶 %s璹綷\ 穝狾? [N/y] ", cuser.uflag2 & FAVNEW_FLAG ? "" : "");
- if (getans(genbuf) != 'y')
- break;
+ if (HAS_PERM(PERM_BASIC)) {
+ char genbuf[256];
+ sprintf(genbuf, "絋﹚璶 %s璹綷\ 穝狾? [N/y] ", cuser.uflag2 & FAVNEW_FLAG ? "" : "");
+ if (getans(genbuf) != 'y')
+ break;
- cuser.uflag2 ^= FAVNEW_FLAG;
- if(cuser.uflag2 & FAVNEW_FLAG){
- char fname[80];
+ cuser.uflag2 ^= FAVNEW_FLAG;
+ if(cuser.uflag2 & FAVNEW_FLAG){
+ char fname[80];
- setuserfile(fname, FAVNB);
+ setuserfile(fname, FAVNB);
- if( (tmp = open(fname, O_RDONLY, 0600)) != -1 ){
- close(tmp);
- updatenewfav(0);
+ if( (tmp = open(fname, O_RDONLY, 0600)) != -1 ){
+ close(tmp);
+ updatenewfav(0);
+ }
}
+ vmsg((cuser.uflag2 & FAVNEW_FLAG) ? "ち传璹綷\穝狾家Α" : "ち传タ盽家Α");
}
- vmsg((cuser.uflag2 & FAVNEW_FLAG) ? "ち传璹綷\穝狾家Α" : "ち传タ盽家Α");
break;
case 'v':
case 'V':
diff --git a/mbbsd/fav.c b/mbbsd/fav.c
index 9479979e..08b837a6 100644
--- a/mbbsd/fav.c
+++ b/mbbsd/fav.c
@@ -30,6 +30,10 @@ inline static fav_folder_t *cast_folder(fav_type_t *p){
}
/* --- */
+inline int get_data_tail(fav_t *fp){
+ return fp->DataTail;
+}
+
inline int get_data_number(fav_t *fp){
return fp->nBoards + fp->nLines + fp->nFolders;
}