--- lbbs/utils/bin/gen_top.php 2004/10/22 17:45:36 1.1 +++ lbbs/utils/bin/gen_top.php 2025/10/13 07:14:48 1.14 @@ -1,50 +1,92 @@ -#!/usr/local/bin/php -=10". - " and (bbs.sub_dt >= subdate(now(),interval '7' day))". - " order by bbs.excerption desc,bbs.view_count+bbs.reply_count desc,". - "bbs.transship limit 10",$db_conn); + $text_file_path = "../../var/bbs_top.txt"; + $menu_file_path = "../../var/bbs_top_menu.conf"; - i = 1; + $buffer_text = + " \033[1;34m-----\033[37m=====\033[41;37m 鏈珯鍗佸ぇ鐑棬璇濋 \033[40m=====\033[34m-----\033[m\r\n\r\n"; + + $buffer_screen = <<format("M d H:i:s"), + str_repeat(" ", 16 - strlen($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 .= << + mysqli_free_result($rs); + + mysqli_close($db_conn); + + $buffer_screen .= "%\n"; + $buffer_menu .= ("%\n" . $buffer_screen); + + file_put_contents($text_file_path, $buffer_text); + file_put_contents($menu_file_path, $buffer_menu);