summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2003-05-26 13:25:03 +0800
committerin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2003-05-26 13:25:03 +0800
commit38918e67f0aabf6c9fd7ee743faa4dc296384691 (patch)
tree5ce1dd700f8d8327ecf2e65c3ba041fce7a075f4
parent648817f7b2957819f2854e7ee223ea9f7ed32619 (diff)
downloadpttbbs-38918e67f0aabf6c9fd7ee743faa4dc296384691.tar
pttbbs-38918e67f0aabf6c9fd7ee743faa4dc296384691.tar.gz
pttbbs-38918e67f0aabf6c9fd7ee743faa4dc296384691.tar.bz2
pttbbs-38918e67f0aabf6c9fd7ee743faa4dc296384691.tar.lz
pttbbs-38918e67f0aabf6c9fd7ee743faa4dc296384691.tar.xz
pttbbs-38918e67f0aabf6c9fd7ee743faa4dc296384691.tar.zst
pttbbs-38918e67f0aabf6c9fd7ee743faa4dc296384691.zip
blog support
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@903 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--include/modes.h3
-rw-r--r--include/proto.h5
-rw-r--r--include/pttstruct.h3
-rw-r--r--mbbsd/announce.c77
-rw-r--r--mbbsd/var.c13
-rw-r--r--sample/LocalVars.pm7
-rw-r--r--sample/pttbbs.conf4
7 files changed, 106 insertions, 6 deletions
diff --git a/include/modes.h b/include/modes.h
index cc12b3d5..3606cb1a 100644
--- a/include/modes.h
+++ b/include/modes.h
@@ -1,4 +1,4 @@
-/* $Id: modes.h,v 1.2 2002/08/27 21:49:18 kcwu Exp $ */
+/* $Id: modes.h,v 1.3 2003/05/26 05:23:13 in2 Exp $ */
#ifndef INCLUDE_MODES_H
#define INCLUDE_MODES_H
@@ -95,6 +95,7 @@
#define TMPJACK 77
#define JCEE 78
#define REEDIT 79
+#define BLOGGING 80
/* menu.c 中的模式 */
#define QUIT 0x666 /* Return value to abort recursive functions */
diff --git a/include/proto.h b/include/proto.h
index 298f0a2b..a460650d 100644
--- a/include/proto.h
+++ b/include/proto.h
@@ -1,4 +1,4 @@
-/* $Id: proto.h,v 1.43 2003/05/20 02:03:35 bbs Exp $ */
+/* $Id: proto.h,v 1.44 2003/05/26 05:23:13 in2 Exp $ */
#ifndef INCLUDE_PROTO_H
#define INCLUDE_PROTO_H
@@ -26,6 +26,9 @@ int a_menu(char *maintitle, char *path, int lastlevel);
void a_copyitem(char* fpath, char* title, char* owner, int mode);
int Announce();
void gem(char* maintitle, item_t* path, int update);
+#ifdef BLOG
+void BlogMain(int);
+#endif
/* args */
void initsetproctitle(int argc, char **argv, char **envp);
diff --git a/include/pttstruct.h b/include/pttstruct.h
index 80bbe7f3..a85c031d 100644
--- a/include/pttstruct.h
+++ b/include/pttstruct.h
@@ -1,4 +1,4 @@
-/* $Id: pttstruct.h,v 1.37 2003/05/09 13:30:32 victor Exp $ */
+/* $Id: pttstruct.h,v 1.38 2003/05/26 05:23:13 in2 Exp $ */
#ifndef INCLUDE_STRUCT_H
#define INCLUDE_STRUCT_H
@@ -135,6 +135,7 @@ typedef struct boardheader_t {
#define BRD_WARNEL 000002000 /* 連署機看板 */
#define BRD_TOP 000004000 /* 熱門看板群組 */
#define BRD_NORECOMMEND 000010000 /* 不可推薦 */
+#define BRD_BLOG 000020000 /* BLOG */
#define TTLEN 64 /* Length of title */
#define FNLEN 33 /* Length of filename */
diff --git a/mbbsd/announce.c b/mbbsd/announce.c
index 8bd39115..dd89ff1b 100644
--- a/mbbsd/announce.c
+++ b/mbbsd/announce.c
@@ -1,4 +1,4 @@
-/* $Id: announce.c,v 1.22 2003/05/24 03:45:14 in2 Exp $ */
+/* $Id: announce.c,v 1.23 2003/05/26 05:23:13 in2 Exp $ */
#include "bbs.h"
static void
@@ -1542,6 +1542,30 @@ a_menu(char *maintitle, char *path, int lastlevel)
refresh();
sleep(1);
break;
+
+#ifdef BLOG
+ case 'b':
+ if( !HAS_PERM(SYSOP) && !is_BM(bcache[currbid - 1].BM) )
+ vmsg("只有板主才可以用唷!");
+ else{
+ char genbuf[128];
+ snprintf(genbuf, sizeof(genbuf),
+ "bin/builddb.pl -f -n %d %s", me.now, currboard);
+ system(genbuf);
+ vmsg("資料更新完成");
+ }
+ me.page = 9999;
+ break;
+
+ case 'B':
+ if( !HAS_PERM(SYSOP) && !is_BM(bcache[currbid - 1].BM) )
+ vmsg("只有板主才可以用唷!");
+ else
+ BlogMain(me.now);
+ me.page = 9999;
+
+ break;
+#endif
}
if (me.level >= MANAGER) {
@@ -1641,3 +1665,54 @@ Announce()
NOBODY));
return 0;
}
+
+#ifdef BLOG
+void BlogMain(int num)
+{
+ int oldmode = currutmp->mode;
+ char genbuf[128], exit = 0;
+
+ //setutmpmode(BLOGGING); /* will crash someone using old program */
+ sprintf(genbuf, "%s的布落格", currboard);
+ showtitle("布落格", genbuf);
+ while( !exit ){
+ move(1, 0);
+ prints("請選擇您要執行的重作:\n"
+ "0.回到上一層\n"
+ "1.製作布落格樣板格式\n"
+ " 使用新的 config 目錄下樣板資料\n"
+ " 通常在第一次使用布落格或樣板更新的時候使用\n"
+ "\n"
+ "2.重新製作布落格\n"
+ " 只在布落格資料整個亂掉的時候才使用\n"
+ "\n"
+ "3.將本文加入布落格\n"
+ " 將游標所在位置的文章加入布落格\n");
+ switch( getans("請選擇(0-3)?[0]") ){
+ case '1':
+ snprintf(genbuf, sizeof(genbuf),
+ "bin/builddb.pl -c %s", currboard);
+ system(genbuf);
+ break;
+ case '2':
+ snprintf(genbuf, sizeof(genbuf),
+ "bin/builddb.pl -a %s", currboard);
+ vmsg(genbuf);
+ system(genbuf);
+ break;
+ case '3':
+ snprintf(genbuf, sizeof(genbuf),
+ "bin/builddb.pl -f -n %d %s", num, currboard);
+ system(genbuf);
+ break;
+ default:
+ exit = 1;
+ break;
+ }
+ if( !exit )
+ vmsg("布落格完成");
+ }
+ currutmp->mode = oldmode;
+ pressanykey();
+}
+#endif
diff --git a/mbbsd/var.c b/mbbsd/var.c
index 8d43e7d5..d8356d02 100644
--- a/mbbsd/var.c
+++ b/mbbsd/var.c
@@ -1,4 +1,4 @@
-/* $Id: var.c,v 1.16 2003/04/06 04:11:10 victor Exp $ */
+/* $Id: var.c,v 1.17 2003/05/26 05:23:13 in2 Exp $ */
#define INCLUDE_VAR_H
#include "bbs.h"
@@ -262,6 +262,17 @@ char *ModeTypeTable[MAX_MODES] = {
"NBA大猜測" /* TMPJACK */
"Ptt查榜系統", /* JCEE */
"重編文章" /* REEDIT */
+ "布落格", /* BLOGGING */
+ "", /* for future usage */
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
};
/* indict.c */
diff --git a/sample/LocalVars.pm b/sample/LocalVars.pm
index 1f24872d..a2ad4ab5 100644
--- a/sample/LocalVars.pm
+++ b/sample/LocalVars.pm
@@ -5,7 +5,9 @@ require Exporter;
@EXPORT = qw/
$hostname $MYHOSTNAME $FQDN $SMTPSERVER
$BBSHOME $JOBSPOOL $TMP
- $TAR $LYNX $GREP/;
+ $TAR $LYNX $GREP
+ $BLOGDATA
+/;
# host
$hostname = 'ptt';
@@ -22,3 +24,6 @@ $TMP = '/tmp';
$TAR = '/usr/bin/tar';
$LYNX = '/usr/local/bin/lynx'; # /usr/ports/www/lynx
$GREP = '/usr/bin/grep';
+
+# blog
+$BLOGDATA = '/home/bbs/blog/data';
diff --git a/sample/pttbbs.conf b/sample/pttbbs.conf
index 67e696d9..b76d0ef4 100644
--- a/sample/pttbbs.conf
+++ b/sample/pttbbs.conf
@@ -88,6 +88,10 @@
須要加跑 shmctl timed 來提供時間 */
//#define OUTTA_TIMER
+/* 若定義, 則啟動 bbs中連至 BLOG 的 interface
+ 請參閱 pttbbs/blog/ */
+//#define BLOG
+
/* 前進站畫面 */
#define INSCREEN \
"前進站畫面 (請至 pttbbs.conf 修改您的前進站畫面)"