/[LeafOK_CVS]/lbbs/src/menu_proc.c
ViewVC logotype

Diff of /lbbs/src/menu_proc.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.30 by sysadm, Wed Jul 2 04:17:33 2025 UTC Revision 1.35 by sysadm, Mon Oct 13 07:35:48 2025 UTC
# Line 37  Line 37 
37    
38  int list_section(void *param)  int list_section(void *param)
39  {  {
40          section_list_display(param);          section_list_display(param, 0);
41    
42          return REDRAW;          return REDRAW;
43  }  }
# Line 141  int shutdown_bbs(void *param) Line 141  int shutdown_bbs(void *param)
141          return REDRAW;          return REDRAW;
142  }  }
143    
144  int favour_section_filter(void *param)  int favor_section_filter(void *param)
145  {  {
146          MENU_ITEM *p_menu_item = param;          MENU_ITEM *p_menu_item = param;
147    
# Line 211  int list_ex_section(void *param) Line 211  int list_ex_section(void *param)
211  {  {
212          SECTION_LIST *p_section;          SECTION_LIST *p_section;
213    
214          p_section = section_list_find_by_name(param);          p_section = section_list_find_by_name(param, NULL);
215          if (p_section == NULL)          if (p_section == NULL)
216          {          {
217                  log_error("Section %s not found\n", (const char *)param);                  log_error("Section %s not found\n", (const char *)param);
# Line 225  int list_ex_section(void *param) Line 225  int list_ex_section(void *param)
225    
226          return REDRAW;          return REDRAW;
227  }  }
228    
229    int show_top10_menu(void *param)
230    {
231            static int show_top10 = 0;
232            int ch = 0;
233    
234            if (show_top10)
235            {
236                    return NOREDRAW;
237            }
238            show_top10 = 1;
239            
240            clearscr();
241            show_top("", BBS_name, "");
242            show_bottom("");
243    
244            if (display_menu(&top10_menu) == 0)
245            {
246                    while (!SYS_server_exit)
247                    {
248                            iflush();
249                            ch = igetch(100);
250                            switch (ch)
251                            {
252                            case KEY_NULL: // broken pipe
253                                    show_top10 = 0;
254                                    return 0;
255                            case KEY_TIMEOUT:
256                                    if (time(NULL) - BBS_last_access_tm >= MAX_DELAY_TIME)
257                                    {
258                                            show_top10 = 0;
259                                            return 0;
260                                    }
261                                    continue;
262                            case CR:
263                                    igetch_reset();
264                            default:
265                                    switch (menu_control(&top10_menu, ch))
266                                    {
267                                    case EXITMENU:
268                                            ch = EXITMENU;
269                                            break;
270                                    case REDRAW:
271                                            clearscr();
272                                            show_bottom("");
273                                            display_menu(&top10_menu);
274                                            break;
275                                    case NOREDRAW:
276                                    case UNKNOWN_CMD:
277                                    default:
278                                            break;
279                                    }
280                            }
281    
282                            BBS_last_access_tm = time(NULL);
283    
284                            if (ch == EXITMENU)
285                            {
286                                    break;
287                            }
288                    }
289            }
290            
291            show_top10 = 0;
292            return REDRAW;
293    }
294    
295    int locate_article(void *param)
296    {
297            char buf[MAX_MENUITEM_NAME_LENGTH];
298            char *sname, *aid, *saveptr;
299    
300            strncpy(buf, param, sizeof(buf) - 1);
301            buf[sizeof(buf) - 1] = '\0';
302    
303            sname = strtok_r(buf, "|", &saveptr);
304            aid = strtok_r(NULL, "|", &saveptr);
305    
306            if (sname == NULL || aid == NULL)
307            {
308                    log_error("top10_locate(%s) error: invalid parameter\n", param);
309                    return NOREDRAW;
310            }
311    
312            section_list_display(sname, atoi(aid));
313    
314            return REDRAW;
315    }
316    
317    int favor_topic(void *param)
318    {
319            clearscr();
320            prints("此功能尚未实现");
321            press_any_key();
322    
323            return REDRAW;
324    }


Legend:
Removed lines/characters  
Changed lines/characters
  Added lines/characters

webmaster@leafok.com
ViewVC Help
Powered by ViewVC 1.3.0-beta1