| 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) |
| 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> |