diff options
author | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2008-04-13 14:31:38 +0800 |
---|---|---|
committer | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2008-04-13 14:31:38 +0800 |
commit | 7aa3580fa65b08c9032e8628c00c081ca1d1c9c3 (patch) | |
tree | 1b19e42e3fbd123cd15b98e033708397af28b84a | |
parent | cd394a56028c2e701545b79138077c78e21a0aed (diff) | |
download | pttbbs-7aa3580fa65b08c9032e8628c00c081ca1d1c9c3.tar pttbbs-7aa3580fa65b08c9032e8628c00c081ca1d1c9c3.tar.gz pttbbs-7aa3580fa65b08c9032e8628c00c081ca1d1c9c3.tar.bz2 pttbbs-7aa3580fa65b08c9032e8628c00c081ca1d1c9c3.tar.lz pttbbs-7aa3580fa65b08c9032e8628c00c081ca1d1c9c3.tar.xz pttbbs-7aa3580fa65b08c9032e8628c00c081ca1d1c9c3.tar.zst pttbbs-7aa3580fa65b08c9032e8628c00c081ca1d1c9c3.zip |
- add 'del' in admin x_file
- add ASSESS confitional compile blocks
Reported by watch@ptt/PttCurrent
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@4154 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r-- | mbbsd/admin.c | 25 | ||||
-rw-r--r-- | mbbsd/user.c | 3 |
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) |