/[LeafOK_CVS]/fenglin/bbs/themes/default/list.view.php
ViewVC logotype

Contents of /fenglin/bbs/themes/default/list.view.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.23 - (show annotations)
Wed Jan 21 13:39:25 2026 UTC (7 weeks, 6 days ago) by sysadm
Branch: MAIN
CVS Tags: HEAD
Changes since 1.22: +1 -1 lines
Error occurred while calculating annotation data.
Apply advanced search (v2)

1 <?php
2 // Prevent load standalone
3 if (!isset($result_set))
4 {
5 exit();
6 }
7
8 require_once "../lib/lml.inc.php";
9 require_once "../lib/str_process.inc.php";
10
11 function pic_file(string $status) : string
12 {
13 switch(strtoupper($status))
14 {
15 case "H":
16 $file = "hotclosed.gif";
17 break;
18 case "M":
19 $file = "hotfolder.gif";
20 break;
21 case "G":
22 $file = "star.gif";
23 break;
24 case "B":
25 $file = "settop.gif";
26 break;
27 default:
28 $file = "closed.gif";
29 }
30
31 return($file);
32 }
33
34 $section_scope = ($result_set["data"]["ex"] ? "文摘区" : "讨论区");
35
36 $css_file = get_theme_file('css/default');
37
38 $top_right_info = "";
39 if ($_SESSION["BBS_uid"] == 0)
40 {
41 $top_right_info .= <<<HTML
42 [<a class="s2" href="index.php?redir={$result_set['data']['redir']}">登录</a>]
43 HTML;
44 }
45 else
46 {
47 if ($_SESSION["BBS_new_msg"] > 0)
48 {
49 $top_right_info .= <<<HTML
50 [<a class="s6" href="msg_read.php" target="_blank">{$_SESSION["BBS_new_msg"]}条新消息</a>]
51 HTML;
52 }
53
54 $top_right_info .= <<<HTML
55 欢迎回来&nbsp;<font color="blue">{$_SESSION["BBS_username"]}</font>
56 [<a class="s6" href="logout.php">退出</a>]
57 HTML;
58 }
59
60 $section_master_info = "";
61 foreach ($result_set["data"]["section_masters"] as $master)
62 {
63 $img_src = ($master["major"] ? "master_major.gif" : "master_minor.gif");
64 $img_alt = ($master["major"] ? "正版主" : "副版主");
65
66 $section_master_info .= <<<HTML
67 <img src="images/{$img_src}" width="12" height="11" alt="{$img_alt}"><a class="s3" href="view_user.php?uid={$master['uid']}" target="_blank" title="查看版主资料">{$master["username"]}</a>&nbsp;&nbsp;
68 HTML;
69 }
70
71 $announcement_info = "";
72 if ($result_set["data"]["announcement"] != "")
73 {
74 $annoucement = LML($result_set["data"]["announcement"], 100);
75
76 $announcement_info .= <<<HTML
77 <tr>
78 <td class="dark"><img src="images/announce.gif" width="18" height="18" alt="本版公告"></td>
79 <td class="head">
80 <pre class="announcement">{$annoucement}</pre>
81 </td>
82 </tr>
83 HTML;
84 }
85
86 $article_op_bar = "";
87 if ($_SESSION["BBS_priv"]->checkpriv($result_set["data"]["sid"], S_POST))
88 {
89 $article_op_bar .= <<<HTML
90 <a class="s4" href="article_post.php?sid={$result_set['data']['sid']}" title="发表新文章">发帖</a>&nbsp;
91 HTML;
92 }
93
94 $scope_switch = ($result_set["data"]["ex"] ? "讨论区" : "文摘区");
95 $reply_switch = ($result_set["data"]["reply"] ? "主题" : "普通");
96
97 $article_op_bar .= <<<HTML
98 <a class="s4" href="" onclick="return ch_ex({$result_set['data']['ex']} ? 0 : 1)" title="切换">{$scope_switch}</a>&nbsp;
99 <a class="s4" href="/gen_ex/{$result_set['data']['sid']}/" title="浏览本版块精华区" target=_blank>精华区</a>&nbsp;
100 <a class="s4" href="" onclick="return ch_reply({$result_set['data']['reply']} ? 0 : 1)" title="切换文章显示模式">{$reply_switch}</a>&nbsp;
101 HTML;
102
103 echo <<<HTML
104 <html>
105 <head>
106 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
107 <title>{$result_set["data"]["section_title"]}——{$section_scope}</title>
108 <link rel="stylesheet" href="{$css_file}" type="text/css">
109 <style type="text/css">
110 TD.head,TD.favor,TD.reply,TD.dark,TD.topic
111 {
112 border-right: #d0d3F0 1px solid;
113 border-left: #d0d3F0 1px solid;
114 border-bottom: #d0d3F0 1px solid;
115 }
116 TD.head,PRE.announcement
117 {
118 font-family: 楷体;
119 color: blue;
120 }
121 TD.favor,TD.dark
122 {
123 text-align: center;
124 }
125 TD.reply,TD.dark
126 {
127 color: #909090;
128 background-color: #eaf0Fa;
129 }
130 TD.head,TD.favor
131 {
132 background-color: #fafbfc;
133 }
134 TD.favor
135 {
136 color: #c0c3f0;
137 font-weight: bold;
138 }
139 TD.topic
140 {
141 background-color: #fafbfc;
142 }
143 TD.topic:hover
144 {
145 background-color: #eaf0Fa;
146 }
147 </style>
148
149 <script type="text/javascript">
150 function ch_page(page)
151 {
152 document.change_page.page.value = page;
153 document.change_page.submit();
154 return false;
155 }
156
157 function ch_rpp()
158 {
159 document.change_page.page.value = Math.floor((document.change_page.page.value - 1) * {$result_set["data"]["rpp"]} / document.change_page.rpp.value) + 1;
160 document.change_page.submit();
161 return false;
162 }
163
164 function ch_sect(sid)
165 {
166 if (sid > 0)
167 {
168 document.change_page.sid.value = sid;
169 document.change_page.page.value = 1;
170 document.change_page.submit();
171 }
172 return false;
173 }
174
175 function ch_ex(ex)
176 {
177 document.change_page.ex.value = ex;
178 document.change_page.submit();
179 return false;
180 }
181
182 function ch_reply(reply)
183 {
184 document.change_page.reply.value = reply;
185 document.change_page.submit();
186 return false;
187 }
188
189 function use_nick(use)
190 {
191 document.change_page.use_nick.value = use;
192 document.change_page.submit();
193 return false;
194 }
195
196 function ch_sort(type)
197 {
198 document.change_page.sort.value = type;
199 document.change_page.submit();
200 return false;
201 }
202
203 window.addEventListener("load", () => {
204 var s = document.change_section.sid;
205 for (i = 0; i < s.options.length; i++)
206 {
207 if (s.options[i].value == {$result_set["data"]["sid"]})
208 {
209 s.selectedIndex = i;
210 break;
211 }
212 }
213 });
214
215 </script>
216 </head>
217 <body>
218 <center>
219 <table cols="2" border="0" cellpadding="0" cellspacing="0" width="1050">
220 <tr>
221 <td width="60%" style="color: green">
222 <a class="s2" href="main.php?sid={$result_set['data']['sid']}">{$BBS_name}</a>&gt;&gt;{$result_set["data"]["class_title"]}[{$result_set["data"]["class_name"]}]&gt;&gt;{$result_set["data"]["section_title"]}[{$result_set["data"]["section_name"]}]&gt;&gt;{$section_scope}
223 </td>
224 <td width="40%" align="right" style="color: gray">
225 {$top_right_info}
226 </td>
227 </tr>
228 </table>
229 <table cols="2" border="0" cellpadding="0" cellspacing="0" width="1050">
230 <tr bgcolor="#d0d3F0" height="2">
231 <td colspan="2"></td>
232 </tr>
233 <tr>
234 <td class="dark" width="3%"><img src="images/master.gif" width="16" height="16" alt="本版版主"></td>
235 <td class="head" width="97%">
236 {$section_master_info}
237 </td>
238 </tr>
239 {$announcement_info}
240 <tr>
241 <td class="dark"></td>
242 <td class="head" align="right">
243 {$article_op_bar}
244 </td>
245 </tr>
246 <tr height="10">
247 <td colspan="2"></td>
248 </tr>
249 </table>
250 <table cols="5" border="0" cellpadding="0" cellspacing="0" width="1050">
251 <tr bgcolor="#d0d3F0" height="25">
252 <td width="4%" class="title">状态</td>
253 <td width="39%" class="title"><a class="s10" href="" onclick="return ch_sort('topic')" title="按主题发表时间排序">标题</a></td>
254 <td width="16%" class="title"><a class="s10" href="" onclick="return use_nick({$result_set['data']['use_nick']} ? 0 : 1)" title="切换用户显示模式">作者</a></td>
255 <td width="10%" class="title"><a class="s10" href="" onclick="return ch_sort('hot')" title="按人气回复排序">回复/人气</a></td>
256 <td width="31%" class="title"><a class="s10" href="" onclick="return ch_sort('reply')" title="按最后回复时间排序">最后更新 | 回复人</a></td>
257 </tr>
258 </table>
259 <table cols="5" border="0" cellpadding="0" cellspacing="0" width="1050">
260 HTML;
261
262 foreach ($result_set["data"]["articles"] as $article)
263 {
264 $status = ($article["ontop"] ? "B" : ($article["gen_ex"] ? "G" : ($article["excerption"] ? "M" : ($article["reply_count"] < 10 ? "N" : "H"))));
265 $status = ($article["visited"] ? strtolower($status) : strtoupper($status));
266
267 $status_str = "";
268 if ($status == "H")
269 {
270 $status_str = <<<HTML
271 <font color="#b0b0b0">N</font>
272 HTML;
273 }
274 else if ($status != "n" && $status != "h")
275 {
276 $status_str = <<<HTML
277 <font color="#b0b0b0">{$status}</font>
278 HTML;
279 }
280
281 if ($article["lock"])
282 {
283 $status_str .= <<<HTML
284 <font color="red">x</font>
285 HTML;
286 }
287
288 $status_pic = pic_file($status);
289 $title = split_line(htmlspecialchars($article["title"], ENT_HTML401, 'UTF-8'), "", 50, 2, "<br />");
290 $user_viewable = (isset($result_set["data"]["author_list"][$article["uid"]]) ? "true" : "false");
291 $name = htmlspecialchars(($result_set["data"]["use_nick"] ? $article["nickname"] : $article["username"]), ENT_HTML401, 'UTF-8');
292 $name_alt = htmlspecialchars(($result_set["data"]["use_nick"] ? $article["username"] : $article["nickname"]), ENT_QUOTES, 'UTF-8');
293 $last_reply_user_viewable = (isset($result_set["data"]["author_list"][$article["last_reply_uid"]]) ? "true" : "false");
294 $last_reply_name = htmlspecialchars(($result_set["data"]["use_nick"] ? $article["last_reply_nickname"] : $article["last_reply_username"]), ENT_HTML401, 'UTF-8');
295 $last_reply_name_alt = htmlspecialchars(($result_set["data"]["use_nick"] ? $article["last_reply_username"] : $article["last_reply_nickname"]), ENT_QUOTES, 'UTF-8');
296
297 $transship_info = "";
298 if ($article["transship"])
299 {
300 $transship_info = <<<HTML
301 <font color="#b0b0b0">[转]</font>
302 HTML;
303 }
304
305 if ($article["reply_count"] > 0)
306 {
307 $last_reply_info = <<<HTML
308 <a class="s2" href="view_user.php?uid={$article['last_reply_uid']}" onclick="return {$last_reply_user_viewable}" title="{$last_reply_name_alt}" target="_blank">
309 {$last_reply_name}
310 </a>
311 HTML;
312 }
313 else
314 {
315 $last_reply_info = <<<HTML
316 ------
317 HTML;
318 }
319
320 echo <<<HTML
321 <tr height="30">
322 <td width="4%" class="dark">
323 <a class="s0" href="view_article.php?tn=xml&rpp=20&id={$article['aid']}&ex={$result_set['data']['ex']}#{$article['aid']}" target="_blank">
324 <img src="images/{$status_pic}" border="0">
325 </a>
326 </td>
327 <td width="39%" class="topic">
328 <a class="s0" href="view_article.php?id={$article['aid']}&ex={$result_set['data']['ex']}#{$article['aid']}" target="_blank" title="发表时间:{$article['sub_dt']->format('Y-m-d H:i:s')}\n文章长度:{$article['length']}字">
329 <img src="images/expression/{$article['icon']}.gif" border="0">
330 {$transship_info}
331 {$title}
332 </a>
333 {$status_str}
334 </td>
335 <td width="16%" class="dark">
336 <a class="s2" href="view_user.php?uid={$article['uid']}" onclick="return {$user_viewable}" title="{$name_alt}" target="_blank">
337 {$name}
338 </a>
339 </td>
340 <td width="10%" class="favor">
341 {$article["reply_count"]}/{$article["view_count"]}
342 </td>
343 <td width="31%" class="reply">
344 {$article["last_reply_dt"]->format("Y-m-d H:i:s")} | {$last_reply_info}
345 </td>
346 </tr>
347
348 HTML;
349 }
350
351 $rpp_options = "";
352 foreach ($BBS_list_rpp_options as $v)
353 {
354 $selected = ($v == $result_set["data"]["rpp"] ? "selected" : "");
355
356 $rpp_options .= <<<HTML
357 <option value="{$v}" {$selected}>{$v}</option>
358 HTML;
359 }
360
361 echo <<<HTML
362 </table>
363 <table cols="3" border="0" cellpadding="0" cellspacing="0" width="1050">
364 <tr bgcolor="#d0d3F0" height="5">
365 <td colspan="3"></td></tr>
366 <tr height="10">
367 <td colspan="3"></td></tr>
368 <tr valign="top">
369 <form action="list.php" method="get" id="change_page" name="change_page">
370 <td width="40%" style="color: #909090">
371 <input type="hidden" id="sid" name="sid" value="{$result_set['data']['sid']}">
372 <input type="hidden" id="reply" name="reply" value="{$result_set['data']['reply']}">
373 <input type="hidden" id="ex" name="ex" value="{$result_set['data']['ex']}">
374 <input type="hidden" id="use_nick" name="use_nick" value="{$result_set['data']['use_nick']}">
375 <input type="hidden" id="sort" name="sort" value="{$result_set['data']['sort']}">
376 每页<select size="1" id="rpp" name="rpp" onchange="ch_rpp()">
377 {$rpp_options}
378 </select>篇
379 HTML;
380
381 if ($result_set["data"]["page"] > 1)
382 {
383 echo <<<HTML
384 <a class="s8" title="首页" href="" onclick="return ch_page(1)">|◀</a>
385 <a class="s8" title="上一页" href="" onclick='return ch_page({$result_set["data"]["page"]} - 1)'>◀</a>
386 HTML;
387 }
388 else
389 {
390 echo <<<HTML
391 |◀ ◀
392 HTML;
393 }
394
395 echo <<<HTML
396 第<input id="page" name="page" value="{$result_set['data']['page']}" style="width: 30px;">/{$result_set['data']['page_total']}页
397 HTML;
398
399 if ($result_set["data"]["page"] < $result_set["data"]["page_total"])
400 {
401 echo <<<HTML
402 <a class="s8" title="下一页" href="" onclick="return ch_page({$result_set['data']['page']} + 1)">▶</a>
403 <a class="s8" title="尾页" href="" onclick="return ch_page({$result_set['data']['page_total']})">▶|</a>
404 HTML;
405 }
406 else
407 {
408 echo <<<HTML
409 ▶ ▶|
410 HTML;
411 }
412
413 echo <<<HTML
414 </td>
415 <td width="35%">
416 <font color="#909090">查找文章</font>
417 <input type="text" id="search_text" name="search_text" value="{$result_set['data']['search_text']}" size="15"> <input type="image" src="images/search.gif" alt="按主题内容查找文章" border="0"></a>
418 <a class="s8" href="search_form_v2.php?sid={$result_set['data']['sid']}" target="_blank" title="全功能检索">高级</a>&nbsp;
419 </td>
420 </form>
421 <td width="25%" align="right">
422 <form action="" method="get" id="change_section" name="change_section">
423 <select size="1" id="sid" name="sid" onchange="ch_sect(this.value);">
424 {$result_set["data"]["section_select_options"]}
425 </select>
426 </form>
427 </td>
428 </tr>
429 </table>
430 </center>
431 HTML;
432
433 include "./foot.inc.php";
434
435 echo <<<HTML
436 </body>
437 </html>
438 HTML;

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