summaryrefslogtreecommitdiffstats
path: root/mbbsd
diff options
context:
space:
mode:
Diffstat (limited to 'mbbsd')
-rw-r--r--mbbsd/admin.c25
-rw-r--r--mbbsd/user.c3
2 files changed, 22 insertions, 6 deletions
diff --git a/mbbsd/admin.c b/mbbsd/admin.c
index c813b0e3..500d1c1e 100644
--- a/mbbsd/admin.c
+++ b/mbbsd/admin.c
@@ -790,14 +790,16 @@ x_file(void)
while (*v == ' ') v++;
if (strlen(fn) > 30)
strcpy(fn+30-2, "..");
- prints(" %3d. "
- ANSI_COLOR(1;32) "%-36.36s "
+ prints(" %3d. %s"
+ "%-36.36s "
ANSI_COLOR(0;1) "%-30.30s"
ANSI_RESET "\n",
- i+1, v, fn);
+ i+1,
+ dashf(fn) ? ANSI_COLOR(1;32) : ANSI_COLOR(1;30;40),
+ v, fn);
}
vfooter(" 編輯系統檔案 ",
- " 請按方向鍵或數字鍵選擇 (Enter/→)編輯\t(q/←)跳出");
+ " (jk/↑↓/0-9)移動 (Enter/→)編輯 (d)刪除 \t(q/←)跳出");
cursor_show(1+sel-page*rows, 0);
switch((i = vkey()))
{
@@ -816,13 +818,24 @@ x_file(void)
case 'j': case KEY_DOWN:
if (sel < centries-1) sel++; break;
+ case 'd':
+ strlcpy(buf, entries[sel], sizeof(buf));
+ v = strchr(buf, ' '); *v++ = 0;
+ i = getans("確定要刪除 %s 嗎? (y/N) ", v);
+ if (i == 'y')
+ unlink(buf);
+ vmsgf("系統檔案[%s]: %s", buf, !dashf(buf) ?
+ "刪除成功\ " : "未刪除");
+ break;
+
case '\n': case '\r': case KEY_RIGHT:
strlcpy(buf, entries[sel], sizeof(buf));
- v = strchr(buf, ' ');
- *v++ = 0;
+ v = strchr(buf, ' '); *v++ = 0;
i = vedit(buf, NA, NULL);
vmsgf("系統檔案[%s]: %s", buf, (i == -1) ?
"未改變" : "更新完畢");
+ break;
+
default:
if (i >= '0' && i <= '9')
{
diff --git a/mbbsd/user.c b/mbbsd/user.c
index b81143af..72e175a4 100644
--- a/mbbsd/user.c
+++ b/mbbsd/user.c
@@ -769,6 +769,7 @@ uinfo_query(userec_t *u, int adminmode, int unum)
if (getdata_str(y++, 0, "文章數目:", buf, 10, DOECHO, genbuf))
if ((tmp = atoi(buf)) >= 0)
x.numposts = tmp;
+#ifdef ASSESS
snprintf(genbuf, sizeof(genbuf), "%d", u->goodpost);
if (getdata_str(y++, 0, "優良文章數:", buf, 10, DOECHO, genbuf))
if ((tmp = atoi(buf)) >= 0)
@@ -777,6 +778,8 @@ uinfo_query(userec_t *u, int adminmode, int unum)
if (getdata_str(y++, 0, "惡劣文章數:", buf, 10, DOECHO, genbuf))
if ((tmp = atoi(buf)) >= 0)
x.badpost = tmp;
+#endif // ASSESS
+
snprintf(genbuf, sizeof(genbuf), "%d", u->vl_count);
if (getdata_str(y++, 0, "違法記錄:", buf, 10, DOECHO, genbuf))
if ((tmp = atoi(buf)) >= 0)