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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.11 - (hide annotations)
Tue Apr 29 10:27:33 2025 UTC (10 months, 2 weeks ago) by sysadm
Branch: MAIN
Changes since 1.10: +1 -1 lines
Removing redundant PHP closing tag

1 sysadm 1.7 <?php
2 sysadm 1.1 // Prevent load standalone
3     if (!isset($result_set))
4     {
5     exit();
6     }
7    
8     require_once "../lib/str_process.inc.php";
9 sysadm 1.2
10     function pic_file(string $status) : string
11     {
12     switch(strtoupper($status))
13     {
14     case "H":
15     $file = "hotclosed.gif";
16     break;
17     case "M":
18     $file = "hotfolder.gif";
19     break;
20     case "G":
21     $file = "star.gif";
22     break;
23     case "B":
24     $file = "settop.gif";
25     break;
26     default:
27     $file = "closed.gif";
28     }
29 sysadm 1.10
30 sysadm 1.2 return($file);
31     }
32 sysadm 1.9
33     $css_file = get_theme_file('css/default');
34    
35     echo <<<HTML
36     <html>
37     <head>
38     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
39     <title>文章查找结果</title>
40     <link rel="stylesheet" href="{$css_file}" type="text/css">
41     <style type="text/css">
42     TD.head,TD.favor,TD.reply,TD.dark,TD.topic
43     {
44     border-right: #d0d3F0 1px solid;
45     border-left: #d0d3F0 1px solid;
46     border-bottom: #d0d3F0 1px solid;
47     }
48     TD.head
49     {
50     font-family: 楷体;
51     color: blue;
52     }
53     TD.favor,TD.dark
54     {
55     text-align: center;
56     }
57     TD.reply,TD.dark
58     {
59     color: #909090;
60     background-color: #eaf0Fa;
61     }
62     TD.head,TD.favor
63     {
64     background-color: #fafbfc;
65     }
66     TD.favor
67     {
68     color: #c0c3F0;
69     font-weight: bold;
70     }
71     TD.topic
72     {
73     background-color: #fafbfc;
74     }
75     TD.topic:hover
76     {
77     background-color: #eaf0Fa;
78     }
79     </style>
80    
81     <script type="text/javascript">
82     function ch_page(page)
83     {
84     document.search_form.page.value = page;
85     document.search_form.submit();
86     return false;
87     }
88    
89     function ch_rpp()
90     {
91     document.search_form.page.value = Math.floor((document.search_form.page.value - 1) * {$result_set["data"]["rpp"]} / document.search_form.rpp.value) + 1;
92     document.search_form.submit();
93     return false;
94     }
95     </script>
96     </head>
97     <body>
98     <center>
99     <table cols="5" border="0" cellpadding="0" cellspacing="0" width="1050" >
100     <tr bgcolor="#d0d3F0" height="25">
101     <td width="4%" class="title">状态</td>
102     <td width="39%" class="title">标题(共{$result_set["data"]["toa"]}篇)</td>
103     <td width="16%" class="title">作者</td>
104     <td width="10%" class="title">回复/人气</td>
105     <td width="31%" class="title">最后更新 | 回复人</td>
106     </tr>
107     </table>
108     <table cols="5" border="0" cellpadding="0" cellspacing="0" width="1050">
109     HTML;
110    
111 sysadm 1.2 $ex = ($result_set["data"]["ex"] > 0 ? 1 : 0);
112 sysadm 1.1
113     foreach ($result_set["data"]["articles"] as $article)
114     {
115     $status = ($article["ontop"] ? "B" : ($article["gen_ex"] ? "G" : ($article["excerption"] ? "M" : ($article["reply_count"] < 10 ? "N" : "H"))));
116     $status = ($article["visited"] ? strtolower($status) : strtoupper($status));
117    
118 sysadm 1.9 $status_str = "";
119     if ($status == "H")
120 sysadm 1.2 {
121 sysadm 1.9 $status_str = <<<HTML
122     <font color="#b0b0b0">N</font>
123     HTML;
124 sysadm 1.2 }
125 sysadm 1.9 else if ($status != "n" && $status != "h")
126 sysadm 1.2 {
127 sysadm 1.9 $status_str = <<<HTML
128     <font color="#b0b0b0">{$status}</font>
129     HTML;
130 sysadm 1.2 }
131 sysadm 1.9
132     if ($article["lock"])
133 sysadm 1.2 {
134 sysadm 1.9 $status_str .= <<<HTML
135     <font color="red">x</font>
136     HTML;
137 sysadm 1.2 }
138    
139 sysadm 1.9 $status_pic = pic_file($status);
140     $title = split_line(htmlspecialchars($article["title"], ENT_HTML401, 'UTF-8'), "", 50, 2, "<br />");
141     $user_viewable = (isset($result_set["data"]["author_list"][$article["uid"]]) ? "true" : "false");
142     $name = htmlspecialchars(($result_set["data"]["use_nick"] ? $article["nickname"] : $article["username"]), ENT_HTML401, 'UTF-8');
143     $name_alt = htmlspecialchars(($result_set["data"]["use_nick"] ? $article["username"] : $article["nickname"]), ENT_QUOTES, 'UTF-8');
144     $last_reply_user_viewable = (isset($result_set["data"]["author_list"][$article["last_reply_uid"]]) ? "true" : "false");
145     $last_reply_name = htmlspecialchars(($result_set["data"]["use_nick"] ? $article["last_reply_nickname"] : $article["last_reply_username"]), ENT_HTML401, 'UTF-8');
146     $last_reply_name_alt = htmlspecialchars(($result_set["data"]["use_nick"] ? $article["last_reply_username"] : $article["last_reply_nickname"]), ENT_QUOTES, 'UTF-8');
147     $class_title = htmlspecialchars($article["class_title"], ENT_HTML401, 'UTF-8');
148     $section_title = htmlspecialchars($article["section_title"], ENT_HTML401, 'UTF-8');
149 sysadm 1.2
150 sysadm 1.9 $transship_info = "";
151 sysadm 1.2 if ($article["transship"])
152     {
153 sysadm 1.9 $transship_info = <<<HTML
154     <font color="#b0b0b0">[转]</font>
155     HTML;
156 sysadm 1.2 }
157 sysadm 1.9
158 sysadm 1.2 if ($article["reply_count"] > 0)
159     {
160 sysadm 1.9 $last_reply_info = <<<HTML
161     <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">
162     {$last_reply_name}
163     </a>
164     HTML;
165 sysadm 1.2 }
166     else
167     {
168 sysadm 1.9 $last_reply_info = <<<HTML
169     ------
170     HTML;
171 sysadm 1.2 }
172 sysadm 1.9
173     echo <<<HTML
174     <tr height="30">
175     <td width="4%" class="dark">
176     <a class="s0" href="view_article.php?tn=xml&rpp=20&id={$article['aid']}&ex={$ex}&trash={$result_set["data"]["trash"]}#{$article['aid']}" target="_blank">
177     <img src="images/{$status_pic}" border="0">
178     </a>
179     </td>
180     <td width="39%" class="topic">
181     <font color="green">{$class_title}&gt;&gt;{$section_title}&gt;&gt;</font><br />
182     <a class="s0" href="view_article.php?id={$article['aid']}&ex={$result_set['data']['ex']}&trash={$result_set["data"]["trash"]}#{$article['aid']}" target="_blank" title="发表时间:{$article['sub_dt']->format('Y-m-d H:i:s')}\n文章长度:{$article['length']}字">
183     <img src="images/expression/{$article['icon']}.gif" border="0">
184     {$transship_info}
185     {$title}
186     </a>
187     {$status_str}
188     </td>
189     <td width="16%" class="dark">
190     <a class="s2" href="view_user.php?uid={$article['uid']}" onclick="return {$user_viewable}" title="{$name_alt}" target="_blank">
191     {$name}
192     </a>
193     </td>
194     <td width="10%" class="favor">
195     {$article["reply_count"]}/{$article["view_count"]}
196     </td>
197     <td width="31%" class="reply">
198     {$article["last_reply_dt"]->format("Y-m-d H:i:s")} | {$last_reply_info}
199     </td>
200     </tr>
201    
202     HTML;
203 sysadm 1.1 }
204 sysadm 1.9
205     $rpp_options = "";
206 sysadm 1.1 foreach ($BBS_list_rpp_options as $v)
207     {
208 sysadm 1.9 $selected = ($v == $result_set["data"]["rpp"] ? "selected" : "");
209    
210     $rpp_options .= <<<HTML
211     <option value="{$v}" {$selected}>{$v}</option>
212     HTML;
213 sysadm 1.1 }
214 sysadm 1.9
215     echo <<<HTML
216     </table>
217     <table cols="3" border="0" cellpadding="0" cellspacing="0" width="1050">
218     <tr bgcolor="#d0d3F0" height="5">
219     <td colspan="3"></td>
220     </tr>
221     <tr height="10">
222     <td colspan="3"></td>
223     </tr>
224     <tr valign="top">
225     <td width="40%" align="left" style="color: #909090">
226     <form action="search_article.php" method="GET" id="search_form" name="search_form">
227     <a name="cp"></a>
228     <input type="hidden" id="uid" name="uid" value="{$result_set['data']['uid']}">
229     <input type="hidden" id="nickname" name="nickname" value="{$result_set['data']['nickname']}">
230     <input type="hidden" id="title" name="title" value="{$result_set['data']['title']}">
231     <input type="hidden" id="content" name="content" value="{$result_set['data']['content']}">
232     <input type="hidden" id="sid" name="sid" value="{$result_set['data']['sid']}">
233     <input type="hidden" id="begin_dt" name="begin_dt" value="{$result_set['data']['begin_dt']->format('Y-m-d')}">
234     <input type="hidden" id="end_dt" name="end_dt" value="{$result_set['data']['end_dt']->format('Y-m-d')}">
235     <input type="hidden" id="reply" name="reply" value="{$result_set['data']['reply']}">
236     <input type="hidden" id="ex" name="ex" value="{$result_set['data']['ex']}">
237     <input type="hidden" id="use_nick" name="use_nick" value="{$result_set['data']['use_nick']}">
238     <input type="hidden" id="original" name="original" value="{$result_set['data']['original']}">
239     <input type="hidden" id="trash" name="trash" value="{$result_set['data']['trash']}">
240     每页<select size="1" id="rpp" name="rpp" onchange="ch_rpp();">
241     {$rpp_options}
242     </select>篇
243     HTML;
244    
245 sysadm 1.1 if ($result_set["data"]["page"] > 1)
246     {
247 sysadm 1.9 echo <<<HTML
248     <a class="s8" title="首页" href="" onclick="return ch_page(1)">|◀</a>
249     <a class="s8" title="上一页" href="" onclick='return ch_page({$result_set["data"]["page"]} - 1)'>◀</a>
250     HTML;
251 sysadm 1.1 }
252     else
253     {
254 sysadm 1.9 echo <<<HTML
255     |◀ ◀
256     HTML;
257 sysadm 1.1 }
258 sysadm 1.9
259     echo <<<HTML
260     第<input id="page" name="page" value="{$result_set['data']['page']}" style="width: 30px;">/{$result_set['data']['page_total']}页
261     HTML;
262    
263 sysadm 1.1 if ($result_set["data"]["page"] < $result_set["data"]["page_total"])
264     {
265 sysadm 1.9 echo <<<HTML
266     <a class="s8" title="下一页" href="" onclick="return ch_page({$result_set['data']['page']} + 1)">▶</a>
267     <a class="s8" title="尾页" href="" onclick="return ch_page({$result_set['data']['page_total']})">▶|</a>
268     HTML;
269 sysadm 1.1 }
270     else
271     {
272 sysadm 1.9 echo <<<HTML
273     ▶ ▶|
274     HTML;
275 sysadm 1.1 }
276 sysadm 1.9
277     echo <<<HTML
278 sysadm 1.1 </form>
279 sysadm 1.9 </td>
280     <td width="35%">
281     </td>
282     <td width="25%">
283     </td>
284     </tr>
285 sysadm 1.10 </table>
286 sysadm 1.9 </center>
287     HTML;
288    
289 sysadm 1.1 include "./foot.inc.php";
290 sysadm 1.9
291     echo <<<HTML
292     </body>
293     </html>
294     HTML;
295 sysadm 1.11 //?>

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