/[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.7 by sysadm, Wed Apr 23 05:13:57 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            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                            
30                    return($file);
31            }
32  ?>  ?>
33  <html>  <html>
34  <head>  <head>
35  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
36  <title>文章查找结果</title>  <title>文章查找结果</title>
37  <link rel="stylesheet" href="<? echo get_theme_file('css/default'); ?>" type="text/css">  <link rel="stylesheet" href="<?= get_theme_file('css/default'); ?>" type="text/css">
38  <style type="text/css">  <style type="text/css">
39  TD.head,TD.favor,TD.reply,TD.dark,TD.topic  TD.head,TD.favor,TD.reply,TD.dark,TD.topic
40  {  {
# Line 52  TD.topic:hover Line 75  TD.topic:hover
75  }  }
76  </style>  </style>
77    
 <script type="text/javascript" src="../js/bbs_article.js"></script>  
78  <script type="text/javascript">  <script type="text/javascript">
79  function ch_page(page)  function ch_page(page)
80  {  {
# Line 63  function ch_page(page) Line 85  function ch_page(page)
85    
86  function ch_rpp()  function ch_rpp()
87  {  {
88          document.search_form.page.value = Math.floor((document.search_form.page.value - 1) * <? echo $result_set["data"]["rpp"]; ?> / document.search_form.rpp.value) + 1;          document.search_form.page.value = Math.floor((document.search_form.page.value - 1) * <?= $result_set["data"]["rpp"]; ?> / document.search_form.rpp.value) + 1;
89          document.search_form.submit();          document.search_form.submit();
90          return false;          return false;
91  }  }
# Line 71  function ch_rpp() Line 93  function ch_rpp()
93  </head>  </head>
94  <body>  <body>
95  <center>  <center>
96  <table cols="5" border="0" cellpadding="0" cellspacing="0" width="770">  <table cols="5" border="0" cellpadding="0" cellspacing="0" width="1050" >
97          <tr bgcolor="#d0d3F0" height="20">          <tr bgcolor="#d0d3F0" height="25">
98                  <td width="4%" class="title">状态</td>                  <td width="4%" class="title">状态</td>
99                  <td width="39%" class="title">标题(共<? echo $result_set["data"]["toa"]; ?>篇)</td>                  <td width="39%" class="title">标题(共<?= $result_set["data"]["toa"]; ?>篇)</td>
100                  <td width="16%" class="title">作者</td>                  <td width="16%" class="title">作者</td>
101                  <td width="10%" class="title">回复/人气</td>                  <td width="10%" class="title">回复/人气</td>
102                  <td width="31%" class="title">最后更新 | 回复人</td>                  <td width="31%" class="title">最后更新 | 回复人</td>
103          </tr>          </tr>
104  </table>  </table>
105  <?  <table cols="5" border="0" cellpadding="0" cellspacing="0" width="1050">
106          echo ("<script language=\"JavaScript\">\n");  <?php
107            $ex = ($result_set["data"]["ex"] > 0 ? 1 : 0);
108    
109          foreach ($result_set["data"]["articles"] as $article)          foreach ($result_set["data"]["articles"] as $article)
110          {          {
111                  $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"))));
112                  $status = ($article["visited"] ? strtolower($status) : strtoupper($status));                  $status = ($article["visited"] ? strtolower($status) : strtoupper($status));
113    
114                  echo ("show_article(" .                  if ($status == "n" || $status == "h")
115                          $article["tid"] . ", " . //tid                  {
116                          $article["aid"] . ", " . //aid                          $ss = "";
117                          "'" . split_line(htmlspecialchars($article["title"], ENT_QUOTES | ENT_HTML401, 'UTF-8'), "", 42, 2, "<br />") . "', " . //title                  }
118                          ($result_set["data"]["ex"] > 0 ? 1 : 0) . ", " . //ex                  else if ($status == "H")
119                          "'$status', " . //status                  {
120                          "'" . $article["sub_dt"]->format("Y-m-d H:i") . "', " . //sub_dt                          $ss = "N";
121                          "'" . $article["length"] . "', " . //length                  }
122                          $article["icon"] . " ," . //icon                  else
123                          $article["uid"] . ", " . //uid                  {
124                          "'" . htmlspecialchars($article["username"], ENT_QUOTES | ENT_HTML401, 'UTF-8') . "', " . //username                          $ss = $status;
125                          "'" . htmlspecialchars($article["nickname"], ENT_QUOTES | ENT_HTML401, 'UTF-8') . "', " . //nickname                  }
126                          $article["reply_count"] . ", " . //reply_count  
127                          $article["view_count"] . ", " . //view_count                  $status_str = "<font color=#b0b0b0>$ss</font>";
                         $article["transship"] . ", " . //transship  
                         $article["lock"] . ", " . //lock  
                         "'" . $article["last_reply_dt"]->format("Y-m-d H:i") . "', " . //last_reply_dt  
                         $article["last_reply_uid"] . ", " . //last_reply_uid  
                         "'" . htmlspecialchars($article["last_reply_username"], ENT_QUOTES | ENT_HTML401, 'UTF-8') . "', " . //last_reply_username  
                         "'" . htmlspecialchars($article["last_reply_nickname"], ENT_QUOTES | ENT_HTML401, 'UTF-8') . "', " . //last_reply_nickname  
                         ($result_set["data"]["trash"] ? 1 : 0) . ", " . //visible_mode  
                         "1, " . //use_nick  
                         "'" . htmlspecialchars($article["class_name"], ENT_QUOTES | ENT_HTML401, 'UTF-8') . "'," . //cname  
                         "'" . htmlspecialchars($article["class_title"], ENT_QUOTES | ENT_HTML401, 'UTF-8') . "'," . //c_title  
                         "'" . htmlspecialchars($article["section_name"], ENT_QUOTES | ENT_HTML401, 'UTF-8') . "'," . //sname  
                         "'" . htmlspecialchars($article["section_title"], ENT_QUOTES | ENT_HTML401, 'UTF-8') . "'," . //s_title  
                         ");\n");  
         }  
128    
129          echo ("</script>\n");                  if ($article["lock"])
130                    {
131                            $status_str .= "<font color=red>x</font>";
132                    }
133                    
134                    $title = split_line(htmlspecialchars($article["title"], ENT_QUOTES | ENT_HTML401, 'UTF-8'), "", 50, 2, "<br />");
135                    $username = htmlspecialchars($article["username"], ENT_QUOTES | ENT_HTML401, 'UTF-8');
136                    $nickname = htmlspecialchars($article["nickname"], ENT_QUOTES | ENT_HTML401, 'UTF-8');
137                    $user_viewable = (isset($result_set["data"]["author_list"][$article["uid"]]));
138                    $last_reply_username = htmlspecialchars($article["last_reply_username"], ENT_QUOTES | ENT_HTML401, 'UTF-8');
139                    $last_reply_nickname = htmlspecialchars($article["last_reply_nickname"], ENT_QUOTES | ENT_HTML401, 'UTF-8');
140                    $last_reply_user_viewable = (isset($result_set["data"]["author_list"][$article["last_reply_uid"]]));
141                    $class_title = htmlspecialchars($article["class_title"], ENT_QUOTES | ENT_HTML401, 'UTF-8');
142                    $section_title = htmlspecialchars($article["section_title"], ENT_QUOTES | ENT_HTML401, 'UTF-8');
143    ?>
144            <tr height="30">
145                    <td width="4%" class="dark">
146                            <a class="s0" href="view_article.php?tn=xml&rpp=20&id=<?= $article["aid"]; ?>&ex=<?= $ex; ?>#<?= $article["aid"]; ?>" target=_blank>
147                                    <img src="images/<?= pic_file($status); ?>" border="0">
148                            </a>
149                    </td>
150                    <td width="39%" class="topic">
151                    <font color="green"><?= $class_title; ?>&gt;&gt;</font>
152                    <font color="green"><?= $section_title; ?>&gt;&gt;</font><br />
153    
154                            <a class="s0" href="view_article.php?id=<?= $article["aid"]; ?>&ex=<?= $ex; ?>&trash=<?= ($result_set["data"]["trash"] ? 1 : 0); ?>#<?= $article["aid"]; ?>" target=_blank title="发表时间:<?= $article["sub_dt"]->format("Y-m-d H:i:s") . "\n"; ?>文章长度:<?= $article["length"]; ?>字">
155                                    <img src="images/expression/<?= $article["icon"]; ?>.gif" border="0">
156    <?php
157                    if ($article["transship"])
158                    {
159    ?>
160                                    <font color=#b0b0b0>[转]</font>
161    <?      
162                    }
163    ?>
164                                    <?= $title; ?>
165                            </a>
166                            <?= $status_str; ?>
167                    </td>
168                    <td width="16%" class="dark">
169                            <a class="s2" href="show_profile.php?uid=<?= $article["uid"]; ?>" onclick='return <?= ($user_viewable ? "true" : "false"); ?>' title="<?= $article["username"]; ?>" target=_blank>
170                                    <?= $article["nickname"]; ?>
171                            </a>
172                    </td>
173                    <td width="10%" class="favor">
174                            <?= $article["reply_count"]; ?>/<?= $article["view_count"]; ?>
175                    </td>
176                    <td width="31%" class="reply"><?= $article["last_reply_dt"]->format("Y-m-d H:i:s"); ?> |
177    <?php
178                    if ($article["reply_count"] > 0)
179                    {
180    ?>
181                            <a class="s2" href="show_profile.php?uid=<?= $article["last_reply_uid"]; ?>" onclick='return <?= ($last_reply_user_viewable ? "true" : "false"); ?>' title="<?= $article["last_reply_username"]; ?>" target=_blank>
182                                    <?= $article["last_reply_nickname"]; ?>
183                            </a>
184    <?php
185                    }
186                    else
187                    {
188    ?>
189                            ------
190    <?      
191                    }
192  ?>  ?>
193  <table cols="3" border="0" cellpadding="0" cellspacing="0" width="770">                  </td>
194            </tr>
195    <?php
196            }
197    ?>
198    </table>
199    <table cols="3" border="0" cellpadding="0" cellspacing="0" width="1050">
200          <tr bgcolor="#d0d3F0" height="5">          <tr bgcolor="#d0d3F0" height="5">
201                  <td colspan="3"></td>                  <td colspan="3"></td>
202          </tr>          </tr>
# Line 127  function ch_rpp() Line 204  function ch_rpp()
204                  <td colspan="3"></td>                  <td colspan="3"></td>
205          </tr>          </tr>
206          <tr valign="top">          <tr valign="top">
207                  <td width="40%" align="left" style="color:#909090">                  <td width="40%" align="left" style="color: #909090">
208                  <form action="search_article.php" method="GET" id="search_form" name="search_form">                  <form action="search_article.php" method="GET" id="search_form" name="search_form">
209                          <a name="cp"></a>                          <a name="cp"></a>
210                          <input type="hidden" id="uid" name="uid" value="<? echo $result_set["data"]["uid"];?>">                          <input type="hidden" id="uid" name="uid" value="<?= $result_set["data"]["uid"];?>">
211                          <input type="hidden" id="nickname" name="nickname" value="<? echo $result_set["data"]["nickname"];?>">                          <input type="hidden" id="nickname" name="nickname" value="<?= $result_set["data"]["nickname"];?>">
212                          <input type="hidden" id="title" name="title" value="<? echo $result_set["data"]["title"];?>">                          <input type="hidden" id="title" name="title" value="<?= $result_set["data"]["title"];?>">
213                          <input type="hidden" id="content" name="content" value="<? echo $result_set["data"]["content"];?>">                          <input type="hidden" id="content" name="content" value="<?= $result_set["data"]["content"];?>">
214                          <input type="hidden" id="sid" name="sid" value="<? echo $result_set["data"]["sid"];?>">                          <input type="hidden" id="sid" name="sid" value="<?= $result_set["data"]["sid"];?>">
215                          <input type="hidden" id="begin_dt" name="begin_dt" value="<? echo $result_set["data"]["begin_dt"]->format("Y-m-d");?>">                          <input type="hidden" id="begin_dt" name="begin_dt" value="<?= $result_set["data"]["begin_dt"]->format("Y-m-d");?>">
216                          <input type="hidden" id="end_dt" name="end_dt" value="<? echo $result_set["data"]["end_dt"]->format("Y-m-d");?>">                          <input type="hidden" id="end_dt" name="end_dt" value="<?= $result_set["data"]["end_dt"]->format("Y-m-d");?>">
217                          <input type="hidden" id="reply" name="reply" value="<? echo $result_set["data"]["reply"]; ?>">                          <input type="hidden" id="reply" name="reply" value="<?= $result_set["data"]["reply"]; ?>">
218                          <input type="hidden" id="ex" name="ex" value="<? echo $result_set["data"]["ex"]; ?>">                          <input type="hidden" id="ex" name="ex" value="<?= $result_set["data"]["ex"]; ?>">
219                          <input type="hidden" id="original" name="original" value="<? echo $result_set["data"]["original"]; ?>">                          <input type="hidden" id="original" name="original" value="<?= $result_set["data"]["original"]; ?>">
220                          <input type="hidden" id="trash" name="trash" value="<? echo $result_set["data"]["trash"]; ?>">                          <input type="hidden" id="trash" name="trash" value="<?= $result_set["data"]["trash"]; ?>">
221                          每页<select size="1" id="rpp" name="rpp" onchange="ch_rpp();">                          每页<select size="1" id="rpp" name="rpp" onchange="ch_rpp();">
222  <?  <?php
223          foreach ($BBS_list_rpp_options as $v)          foreach ($BBS_list_rpp_options as $v)
224          {          {
225                  echo ("<option value=\"$v\"" . ($v == $result_set["data"]["rpp"] ? " selected" : "") . ">$v</option>");                  echo ("<option value=\"$v\"" . ($v == $result_set["data"]["rpp"] ? " selected" : "") . ">$v</option>");
226          }          }
227  ?>  ?>
228                          </select>篇                          </select>篇
229  <?  <?php
230          if ($result_set["data"]["page"] > 1)          if ($result_set["data"]["page"] > 1)
231          {          {
232  ?>  ?>
233  <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>
234  <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>
235  <?  <?php
236          }          }
237          else          else
238          {          {
239  ?>  ?>
240  <font face=webdings>9 7</font>  |◀ ◀
241  <?  <?php
242          }          }
243  ?>  ?>
244                          第<input id="page" name="page" value="<? echo ($result_set["data"]["page"]) ; ?>" style="width: 30px;">/<? echo $result_set["data"]["page_total"]; ?>页                          第<input id="page" name="page" value="<?= ($result_set["data"]["page"]) ; ?>" style="width: 30px;">/<?= $result_set["data"]["page_total"]; ?>页
245  <?  <?php
246          if ($result_set["data"]["page"] < $result_set["data"]["page_total"])          if ($result_set["data"]["page"] < $result_set["data"]["page_total"])
247          {          {
248  ?>  ?>
249  <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>
250  <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>
251  <?  <?php
252          }          }
253          else          else
254          {          {
255  ?>  ?>
256  <font face=webdings>8 :</font>  ▶ ▶|
257  <?  <?php
258          }          }
259  ?>  ?>
260                          </form>                          </form>
# Line 189  function ch_rpp() Line 266  function ch_rpp()
266          </tr>          </tr>
267  </table>    </table>  
268  </center>  </center>
269  <?  <?php
270          include "./foot.inc.php";          include "./foot.inc.php";
271  ?>  ?>
272  </body>  </body>


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

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