summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2005-07-26 09:58:52 +0800
committerpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2005-07-26 09:58:52 +0800
commitf691debbb8d669831feba1740ba0e6ac0d815cca (patch)
treec04364489ef3f6a15ef88494b00e3ce4c9034474
parent7cd7fa6b7e73d78325b745fbf3e3281872eec634 (diff)
downloadpttbbs-f691debbb8d669831feba1740ba0e6ac0d815cca.tar
pttbbs-f691debbb8d669831feba1740ba0e6ac0d815cca.tar.gz
pttbbs-f691debbb8d669831feba1740ba0e6ac0d815cca.tar.bz2
pttbbs-f691debbb8d669831feba1740ba0e6ac0d815cca.tar.lz
pttbbs-f691debbb8d669831feba1740ba0e6ac0d815cca.tar.xz
pttbbs-f691debbb8d669831feba1740ba0e6ac0d815cca.tar.zst
pttbbs-f691debbb8d669831feba1740ba0e6ac0d815cca.zip
- announce: multitag enhanced, tag-like behavior
- admin: registeration reject reasons, 'cause some users complained about strange return (?) git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2963 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--mbbsd/admin.c24
-rw-r--r--mbbsd/announce.c64
2 files changed, 70 insertions, 18 deletions
diff --git a/mbbsd/admin.c b/mbbsd/admin.c
index d1470a6e..f6aaff54 100644
--- a/mbbsd/admin.c
+++ b/mbbsd/admin.c
@@ -1049,6 +1049,7 @@ auto_scan(char fdata[][STRLEN], char ans[])
return 0;
}
+#define REJECT_REASONS (6)
/* 處理 Register Form */
int
scan_register_form(const char *regfile, int automode, int neednum)
@@ -1062,14 +1063,13 @@ scan_register_form(const char *regfile, int automode, int neednum)
"帳號", "身分證號", "真實姓名", "服務單位", "目前住址",
"連絡電話", "電子郵件信箱", NULL
};
- char *reason[] = {
+ char *reason[REJECT_REASONS+1] = {
"輸入真實姓名",
"詳填「(畢業)學校及『系』『級』」或「服務單位(含所屬縣市及職稱)」",
"填寫完整的住址資料 (含縣市名稱, 台北市請含行政區域)",
"詳填連絡電話 (含區域碼, 中間不用加 \"-\", \"(\", \")\"等符號",
"確實填寫註冊申請表",
"用中文填寫申請單",
- "輸入真實身分證字號",
NULL
};
char *autoid = "AutoScan";
@@ -1159,7 +1159,8 @@ scan_register_form(const char *regfile, int automode, int neednum)
ans[0] = 'd';
} else {
if (search_ulist(unum) == NULL)
- ans[0] = vmsg_lines(22, "是否接受此資料(Y/N/Q/Del/Skip)?[S])");
+ ans[0] = vmsg_lines(22,
+ "是否接受此資料(Y/N/Q/Del/Skip)?[S])");
else
ans[0] = 's';
if ('A' <= ans[0] && ans[0] <= 'Z')
@@ -1190,11 +1191,9 @@ scan_register_form(const char *regfile, int automode, int neednum)
}
case 'd':
break;
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
+ case '0': case '1': case '2':
+ case '3': case '4': case '5':
+ /* please confirm match REJECT_REASONS here */
case 'n':
if (ans[0] == 'n') {
for (n = 0; field[n]; n++)
@@ -1223,10 +1222,11 @@ scan_register_form(const char *regfile, int automode, int neednum)
fp = fopen(buf1, "w");
for(i = 0; buf[i] && i < sizeof(buf); i++){
- if (!isdigit((int)buf[i]))
- continue;
- fprintf(fp, "[退回原因] 請%s\n",
- reason[buf[i] - '0']);
+ if (buf[i] >= '0' && buf[i] < '0'+n)
+ {
+ fprintf(fp, "[退回原因] 請%s\n",
+ reason[buf[i] - '0']);
+ }
}
fclose(fp);
diff --git a/mbbsd/announce.c b/mbbsd/announce.c
index 4935b32d..83a55ac0 100644
--- a/mbbsd/announce.c
+++ b/mbbsd/announce.c
@@ -20,12 +20,30 @@ static int allocated_copyqueue = 0, used_copyqueue = 0, head_copyqueue = 0;
int copyqueue_testin(CopyQueue *pcq)
{
int i = 0;
- for (i = 0; i < used_copyqueue; i++)
+ for (i = head_copyqueue; i < used_copyqueue; i++)
if (strcmp(pcq->copyfile, copyqueue[i].copyfile) == 0)
return 1;
return 0;
}
+int copyqueue_locate(CopyQueue *pcq)
+{
+ int i = 0;
+ for (i = head_copyqueue; i < used_copyqueue; i++)
+ if (strcmp(pcq->copyfile, copyqueue[i].copyfile) == 0)
+ return i;
+ return -1;
+}
+
+int copyqueue_fileinqueue(const char *fn)
+{
+ int i = 0;
+ for (i = head_copyqueue; i < used_copyqueue; i++)
+ if (strcmp(fn, copyqueue[i].copyfile) == 0)
+ return 1;
+ return 0;
+}
+
void copyqueue_reset()
{
allocated_copyqueue = 0;
@@ -71,6 +89,31 @@ int copyqueue_append(CopyQueue *pcq)
return 1;
}
+int copyqueue_toggle(CopyQueue *pcq)
+{
+ int i = copyqueue_locate(pcq);
+ if(i >= 0)
+ {
+#if 0
+ if (getans("已標記過此檔,要取消標記嗎 [y/N]: ") != 'y')
+ return 1;
+#endif
+ /* remove it */
+ used_copyqueue --;
+ if(head_copyqueue > used_copyqueue)
+ head_copyqueue =used_copyqueue;
+ if (i < used_copyqueue)
+ {
+ memcpy(copyqueue + i, copyqueue+i+1,
+ sizeof(CopyQueue) * (used_copyqueue - i));
+ }
+ return 0;
+ } else {
+ copyqueue_append(pcq);
+ }
+ return 1;
+}
+
CopyQueue *copyqueue_gethead()
{
if( used_copyqueue <= 0 ||
@@ -101,7 +144,8 @@ a_copyitem(const char *fpath, const char *title, const char *owner, int mode)
if (owner)
strcpy(cq.copyowner, owner);
- copyqueue_append(&cq);
+ //copyqueue_append(&cq);
+ copyqueue_toggle(&cq);
if (mode && flFirstAlert) {
#if 0
move(b_lines-2, 0); clrtoeol();
@@ -154,6 +198,7 @@ a_showmenu(const menu_t * pm)
setadir(buf, pm->path);
a_loadname(pm);
for (n = 0; n < p_lines && pm->page + n < pm->num; n++) {
+ int flTagged = 0;
item = &pm->header[n];
title = item->title;
editor = item->owner;
@@ -161,11 +206,16 @@ a_showmenu(const menu_t * pm)
* Ptt 把時間改為取檔案時間 dtime = atoi(&item->filename[2]);
*/
snprintf(buf, sizeof(buf), "%s/%s", pm->path, item->filename);
+ if(copyqueue_querysize() > 0 && copyqueue_fileinqueue(buf))
+ {
+ flTagged = 1;
+ }
dtime = dasht(buf);
a_timestamp(buf, &dtime);
- prints("\n%6d%c %-47.46s%-13s[%s]", pm->page + n + 1,
+ prints("\n%6d%c%c%-47.46s%-13s[%s]", pm->page + n + 1,
(item->filemode & FILE_BM) ? 'X' :
(item->filemode & FILE_HIDE) ? ')' : '.',
+ flTagged ? 'c' : ' ',
title, editor,
buf);
}
@@ -178,8 +228,9 @@ a_showmenu(const menu_t * pm)
prints(
ANSI_COLOR(37;44) "【已標記 %d 個項目】"
ANSI_COLOR(31;47) " (h)" ANSI_COLOR(30) "說明 "
- ANSI_COLOR(31) "(p)" ANSI_COLOR(30) "貼上或重設標記 "
- ANSI_COLOR(31) "(a)" ANSI_COLOR(30) "附加至文章後 "
+ ANSI_COLOR(31) "(c)" ANSI_COLOR(30) "標記 "
+ ANSI_COLOR(31) "(p)" ANSI_COLOR(30) "貼上/取消/重設標記 "
+ ANSI_COLOR(31) "(a)" ANSI_COLOR(30) "附加至文章後 "
// ANSI_COLOR(31) "[注意]" ANSI_COLOR(30) "拷貝後才能刪除原文!"
ANSI_RESET , copyqueue_querysize());
}
@@ -260,7 +311,7 @@ a_showhelp(int level)
"[n/g/G] 收錄精華文章/開闢目錄/建立連線\n"
"[m/d/D] 移動/刪除文章/刪除一個範圍的文章\n"
"[f/T/e] 編輯標題符號/修改文章標題/內容\n"
- "[c/p/a] 精華區內 拷貝/貼上(可多篇)/附加單篇文章\n"
+ "[c/p/a] 精華區內 標記(複製)/貼上(可多篇)/附加單篇文章\n"
"[^P/^A] 貼上/附加精華區外已用't'標記文章\n");
}
if (level >= SYSOP) {
@@ -993,6 +1044,7 @@ a_menu(const char *maintitle, char *path, int lastlevel, char *trans_buffer)
}
break;
+ case 't':
case 'c':
if (me.now < me.num) {
if (!isvisible_man(&me))