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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.9 - (hide annotations)
Tue Apr 22 01:55:01 2025 UTC (10 months, 3 weeks ago) by sysadm
Branch: MAIN
Changes since 1.8: +2 -4 lines
Use <pre> to format section announcement

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

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