--- lbbs/src/bbs_main.c 2025/05/15 05:14:57 1.45 +++ lbbs/src/bbs_main.c 2025/05/15 14:34:13 1.48 @@ -150,10 +150,10 @@ int bbs_welcome(MYSQL *db) u_anonymous++; // Display logo - display_file(DATA_WELCOME); + display_file_ex(DATA_WELCOME, 1, 0); // Display welcome message - prints("\033[1;35m欢迎光临\033[33m 【 %s 】 \033[35mBBS\r\n" + prints("\r\033[1;35m欢迎光临\033[33m 【 %s 】 \033[35mBBS\r\n" "\033[32m目前上站人数 [\033[36m%d/%d\033[32m] " "匿名游客[\033[36m%d\033[32m] " "注册用户数[\033[36m%d/%d\033[32m]\r\n" @@ -172,10 +172,7 @@ int bbs_logout(MYSQL *db) return -1; } - if (display_file_ex(DATA_GOODBYE, 1, 0) < 0) - { - return -2; - } + display_file_ex(DATA_GOODBYE, 1, 0); log_std("User logout\n"); @@ -278,14 +275,22 @@ int bbs_main() clearscr(); // BBS Top 10 - if (display_file_ex("./var/bbs_top.txt", 1, 1) < 0) + display_file_ex("./var/bbs_top.txt", 1, 1); + + // Load menu in shared memory + if (load_menu_shm(p_bbs_menu) < 0) { - prints("无法加载本站十大\n"); + return -5; } // Main bbs_center(); + // Unload menu in shared memory + unload_menu_shm(p_bbs_menu); + free(p_bbs_menu); + p_bbs_menu = NULL; + // Logout bbs_logout(db);