--- lbbs/utils/bin/gen_top.php 2004/10/22 17:45:36 1.1 +++ lbbs/utils/bin/gen_top.php 2004/12/01 06:04:37 1.4 @@ -9,12 +9,12 @@ $cache_path = "../../data/bbs_top.txt"; $buffer = - " -----===== 全国十大热门话题 =====-----\r\n\r\n"; + " \033[1;34m-----\033[37m=====\033[41;37m 本站十大热门话题 \033[40m=====\033[34m-----\033[m\r\n\r\n"; $db_conn = include "./db_open.inc.php"; $rs = mysql_query( - " select bbs.title, sname, username". + " select bbs.title, sname, username, sub_dt". " from bbs inner join section_config on". " bbs.SID=section_config.SID inner join user_list on". " user_list.UID=bbs.UID where section_config.recommend". @@ -23,17 +23,18 @@ " order by bbs.excerption desc,bbs.view_count+bbs.reply_count desc,". "bbs.transship limit 10",$db_conn); - i = 1; - + $i = 1; while ($row=mysql_fetch_array($rs)) { - sprintf ($temp, - "第 %2d 名 版块 : [%s]%s%s%s\r\n". - " 标题 : %s%s\r\n", - i++, $row["sname"], str_repeat(" ", 36 - strlen($row["sname"])), - $row["username"], str_repeat(" ", 28 - strlen($row["username"])) + $buffer .= sprintf ( + " \033[1;37m第 \033[31m%2d \033[37m名 版块 : \033[33m%s%s \033[37m【\033[32m%s \033[37m】 \033[35m%s%s \r\n". + " \033[37m 标题 : \033[44;37m%s%s \033[0;40;37m\r\n", + $i++, $row["sname"], str_repeat(" ", 20 - strlen($row["sname"])), + strftime("%b %d %H:%M:%S", strtotime($row["sub_dt"])), + str_repeat(" ", 16 - strlen($row["username"])), + $row["username"], substr($row["title"],0,60), + str_repeat(" ", 60 - strlen($row["title"])) ); - $buffer.=$temp; } mysql_free_result($rs);