--- lbbs/utils/bin/gen_top.php 2025/10/04 15:55:07 1.13 +++ lbbs/utils/bin/gen_top.php 2026/01/06 15:43:33 1.16 @@ -2,7 +2,7 @@ if (!isset($_SERVER["argc"])) { echo ("Invalid usage"); - exit(); + exit(-1); } chdir(dirname($_SERVER["argv"][0])); @@ -10,10 +10,26 @@ require_once "../lib/db_open.inc.php"; require_once "../lib/str_process.inc.php"; - $cache_path = "../../var/bbs_top.txt"; + $text_file_path = "../../var/bbs_top.txt"; + $menu_file_path = "../../var/bbs_top_menu.conf"; - $buffer = - " \033[1;34m-----\033[37m=====\033[41;37m 本站十大热门话题 \033[40m=====\033[34m-----\033[m\r\n\r\n"; + $buffer_text = + " \033[1;34m-----\033[37m=====\033[41;37m 本站十大热门话题 \033[40m=====\033[34m-----\033[m\n\n"; + + $buffer_screen = <<format("M d H:i:s"), str_repeat(" ", 16 - strlen($row["username"])), - $row["username"], + $row["username"] + ); + + $line_article = sprintf ( + " \033[1;37m 标题 : \033[44;37m%s%s \033[0;40;37m", $title_f, str_repeat(" ", 60 - str_length($title_f)) ); + + $buffer_text .= $line_section . "\n " . $line_article . "\n"; + + $buffer_screen .= $line_section . "\n\n"; + + $row_article = $i * 2 + 2; + + $buffer_menu .= <<