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

Diff of /lbbs/src/section_list_display.c

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

Revision 1.54 by sysadm, Thu Oct 16 11:26:16 2025 UTC Revision 1.57 by sysadm, Sat Oct 25 13:09:42 2025 UTC
# Line 30  Line 30 
30  #include "section_list_loader.h"  #include "section_list_loader.h"
31  #include "screen.h"  #include "screen.h"
32  #include "str_process.h"  #include "str_process.h"
33    #include "user_info_display.h"
34  #include "user_priv.h"  #include "user_priv.h"
35  #include <string.h>  #include <string.h>
36  #include <time.h>  #include <time.h>
# Line 50  enum select_cmd_t Line 51  enum select_cmd_t
51          EDIT_ARTICLE,          EDIT_ARTICLE,
52          DELETE_ARTICLE,          DELETE_ARTICLE,
53          QUERY_ARTICLE,          QUERY_ARTICLE,
54            QUERY_USER,
55          SET_FAVOR_ARTICLE,          SET_FAVOR_ARTICLE,
56          UNSET_FAVOR_ARTICLE,          UNSET_FAVOR_ARTICLE,
57          FIRST_TOPIC_ARTICLE,          FIRST_TOPIC_ARTICLE,
# Line 262  static enum select_cmd_t section_list_se Line 264  static enum select_cmd_t section_list_se
264    
265                  switch (ch)                  switch (ch)
266                  {                  {
267                  case KEY_NULL:                   // broken pipe                  case KEY_NULL: // broken pipe
268                          log_error("KEY_NULL\n");                          log_error("KEY_NULL\n");
269                          return EXIT_SECTION;                          return EXIT_SECTION;
270                  case KEY_TIMEOUT:                  case KEY_TIMEOUT:
# Line 278  static enum select_cmd_t section_list_se Line 280  static enum select_cmd_t section_list_se
280                  case 'n':                  case 'n':
281                          return CHANGE_NAME_DISPLAY;                          return CHANGE_NAME_DISPLAY;
282                  case CR:                  case CR:
                         igetch_reset();  
283                  case 'r':                  case 'r':
284                  case KEY_RIGHT:                  case KEY_RIGHT:
285                          if (item_count > 0)                          if (item_count > 0)
# Line 306  static enum select_cmd_t section_list_se Line 307  static enum select_cmd_t section_list_se
307                                  return QUERY_ARTICLE;                                  return QUERY_ARTICLE;
308                          }                          }
309                          break;                          break;
310                    case Ctrl('A'):
311                            if (item_count > 0)
312                            {
313                                    return QUERY_USER;
314                            }
315                            break;
316                  case 'F':                  case 'F':
317                          if (item_count > 0)                          if (item_count > 0)
318                          {                          {
# Line 406  static enum select_cmd_t section_list_se Line 413  static enum select_cmd_t section_list_se
413                  case 'H':                  case 'H':
414                          return SHOW_TOP10;                          return SHOW_TOP10;
415                  default:                  default:
416                            break;
417                  }                  }
418    
419                  if (old_page_id != *p_page_id)                  if (old_page_id != *p_page_id)
# Line 549  int section_list_display(const char *sna Line 557  int section_list_display(const char *sna
557          ARTICLE article_new;          ARTICLE article_new;
558          int page_id_cur;          int page_id_cur;
559          const ARTICLE *p_article_locate;          const ARTICLE *p_article_locate;
560            USER_INFO user_info;
561    
562          p_section = section_list_find_by_name(sname);          p_section = section_list_find_by_name(sname);
563          if (p_section == NULL)          if (p_section == NULL)
# Line 943  int section_list_display(const char *sna Line 952  int section_list_display(const char *sna
952                                  return -2;                                  return -2;
953                          }                          }
954                          break;                          break;
955                    case QUERY_USER:
956                            if ((ret = query_user_info_by_uid(p_articles[selected_index]->uid, &user_info)) < 0)
957                            {
958                                    log_error("query_user_info_by_uid(uid=%d) error\n", p_articles[selected_index]->uid);
959                                    return -2;
960                            }
961                            else if (ret == 0)
962                            {
963                                    clearscr();
964                                    prints("该用户已升天");
965                                    press_any_key();
966                            }
967                            else if (user_info_display(&user_info) < 0) // && ret > 0
968                            {
969                                    log_error("user_info_display(uid=%d) error\n", p_articles[selected_index]->uid);
970                            }
971    
972                            if (section_list_draw_screen(sname, stitle, master_list, display_nickname) < 0)
973                            {
974                                    log_error("section_list_draw_screen() error\n");
975                                    return -2;
976                            }
977                            break;
978                  case SET_FAVOR_ARTICLE:                  case SET_FAVOR_ARTICLE:
979                          ret = article_favor_set(p_articles[selected_index]->tid == 0                          ret = article_favor_set(p_articles[selected_index]->tid == 0
980                                                                                  ? p_articles[selected_index]->aid                                                                                  ? p_articles[selected_index]->aid
# Line 1113  int section_list_ex_dir_display(SECTION_ Line 1145  int section_list_ex_dir_display(SECTION_
1145                                  }                                  }
1146                                  continue;                                  continue;
1147                          case CR:                          case CR:
                                 igetch_reset();  
1148                          default:                          default:
1149                                  switch (menu_control(&ex_menu_set, ch))                                  switch (menu_control(&ex_menu_set, ch))
1150                                  {                                  {


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

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