/[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.4 - (hide annotations)
Sun Apr 13 11:27:28 2025 UTC (11 months ago) by sysadm
Branch: MAIN
Changes since 1.3: +2 -3 lines
Update

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     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="770">
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="770">
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="770">
233     <tr bgcolor="#d0d3F0" height="20">
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 sysadm 1.4 <table cols="5" border="0" cellpadding="0" cellspacing="0" width="770">
242 sysadm 1.1 <?
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 sysadm 1.3 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'), "", 42, 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     $last_reply_username = htmlspecialchars($article["last_reply_username"], ENT_QUOTES | ENT_HTML401, 'UTF-8');
272     $last_reply_nickname = htmlspecialchars($article["last_reply_nickname"], ENT_QUOTES | ENT_HTML401, 'UTF-8');
273     ?>
274     <tr height="30">
275     <td width="4%" class="dark">
276     <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>
277     <img src="images/<? echo pic_file($status); ?>" border="0">
278     </a>
279     </td>
280     <td width="39%" class="topic">
281     <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") . "\n"; ?>文章长度:<? echo $article["length"]; ?>字">
282     <img src="images/expression/<? echo $article["icon"]; ?>.gif" border="0">
283     <?
284     if ($article["transship"])
285     {
286     ?>
287     <font color=#b0b0b0>[转]</font>
288     <?
289     }
290     ?>
291     <? echo $title; ?>
292     </a>
293     <? echo $status_str; ?>
294     </td>
295     <td width="16%" class="dark">
296     <a class="s2" href="show_profile.php?uid=<? echo $article["uid"]; ?>" title="<? echo ($result_set["data"]["use_nick"] ? $username : $nickname); ?>" target=_blank>
297     <? echo ($result_set["data"]["use_nick"] ? $nickname : $username); ?>
298     </a>
299     </td>
300     <td width="10%" class="favor">
301     <? echo $article["reply_count"]; ?>/<? echo $article["view_count"]; ?>
302     </td>
303     <td width="31%" class="reply"><? echo $article["last_reply_dt"]->format("Y-m-d H:i"); ?> |
304     <?
305     if ($article["reply_count"] > 0)
306     {
307     ?>
308     <a class="s2" href="show_profile.php?uid=<? echo $article["last_reply_uid"]; ?>" title="<? echo ($result_set["data"]["use_nick"] ? $last_reply_username : $last_reply_nickname); ?>" target=_blank>
309     <? echo ($result_set["data"]["use_nick"] ? $last_reply_nickname : $last_reply_username); ?>
310     </a>
311     <?
312     }
313     else
314     {
315     ?>
316     ------
317     <?
318     }
319     ?>
320     </td>
321     </tr>
322     <?
323 sysadm 1.1 }
324     ?>
325 sysadm 1.4 </table>
326 sysadm 1.1 <table cols="3" border="0" cellpadding="0" cellspacing="0" width="770">
327     <tr bgcolor="#d0d3F0" height="5">
328     <td colspan="3"></td></tr>
329     <tr height="10">
330     <td colspan="3"></td></tr>
331     <tr valign="top">
332     <form action="list.php" method="get" id="change_page" name="change_page">
333     <td width="40%" style="color:#909090">
334     <input type="hidden" id="sid" name="sid" value="<? echo $result_set["data"]["sid"]; ?>">
335     <input type="hidden" id="reply" name="reply" value="<? echo $result_set["data"]["reply"]; ?>">
336     <input type="hidden" id="ex" name="ex" value="<? echo $result_set["data"]["ex"]; ?>">
337     <input type="hidden" id="use_nick" name="use_nick" value="<? echo $result_set["data"]["use_nick"]; ?>">
338     <input type="hidden" id="sort" name="sort" value="<? echo $result_set["data"]["sort"]; ?>">
339     每页<select size="1" id="rpp" name="rpp" onchange="ch_rpp();">
340     <?
341     foreach ($BBS_list_rpp_options as $v)
342     {
343     echo ("<option value=\"$v\"" . ($v == $result_set["data"]["rpp"] ? " selected" : "") . ">$v</option>");
344     }
345     ?>
346     </select>篇
347     <?
348     if ($result_set["data"]["page"] > 1)
349     {
350     ?>
351     <a class="s8" title="首页" href="" onclick="return ch_page(1);"><font face=webdings>9</font></a>
352     <a class="s8" title="上一页" href="" onclick='return ch_page(<? echo ($result_set["data"]["page"] - 1); ?>);'><font face=webdings>7</font></a>
353     <?
354     }
355     else
356     {
357     ?>
358 sysadm 1.2 <font face=webdings>9 7</font>
359 sysadm 1.1 <?
360     }
361     ?>
362     第<input id="page" name="page" value="<? echo ($result_set["data"]["page"]) ; ?>" style="width: 30px;">/<? echo $result_set["data"]["page_total"]; ?>页
363     <?
364     if ($result_set["data"]["page"] < $result_set["data"]["page_total"])
365     {
366     ?>
367     <a class="s8" title="下一页" href="" onclick="return ch_page(<? echo ($result_set["data"]["page"] + 1); ?>);"><font face=webdings>8</font></a>
368     <a class="s8" title="尾页" href="" onclick="return ch_page(<? echo ($result_set["data"]["page_total"]); ?>);"><font face=webdings>:</font></a>
369     <?
370     }
371     else
372     {
373     ?>
374 sysadm 1.2 <font face=webdings>8 :</font>
375 sysadm 1.1 <?
376     }
377     ?>
378     </td>
379     <td width="35%">
380     <font color=#909090>查找文章</font>
381     <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>
382     <a class="s8" href="search_form.php?sid=<? echo $result_set["data"]["sid"]; ?>" target=_blank title="全功能检索">高级</a>&nbsp;
383     </td>
384     </form>
385     <td width="25%" align="right">
386     <form action="" method="get" id="change_section" name="change_section">
387     <select size="1" id="sid" name="sid" onchange="ch_sect(this.value);">
388     <?
389     echo $result_set["data"]["section_select_options"];
390     ?>
391     </select>
392     </form>
393     </td>
394     </tr>
395     </table>
396     </center>
397     <?
398     include "./foot.inc.php";
399     ?>
400     </body>
401     </html>

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