/[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.6 - (show annotations)
Tue Apr 15 01:10:48 2025 UTC (11 months ago) by sysadm
Branch: MAIN
Changes since 1.5: +4 -2 lines
Prevent view profile of non-existing users

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

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