/[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.2 by sysadm, Sun Jun 15 04:47:59 2025 UTC Revision 1.5 by sysadm, Sat Jun 21 02:15:18 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>  #include <ctype.h>
# Line 40  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]: ");
# Line 49  int article_del(const SECTION_LIST *p_se Line 59  int article_del(const SECTION_LIST *p_se
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:
66                          igetch_reset();                          igetch_reset();
67                  case KEY_ESC:                  case KEY_ESC:
68                  case 'N':                  case 'N':
69                          goto cleanup;                          return 0;
70                  case 'Y':                  case 'Y':
71                          break;                          break;
72                  default: // Invalid selection                  default: // Invalid selection
# Line 63  int article_del(const SECTION_LIST *p_se Line 76  int article_del(const SECTION_LIST *p_se
76                  break;                  break;
77          }          }
78    
79            if (SYS_server_exit) // Do not save data on shutdown
80            {
81                    goto cleanup;
82            }
83    
84          db = db_open();          db = db_open();
85          if (db == NULL)          if (db == NULL)
86          {          {


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

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