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

Diff of /lbbs/src/bbs_main.c

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

Revision 1.46 by sysadm, Thu May 15 06:24:11 2025 UTC Revision 1.52 by sysadm, Mon May 19 06:55:06 2025 UTC
# Line 150  int bbs_welcome(MYSQL *db) Line 150  int bbs_welcome(MYSQL *db)
150          u_anonymous++;          u_anonymous++;
151    
152          // Display logo          // Display logo
153          display_file(DATA_WELCOME);          display_file_ex(DATA_WELCOME, 1, 0);
154    
155          // Display welcome message          // Display welcome message
156          prints("\033[1;35m欢迎光临\033[33m 【 %s 】 \033[35mBBS\r\n"          prints("\r\033[1;35m欢迎光临\033[33m 【 %s 】 \033[35mBBS\r\n"
157                     "\033[32m目前上站人数 [\033[36m%d/%d\033[32m] "                     "\033[32m目前上站人数 [\033[36m%d/%d\033[32m] "
158                     "匿名游客[\033[36m%d\033[32m] "                     "匿名游客[\033[36m%d\033[32m] "
159                     "注册用户数[\033[36m%d/%d\033[32m]\r\n"                     "注册用户数[\033[36m%d/%d\033[32m]\r\n"
# Line 172  int bbs_logout(MYSQL *db) Line 172  int bbs_logout(MYSQL *db)
172                  return -1;                  return -1;
173          }          }
174    
175          if (display_file_ex(DATA_GOODBYE, 1, 0) < 0)          display_file_ex(DATA_GOODBYE, 1, 1);
         {  
                 return -2;  
         }  
176    
177          log_std("User logout\n");          log_std("User logout\n");
178    
# Line 195  int bbs_center() Line 192  int bbs_center()
192          show_active_board();          show_active_board();
193          show_bottom("");          show_bottom("");
194          display_menu(p_bbs_menu);          display_menu(p_bbs_menu);
195            iflush();
196    
197          while (!SYS_server_exit)          while (!SYS_server_exit)
198          {          {
199                  ch = igetch(100);                  ch = igetch(100);
200    
201                  if (time(0) - t_last_action >= 10)                  if (p_bbs_menu->choose_step == 0 && time(0) - t_last_action >= 10)
202                  {                  {
203                          t_last_action = time(0);                          t_last_action = time(0);
204    
205                          show_active_board();                          show_active_board();
206                          show_bottom("");                          show_bottom("");
207                            iflush();
208                  }                  }
209    
210                  switch (ch)                  switch (ch)
# Line 225  int bbs_center() Line 225  int bbs_center()
225                          case EXITBBS:                          case EXITBBS:
226                                  return 0;                                  return 0;
227                          case REDRAW:                          case REDRAW:
228                                    t_last_action = time(0);
229                                  clearscr();                                  clearscr();
230                                  show_top("");                                  show_top("");
231                                  show_active_board();                                  show_active_board();
# Line 236  int bbs_center() Line 237  int bbs_center()
237                          default:                          default:
238                                  break;                                  break;
239                          }                          }
240                            iflush();
241                  }                  }
242    
243                  BBS_last_access_tm = time(0);                  BBS_last_access_tm = time(0);
244          }          }
245    
# Line 278  int bbs_main() Line 281  int bbs_main()
281          clearscr();          clearscr();
282    
283          // BBS Top 10          // BBS Top 10
284          if (display_file_ex("./var/bbs_top.txt", 1, 1) < 0)          display_file_ex(VAR_BBS_TOP, 1, 1);
         {  
                 prints("无法加载本站十大\n");  
         }  
285    
286          // Load menu in shared memory          // Load menu in shared memory
287          if (load_menu_shm(p_bbs_menu) < 0)          if (load_menu_shm(p_bbs_menu) < 0)


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

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