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

Annotation of /fenglin/www/home.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.24 - (hide 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 sysadm 1.1 <?
2 sysadm 1.14 require_once "../lib/common.inc.php";
3 sysadm 1.12 require_once "../lib/db_open.inc.php";
4 sysadm 1.16 require_once "../bbs/session_init.inc.php";
5 sysadm 1.20 require_once "../bbs/section_list.inc.php";
6     require_once "../bbs/s_favor.inc.php";
7 sysadm 1.12 require_once "./load_doc_list.inc.php";
8 sysadm 1.20
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 sysadm 1.1 ?>
45     <html>
46     <head>
47 sysadm 1.8 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
48 sysadm 1.14 <title><? echo $BBS_name; ?></title>
49 sysadm 1.1 <link rel="stylesheet" href="css/default.css" type="text/css">
50     </head>
51     <body>
52     <center>
53     <?
54     include "./head.inc.php";
55     ?>
56 sysadm 1.22 <table width="1050" border="0" cellpadding="0" cellspacing="0">
57     <tr height="25" bgcolor=#F3F9FC>
58 sysadm 1.1 <td width="20">&nbsp;</td>
59 sysadm 1.14 <td><? echo $BBS_name; ?> &gt;&gt; 首页</td>
60 sysadm 1.1 <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 sysadm 1.20 <?
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 sysadm 1.22 <table width="1050" border="0" cellpadding="0" cellspacing="0">
84 sysadm 1.1 <tr>
85 sysadm 1.20 <td width="25%" align="left" valign="top">
86 sysadm 1.1 <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 sysadm 1.8 <tr><td height=10></td></tr>
91 sysadm 1.24 <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 sysadm 1.17 <tr><td height=18>·<a href="../bbs/view_article.php?tn=portal&id=471914" target="_blank">中文编码及重要功能调整</a></td></tr>
93 sysadm 1.24 <tr><td height=18>·<a href="../bbs/view_article.php?tn=portal&id=236535" target="_blank">本站开放源码查看服务</a></td></tr>
94 sysadm 1.8 <tr><td height=10></td></tr>
95 sysadm 1.1 </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 sysadm 1.20 <td class="alpha"><font color=brown><b><font size=3>本周导读</font></b></font></td>
104     </tr>
105 sysadm 1.1 <tr><td bgcolor=gray height=1></td></tr>
106 sysadm 1.22 <? load_top(10, 60, $db_conn); ?>
107 sysadm 1.18 <tr><td></td></tr>
108 sysadm 1.1 </table>
109     </td>
110 sysadm 1.4 <td width="25%" align="right" valign="top">
111 sysadm 1.1 <table width="100%" border="0" cellpadding="0" cellspacing="0">
112 sysadm 1.18 <tr class=title_bar_4><td>进入论坛</td></tr>
113 sysadm 1.4 <tr class=title_list><td height=8></td></tr>
114     <tr class=title_list><td height=18 align="center">
115 sysadm 1.8 <a href="/bbs/main.php" target="_blank">讨论区</a>&nbsp;
116     <a href="/gen_ex/" target="_blank">精华区</a>
117 sysadm 1.1 </td></tr>
118 sysadm 1.4 <tr class=title_list><td height=8></td></tr>
119 sysadm 1.1 </table>
120     </td>
121     </tr>
122 sysadm 1.22 <tr height="10">
123 sysadm 1.1 <td>&nbsp;</td>
124     </tr>
125     </table>
126 sysadm 1.22 <table width="1050" border="0" cellspacing="0" cellpadding="5">
127 sysadm 1.20 <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 sysadm 1.18 </tr>
141     </table>
142 sysadm 1.22 <table width="1050" border="0" cellspacing="0" cellpadding="5">
143 sysadm 1.20 <tr>
144     <?
145     }
146     ?>
147     <td width="33%" align="center" valign="top">
148 sysadm 1.23 <table width="100%" border="0" cellspacing="0" cellpadding="1">
149 sysadm 1.22 <? load_doc_list($section["sid"], 5, 40, $column % $style_count + 1, false, $db_conn); ?>
150 sysadm 1.20 </table>
151     </td>
152     <?
153     $column++;
154 sysadm 1.23
155     if ($column % $column_limit == 0)
156     {
157     ?>
158     <td width="1%">
159     </td>
160     <?
161     }
162 sysadm 1.20 }
163     }
164    
165 sysadm 1.23 for (; $column % $column_limit != 0;)
166 sysadm 1.20 {
167     ?>
168     <td width="33%" align="center" valign="top">
169     </td>
170     <?
171 sysadm 1.23 $column++;
172    
173     if ($column % $column_limit == 0)
174     {
175 sysadm 1.20 ?>
176     <td width="1%">
177     </td>
178 sysadm 1.23 <?
179     }
180     }
181     ?>
182 sysadm 1.1 </tr>
183     </table>
184     <?
185 sysadm 1.20 $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 sysadm 1.1 include "./foot.inc.php";
199     ?>
200     </center>
201     </body>
202     </html>

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