/[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.55 by sysadm, Fri Oct 17 01:25:08 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 305  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 405  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 548  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 939  int section_list_display(const char *sna Line 949  int section_list_display(const char *sna
949                          if (section_list_draw_screen(sname, stitle, master_list, display_nickname) < 0)                          if (section_list_draw_screen(sname, stitle, master_list, display_nickname) < 0)
950                          {                          {
951                                  log_error("section_list_draw_screen() error\n");                                  log_error("section_list_draw_screen() error\n");
952                                    return -2;
953                            }
954                            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;                                  return -2;
976                          }                          }
977                          break;                          break;


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

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