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

Diff of /lbbs/src/article_post.c

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

Revision 1.3 by sysadm, Fri Jun 13 12:01:27 2025 UTC Revision 1.5 by sysadm, Fri Jun 13 13:39:46 2025 UTC
# Line 54  int article_post(SECTION_LIST *p_section Line 54  int article_post(SECTION_LIST *p_section
54                  moveto(21, 1);                  moveto(21, 1);
55                  prints("发表文章于 %s[%s] 讨论区", p_section->stitle, p_section->sname);                  prints("发表文章于 %s[%s] 讨论区", p_section->stitle, p_section->sname);
56                  moveto(22, 1);                  moveto(22, 1);
57                  prints("使用标题: %s", (title[0] == '\0' ? "[正在设定主题]" : title));                  prints("标题: %s", (title[0] == '\0' ? "[无]" : title));
58                  moveto(23, 1);                  moveto(23, 1);
59                  prints("使用第 %d 个签名", sign_id);                  prints("使用第 %d 个签名", sign_id);
60    
61                  if (toupper(ch) != 'T')                  if (toupper(ch) != 'T')
62                  {                  {
63                          prints("    按0~3选签名档");                          prints("    按0~3选签名档(0表示不使用)");
64    
65                          moveto(24, 1);                          moveto(24, 1);
66                          prints("T改标题, C取消, Enter继续: ");                          prints("T改标题, C取消, Enter继续: ");
67                          iflush();                          iflush();
68                          ch = 0;                          ch = 0;
69                  }                  }
# Line 85  int article_post(SECTION_LIST *p_section Line 85  int article_post(SECTION_LIST *p_section
85                                          ;                                          ;
86                                  *q = '\0';                                  *q = '\0';
87                                  len = q - p;                                  len = q - p;
   
88                                  if (*p != '\0')                                  if (*p != '\0')
89                                  {                                  {
90                                          memcpy(title, p, (size_t)len + 1);                                          memcpy(title, p, (size_t)len + 1);
91                                          memcpy(title_input, title, (size_t)len + 1);                                          memcpy(title_input, title, (size_t)len + 1);
92                                  }                                  }
93                                  if (title[0] != '\0') // title is valid                                  ch = 0;
                                 {  
                                         ch = 0;  
                                 }  
94                                  break;                                  break;
95                          case 'C':                          case 'C':
96                                  clearscr();                                  clearscr();
# Line 115  int article_post(SECTION_LIST *p_section Line 111  int article_post(SECTION_LIST *p_section
111                          break;                          break;
112                  }                  }
113    
114                  if (ch != CR)                  if (ch != CR || title[0] == '\0')
115                  {                  {
116                          continue;                          continue;
117                  }                  }
# Line 154  int article_post(SECTION_LIST *p_section Line 150  int article_post(SECTION_LIST *p_section
150                                  break;                                  break;
151                          }                          }
152                  }                  }
153    
154                    if (toupper(ch) != 'T')
155                    {
156                            break;
157                    }
158          }          }
159    
160          // editor_data_save(p_editor_data, p_data_new, data_new_len);          // editor_data_save(p_editor_data, p_data_new, data_new_len);
# Line 180  int article_modify(SECTION_LIST *p_secti Line 181  int article_modify(SECTION_LIST *p_secti
181                  log_error("article_cache_load(aid=%d, cid=%d) error\n", p_article->aid, p_article->cid);                  log_error("article_cache_load(aid=%d, cid=%d) error\n", p_article->aid, p_article->cid);
182                  return -2;                  return -2;
183          }          }
184    
185          p_editor_data = editor_data_load(cache.p_data);          p_editor_data = editor_data_load(cache.p_data);
186          if (p_editor_data == NULL)          if (p_editor_data == NULL)
187          {          {
188                  log_error("editor_data_load(aid=%d, cid=%d) error\n", p_article->aid, p_article->cid);                  log_error("editor_data_load(aid=%d, cid=%d) error\n", p_article->aid, p_article->cid);
189                  return -2;                  return -2;
190          }          }
191    
192          if (article_cache_unload(&cache) < 0)          if (article_cache_unload(&cache) < 0)
193          {          {
194                  log_error("article_cache_unload(aid=%d, cid=%d) error\n", p_article->aid, p_article->cid);                  log_error("article_cache_unload(aid=%d, cid=%d) error\n", p_article->aid, p_article->cid);
# Line 195  int article_modify(SECTION_LIST *p_secti Line 198  int article_modify(SECTION_LIST *p_secti
198          editor_display(p_editor_data);          editor_display(p_editor_data);
199    
200          // editor_data_save(p_editor_data, p_data_new, data_new_len);          // editor_data_save(p_editor_data, p_data_new, data_new_len);
201            log_common("Debug: modify article\n");
202    
203          editor_data_cleanup(p_editor_data);          editor_data_cleanup(p_editor_data);
204    
# Line 216  int article_reply(SECTION_LIST *p_sectio Line 220  int article_reply(SECTION_LIST *p_sectio
220                  log_error("article_cache_load(aid=%d, cid=%d) error\n", p_article->aid, p_article->cid);                  log_error("article_cache_load(aid=%d, cid=%d) error\n", p_article->aid, p_article->cid);
221                  return -2;                  return -2;
222          }          }
223    
224          p_editor_data = editor_data_load(cache.p_data);          p_editor_data = editor_data_load(cache.p_data);
225          if (p_editor_data == NULL)          if (p_editor_data == NULL)
226          {          {
227                  log_error("editor_data_load(aid=%d, cid=%d) error\n", p_article->aid, p_article->cid);                  log_error("editor_data_load(aid=%d, cid=%d) error\n", p_article->aid, p_article->cid);
228                  return -2;                  return -2;
229          }          }
230    
231          if (article_cache_unload(&cache) < 0)          if (article_cache_unload(&cache) < 0)
232          {          {
233                  log_error("article_cache_unload(aid=%d, cid=%d) error\n", p_article->aid, p_article->cid);                  log_error("article_cache_unload(aid=%d, cid=%d) error\n", p_article->aid, p_article->cid);
# Line 231  int article_reply(SECTION_LIST *p_sectio Line 237  int article_reply(SECTION_LIST *p_sectio
237          editor_display(p_editor_data);          editor_display(p_editor_data);
238    
239          // editor_data_save(p_editor_data, p_data_new, data_new_len);          // editor_data_save(p_editor_data, p_data_new, data_new_len);
240            log_common("Debug: reply article\n");
241    
242          editor_data_cleanup(p_editor_data);          editor_data_cleanup(p_editor_data);
243    


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

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