/[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.32 by sysadm, Wed Apr 30 09:18:19 2025 UTC Revision 1.37 by sysadm, Fri May 9 11:21:11 2025 UTC
# Line 1  Line 1 
1  /***************************************************************************  /***************************************************************************
2                                                    bbs_main.c  -  description                                                    bbs_main.c  -  description
3                                                           -------------------                                                           -------------------
4          begin                : Mon Oct 18 2004          Copyright            : (C) 2004-2025 by Leaflet
5          copyright            : (C) 2004 by Leaflet          Email                : leaflet@leafok.com
         email                : leaflet@leafok.com  
6   ***************************************************************************/   ***************************************************************************/
7    
8  /***************************************************************************  /***************************************************************************
9   *                                                                         *   *                                                                         *
10   *   This program is free software; you can redistribute it and/or modify  *   *   This program is free software; you can redistribute it and/or modify  *
11   *   it under the terms of the GNU General Public License as published by  *   *   it under the terms of the GNU General Public License as published by  *
12   *   the Free Software Foundation; either version 2 of the License, or     *   *   the Free Software Foundation; either version 3 of the License, or     *
13   *   (at your option) any later version.                                   *   *   (at your option) any later version.                                   *
14   *                                                                         *   *                                                                         *
15   ***************************************************************************/   ***************************************************************************/
# Line 21  Line 20 
20  #include "login.h"  #include "login.h"
21  #include "user_priv.h"  #include "user_priv.h"
22  #include "common.h"  #include "common.h"
23    #include "database.h"
24  #include "log.h"  #include "log.h"
25  #include "io.h"  #include "io.h"
26  #include "screen.h"  #include "screen.h"
# Line 42  int bbs_info() Line 42  int bbs_info()
42    
43  int bbs_exit()  int bbs_exit()
44  {  {
45          char temp[256];          display_file_ex(DATA_GOODBYE, 1, 0);
   
         strcpy(temp, app_home_dir);  
         strcat(temp, "data/goodbye.txt");  
         display_file_ex(temp, 1, 0);  
46    
47          sleep(1);          sleep(1);
48    
# Line 55  int bbs_exit() Line 51  int bbs_exit()
51    
52  int bbs_center()  int bbs_center()
53  {  {
54          int ch, result, redraw;          int ch, redraw;
         char temp[256];  
55          time_t t_last_action;          time_t t_last_action;
56    
57          BBS_last_access_tm = t_last_action = time(0);          BBS_last_access_tm = t_last_action = time(0);
# Line 68  int bbs_center() Line 63  int bbs_center()
63          show_bottom("");          show_bottom("");
64          display_menu(get_menu(&bbs_menu, "TOPMENU"));          display_menu(get_menu(&bbs_menu, "TOPMENU"));
65    
66          while (!SYS_exit)          while (!SYS_server_exit)
67          {          {
68                  ch = igetch();                  ch = igetch(0);
69    
70                  if (time(0) - t_last_action >= 10)                  if (time(0) - t_last_action >= 10)
71                  {                  {
# Line 120  int bbs_center() Line 115  int bbs_center()
115    
116  int bbs_main()  int bbs_main()
117  {  {
         char temp[256];  
118          int ret;          int ret;
119    
120          set_input_echo(0);          set_input_echo(0);
# Line 139  int bbs_main() Line 133  int bbs_main()
133          clearscr();          clearscr();
134    
135          // BBS Top 10          // BBS Top 10
136          strcpy(temp, app_home_dir);          display_file_ex("./var/bbs_top.txt", 1, 1);
         strcat(temp, "data/bbs_top.txt");  
         display_file_ex(temp, 1, 1);  
137    
138          // Main          // Main
139          bbs_center();          bbs_center();
# Line 150  int bbs_main() Line 142  int bbs_main()
142          bbs_exit();          bbs_exit();
143          log_std("User logout\n");          log_std("User logout\n");
144    
145            MYSQL *db = db_open();
146            if (db == NULL)
147            {
148                    return -1;
149            }
150    
151            user_online_del(db);
152    
153            mysql_close(db);
154    
155          return 0;          return 0;
156  }  }


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

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