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

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

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.1 by sysadm, Sat Apr 12 06:31:56 2025 UTC Revision 1.9 by sysadm, Fri Apr 25 11:01:22 2025 UTC
# Line 1  Line 1 
1  <?  <?php
2          // Prevent load standalone          // Prevent load standalone
3          if (!isset($result_set))          if (!isset($result_set))
4          {          {
# Line 6  Line 6 
6          }          }
7    
8          require_once "../lib/str_process.inc.php";          require_once "../lib/str_process.inc.php";
9  ?>  
10  <html>          function pic_file(string $status) : string
11  <head>          {
12  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">                  switch(strtoupper($status))
13  <title>文章查找结果</title>                  {
14  <link rel="stylesheet" href="<? echo get_theme_file('css/default'); ?>" type="text/css">                          case "H":
15  <style type="text/css">                                  $file = "hotclosed.gif";
16  TD.head,TD.favor,TD.reply,TD.dark,TD.topic                                  break;
17  {                          case "M":
18          border-right: #d0d3F0 1px solid;                                  $file = "hotfolder.gif";
19          border-left: #d0d3F0 1px solid;                                  break;
20          border-bottom: #d0d3F0 1px solid;                          case "G":
21  }                                  $file = "star.gif";
22  TD.head                                  break;
23  {                          case "B":
24          font-family: 楷体;                                  $file = "settop.gif";
25          color: blue;                                  break;
26  }                          default:
27  TD.favor,TD.dark                                  $file = "closed.gif";
28  {                  }
29          text-align: center;                          
30  }                  return($file);
31  TD.reply,TD.dark          }
32  {  
33          color: #909090;          $css_file = get_theme_file('css/default');
34          background-color: #eaf0Fa;  
35  }          echo <<<HTML
36  TD.head,TD.favor          <html>
37  {          <head>
38          background-color: #fafbfc;          <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
39  }          <title>文章查找结果</title>
40  TD.favor          <link rel="stylesheet" href="{$css_file}" type="text/css">
41  {          <style type="text/css">
42          color: #c0c3F0;          TD.head,TD.favor,TD.reply,TD.dark,TD.topic
43          font-weight: bold;          {
44  }                  border-right: #d0d3F0 1px solid;
45  TD.topic                  border-left: #d0d3F0 1px solid;
46  {                  border-bottom: #d0d3F0 1px solid;
47          background-color: #fafbfc;          }
48  }          TD.head
49  TD.topic:hover          {
50  {                  font-family: 楷体;
51          background-color: #eaf0Fa;                  color: blue;
52  }          }
53  </style>          TD.favor,TD.dark
54            {
55  <script type="text/javascript" src="../js/bbs_article.js"></script>                  text-align: center;
56  <script type="text/javascript">          }
57  function ch_page(page)          TD.reply,TD.dark
58  {          {
59          document.search_form.page.value = page;                  color: #909090;
60          document.search_form.submit();                  background-color: #eaf0Fa;
61          return false;          }
62  }          TD.head,TD.favor
63            {
64  function ch_rpp()                  background-color: #fafbfc;
65  {          }
66          document.search_form.page.value = Math.floor((document.search_form.page.value - 1) * <? echo $result_set["data"]["rpp"]; ?> / document.search_form.rpp.value) + 1;          TD.favor
67          document.search_form.submit();          {
68          return false;                  color: #c0c3F0;
69  }                  font-weight: bold;
70  </script>          }
71  </head>          TD.topic
72  <body>          {
73  <center>                  background-color: #fafbfc;
74  <table cols="5" border="0" cellpadding="0" cellspacing="0" width="770">          }
75          <tr bgcolor="#d0d3F0" height="20">          TD.topic:hover
76                  <td width="4%" class="title">状态</td>          {
77                  <td width="39%" class="title">标题(共<? echo $result_set["data"]["toa"]; ?>篇)</td>                  background-color: #eaf0Fa;
78                  <td width="16%" class="title">作者</td>          }
79                  <td width="10%" class="title">回复/人气</td>          </style>
80                  <td width="31%" class="title">最后更新 | 回复人</td>  
81          </tr>          <script type="text/javascript">
82  </table>          function ch_page(page)
83  <?          {
84          echo ("<script language=\"JavaScript\">\n");                  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            $ex = ($result_set["data"]["ex"] > 0 ? 1 : 0);
112    
113          foreach ($result_set["data"]["articles"] as $article)          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"))));                  $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));                  $status = ($article["visited"] ? strtolower($status) : strtoupper($status));
117    
118                  echo ("show_article(" .                  $status_str = "";
119                          $article["tid"] . ", " . //tid                  if ($status == "H")
120                          $article["aid"] . ", " . //aid                  {
121                          "'" . split_line(htmlspecialchars($article["title"], ENT_QUOTES | ENT_HTML401, 'UTF-8'), "", 42, 2, "<br />") . "', " . //title                          $status_str = <<<HTML
122                          ($result_set["data"]["ex"] > 0 ? 1 : 0) . ", " . //ex                                  <font color="#b0b0b0">N</font>
123                          "'$status', " . //status                          HTML;
124                          "'" . $article["sub_dt"]->format("Y-m-d H:i") . "', " . //sub_dt                  }
125                          "'" . $article["length"] . "', " . //length                  else if ($status != "n" && $status != "h")
126                          $article["icon"] . " ," . //icon                  {
127                          $article["uid"] . ", " . //uid                          $status_str = <<<HTML
128                          "'" . htmlspecialchars($article["username"], ENT_QUOTES | ENT_HTML401, 'UTF-8') . "', " . //username                                  <font color="#b0b0b0">{$status}</font>
129                          "'" . htmlspecialchars($article["nickname"], ENT_QUOTES | ENT_HTML401, 'UTF-8') . "', " . //nickname                          HTML;
130                          $article["reply_count"] . ", " . //reply_count                  }
131                          $article["view_count"] . ", " . //view_count  
132                          $article["transship"] . ", " . //transship                  if ($article["lock"])
133                          $article["lock"] . ", " . //lock                  {
134                          "'" . $article["last_reply_dt"]->format("Y-m-d H:i") . "', " . //last_reply_dt                          $status_str .= <<<HTML
135                          $article["last_reply_uid"] . ", " . //last_reply_uid                                  <font color="red">x</font>
136                          "'" . htmlspecialchars($article["last_reply_username"], ENT_QUOTES | ENT_HTML401, 'UTF-8') . "', " . //last_reply_username                          HTML;
137                          "'" . htmlspecialchars($article["last_reply_nickname"], ENT_QUOTES | ENT_HTML401, 'UTF-8') . "', " . //last_reply_nickname                  }
138                          ($result_set["data"]["trash"] ? 1 : 0) . ", " . //visible_mode  
139                          "1, " . //use_nick                  $status_pic = pic_file($status);
140                          "'" . htmlspecialchars($article["class_name"], ENT_QUOTES | ENT_HTML401, 'UTF-8') . "'," . //cname                  $title = split_line(htmlspecialchars($article["title"], ENT_HTML401, 'UTF-8'), "", 50, 2, "<br />");
141                          "'" . htmlspecialchars($article["class_title"], ENT_QUOTES | ENT_HTML401, 'UTF-8') . "'," . //c_title                  $user_viewable = (isset($result_set["data"]["author_list"][$article["uid"]]) ? "true" : "false");
142                          "'" . htmlspecialchars($article["section_name"], ENT_QUOTES | ENT_HTML401, 'UTF-8') . "'," . //sname                  $name = htmlspecialchars(($result_set["data"]["use_nick"] ? $article["nickname"] : $article["username"]), ENT_HTML401, 'UTF-8');
143                          "'" . htmlspecialchars($article["section_title"], ENT_QUOTES | ENT_HTML401, 'UTF-8') . "'," . //s_title                  $name_alt = htmlspecialchars(($result_set["data"]["use_nick"] ? $article["username"] : $article["nickname"]), ENT_QUOTES, 'UTF-8');
144                          ");\n");                  $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    
150                    $transship_info = "";
151                    if ($article["transship"])
152                    {
153                            $transship_info = <<<HTML
154                                    <font color="#b0b0b0">[转]</font>
155                            HTML;
156                    }
157    
158                    if ($article["reply_count"] > 0)
159                    {
160                            $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                    }
166                    else
167                    {
168                            $last_reply_info = <<<HTML
169                                    ------
170                            HTML;
171                    }
172    
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          }          }
204    
205          echo ("</script>\n");          $rpp_options = "";
 ?>  
 <table cols="3" border="0" cellpadding="0" cellspacing="0" width="770">  
         <tr bgcolor="#d0d3F0" height="5">  
                 <td colspan="3"></td>  
         </tr>  
         <tr height="10">  
                 <td colspan="3"></td>  
         </tr>  
         <tr valign="top">  
                 <td width="40%" align="left" style="color:#909090">  
                 <form action="search_article.php" method="GET" id="search_form" name="search_form">  
                         <a name="cp"></a>  
                         <input type="hidden" id="uid" name="uid" value="<? echo $result_set["data"]["uid"];?>">  
                         <input type="hidden" id="nickname" name="nickname" value="<? echo $result_set["data"]["nickname"];?>">  
                         <input type="hidden" id="title" name="title" value="<? echo $result_set["data"]["title"];?>">  
                         <input type="hidden" id="content" name="content" value="<? echo $result_set["data"]["content"];?>">  
                         <input type="hidden" id="sid" name="sid" value="<? echo $result_set["data"]["sid"];?>">  
                         <input type="hidden" id="begin_dt" name="begin_dt" value="<? echo $result_set["data"]["begin_dt"]->format("Y-m-d");?>">  
                         <input type="hidden" id="end_dt" name="end_dt" value="<? echo $result_set["data"]["end_dt"]->format("Y-m-d");?>">  
                         <input type="hidden" id="reply" name="reply" value="<? echo $result_set["data"]["reply"]; ?>">  
                         <input type="hidden" id="ex" name="ex" value="<? echo $result_set["data"]["ex"]; ?>">  
                         <input type="hidden" id="original" name="original" value="<? echo $result_set["data"]["original"]; ?>">  
                         <input type="hidden" id="trash" name="trash" value="<? echo $result_set["data"]["trash"]; ?>">  
                         每页<select size="1" id="rpp" name="rpp" onchange="ch_rpp();">  
 <?  
206          foreach ($BBS_list_rpp_options as $v)          foreach ($BBS_list_rpp_options as $v)
207          {          {
208                  echo ("<option value=\"$v\"" . ($v == $result_set["data"]["rpp"] ? " selected" : "") . ">$v</option>");                  $selected = ($v == $result_set["data"]["rpp"] ? "selected" : "");
209    
210                    $rpp_options .= <<<HTML
211                            <option value="{$v}" {$selected}>{$v}</option>
212                    HTML;
213          }          }
214  ?>  
215                          </select>篇          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          if ($result_set["data"]["page"] > 1)          if ($result_set["data"]["page"] > 1)
246          {          {
247  ?>                  echo <<<HTML
248  <a class="s8" title="首页" href="" onclick="return ch_page(1);"><font face=webdings>9</font></a>                          <a class="s8" title="首页" href="" onclick="return ch_page(1)">|◀</a>
249  <a class="s8" title="上一页" href="" onclick="return ch_page(<? echo ($result_set["data"]["page"] - 1); ?>);"><font face=webdings>7</font></a>                          <a class="s8" title="上一页" href="" onclick='return ch_page({$result_set["data"]["page"]} - 1)'>◀</a>
250  <?                  HTML;
251          }          }
252          else          else
253          {          {
254  ?>                  echo <<<HTML
255  <font face=webdings>9 7</font>                          |◀ ◀
256  <?                  HTML;
257          }          }
258  ?>  
259                          第<input id="page" name="page" value="<? echo ($result_set["data"]["page"]) ; ?>" style="width: 30px;">/<? echo $result_set["data"]["page_total"]; ?>页          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          if ($result_set["data"]["page"] < $result_set["data"]["page_total"])          if ($result_set["data"]["page"] < $result_set["data"]["page_total"])
264          {          {
265  ?>                  echo <<<HTML
266  <a class="s8" title="下一页" href="" onclick="return ch_page(<? echo ($result_set["data"]["page"] + 1); ?>);"><font face=webdings>8</font></a>                          <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(<? echo ($result_set["data"]["page_total"]); ?>);"><font face=webdings>:</font></a>                          <a class="s8" title="尾页" href="" onclick="return ch_page({$result_set['data']['page_total']})">▶|</a>
268  <?                  HTML;
269          }          }
270          else          else
271          {          {
272  ?>                  echo <<<HTML
273  <font face=webdings>8 :</font>                          ▶ ▶|
274  <?                  HTML;
275          }          }
276  ?>  
277            echo <<<HTML
278                          </form>                          </form>
279                  </td>                          </td>
280                  <td width="35%" align="left">                          <td width="35%">
281                  </td>                          </td>
282                  <td width="25%" align="right">                          <td width="25%">
283                  </td>                          </td>
284          </tr>                  </tr>
285  </table>            </table>  
286  </center>          </center>
287  <?          HTML;
288    
289          include "./foot.inc.php";          include "./foot.inc.php";
290    
291            echo <<<HTML
292            </body>
293            </html>
294            HTML;
295  ?>  ?>
 </body>  
 </html>  


Legend:
Removed lines/characters  
Changed lines/characters
  Added lines/characters

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