/[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.21 by sysadm, Fri Jun 13 12:01:27 2025 UTC Revision 1.25 by sysadm, Sat Jun 14 13:33:48 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 236  static enum select_cmd_t section_list_se Line 237  static enum select_cmd_t section_list_se
237                                          (*p_page_id)++;                                          (*p_page_id)++;
238                                          *p_selected_index = 0;                                          *p_selected_index = 0;
239                                  }                                  }
240                                    else // end of last page
241                                    {
242                                            return CHANGE_PAGE; // force refresh pages
243                                    }
244                          }                          }
245                          else                          else
246                          {                          {
# Line 283  static int display_article_key_handler(i Line 288  static int display_article_key_handler(i
288                  if (section_topic_view_mode)                  if (section_topic_view_mode)
289                  {                  {
290                          snprintf(p_ctx->msg, sizeof(p_ctx->msg),                          snprintf(p_ctx->msg, sizeof(p_ctx->msg),
291                                           "| 返回[\033[32m←\033[33m,\033[32mESC\033[33m] | "                                           "| 返回[\033[32m←\033[33m,\033[32mESC\033[33m] "
292                                           "同主题阅读[\033[32m↑\033[33m/\033[32m↓\033[33m] | "                                           "同主题阅读[\033[32m↑\033[33m/\033[32m↓\033[33m] "
293                                           "模式[\033[32mp\033[33m] | 帮助[\033[32mh\033[33m] |");                                           "切换[\033[32mp\033[33m] 回复[\033[32mr\033[33m] 帮助[\033[32mh\033[33m] |");
294                  }                  }
295                  else                  else
296                  {                  {
297                          snprintf(p_ctx->msg, sizeof(p_ctx->msg),                          snprintf(p_ctx->msg, sizeof(p_ctx->msg),
298                                           "| 返回[\033[32m←\033[33m,\033[32mESC\033[33m] | "                                           "| 返回[\033[32m←\033[33m,\033[32mESC\033[33m] "
299                                           "移动[\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] "
300                                           "模式[\033[32mp\033[33m] | 帮助[\033[32mh\033[33m] |");                                           "切换[\033[32mp\033[33m] 回复[\033[32mr\033[33m] 帮助[\033[32mh\033[33m] |");
301                  }                  }
302                  *p_key = 0;                  *p_key = 0;
303                  break;                  break;
# Line 352  int section_list_display(const char *sna Line 357  int section_list_display(const char *sna
357          int ret;          int ret;
358          int loop;          int loop;
359          int direction;          int direction;
360            ARTICLE article_new;
361    
362          p_section = section_list_find_by_name(sname);          p_section = section_list_find_by_name(sname);
363          if (p_section == NULL)          if (p_section == NULL)
# Line 544  int section_list_display(const char *sna Line 550  int section_list_display(const char *sna
550                                          }                                          }
551                                          break;                                          break;
552                                  case 'r': // Reply article                                  case 'r': // Reply article
553                                          if (article_reply(p_section, p_articles[selected_index]) < 0)                                          if (article_reply(p_section, p_articles[selected_index], &article_new) < 0)
554                                          {                                          {
555                                                  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);
556                                          }                                          }
# Line 571  int section_list_display(const char *sna Line 577  int section_list_display(const char *sna
577                          }                          }
578                          break;                          break;
579                  case POST_ARTICLE:                  case POST_ARTICLE:
580                          if (article_post(p_section) < 0)                          ret = article_post(p_section, &article_new);
581                            if (ret < 0)
582                          {                          {
583                                  log_error("article_post(sid=%d, NEW) error\n", p_section->sid);                                  log_error("article_post(sid=%d, NEW) error\n", p_section->sid);
584                          }                          }
585                            else if (ret > 0) // New article posted
586                            {
587                                    ret = query_section_articles(p_section, page_id, p_articles, &article_count, &page_count);
588                                    if (ret < 0)
589                                    {
590                                            log_error("query_section_articles(sid=%d, page_id=%d) error\n", p_section->sid, page_id);
591                                            return -3;
592                                    }
593                            }
594                          if (section_list_draw_screen(sname, stitle, master_list, display_nickname) < 0)                          if (section_list_draw_screen(sname, stitle, master_list, display_nickname) < 0)
595                          {                          {
596                                  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 602  int section_list_display(const char *sna
602                          {                          {
603                                  break;                                  break;
604                          }                          }
605                          if (article_modify(p_section, p_articles[selected_index]) < 0)                          if (article_modify(p_section, p_articles[selected_index], &article_new) < 0)
606                          {                          {
607                                  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);
608                          }                          }


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

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