summaryrefslogtreecommitdiffstats
path: root/mbbsd/calendar.c
diff options
context:
space:
mode:
authorpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2007-12-24 23:18:15 +0800
committerpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2007-12-24 23:18:15 +0800
commitebb38c5b0ea94a55365eac998433438f195f407e (patch)
treee6bbf8b87345aeef75f97d838f2d73bbe577a886 /mbbsd/calendar.c
parentff7897f3bf68a25867e89114c44bbbe45d6e1231 (diff)
downloadpttbbs-ebb38c5b0ea94a55365eac998433438f195f407e.tar
pttbbs-ebb38c5b0ea94a55365eac998433438f195f407e.tar.gz
pttbbs-ebb38c5b0ea94a55365eac998433438f195f407e.tar.bz2
pttbbs-ebb38c5b0ea94a55365eac998433438f195f407e.tar.lz
pttbbs-ebb38c5b0ea94a55365eac998433438f195f407e.tar.xz
pttbbs-ebb38c5b0ea94a55365eac998433438f195f407e.tar.zst
pttbbs-ebb38c5b0ea94a55365eac998433438f195f407e.zip
- hide register menu option for registered users
- integrate calendar editing into calendar itself git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3736 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/calendar.c')
-rw-r--r--mbbsd/calendar.c39
1 files changed, 38 insertions, 1 deletions
diff --git a/mbbsd/calendar.c b/mbbsd/calendar.c
index 053474fe..2205d71b 100644
--- a/mbbsd/calendar.c
+++ b/mbbsd/calendar.c
@@ -270,6 +270,37 @@ GenerateCalendar(char **buf, int y, int m, int today, event_t * e)
}
int
+u_editcalendar(void)
+{
+ char genbuf[200];
+
+ getdata(b_lines - 1, 0, "行事曆 (D)刪除 (E)編輯 (H)說明 [Q]取消?[Q] ",
+ genbuf, 3, LCECHO);
+
+ if (genbuf[0] == 'e') {
+ int aborted;
+
+ setutmpmode(EDITPLAN);
+ sethomefile(genbuf, cuser.userid, "calendar");
+ aborted = vedit(genbuf, NA, NULL);
+ if (aborted != -1)
+ vmsg("行事曆更新完畢");
+ return 0;
+ } else if (genbuf[0] == 'd') {
+ sethomefile(genbuf, cuser.userid, "calendar");
+ unlink(genbuf);
+ vmsg("行事曆刪除完畢");
+ } else if (genbuf[0] == 'h') {
+ move(1, 0);
+ clrtoln(b_lines);
+ move(3, 0);
+ prints("行事曆格式說明:\n編輯時以一行為單位,如:\n\n# 井號開頭的是註解\n2006/05/04 red 上批踢踢!\n\n其中的 red 是指表示的顏色。");
+ pressanykey();
+ }
+ return 0;
+}
+
+int
calendar(void)
{
char **buf;
@@ -322,6 +353,12 @@ calendar(void)
}
FreeEvent(head);
FreeCalBuffer(buf);
- pressanykey();
+ i = vmsg("請按 e 編輯行事曆,或其它任意鍵離開。");
+ i = tolower(((unsigned char)i) & 0xFF);
+ if (i == 'e')
+ {
+ u_editcalendar();
+ }
return 0;
}
+