| 1 |
#!/usr/local/bin/php |
#!/usr/local/php/bin/php |
| 2 |
<? |
<? |
| 3 |
if (!isset($_SERVER["argc"])) |
if (!isset($_SERVER["argc"])) |
| 4 |
$_SERVER["argc"] = 0; |
$_SERVER["argc"] = 0; |
| 16 |
$rs = mysql_query( |
$rs = mysql_query( |
| 17 |
" select bbs.title, sname, username, sub_dt". |
" select bbs.title, sname, username, sub_dt". |
| 18 |
" from bbs inner join section_config on". |
" from bbs inner join section_config on". |
| 19 |
" bbs.SID=section_config.SID inner join user_list on". |
" bbs.SID=section_config.SID where section_config.recommend". |
|
" user_list.UID=bbs.UID where section_config.recommend". |
|
| 20 |
" and bbs.TID=0 and bbs.visible and bbs.view_count>=10". |
" and bbs.TID=0 and bbs.visible and bbs.view_count>=10". |
| 21 |
" and (bbs.sub_dt >= subdate(now(),interval '7' day))". |
" and (bbs.sub_dt >= subdate(now(),interval '7' day))". |
| 22 |
" order by bbs.excerption desc,bbs.view_count+bbs.reply_count desc,". |
" order by bbs.excerption desc,bbs.view_count+bbs.reply_count desc,". |
| 23 |
"bbs.transship limit 10",$db_conn); |
"bbs.transship limit 10",$db_conn) |
| 24 |
|
or die ("Query data error"); |
| 25 |
|
|
| 26 |
$i = 1; |
$i = 1; |
| 27 |
while ($row=mysql_fetch_array($rs)) |
while ($row=mysql_fetch_array($rs)) |
| 30 |
" \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[1;37m第 \033[31m%2d \033[37m名 版块 : \033[33m%s%s \033[37m【\033[32m%s \033[37m】 \033[35m%s%s \r\n". |
| 31 |
" \033[37m 标题 : \033[44;37m%s%s \033[0;40;37m\r\n", |
" \033[37m 标题 : \033[44;37m%s%s \033[0;40;37m\r\n", |
| 32 |
$i++, $row["sname"], str_repeat(" ", 20 - strlen($row["sname"])), |
$i++, $row["sname"], str_repeat(" ", 20 - strlen($row["sname"])), |
| 33 |
strftime("%a %d %H:%M:%S", strtotime($row["sub_dt"])), |
strftime("%b %d %H:%M:%S", strtotime($row["sub_dt"])), |
| 34 |
str_repeat(" ", 16 - strlen($row["username"])), |
str_repeat(" ", 16 - strlen($row["username"])), |
| 35 |
$row["username"], substr($row["title"],0,60), |
$row["username"], substr($row["title"],0,60), |
| 36 |
str_repeat(" ", 60 - strlen($row["title"])) |
str_repeat(" ", 60 - strlen($row["title"]) >=0 ? 60 - strlen($row["title"]) : 0) |
| 37 |
); |
); |
| 38 |
} |
} |
| 39 |
|
|
| 41 |
|
|
| 42 |
mysql_close($db_conn); |
mysql_close($db_conn); |
| 43 |
|
|
|
$buffer .= "\r\n"; |
|
|
|
|
| 44 |
if (($fp=fopen($cache_path,"w"))) |
if (($fp=fopen($cache_path,"w"))) |
| 45 |
{ |
{ |
| 46 |
fwrite($fp,$buffer); |
fwrite($fp,$buffer); |