--- lbbs/src/menu_proc.c 2025/07/02 04:17:33 1.30 +++ lbbs/src/menu_proc.c 2025/10/13 07:13:39 1.34 @@ -37,7 +37,7 @@ int list_section(void *param) { - section_list_display(param); + section_list_display(param, 0); return REDRAW; } @@ -141,7 +141,7 @@ int shutdown_bbs(void *param) return REDRAW; } -int favour_section_filter(void *param) +int favor_section_filter(void *param) { MENU_ITEM *p_menu_item = param; @@ -211,7 +211,7 @@ int list_ex_section(void *param) { SECTION_LIST *p_section; - p_section = section_list_find_by_name(param); + p_section = section_list_find_by_name(param, NULL); if (p_section == NULL) { log_error("Section %s not found\n", (const char *)param); @@ -225,3 +225,90 @@ int list_ex_section(void *param) return REDRAW; } + +int show_top10_menu(void *param) +{ + int ch = 0; + + clearscr(); + show_top("", BBS_name, ""); + show_bottom(""); + + if (display_menu(&top10_menu) == 0) + { + while (!SYS_server_exit) + { + iflush(); + ch = igetch(100); + switch (ch) + { + case KEY_NULL: // broken pipe + return 0; + case KEY_TIMEOUT: + if (time(NULL) - BBS_last_access_tm >= MAX_DELAY_TIME) + { + return 0; + } + continue; + case CR: + igetch_reset(); + default: + switch (menu_control(&top10_menu, ch)) + { + case EXITMENU: + ch = EXITMENU; + break; + case REDRAW: + clearscr(); + show_bottom(""); + display_menu(&top10_menu); + break; + case NOREDRAW: + case UNKNOWN_CMD: + default: + break; + } + } + + BBS_last_access_tm = time(NULL); + + if (ch == EXITMENU) + { + break; + } + } + } + + return REDRAW; +} + +int locate_article(void *param) +{ + char buf[MAX_MENUITEM_NAME_LENGTH]; + char *sname, *aid, *saveptr; + + strncpy(buf, param, sizeof(buf) - 1); + buf[sizeof(buf) - 1] = '\0'; + + sname = strtok_r(buf, "|", &saveptr); + aid = strtok_r(NULL, "|", &saveptr); + + if (sname == NULL || aid == NULL) + { + log_error("top10_locate(%s) error: invalid parameter\n", param); + return NOREDRAW; + } + + section_list_display(sname, atoi(aid)); + + return REDRAW; +} + +int favor_topic(void *param) +{ + clearscr(); + prints("此功能尚未实现"); + press_any_key(); + + return REDRAW; +}