/[LeafOK_CVS]/fenglin/bbs/top_user.php
ViewVC logotype

Diff of /fenglin/bbs/top_user.php

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

Revision 1.2 by sysadm, Thu Jun 24 05:37:09 2004 UTC Revision 1.3 by sysadm, Sat Mar 1 08:43:29 2025 UTC
# Line 1  Line 1 
1  <?  <?
2          require_once "./session_init.inc.php";          require_once "./session_init.inc.php";
         require_once "./top_user_gen.inc.php";  
3  ?>  ?>
4  <?  <?
5          if ($_SESSION["BBS_uid"]==0)          if ($_SESSION["BBS_uid"]==0)
# Line 11  Line 10 
10  ?>  ?>
11  <html>  <html>
12  <head>  <head>
13  <meta http-equiv="Content-Type" content="text/html; charset=gb2312">  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
14  <title>Ô­´´ÅÅÐаñ</title>  <title>原创排行榜</title>
15  </head>  </head>
16  <body>  <body>
17  <p align="center">  <p align="center">
18  -----===== Ô­´´ÅÅÐаñ =====-----  -----===== 原创排行榜 =====-----
19  </p>  </p>
20  <?  <?
21          $cache_path = "../stat/top_user.txt";          $cache_path = "../stat/top_user.txt";
22          $use_cache = false;          $buffer = false;
23          if (file_exists($cache_path))          if (file_exists($cache_path))
24          {          {
25                  if (time() - filemtime($cache_path) < 60*60*8)                  if (time() - filemtime($cache_path) < 60*60*8)
26                  {                  {
27                          $use_cache = true;                          $buffer = file_get_contents($cache_path);
28                  }                  }
29          }          }
30          if (!$use_cache)          if ($buffer == false)
31          {          {
32                  $db_conn = include "./db_open.inc.php";                  $db_conn = include "./db_open.inc.php";
33    
34                  $buffer = top_user_gen($db_conn);                  ob_start();
35                  if (($fp=fopen($cache_path,"w")))                  include "top_user_gen.inc.php";
36                  {                  $buffer = ob_get_clean();
                         fwrite($fp,$buffer);  
                         fclose($fp);  
                 }  
                   
                 mysql_close($db_conn);  
         }  
37    
38          readfile($cache_path);                  file_put_contents($cache_path, $buffer);
39            }
40            echo $buffer;
41  ?>  ?>
42  </body>  </body>
43  </html>  </html>


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

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