| 1 |
<? |
<?php |
| 2 |
require_once "../lib/common.inc.php"; |
require_once "../lib/common.inc.php"; |
| 3 |
require_once "../lib/db_open.inc.php"; |
require_once "../lib/db_open.inc.php"; |
| 4 |
require_once "../bbs/session_init.inc.php"; |
require_once "../bbs/session_init.inc.php"; |
| 5 |
require_once "../bbs/section_list.inc.php"; |
require_once "../bbs/section_list.inc.php"; |
| 6 |
require_once "../bbs/s_favor.inc.php"; |
require_once "../bbs/user_section_favor.inc.php"; |
| 7 |
require_once "./load_doc_list.inc.php"; |
require_once "./load_doc_list.inc.php"; |
| 8 |
|
|
| 9 |
|
$no_cache = (isset($_GET["cache"]) && $_GET["cache"] == "0"); |
| 10 |
|
|
| 11 |
$s_favor = new section_favorite($_SESSION["BBS_uid"], $db_conn); |
$s_favor = new section_favorite($_SESSION["BBS_uid"], $db_conn); |
| 12 |
|
|
| 13 |
// Load section list |
// Load section list |
| 16 |
$ret = load_section_list($section_hierachy, |
$ret = load_section_list($section_hierachy, |
| 17 |
function (array $section, array $filter_param) : bool |
function (array $section, array $filter_param) : bool |
| 18 |
{ |
{ |
| 19 |
if ($_SESSION["BBS_uid"] > 0) |
return ($section["recommend"] && |
| 20 |
{ |
$_SESSION["BBS_priv"]->checkpriv($section["SID"], S_LIST) && |
| 21 |
return ($section["recommend"] && |
($_SESSION["BBS_uid"] > 0 ? $filter_param["s_favor"]->is_in($section["SID"]) : true)); |
|
$_SESSION["BBS_priv"]->checkpriv($section["SID"], S_LIST) && |
|
|
$filter_param["s_favor"]->is_in($section["SID"])); |
|
|
} |
|
|
|
|
|
return $section["recommend"]; |
|
| 22 |
}, |
}, |
| 23 |
function (array $section, array $filter_param) : mixed |
function (array $section, array $filter_param) : mixed |
| 24 |
{ |
{ |
| 38 |
mysqli_close($db_conn); |
mysqli_close($db_conn); |
| 39 |
exit(json_encode($result_set)); |
exit(json_encode($result_set)); |
| 40 |
} |
} |
| 41 |
?> |
|
| 42 |
<html> |
echo <<<HTML |
| 43 |
<head> |
<html> |
| 44 |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
<head> |
| 45 |
<title><? echo $BBS_name; ?></title> |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
| 46 |
<link rel="stylesheet" href="css/default.css" type="text/css"> |
<title>{$BBS_name}</title> |
| 47 |
</head> |
<link rel="stylesheet" href="css/default.css" type="text/css"> |
| 48 |
<body> |
</head> |
| 49 |
<center> |
<body> |
| 50 |
<? |
<center> |
| 51 |
|
HTML; |
| 52 |
|
|
| 53 |
include "./head.inc.php"; |
include "./head.inc.php"; |
| 54 |
?> |
|
| 55 |
<table width="760" border="0" cellpadding="0" cellspacing="0"> |
echo <<<HTML |
| 56 |
<tr height=20 bgcolor=#F3F9FC> |
<table width="1050" border="0" cellpadding="0" cellspacing="0"> |
| 57 |
<td width="20"> </td> |
<tr height="25" bgcolor=#F3F9FC> |
| 58 |
<td><? echo $BBS_name; ?> >> 首页</td> |
<td width="20"> </td> |
| 59 |
<td width="20"> </td> |
<td>{$BBS_name} >> 首页</td> |
| 60 |
</tr> |
<td width="20"> </td> |
| 61 |
<tr> |
</tr> |
| 62 |
<td colspan=3 height=1 bgcolor=gray></td> |
<tr> |
| 63 |
</tr> |
<td colspan=3 height=1 bgcolor=gray></td> |
| 64 |
<tr height=5> |
</tr> |
| 65 |
<td> </td> |
<tr height=5> |
| 66 |
</tr> |
<td> </td> |
| 67 |
</table> |
</tr> |
| 68 |
<? |
</table> |
| 69 |
|
HTML; |
| 70 |
|
|
| 71 |
$cache_path = "../bbs/cache/www_doc_list_" . $_SESSION["BBS_uid"]; |
$cache_path = "../bbs/cache/www_doc_list_" . $_SESSION["BBS_uid"]; |
| 72 |
$buffer = false; |
$buffer = false; |
| 73 |
if (file_exists($cache_path)) |
if (!$no_cache && file_exists($cache_path)) |
| 74 |
{ |
{ |
| 75 |
if (filemtime($cache_path) >= time() - 3600) // refresh interval = 1 hour |
if (filemtime($cache_path) >= time() - 3600) // refresh interval = 1 hour |
| 76 |
{ |
{ |
| 80 |
if ($buffer == false) |
if ($buffer == false) |
| 81 |
{ |
{ |
| 82 |
ob_start(); |
ob_start(); |
|
?> |
|
|
<table width="760" border="0" cellpadding="0" cellspacing="0"> |
|
|
<tr> |
|
|
<td width="25%" align="left" valign="top"> |
|
|
<table width="100%" border="0" cellpadding="0" cellspacing="0"> |
|
|
<tr> |
|
|
<td class="td3"> |
|
|
<table width="100%" border="0" cellspacing="0" cellpadding="0"> |
|
|
<tr><td height=10></td></tr> |
|
|
<tr><td height=18>·<a href="../bbs/view_article.php?tn=portal&id=471914" target="_blank">中文编码及重要功能调整</a></td></tr> |
|
|
<tr><td height=18>·<a href="../bbs/view_article.php?tn=portal&id=328739" target="_blank">枫林在线网址变更公告</a></td></tr> |
|
|
<tr><td height=18>·<a href="../bbs/view_article.php?tn=portal&id=236535" target="_blank"><font color="red">本站开放源码查看服务</a></font></td></tr> |
|
|
<tr><td height=18>·<a href="../bbs/view_article.php?tn=portal&id=221947" target="_blank">系统密码验证机制调整</a></td></tr> |
|
|
<tr><td height=18>·<a href="../bbs/view_article.php?tn=portal&id=128430" target="_blank"><font color="red">枫林在线《精品导读》发布</font></a></td></tr> |
|
|
<tr><td height=10></td></tr> |
|
|
</table> |
|
|
</td> |
|
|
</tr> |
|
|
</table> |
|
|
</td> |
|
|
<td width="50%" align="center" valign="top"> |
|
|
<table width="95%" border="0" cellspacing="0" cellpadding="0"> |
|
|
<tr> |
|
|
<td class="alpha"><font color=brown><b><font size=3>本周导读</font></b></font></td> |
|
|
</tr> |
|
|
<tr><td bgcolor=gray height=1></td></tr> |
|
|
<? load_top(10, 58, $db_conn); ?> |
|
|
<tr><td></td></tr> |
|
|
</table> |
|
|
</td> |
|
|
<td width="25%" align="right" valign="top"> |
|
|
<table width="100%" border="0" cellpadding="0" cellspacing="0"> |
|
|
<tr class=title_bar_4><td>进入论坛</td></tr> |
|
|
<tr class=title_list><td height=8></td></tr> |
|
|
<tr class=title_list><td height=18 align="center"> |
|
|
<a href="/bbs/main.php" target="_blank">讨论区</a> |
|
|
<a href="/gen_ex/" target="_blank">精华区</a> |
|
|
</td></tr> |
|
|
<tr class=title_list><td height=8></td></tr> |
|
|
</table> |
|
|
</td> |
|
|
</tr> |
|
|
<tr height=5> |
|
|
<td> </td> |
|
|
</tr> |
|
|
</table> |
|
|
<table width="760" border="0" cellspacing="0" cellpadding="5"> |
|
|
<tr> |
|
|
<? |
|
|
$column = 0; |
|
|
$column_limit = 3; |
|
|
$style_count = 4; |
|
| 83 |
|
|
| 84 |
foreach ($section_hierachy as $c_index => $section_class) |
echo <<<HTML |
| 85 |
{ |
<table width="1050" border="0" cellpadding="0" cellspacing="0"> |
| 86 |
foreach ($section_class["sections"] as $s_index => $section) |
<tr> |
| 87 |
|
<td width="25%" align="left" valign="top"> |
| 88 |
|
<table width="100%" border="0" cellpadding="0" cellspacing="0"> |
| 89 |
|
<tr> |
| 90 |
|
<td class="td3"> |
| 91 |
|
<table width="100%" border="0" cellspacing="0" cellpadding="0"> |
| 92 |
|
<tr><td height=10></td></tr> |
| 93 |
|
<tr><td height=18>·<a href="../bbs/view_article.php?tn=portal&id=472079" target="_blank">调整各版块访问权限的通知</a></td></tr> |
| 94 |
|
<tr><td height=18>·<a href="../bbs/view_article.php?tn=portal&id=472069" target="_blank">Telnet版本新增重要功能</a></td></tr> |
| 95 |
|
<tr><td height=18>·<a href="../bbs/view_article.php?tn=portal&id=472059" target="_blank"><font color="red">时隔二十载,Telnet版终发布</font></a></td></tr> |
| 96 |
|
<tr><td height=18>·<a href="../bbs/view_article.php?tn=portal&id=472035" target="_blank">本站源码上传GitHub</a></td></tr> |
| 97 |
|
<tr><td height=18>·<a href="../bbs/view_article.php?tn=portal&id=472032" target="_blank"><font color="red">重要系统升级提示【2025-04-14】</font></a></td></tr> |
| 98 |
|
<tr><td height=10></td></tr> |
| 99 |
|
</table> |
| 100 |
|
</td> |
| 101 |
|
</tr> |
| 102 |
|
</table> |
| 103 |
|
</td> |
| 104 |
|
<td width="50%" align="center" valign="top"> |
| 105 |
|
<table width="95%" border="0" cellspacing="0" cellpadding="0"> |
| 106 |
|
<tr> |
| 107 |
|
<td class="alpha"><font color=brown><b><font size=3>本周导读</font></b></font></td> |
| 108 |
|
</tr> |
| 109 |
|
<tr><td bgcolor=gray height=1></td></tr> |
| 110 |
|
HTML; |
| 111 |
|
|
| 112 |
|
load_top(10, 60, $db_conn); |
| 113 |
|
|
| 114 |
|
echo <<<HTML |
| 115 |
|
<tr><td></td></tr> |
| 116 |
|
</table> |
| 117 |
|
</td> |
| 118 |
|
<td width="25%" align="right" valign="top"> |
| 119 |
|
<table width="100%" border="0" cellpadding="0" cellspacing="0"> |
| 120 |
|
<tr class=title_bar_4><td>进入论坛</td></tr> |
| 121 |
|
<tr class=title_list><td height=8></td></tr> |
| 122 |
|
<tr class=title_list><td height=18 align="center"> |
| 123 |
|
<a href="/bbs/main.php" target="_blank">讨论区</a> |
| 124 |
|
<a href="/gen_ex/" target="_blank">精华区</a> |
| 125 |
|
</td></tr> |
| 126 |
|
<tr class=title_list><td height=8></td></tr> |
| 127 |
|
</table> |
| 128 |
|
</td> |
| 129 |
|
</tr> |
| 130 |
|
<tr height="10"> |
| 131 |
|
<td> </td> |
| 132 |
|
</tr> |
| 133 |
|
</table> |
| 134 |
|
<table width="1050" border="0" cellspacing="0" cellpadding="5"> |
| 135 |
|
<tr> |
| 136 |
|
HTML; |
| 137 |
|
|
| 138 |
|
$column = 0; |
| 139 |
|
$column_limit = 3; |
| 140 |
|
$style_count = 4; |
| 141 |
|
|
| 142 |
|
foreach ($section_hierachy as $c_index => $section_class) |
| 143 |
{ |
{ |
| 144 |
if ($column % $column_limit == 0) |
foreach ($section_class["sections"] as $s_index => $section) |
| 145 |
{ |
{ |
| 146 |
?> |
if ($column % $column_limit == 0) |
| 147 |
</tr> |
{ |
| 148 |
</table> |
echo <<<HTML |
| 149 |
<table width="760" border="0" cellspacing="0" cellpadding="5"> |
</tr> |
| 150 |
<tr> |
</table> |
| 151 |
<? |
<table width="1050" border="0" cellspacing="0" cellpadding="5"> |
| 152 |
|
<tr> |
| 153 |
|
HTML; |
| 154 |
|
} |
| 155 |
|
|
| 156 |
|
|
| 157 |
|
echo <<<HTML |
| 158 |
|
<td width="33%" align="center" valign="top"> |
| 159 |
|
<table width="100%" border="0" cellspacing="0" cellpadding="1"> |
| 160 |
|
HTML; |
| 161 |
|
|
| 162 |
|
load_doc_list($section["sid"], 5, 40, $column % $style_count + 1, false, $db_conn); |
| 163 |
|
|
| 164 |
|
echo <<<HTML |
| 165 |
|
</table> |
| 166 |
|
</td> |
| 167 |
|
HTML; |
| 168 |
|
|
| 169 |
|
$column++; |
| 170 |
} |
} |
|
?> |
|
|
<td width="33%" align="center" valign="top"> |
|
|
<table width="100%" border="0" cellspacing="0" cellpadding="0"> |
|
|
<? load_doc_list($section["sid"], 5, 38, $column % $style_count + 1, false, $db_conn); ?> |
|
|
</table> |
|
|
</td> |
|
|
<? |
|
|
$column++; |
|
| 171 |
} |
} |
|
} |
|
| 172 |
|
|
| 173 |
for (; $column % $column_limit != 0; $column++) |
for (; $column % $column_limit != 0; $column++) |
| 174 |
{ |
{ |
| 175 |
?> |
echo <<<HTML |
| 176 |
<td width="33%" align="center" valign="top"> |
<td width="33%" align="center" valign="top"> |
| 177 |
</td> |
</td> |
| 178 |
<? |
HTML; |
| 179 |
} |
} |
| 180 |
?> |
|
| 181 |
<td width="1%"> |
if (count($section_hierachy) == 0) |
| 182 |
</td> |
{ |
| 183 |
</tr> |
echo <<<HTML |
| 184 |
</table> |
<td width="100%" align="center" valign="top"> |
| 185 |
<? |
没有收藏的版块,<a href="/bbs/user_section_favor.php" target=_blank>点击这里设定</a> |
| 186 |
|
</td> |
| 187 |
|
HTML; |
| 188 |
|
} |
| 189 |
|
|
| 190 |
|
echo <<<HTML |
| 191 |
|
</tr> |
| 192 |
|
</table> |
| 193 |
|
HTML; |
| 194 |
|
|
| 195 |
$buffer = ob_get_clean(); |
$buffer = ob_get_clean(); |
| 196 |
|
|
| 197 |
file_put_contents($cache_path, $buffer); |
file_put_contents($cache_path, $buffer); |
| 206 |
mysqli_close($db_conn); |
mysqli_close($db_conn); |
| 207 |
|
|
| 208 |
include "./foot.inc.php"; |
include "./foot.inc.php"; |
| 209 |
?> |
|
| 210 |
</center> |
echo <<<HTML |
| 211 |
</body> |
</center> |
| 212 |
</html> |
</body> |
| 213 |
|
</html> |
| 214 |
|
|
| 215 |
|
HTML; |