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

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

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

Revision 1.2 by sysadm, Sat Apr 12 11:36:06 2025 UTC Revision 1.3 by sysadm, Sun Apr 13 08:05:43 2025 UTC
# Line 7  Line 7 
7    
8          require_once "../lib/lml.inc.php";          require_once "../lib/lml.inc.php";
9          require_once "../lib/str_process.inc.php";          require_once "../lib/str_process.inc.php";
10    
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  ?>  ?>
34  <html>  <html>
35  <head>  <head>
# Line 54  TD.topic:hover Line 77  TD.topic:hover
77  </style>  </style>
78    
79  <script type="text/javascript" src="../js/nw_open.js"></script>  <script type="text/javascript" src="../js/nw_open.js"></script>
 <script type="text/javascript" src="../js/bbs_article.js"></script>  
80  <script type="text/javascript">  <script type="text/javascript">
81  function ch_page(page)  function ch_page(page)
82  {  {
# Line 218  window.addEventListener("load", () => { Line 240  window.addEventListener("load", () => {
240  </table>  </table>
241  <div id="article_list"></div>  <div id="article_list"></div>
242  <?  <?
         echo ("<script language=\"JavaScript\">\n");  
   
243          foreach ($result_set["data"]["articles"] as $article)          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"))));                  $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));                  $status = ($article["visited"] ? strtolower($status) : strtoupper($status));
247    
248                  echo ("show_article(" .                  if ($status == "n" || $status == "h")
249                          $article["tid"] . ", " . //tid                  {
250                          $article["aid"] . ", " . //aid                          $ss = "";
251                          "'" . split_line(htmlspecialchars($article["title"], ENT_QUOTES | ENT_HTML401, 'UTF-8'), "", 42, 2, "<br />") . "', " . //title                  }
252                          $result_set["data"]["ex"] . ", " . //ex                  else if ($status == "H")
253                          "'$status', " . //status                  {
254                          "'" . $article["sub_dt"]->format("Y-m-d H:i") . "', " . //sub_dt                          $ss = "N";
255                          "'" . $article["length"] . "', " . //length                  }
256                          $article["icon"] . ", " . //icon                  else
257                          $article["uid"] . ", " . //uid                  {
258                          "'" . htmlspecialchars($article["username"], ENT_QUOTES | ENT_HTML401, 'UTF-8') . "', " . //username                          $ss = $status;
259                          "'" . htmlspecialchars($article["nickname"], ENT_QUOTES | ENT_HTML401, 'UTF-8') . "', " . //nickname                  }
260                          $article["reply_count"] . ", " . //reply_count  
261                          $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  
                         "0, " . //visible_mode  
                         $result_set["data"]["use_nick"] . //use_nick  
                         ");\n");  
         }  
262    
263          echo ("</script>\n");                  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    <table cols="5" border="0" cellpadding="0" cellspacing="0" width="770">
275            <tr height="30">
276                    <td width="4%" class="dark">
277                            <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>
278                                    <img src="images/<? echo pic_file($status); ?>" border="0">
279                            </a>
280                    </td>
281                    <td width="39%" class="topic">
282                            <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"]; ?>字">
283                                    <img src="images/expression/<? echo $article["icon"]; ?>.gif" border="0">
284    <?
285                    if ($article["transship"])
286                    {
287    ?>
288                                    <font color=#b0b0b0>[转]</font>
289    <?      
290                    }
291    ?>
292                                    <? echo $title; ?>
293                            </a>
294                            <? echo $status_str; ?>
295                    </td>
296                    <td width="16%" class="dark">
297                            <a class="s2" href="show_profile.php?uid=<? echo $article["uid"]; ?>" title="<? echo ($result_set["data"]["use_nick"] ? $username : $nickname); ?>" target=_blank>
298                                    <? echo ($result_set["data"]["use_nick"] ? $nickname : $username); ?>
299                            </a>
300                    </td>
301                    <td width="10%" class="favor">
302                            <? echo $article["reply_count"]; ?>/<? echo $article["view_count"]; ?>
303                    </td>
304                    <td width="31%" class="reply"><? echo $article["last_reply_dt"]->format("Y-m-d H:i"); ?> |
305    <?
306                    if ($article["reply_count"] > 0)
307                    {
308    ?>
309                            <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>
310                                    <? echo ($result_set["data"]["use_nick"] ? $last_reply_nickname : $last_reply_username); ?>
311                            </a>
312    <?
313                    }
314                    else
315                    {
316    ?>
317                            ------
318    <?      
319                    }
320    ?>
321                    </td>
322            </tr>
323    </table>
324    <?
325            }
326  ?>  ?>
327  <table cols="3" border="0" cellpadding="0" cellspacing="0" width="770">  <table cols="3" border="0" cellpadding="0" cellspacing="0" width="770">
328          <tr bgcolor="#d0d3F0" height="5">          <tr bgcolor="#d0d3F0" height="5">


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

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