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

Diff of /lbbs/src/article_del.c

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

Revision 1.1 by sysadm, Sun Jun 15 04:45:13 2025 UTC Revision 1.7 by sysadm, Fri Oct 17 01:25:08 2025 UTC
# Line 16  Line 16 
16    
17  #include "article_del.h"  #include "article_del.h"
18  #include "database.h"  #include "database.h"
 #include "log.h"  
19  #include "io.h"  #include "io.h"
20    #include "log.h"
21  #include "screen.h"  #include "screen.h"
22  #include "user_priv.h"  #include "user_priv.h"
23    #include <ctype.h>
24  #include <stdlib.h>  #include <stdlib.h>
25    
26  int article_del(const SECTION_LIST *p_section, const ARTICLE *p_article)  int article_del(const SECTION_LIST *p_section, const ARTICLE *p_article)
# Line 39  int article_del(const SECTION_LIST *p_se Line 40  int article_del(const SECTION_LIST *p_se
40                  log_error("NULL pointer error\n");                  log_error("NULL pointer error\n");
41          }          }
42    
43            if (p_article->excerption) // Delete is not allowed
44            {
45                    clearscr();
46                    moveto(1, 1);
47                    prints("该文章无法被删除,请联系版主。");
48                    press_any_key();
49    
50                    return 0;
51            }
52    
53          clearscr();          clearscr();
54          moveto(1, 1);          moveto(1, 1);
55          prints("Ҫɾ£(Y), (N) [N]: ");          prints("真的要删除文章?(Y)是, (N)否 [N]: ");
56          iflush();          iflush();
57    
58          for (ch = 0; !SYS_server_exit; ch = igetch_t(MAX_DELAY_TIME))          for (ch = 0; !SYS_server_exit; ch = igetch_t(MAX_DELAY_TIME))
59          {          {
60                  switch (toupper(ch))                  switch (toupper(ch))
61                  {                  {
62                    case KEY_NULL:
63                    case KEY_TIMEOUT:
64                            goto cleanup;
65                  case CR:                  case CR:
                         igetch_reset();  
66                  case KEY_ESC:                  case KEY_ESC:
67                  case 'N':                  case 'N':
68                          goto cleanup;                          return 0;
69                  case 'Y':                  case 'Y':
70                          break;                          break;
71                  default: // Invalid selection                  default: // Invalid selection
# Line 62  int article_del(const SECTION_LIST *p_se Line 75  int article_del(const SECTION_LIST *p_se
75                  break;                  break;
76          }          }
77    
78            if (SYS_server_exit) // Do not save data on shutdown
79            {
80                    goto cleanup;
81            }
82    
83          db = db_open();          db = db_open();
84          if (db == NULL)          if (db == NULL)
85          {          {
# Line 117  int article_del(const SECTION_LIST *p_se Line 135  int article_del(const SECTION_LIST *p_se
135    
136                  clearscr();                  clearscr();
137                  moveto(1, 1);                  moveto(1, 1);
138                  prints("ѱɾԺˢб");                  prints("该文章已被删除,请稍后刷新列表。");
139                  press_any_key();                  press_any_key();
140    
141                  goto cleanup;                  goto cleanup;
# Line 127  int article_del(const SECTION_LIST *p_se Line 145  int article_del(const SECTION_LIST *p_se
145          {          {
146                  clearscr();                  clearscr();
147                  moveto(1, 1);                  moveto(1, 1);
148                  prints("޷ɾϵ");                  prints("该文章无法被删除,请联系版主。");
149                  press_any_key();                  press_any_key();
150    
151                  goto cleanup;                  goto cleanup;
# Line 211  int article_del(const SECTION_LIST *p_se Line 229  int article_del(const SECTION_LIST *p_se
229    
230          clearscr();          clearscr();
231          moveto(1, 1);          moveto(1, 1);
232          prints("ɾɹ%dˢб", BBS_section_list_load_interval);          prints("删除成功,请在%d秒后刷新列表。", BBS_section_list_load_interval);
233          press_any_key();          press_any_key();
234          ret = 1; // Success          ret = 1; // Success
235    


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

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