/[LeafOK_CVS]/fenglin/www/home.php
ViewVC logotype

Contents of /fenglin/www/home.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.24 - (show annotations)
Mon Apr 14 13:14:49 2025 UTC (11 months ago) by sysadm
Branch: MAIN
Changes since 1.23: +2 -4 lines
Update links

1 <?
2 require_once "../lib/common.inc.php";
3 require_once "../lib/db_open.inc.php";
4 require_once "../bbs/session_init.inc.php";
5 require_once "../bbs/section_list.inc.php";
6 require_once "../bbs/s_favor.inc.php";
7 require_once "./load_doc_list.inc.php";
8
9 $s_favor = new section_favorite($_SESSION["BBS_uid"], $db_conn);
10
11 // Load section list
12 $section_hierachy = array();
13
14 $ret = load_section_list($section_hierachy,
15 function (array $section, array $filter_param) : bool
16 {
17 if ($_SESSION["BBS_uid"] > 0)
18 {
19 return ($section["recommend"] &&
20 $_SESSION["BBS_priv"]->checkpriv($section["SID"], S_LIST) &&
21 $filter_param["s_favor"]->is_in($section["SID"]));
22 }
23
24 return $section["recommend"];
25 },
26 function (array $section, array $filter_param) : mixed
27 {
28 return null;
29 },
30 $db_conn,
31 array(
32 "s_favor" => $s_favor,
33 )
34 );
35
36 if ($ret == false)
37 {
38 $result_set["return"]["code"] = -2;
39 $result_set["return"]["message"] = "Query section error: " . mysqli_error($db_conn);
40
41 mysqli_close($db_conn);
42 exit(json_encode($result_set));
43 }
44 ?>
45 <html>
46 <head>
47 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
48 <title><? echo $BBS_name; ?></title>
49 <link rel="stylesheet" href="css/default.css" type="text/css">
50 </head>
51 <body>
52 <center>
53 <?
54 include "./head.inc.php";
55 ?>
56 <table width="1050" border="0" cellpadding="0" cellspacing="0">
57 <tr height="25" bgcolor=#F3F9FC>
58 <td width="20">&nbsp;</td>
59 <td><? echo $BBS_name; ?> &gt;&gt; 首页</td>
60 <td width="20">&nbsp;</td>
61 </tr>
62 <tr>
63 <td colspan=3 height=1 bgcolor=gray></td>
64 </tr>
65 <tr height=5>
66 <td>&nbsp;</td>
67 </tr>
68 </table>
69 <?
70 $cache_path = "../bbs/cache/www_doc_list_" . $_SESSION["BBS_uid"];
71 $buffer = false;
72 if (file_exists($cache_path))
73 {
74 if (filemtime($cache_path) >= time() - 3600) // refresh interval = 1 hour
75 {
76 $buffer = file_get_contents($cache_path);
77 }
78 }
79 if ($buffer == false)
80 {
81 ob_start();
82 ?>
83 <table width="1050" border="0" cellpadding="0" cellspacing="0">
84 <tr>
85 <td width="25%" align="left" valign="top">
86 <table width="100%" border="0" cellpadding="0" cellspacing="0">
87 <tr>
88 <td class="td3">
89 <table width="100%" border="0" cellspacing="0" cellpadding="0">
90 <tr><td height=10></td></tr>
91 <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>
92 <tr><td height=18>·<a href="../bbs/view_article.php?tn=portal&id=471914" target="_blank">中文编码及重要功能调整</a></td></tr>
93 <tr><td height=18>·<a href="../bbs/view_article.php?tn=portal&id=236535" target="_blank">本站开放源码查看服务</a></td></tr>
94 <tr><td height=10></td></tr>
95 </table>
96 </td>
97 </tr>
98 </table>
99 </td>
100 <td width="50%" align="center" valign="top">
101 <table width="95%" border="0" cellspacing="0" cellpadding="0">
102 <tr>
103 <td class="alpha"><font color=brown><b><font size=3>本周导读</font></b></font></td>
104 </tr>
105 <tr><td bgcolor=gray height=1></td></tr>
106 <? load_top(10, 60, $db_conn); ?>
107 <tr><td></td></tr>
108 </table>
109 </td>
110 <td width="25%" align="right" valign="top">
111 <table width="100%" border="0" cellpadding="0" cellspacing="0">
112 <tr class=title_bar_4><td>进入论坛</td></tr>
113 <tr class=title_list><td height=8></td></tr>
114 <tr class=title_list><td height=18 align="center">
115 <a href="/bbs/main.php" target="_blank">讨论区</a>&nbsp;
116 <a href="/gen_ex/" target="_blank">精华区</a>
117 </td></tr>
118 <tr class=title_list><td height=8></td></tr>
119 </table>
120 </td>
121 </tr>
122 <tr height="10">
123 <td>&nbsp;</td>
124 </tr>
125 </table>
126 <table width="1050" border="0" cellspacing="0" cellpadding="5">
127 <tr>
128 <?
129 $column = 0;
130 $column_limit = 3;
131 $style_count = 4;
132
133 foreach ($section_hierachy as $c_index => $section_class)
134 {
135 foreach ($section_class["sections"] as $s_index => $section)
136 {
137 if ($column % $column_limit == 0)
138 {
139 ?>
140 </tr>
141 </table>
142 <table width="1050" border="0" cellspacing="0" cellpadding="5">
143 <tr>
144 <?
145 }
146 ?>
147 <td width="33%" align="center" valign="top">
148 <table width="100%" border="0" cellspacing="0" cellpadding="1">
149 <? load_doc_list($section["sid"], 5, 40, $column % $style_count + 1, false, $db_conn); ?>
150 </table>
151 </td>
152 <?
153 $column++;
154
155 if ($column % $column_limit == 0)
156 {
157 ?>
158 <td width="1%">
159 </td>
160 <?
161 }
162 }
163 }
164
165 for (; $column % $column_limit != 0;)
166 {
167 ?>
168 <td width="33%" align="center" valign="top">
169 </td>
170 <?
171 $column++;
172
173 if ($column % $column_limit == 0)
174 {
175 ?>
176 <td width="1%">
177 </td>
178 <?
179 }
180 }
181 ?>
182 </tr>
183 </table>
184 <?
185 $buffer = ob_get_clean();
186
187 file_put_contents($cache_path, $buffer);
188 }
189
190 echo $buffer;
191
192 // Cleanup
193 unset($s_favor);
194 unset($section_hierachy);
195
196 mysqli_close($db_conn);
197
198 include "./foot.inc.php";
199 ?>
200 </center>
201 </body>
202 </html>

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