/[LeafOK_CVS]/lbbs/utils/bin/gen_top.php
ViewVC logotype

Diff of /lbbs/utils/bin/gen_top.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.2 by sysadm, Fri Oct 22 18:47:51 2004 UTC Revision 1.6 by sysadm, Sun Jul 10 02:36:22 2005 UTC
# Line 1  Line 1 
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;
# Line 16  Line 16 
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))
# Line 30  Line 30 
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                    
# Line 41  Line 41 
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);


Legend:
Removed lines/characters  
Changed lines/characters
  Added lines/characters

webmaster@leafok.com
ViewVC Help
Powered by ViewVC 1.3.0-beta1