summaryrefslogtreecommitdiffstats
path: root/mbbsd
diff options
context:
space:
mode:
authorvictor <victor@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2003-11-22 19:37:52 +0800
committervictor <victor@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2003-11-22 19:37:52 +0800
commit73633286ba5abef91660b5e731117e7293e83529 (patch)
treee09b49efe317c671608c6de58b6647c18ad1255a /mbbsd
parent9a6d820518d2db326a0342f6d09c8433cae5cd27 (diff)
downloadpttbbs-73633286ba5abef91660b5e731117e7293e83529.tar
pttbbs-73633286ba5abef91660b5e731117e7293e83529.tar.gz
pttbbs-73633286ba5abef91660b5e731117e7293e83529.tar.bz2
pttbbs-73633286ba5abef91660b5e731117e7293e83529.tar.lz
pttbbs-73633286ba5abef91660b5e731117e7293e83529.tar.xz
pttbbs-73633286ba5abef91660b5e731117e7293e83529.tar.zst
pttbbs-73633286ba5abef91660b5e731117e7293e83529.zip
fix 't' for admin, add docs/fav4.txt
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1364 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd')
-rw-r--r--mbbsd/board.c9
-rw-r--r--mbbsd/fav.c31
2 files changed, 37 insertions, 3 deletions
diff --git a/mbbsd/board.c b/mbbsd/board.c
index 148f5d1d..c6ed5d7d 100644
--- a/mbbsd/board.c
+++ b/mbbsd/board.c
@@ -560,6 +560,8 @@ load_boards(char *key)
if (is_set_attr(&fav->favh[i], FAVH_TAG))
state |= BRD_TAG;
+ if (is_set_attr(&fav->favh[i], FAVH_ADM_TAG))
+ state |= BRD_TAG;
addnewbrdstat(fav_getid(&fav->favh[i]) - 1, BRD_FAV | state);
}
if (brdnum == 0)
@@ -1006,9 +1008,10 @@ choose_board(int newflag)
}
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
+ if (ptr->myattr & BRD_TAG)
+ set_attr(getadmtag(ptr->bid), FAVH_ADM_TAG, 0);
+ else
+ fav_add_admtag(ptr->bid);
}
ptr->myattr ^= BRD_TAG;
head = 9999;
diff --git a/mbbsd/fav.c b/mbbsd/fav.c
index 08b837a6..ca3fc5b4 100644
--- a/mbbsd/fav.c
+++ b/mbbsd/fav.c
@@ -528,6 +528,19 @@ void fav_remove_item(short id, char type)
fav_remove(get_current_fav(), get_fav_item(id, type));
}
+fav_type_t *getadmtag(short bid)
+{
+ int i;
+ fav_t *fp = get_fav_root();
+ fav_type_t *ft;
+ for (i = 0; i < fp->DataTail; i++) {
+ ft = &fp->favh[i];
+ if (cast_board(ft)->bid == bid && is_set_attr(ft, FAVH_ADM_TAG))
+ return ft;
+ }
+ return NULL;
+}
+
fav_type_t *getboard(short bid)
{
return get_fav_item(bid, FAVT_BOARD);
@@ -705,6 +718,24 @@ fav_type_t *fav_add_board(int bid)
cast_board(ft)->bid = bid;
return ft;
}
+
+/* for administrator to move/administrate board */
+fav_type_t *fav_add_admtag(int bid)
+{
+ fav_t *fp = get_fav_root();
+ fav_type_t *ft;
+ if (is_maxsize())
+ return NULL;
+ ft = fav_item_allocate(FAVT_BOARD);
+ if (ft == NULL)
+ return NULL;
+ // turn on FAVH_ADM_TAG
+ set_attr(ft, FAVH_ADM_TAG, 1);
+ fav_add(fp, ft);
+ cast_board(ft)->bid = bid;
+ return ft;
+}
+
/* --- */
/* everything about the tag in fav mode.