/[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.20 by sysadm, Thu Jun 12 12:14:28 2025 UTC Revision 1.24 by sysadm, Sat Jun 14 09:20:13 2025 UTC
# Line 140  static int section_list_draw_screen(cons Line 140  static int section_list_draw_screen(cons
140          show_top(str_section_master, stitle, str_section_name);          show_top(str_section_master, stitle, str_section_name);
141          moveto(2, 0);          moveto(2, 0);
142          prints("返回[\033[1;32m←\033[0;37m,\033[1;32mESC\033[0;37m] 选择[\033[1;32m↑\033[0;37m,\033[1;32m↓\033[0;37m] "          prints("返回[\033[1;32m←\033[0;37m,\033[1;32mESC\033[0;37m] 选择[\033[1;32m↑\033[0;37m,\033[1;32m↓\033[0;37m] "
143                     "阅读[\033[1;32m→\033[0;37m,\033[1;32mENTER\033[0;37m]\033[m %s[\033[1;32mn\033[0;37m]\033[m",                     "阅读[\033[1;32m→\033[0;37m,\033[1;32mENTER\033[0;37m] 发表[\033[1;32mCtrl-P\033[0;37m] "
144                       "修改[\033[1;32mE\033[0;37m] %s[\033[1;32mn\033[0;37m]\033[m",
145                     (display_nickname ? "显示用户名" : "显示昵称"));                     (display_nickname ? "显示用户名" : "显示昵称"));
146          moveto(3, 0);          moveto(3, 0);
147          if (display_nickname)          if (display_nickname)
# Line 283  static int display_article_key_handler(i Line 284  static int display_article_key_handler(i
284                  if (section_topic_view_mode)                  if (section_topic_view_mode)
285                  {                  {
286                          snprintf(p_ctx->msg, sizeof(p_ctx->msg),                          snprintf(p_ctx->msg, sizeof(p_ctx->msg),
287                                           "| 返回[\033[32m←\033[33m,\033[32mESC\033[33m] | "                                           "| 返回[\033[32m←\033[33m,\033[32mESC\033[33m] "
288                                           "同主题阅读[\033[32m↑\033[33m/\033[32m↓\033[33m] | "                                           "同主题阅读[\033[32m↑\033[33m/\033[32m↓\033[33m] "
289                                           "模式[\033[32mp\033[33m] | 帮助[\033[32mh\033[33m] |");                                           "切换[\033[32mp\033[33m] 回复[\033[32mr\033[33m] 帮助[\033[32mh\033[33m] |");
290                  }                  }
291                  else                  else
292                  {                  {
293                          snprintf(p_ctx->msg, sizeof(p_ctx->msg),                          snprintf(p_ctx->msg, sizeof(p_ctx->msg),
294                                           "| 返回[\033[32m←\033[33m,\033[32mESC\033[33m] | "                                           "| 返回[\033[32m←\033[33m,\033[32mESC\033[33m] "
295                                           "移动[\033[32m↑\033[33m/\033[32m↓\033[33m/\033[32mPgUp\033[33m/\033[32mPgDn\033[33m] | "                                           "移动[\033[32m↑\033[33m/\033[32m↓\033[33m/\033[32mPgUp\033[33m/\033[32mPgDn\033[33m] "
296                                           "模式[\033[32mp\033[33m] | 帮助[\033[32mh\033[33m] |");                                           "切换[\033[32mp\033[33m] 回复[\033[32mr\033[33m] 帮助[\033[32mh\033[33m] |");
297                  }                  }
298                  *p_key = 0;                  *p_key = 0;
299                  break;                  break;
# Line 352  int section_list_display(const char *sna Line 353  int section_list_display(const char *sna
353          int ret;          int ret;
354          int loop;          int loop;
355          int direction;          int direction;
356            ARTICLE article_new;
357    
358          p_section = section_list_find_by_name(sname);          p_section = section_list_find_by_name(sname);
359          if (p_section == NULL)          if (p_section == NULL)
# Line 544  int section_list_display(const char *sna Line 546  int section_list_display(const char *sna
546                                          }                                          }
547                                          break;                                          break;
548                                  case 'r': // Reply article                                  case 'r': // Reply article
549                                          if (article_post(p_section, p_articles[selected_index], ARTICLE_POST_REPLY) < 0)                                          if (article_reply(p_section, p_articles[selected_index], &article_new) < 0)
550                                          {                                          {
551                                                  log_error("article_post(aid=%d, REPLY) error\n", p_articles[selected_index]->aid);                                                  log_error("article_post(aid=%d, REPLY) error\n", p_articles[selected_index]->aid);
552                                          }                                          }
# Line 571  int section_list_display(const char *sna Line 573  int section_list_display(const char *sna
573                          }                          }
574                          break;                          break;
575                  case POST_ARTICLE:                  case POST_ARTICLE:
576                          if (article_post(p_section, NULL, ARTICLE_POST_NEW) < 0)                          ret = article_post(p_section, &article_new);
577                            if (ret < 0)
578                          {                          {
579                                  log_error("article_post(sid=%d, NEW) error\n", p_section->sid);                                  log_error("article_post(sid=%d, NEW) error\n", p_section->sid);
580                          }                          }
581                            else if (ret > 0) // New article posted
582                            {
583                                    ret = query_section_articles(p_section, page_id, p_articles, &article_count, &page_count);
584                                    if (ret < 0)
585                                    {
586                                            log_error("query_section_articles(sid=%d, page_id=%d) error\n", p_section->sid, page_id);
587                                            return -3;
588                                    }
589                            }
590                          if (section_list_draw_screen(sname, stitle, master_list, display_nickname) < 0)                          if (section_list_draw_screen(sname, stitle, master_list, display_nickname) < 0)
591                          {                          {
592                                  log_error("section_list_draw_screen() error\n");                                  log_error("section_list_draw_screen() error\n");
# Line 586  int section_list_display(const char *sna Line 598  int section_list_display(const char *sna
598                          {                          {
599                                  break;                                  break;
600                          }                          }
601                          if (article_post(p_section, p_articles[selected_index], ARTICLE_POST_EDIT) < 0)                          if (article_modify(p_section, p_articles[selected_index], &article_new) < 0)
602                          {                          {
603                                  log_error("article_post(aid=%d, EDIT) error\n", p_articles[selected_index]->aid);                                  log_error("article_post(aid=%d, EDIT) error\n", p_articles[selected_index]->aid);
604                          }                          }


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

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