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

Contents of /fenglin/www/home.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.21 - (show annotations)
Mon Apr 14 02:15:29 2025 UTC (11 months ago) by sysadm
Branch: MAIN
Changes since 1.20: +1 -1 lines
Update number of articles per section

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="760" border="0" cellpadding="0" cellspacing="0">
57 <tr height=20 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="760" 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=471914" target="_blank">中文编码及重要功能调整</a></td></tr>
92 <tr><td height=18>·<a href="../bbs/view_article.php?tn=portal&id=328739" target="_blank">枫林在线网址变更公告</a></td></tr>
93 <tr><td height=18>·<a href="../bbs/view_article.php?tn=portal&id=236535" target="_blank"><font color="red">本站开放源码查看服务</a></font></td></tr>
94 <tr><td height=18>·<a href="../bbs/view_article.php?tn=portal&id=221947" target="_blank">系统密码验证机制调整</a></td></tr>
95 <tr><td height=18>·<a href="../bbs/view_article.php?tn=portal&id=128430" target="_blank"><font color="red">枫林在线《精品导读》发布</font></a></td></tr>
96 <tr><td height=10></td></tr>
97 </table>
98 </td>
99 </tr>
100 </table>
101 </td>
102 <td width="50%" align="center" valign="top">
103 <table width="95%" border="0" cellspacing="0" cellpadding="0">
104 <tr>
105 <td class="alpha"><font color=brown><b><font size=3>本周导读</font></b></font></td>
106 </tr>
107 <tr><td bgcolor=gray height=1></td></tr>
108 <? load_top(10, 58, $db_conn); ?>
109 <tr><td></td></tr>
110 </table>
111 </td>
112 <td width="25%" align="right" valign="top">
113 <table width="100%" border="0" cellpadding="0" cellspacing="0">
114 <tr class=title_bar_4><td>进入论坛</td></tr>
115 <tr class=title_list><td height=8></td></tr>
116 <tr class=title_list><td height=18 align="center">
117 <a href="/bbs/main.php" target="_blank">讨论区</a>&nbsp;
118 <a href="/gen_ex/" target="_blank">精华区</a>
119 </td></tr>
120 <tr class=title_list><td height=8></td></tr>
121 </table>
122 </td>
123 </tr>
124 <tr height=5>
125 <td>&nbsp;</td>
126 </tr>
127 </table>
128 <table width="760" border="0" cellspacing="0" cellpadding="5">
129 <tr>
130 <?
131 $column = 0;
132 $column_limit = 3;
133 $style_count = 4;
134
135 foreach ($section_hierachy as $c_index => $section_class)
136 {
137 foreach ($section_class["sections"] as $s_index => $section)
138 {
139 if ($column % $column_limit == 0)
140 {
141 ?>
142 </tr>
143 </table>
144 <table width="760" border="0" cellspacing="0" cellpadding="5">
145 <tr>
146 <?
147 }
148 ?>
149 <td width="33%" align="center" valign="top">
150 <table width="100%" border="0" cellspacing="0" cellpadding="0">
151 <? load_doc_list($section["sid"], 5, 38, $column % $style_count + 1, false, $db_conn); ?>
152 </table>
153 </td>
154 <?
155 $column++;
156 }
157 }
158
159 for (; $column % $column_limit != 0; $column++)
160 {
161 ?>
162 <td width="33%" align="center" valign="top">
163 </td>
164 <?
165 }
166 ?>
167 <td width="1%">
168 </td>
169 </tr>
170 </table>
171 <?
172 $buffer = ob_get_clean();
173
174 file_put_contents($cache_path, $buffer);
175 }
176
177 echo $buffer;
178
179 // Cleanup
180 unset($s_favor);
181 unset($section_hierachy);
182
183 mysqli_close($db_conn);
184
185 include "./foot.inc.php";
186 ?>
187 </center>
188 </body>
189 </html>

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