summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2008-03-11 11:57:41 +0800
committerpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2008-03-11 11:57:41 +0800
commit3e4ba33de1435641e65f4a2fd8f4f02c3949c3da (patch)
tree2fcc6bfc66c650249a4ac2ae761d7559c53c5288
parent13d54dabfd3c03ff833c8333633cbcb31e0b1eb4 (diff)
downloadpttbbs-3e4ba33de1435641e65f4a2fd8f4f02c3949c3da.tar
pttbbs-3e4ba33de1435641e65f4a2fd8f4f02c3949c3da.tar.gz
pttbbs-3e4ba33de1435641e65f4a2fd8f4f02c3949c3da.tar.bz2
pttbbs-3e4ba33de1435641e65f4a2fd8f4f02c3949c3da.tar.lz
pttbbs-3e4ba33de1435641e65f4a2fd8f4f02c3949c3da.tar.xz
pttbbs-3e4ba33de1435641e65f4a2fd8f4f02c3949c3da.tar.zst
pttbbs-3e4ba33de1435641e65f4a2fd8f4f02c3949c3da.zip
- removed indict, because there's no any reason to keep those out-dated data.
- removed MRT map because it is not a real 'search' tool. - removed 'search' in P menu because there is no useful stuff in it. git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3990 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--include/proto.h4
-rw-r--r--mbbsd/Makefile2
-rw-r--r--mbbsd/indict.c171
-rw-r--r--mbbsd/menu.c34
-rw-r--r--mbbsd/xyz.c41
5 files changed, 9 insertions, 243 deletions
diff --git a/include/proto.h b/include/proto.h
index 1c594cdb..cd8a260a 100644
--- a/include/proto.h
+++ b/include/proto.h
@@ -327,10 +327,6 @@ ChessInfo* gomoku_replay(FILE* fp);
/* guess */
int guess_main(void);
-/* indict */
-int x_dict(void);
-int use_dict(char *dict,char *database);
-
/* convert */
void set_converting_type(int which);
diff --git a/mbbsd/Makefile b/mbbsd/Makefile
index b385db74..a33301c6 100644
--- a/mbbsd/Makefile
+++ b/mbbsd/Makefile
@@ -16,7 +16,7 @@ ACCOBJS = user.o register.o passwd.o
TALKOBJS = talk.o chat.o friend.o
NETOBJS = mbbsd.o io.o term.o
UTILOBJS = stuff.o file.o kaede.o convert.o name.o
-PLUGOBJS = lovepaper.o calendar.o indict.o topsong.o vice.o
+PLUGOBJS = lovepaper.o calendar.o topsong.o vice.o
OBJS= admin.o assess.o cal.o edit.o menu.o more.o gamble.o \
xyz.o syspost.o vote.o var.o voteboard.o \
pmore.o telnet.o \
diff --git a/mbbsd/indict.c b/mbbsd/indict.c
deleted file mode 100644
index a0504d61..00000000
--- a/mbbsd/indict.c
+++ /dev/null
@@ -1,171 +0,0 @@
-/* $Id$ */
-#include "bbs.h"
-
-#define REFER "etc/dicts"
-
-static void
-addword(const char *database,char word[])
-{
- char buf[150], a[3];
- FILE *fp = fopen(database, "r+");
-
- if (fp == NULL) {
- vmsg("database error");
- return;
- }
- fgets(buf, 130, fp);
- fseek(fp, 0, 2);
- if (HasUserPerm(PERM_LOGINOK)) {
- clear();
- move(4, 0);
- outs(" " ANSI_COLOR(31) "警告" ANSI_RESET ":若蓄意填寫假資料將" ANSI_COLOR(36) "砍id" ANSI_RESET "處份\n");
- prints("\n輸入範例\n:" ANSI_COLOR(33) "%s" ANSI_RESET, buf);
- outs("\n請依上列範例輸入一行資料(直接enter放棄)\n");
- getdata(10, 0, ":", buf, 65, DOECHO);
- if (buf[0]) {
- getdata(13, 0, "確定新增?(Y/n)", a, sizeof(a), LCECHO);
- if (a[0] != 'n')
- fprintf(fp, "%-65s[%s]\n", buf, cuser.userid);
- }
- }
- fclose(fp);
- clear();
-}
-
-static int
-choose_dict(char *dict,int dictlen,char *database,int databaselen)
-{
-#define MAX_DICT 10
- int n,c;
- FILE *fp;
- char buf[MAX_DICT][21], data[MAX_DICT][21], cho[10];
-
- move(12, 0);
- clrtobot();
- outs(" "
- "● " ANSI_COLOR(45;33) "字典唷 ◇ 要查哪一本?" ANSI_RESET " ●");
-
- if ((fp = fopen(REFER, "r"))) {
- for(n=0; n<MAX_DICT && fscanf(fp,"%s %s",buf[n],data[n])==2; n++) { // XXX check buffer size
- prints("\n "
- "(" ANSI_COLOR(36) "%d" ANSI_RESET ") %-20s大字典", n + 1, buf[n]);
- }
- fclose(fp);
-
- getdata(22, 14, " ★ 請選擇,[Enter]離開:", cho, 3, LCECHO);
- c=atoi(cho);
-
- if (c >= 1 && c <= n) {
- strlcpy(dict, buf[c-1], dictlen);
- strlcpy(database, data[c-1], databaselen);
- return 1;
- } else
- return 0;
- }
- return 0;
-}
-
-int
-use_dict(char *dict,char *database)
-{
- FILE *fp;
- char lang[150], word[80] = "";
- char j, f, buf[120], sys[] = "|" ANSI_COLOR(31) "e" ANSI_RESET ":編輯字典";
- int i = 0;
-
- setutmpmode(DICT);
- if (!HasUserPerm(PERM_SYSOP))
- sys[0] = 0;
-
- clear();
-
- snprintf(buf, sizeof(buf),
- ANSI_COLOR(45) " ●" ANSI_COLOR(1;44;33) ""
- " %-14s" ANSI_COLOR(3;45) " ● ", dict);
- strlcpy(&buf[100], ANSI_RESET "\n", sizeof(buf) - 100);
- for (;;) {
- move(0, 0);
- prints(" 請輸入關鍵字串(%s) 或指令(h,t,a)\n", dict);
- prints("[" ANSI_COLOR(32) "<關鍵字>" ANSI_RESET "|" ANSI_COLOR(32) "h" ANSI_RESET ":help|" ANSI_COLOR(32) ""
- "t" ANSI_RESET ":所有資料|" ANSI_COLOR(32) "a" ANSI_RESET ":新增資料%s]\n:", sys);
- getdata(2, 0, ":", word, 18, DOECHO);
- outs("資料搜尋中請稍候....");
- str_lower(word, word);
- if (word[0] == 0)
- return 0;
- clear();
- move(4, 0);
- outs(buf);
- if (strlen(word) == 1) {
- if (word[0] == 'a') {
- clear();
- move(4, 0);
- outs(buf);
- addword(database,word);
- continue;
- } else if (word[0] == 't')
- word[0] = 0;
- else if (word[0] == 'h') {
- more("etc/dict.hlp", YEA);
- clear();
- continue;
- } else if (word[0] == 'e' && HasUserPerm(PERM_SYSOP)) {
- vedit(database, NA, NULL);
- clear();
- continue;
- } else {
- outs("字串太短,請輸入多一點關鍵字");
- continue;
- }
- }
- i = 0;
- if ((fp = fopen(database, "r"))) {
- while (fgets(lang, sizeof(lang), fp) != NULL) {
- if (lang[65] == '[') {
- lang[65] = 0;
- f = 1;
- } else
- f = 0;
- if (strcasestr(lang, word)) {
- if (f == 1)
- lang[65] = '[';
- outs(lang);
- i++;
- if (!((i + 1) % 17)) {
- move(23, 0);
- outs(ANSI_COLOR(45) " "
- "任意鍵繼續 Q:離開 "
- ANSI_RESET " ");
- j = igetch();
- if (j == 'q')
- break;
- else {
- clear();
- move(4, 0);
- outs(buf);
- }
- }
- }
- }
- fclose(fp);
- }
- if (i == 0) {
- getdata(5, 0, "沒這個資料耶,新增嗎?(y/N)", lang, 3, LCECHO);
- if (lang[0] == 'y') {
- clear();
- move(4, 0);
- outs(buf);
- addword(database,word);
- }
- }
- }
-}
-
-int
-x_dict(void)
-{
- char dict[41], database[41];
- if (choose_dict(dict,sizeof(dict),database,sizeof(database)))
- use_dict(dict,database);
- return 0;
-}
diff --git a/mbbsd/menu.c b/mbbsd/menu.c
index 1762dbf3..44671fa4 100644
--- a/mbbsd/menu.c
+++ b/mbbsd/menu.c
@@ -585,40 +585,17 @@ static int p_money() {
return 0;
};
-#if 0
-const static commands_t jceelist[] = {
- {x_90,PERM_LOGINOK, "0090 JCEE 【90學年度大學聯招查榜系統】"},
- {x_89,PERM_LOGINOK, "1189 JCEE 【89學年度大學聯招查榜系統】"},
- {x_88,PERM_LOGINOK, "2288 JCEE 【88學年度大學聯招查榜系統】"},
- {x_87,PERM_LOGINOK, "3387 JCEE 【87學年度大學聯招查榜系統】"},
- {x_86,PERM_LOGINOK, "4486 JCEE 【86學年度大學聯招查榜系統】"},
- {NULL, 0, NULL}
-};
-
-static int m_jcee() {
- domenu(M_JCEE, BBSMNAME2 "查榜系統", '0', jceelist);
- return 0;
-}
-#endif
-
-static int forsearch();
+// static int forsearch();
static int playground();
static int chessroom();
/* Ptt Play menu */
static const commands_t playlist[] = {
-#if 0
-#if HAVE_JCEE
- {m_jcee, PERM_LOGINOK, "JJCEE 【 大學聯考查榜系統 】"},
-#endif
-#endif
{note, PERM_LOGINOK, "NNote 【 刻刻流言板 】"},
-/* XXX 壞掉了, 或許可以換成 weather.today/weather.tomorrow 但反正沒意義 */
-/* {x_weather,0 , "WWeather 【 氣象預報 】"}, */
-/* XXX 壞掉了 */
-/* {x_stock,0 , "SStock 【 股市行情 】"},*/
+ /* // useless.
{forsearch,PERM_LOGINOK, "SSearchEngine【" ANSI_COLOR(1;35) " "
BBSMNAME2 "搜尋器 " ANSI_RESET "】"},
+ */
{topsong,PERM_LOGINOK, "TTop Songs 【" ANSI_COLOR(1;32) " 點歌排行榜 " ANSI_RESET "】"},
{p_money,PERM_LOGINOK, "PPay 【" ANSI_COLOR(1;31) " "
BBSMNAME2 "量販店 " ANSI_RESET "】"},
@@ -671,17 +648,22 @@ static int playground() {
}
static const commands_t slist[] = {
+ /*
+ // x_dict: useless
{x_dict,0, "11Dictionary "
"【" ANSI_COLOR(1;33) " 趣味大字典 " ANSI_RESET "】"},
+ */
{x_mrtmap, 0, "22MRTmap "
"【" ANSI_COLOR(1;34) " 捷運地圖 " ANSI_RESET "】"},
{NULL, 0, NULL}
};
+/* // nothing to search...
static int forsearch() {
domenu(M_SREG, BBSMNAME2 "搜尋器", '1', slist);
return 0;
}
+*/
/* main menu */
diff --git a/mbbsd/xyz.c b/mbbsd/xyz.c
index 6de0f0a5..fd7d5f4e 100644
--- a/mbbsd/xyz.c
+++ b/mbbsd/xyz.c
@@ -1,47 +1,6 @@
/* $Id$ */
#include "bbs.h"
-#if 0
-/* 各種統計及相關資訊列表 */
-/* Ptt90年度大學聯招查榜系統 */
-int
-x_90(void)
-{
- use_dict("(90)准考證號/姓名/學校/科系/類組", "etc/90");
- return 0;
-}
-
-/* Ptt89年度大學聯招查榜系統 */
-int
-x_89(void)
-{
- use_dict("(89)准考證號/姓名/學校/科系/類組", "etc/89");
- return 0;
-}
-/* Ptt88年度大學聯招查榜系統 */
-int
-x_88(void)
-{
- use_dict("(88)准考證號/姓名/學校/科系/類組", "etc/88");
- return 0;
-}
-/* Ptt87年度大學聯招查榜系統 */
-int
-x_87(void)
-{
- use_dict("(87)准考證號/姓名/學校/科系", "etc/87");
- return 0;
-}
-
-/* Ptt86年度大學聯招查榜系統 */
-int
-x_86(void)
-{
- use_dict("(86)准考證號/姓名/學校/科系", "etc/86");
- return 0;
-}
-
-#endif
int
x_boardman(void)
{