summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/pttstruct.h1
-rw-r--r--mbbsd/bbs.c17
-rw-r--r--mbbsd/var.c4
3 files changed, 14 insertions, 8 deletions
diff --git a/include/pttstruct.h b/include/pttstruct.h
index 99be5a50..6c4dbf1e 100644
--- a/include/pttstruct.h
+++ b/include/pttstruct.h
@@ -176,6 +176,7 @@ typedef struct boardheader_t {
#define BRD_BLOG 000020000 /* BLOG */
#define BRD_BMCOUNT 000040000 /* 板主設定列入記錄 */
#define BRD_SYMBOLIC 000100000 /* symbolic link to board */
+#define BRD_NOBOO 000200000 /* 不可噓 */
#define BRD_LINK_TARGET(x) ((x)->postexpire)
#define GROUPOP() (currmode & MODE_GROUPOP)
diff --git a/mbbsd/bbs.c b/mbbsd/bbs.c
index c2edc1ec..1b8a77ce 100644
--- a/mbbsd/bbs.c
+++ b/mbbsd/bbs.c
@@ -1504,12 +1504,12 @@ recommend(int ent, fileheader_t * fhdr, char *direct)
struct tm *ptime = localtime(&now);
char buf[200], path[200],
*ctype[3] = {"37m推","31m噓","31m→"};
- int type;
+ int type = 0;
boardheader_t *bp;
static time_t lastrecommend = 0;
bp = getbcache(currbid);
- if( bp->brdattr & BRD_NORECOMMEND){
+ if( bp->brdattr & BRD_NORECOMMEND ){
vmsg("抱歉, 此處禁止推薦或競標");
return FULLUPDATE;
}
@@ -1529,7 +1529,8 @@ recommend(int ent, fileheader_t * fhdr, char *direct)
}
setdirpath(path, direct, fhdr->filename);
- type = (
+ if(!(bp->brdattr & BRD_NOBOO))
+ type = (
#ifdef OLDRECOMMEND
'1'
#else
@@ -2250,10 +2251,14 @@ b_changerecommend(int ent, fileheader_t * fhdr, char *direct)
if (!((currmode & MODE_BOARD) || HAS_PERM(PERM_SYSOP)))
return DONOTHING;
bp = getbcache(currbid);
- bp->brdattr ^= BRD_NORECOMMEND;
+ if(bp->brdattr & BRD_NOBOO)
+ bp->brdattr ^= BRD_NORECOMMEND;
+ if(!(bp->brdattr & BRD_NORECOMMEND) || !(bp->brdattr & BRD_NOBOO))
+ bp->brdattr ^= BRD_NOBOO;
substitute_record(fn_board, bp, sizeof(boardheader_t), currbid);
- vmsg("本板現在 %s 推薦",
- (bp->brdattr & BRD_NORECOMMEND) ? "禁止" : "開放");
+ vmsg("本板現在 %s 推薦, %s 噓聲",
+ (bp->brdattr & BRD_NORECOMMEND) ? "禁止" : "開放",
+ (bp->brdattr & BRD_NOBOO) ? "禁止" : "開放");
return FULLUPDATE;
}
diff --git a/mbbsd/var.c b/mbbsd/var.c
index fee645bd..5198b45a 100644
--- a/mbbsd/var.c
+++ b/mbbsd/var.c
@@ -57,8 +57,8 @@ char * const str_permboard[] = {
"不可推薦", /* BRD_NORECOMMEND */
"布落格", /* BRD_BLOG */
"板主設定列入記錄", /* BRD_BMCOUNT */
- "沒想到",
- "沒想到",
+ "連結看板", /* BRD_SYMBOLIC */
+ "不可噓", /* BRD_NOBOO */
"沒想到",
"沒想到",
"沒想到",