/[LeafOK_CVS]/fenglin/bbs/list.php
ViewVC logotype

Diff of /fenglin/bbs/list.php

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

Revision 1.1 by sysadm, Fri Apr 11 12:51:13 2025 UTC Revision 1.3 by sysadm, Sat Apr 12 05:02:55 2025 UTC
# Line 1  Line 1 
1  <?  <?
2          require_once "../lib/db_open.inc.php";          require_once "../lib/db_open.inc.php";
         require_once "../lib/lml.inc.php";  
         require_once "../lib/str_process.inc.php";  
3          require_once "./session_init.inc.php";          require_once "./session_init.inc.php";
4            require_once "./section_list_gen.inc.php";
5          require_once "./message.inc.php";          require_once "./message.inc.php";
6  ?>          require_once "./theme.inc.php";
 <?  
 $redir = $_SERVER["SCRIPT_NAME"] .  
         (isset($_SERVER["QUERY_STRING"]) ? "?" . urlencode($_SERVER["QUERY_STRING"]) : "");  
7    
8  $sid = (isset($_GET["sid"]) ? intval($_GET["sid"]) : $BBS_default_sid);          $result_set = array(
9  $ex = (isset($_GET["ex"]) && $_GET["ex"] == "1" ? 1 : 0);                  "return" => array(
10  $reply = (isset($_GET["reply"]) && $_GET["reply"] == "1" ? 1 : 0);                          "code" => 0,
11  $use_nick = (isset($_GET["use_nick"]) && $_GET["use_nick"] == "0" ? 0 : 1);                          "message" => "",
12  $sort = (isset($_GET["sort"]) ? $_GET["sort"] : "topic");                          "errorFields" => array(),
13  $search_text = (isset($_GET["search_text"]) ? $_GET["search_text"] : "");                  )
14  $page = (isset($_GET["page"]) ? intval($_GET["page"]) : 1);          );
15  $rpp = (isset($_GET["rpp"]) ? intval($_GET["rpp"]) : 20);  
16            $redir = $_SERVER["SCRIPT_NAME"] .
17  if (!$_SESSION["BBS_priv"]->checkpriv($sid, S_LIST))                  (isset($_SERVER["QUERY_STRING"]) ? "?" . urlencode($_SERVER["QUERY_STRING"]) : "");
18  {  
19          force_login();          $sid = (isset($_GET["sid"]) ? intval($_GET["sid"]) : $BBS_default_sid);
20            $ex = (isset($_GET["ex"]) && $_GET["ex"] == "1" ? 1 : 0);
21          echo ("您无权访问该版块!");          $reply = (isset($_GET["reply"]) && $_GET["reply"] == "1" ? 1 : 0);
22          exit();          $use_nick = (isset($_GET["use_nick"]) && $_GET["use_nick"] == "0" ? 0 : 1);
23  }          $sort = (isset($_GET["sort"]) ? $_GET["sort"] : "topic");
24            $search_text = (isset($_GET["search_text"]) ? $_GET["search_text"] : "");
25  switch($sort)          $page = (isset($_GET["page"]) ? intval($_GET["page"]) : 1);
26  {          $rpp = (isset($_GET["rpp"]) ? intval($_GET["rpp"]) : 20);
27          case "topic":  
28                  $sort_sql = "sub_dt DESC"; //sub_dt          if (!$_SESSION["BBS_priv"]->checkpriv($sid, S_LIST))
                 break;  
         case "reply":  
                 $sort_sql = "last_reply_dt DESC";  
                 break;  
         case "hot":  
                 $sort_sql = "(view_count + reply_count) DESC";  
                 break;  
         default:  
                 echo ("不支持的排序方式!");  
                 exit();  
 }  
   
 $sql = "SELECT section_config.sname, section_config.title AS s_title,  
                 section_config.announcement, section_class.title AS c_title, section_class.cname  
                 FROM section_config INNER JOIN section_class ON section_config.CID = section_class.CID  
                 WHERE section_config.SID = $sid AND section_config.enable AND section_class.enable";  
   
 $rs = mysqli_query($db_conn, $sql);  
 if ($rs == false)  
 {  
         echo("数据查询错误:" . mysqli_error($db_conn));  
         exit();  
 }  
   
 if($row = mysqli_fetch_array($rs))  
 {  
         $class_title = $row["c_title"];  
         $class_name = $row["cname"];  
         $section_name = $row["sname"];  
         $section_title = $row["s_title"];  
         $announcement = $row["announcement"];  
 }  
 else  
 {  
         echo("版块不存在!");  
         exit();  
 }  
   
 mysqli_free_result($rs);  
   
 $search_topic = mysqli_real_escape_string($db_conn, $search_text);  
   
 $sql = "SELECT count(*) AS article_count FROM bbs WHERE SID = $sid AND visible AND " .  
         ($reply ? "" : " TID = 0 AND ") .  
         ($ex ? " excerption AND " : "") .  
         " title LIKE '%" . $search_topic . "%'";  
   
 $rs = mysqli_query($db_conn, $sql);  
 if ($rs == false)  
 {  
         echo("数据查询错误:" . mysqli_error($db_conn));  
         exit();  
 }  
   
 $toa = 0;  
 if ($row = mysqli_fetch_array($rs))  
 {  
         $toa = $row["article_count"];  
 }  
   
 mysqli_free_result($rs);  
   
 if (!in_array($rpp, $BBS_list_rpp_options))  
 {  
         $rpp = $BBS_list_rpp_options[0];  
 }  
   
 $page_total = ceil($toa / $rpp);  
 if ($page > $page_total)  
 {  
         $page = $page_total;  
 }  
   
 if ($page <= 0)  
 {  
         $page = 1;  
 }  
   
 if ($_SESSION["BBS_uid"] > 0 && time() - $_SESSION["BBS_last_msg_check"] >= $BBS_check_msg_interval)  
 {  
         $_SESSION["BBS_new_msg"] = check_new_msg($_SESSION["BBS_uid"], $db_conn);  
         $_SESSION["BBS_last_msg_check"] = time();  
 }  
 ?>  
 <html>  
 <head>  
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">  
 <title><? echo $section_title . "——" . ($ex ? "文摘区" : "讨论区"); ?></title>  
 <link rel="stylesheet" href="css/default.css" type="text/css">  
 <style type="text/css">  
 TD.head,TD.favor,TD.reply,TD.dark,TD.topic  
 {  
         border-right: #d0d3F0 1px solid;  
         border-left: #d0d3F0 1px solid;  
         border-bottom: #d0d3F0 1px solid;  
 }  
 TD.head  
 {  
         font-family: 楷体;  
         color: blue;  
 }  
 TD.favor,TD.dark  
 {  
         text-align: center;  
 }  
 TD.reply,TD.dark  
 {  
         color: #909090;  
         background-color: #eaf0Fa;  
 }  
 TD.head,TD.favor  
 {  
         background-color: #fafbfc;  
 }  
 TD.favor  
 {  
         color: #c0c3f0;  
         font-weight: bold;  
 }  
 TD.topic  
 {  
         background-color: #fafbfc;  
 }  
 TD.topic:hover  
 {  
         background-color: #eaf0Fa;  
 }  
 </style>  
   
 <script type="text/javascript" src="../js/nw_open.js"></script>  
 <script type="text/javascript" src="../js/bbs_article.js"></script>  
 <script type="text/javascript">  
 function ch_page(page)  
 {  
         document.change_page.page.value = page;  
         document.change_page.submit();  
         return false;  
 }  
   
 function ch_rpp()  
 {  
         document.change_page.page.value = Math.floor((document.change_page.page.value - 1) * <? echo $rpp; ?> / document.change_page.rpp.value) + 1;  
         document.change_page.submit();  
         return false;  
 }  
   
 function ch_sect(sid)  
 {  
         if (sid > 0)  
         {  
                 document.change_page.sid.value = sid;  
                 document.change_page.page.value = 1;  
                 document.change_page.submit();  
         }  
         return false;  
 }  
   
 function ch_ex(ex)  
 {  
         document.change_page.ex.value = ex;  
         document.change_page.submit();  
         return false;  
 }  
   
 function ch_reply(reply)  
 {  
         document.change_page.reply.value = reply;  
         document.change_page.submit();  
         return false;  
 }  
   
 function use_nick(use)  
 {  
         document.change_page.use_nick.value = use;  
         document.change_page.submit();  
         return false;  
 }  
   
 function ch_sort(type)  
 {  
         document.change_page.sort.value = type;  
         document.change_page.submit();  
         return false;  
 }  
   
 window.addEventListener("load", () => {  
         var s = document.change_section.sid;  
         for (i = 0; i < s.options.length; i++)  
29          {          {
30                  if (s.options[i].value == <? echo $sid; ?>)                  force_login();
31                  {          }
32                          s.selectedIndex = i;  
33            switch($sort)
34            {
35                    case "topic":
36                            $sort_sql = "sub_dt DESC"; //sub_dt
37                          break;                          break;
38                  }                  case "reply":
39                            $sort_sql = "last_reply_dt DESC";
40                            break;
41                    case "hot":
42                            $sort_sql = "(view_count + reply_count) DESC";
43                            break;
44                    default:
45                            $result_set["return"]["code"] = -1;
46                            $result_set["return"]["message"] = "不支持的排序方式";
47    
48                            mysqli_close($db_conn);
49                            exit(json_encode($result_set));
50          }          }
 });  
51    
52  </script>          $sql = "SELECT section_config.sname, section_config.title AS s_title,
53  </head>                          section_config.announcement, section_class.title AS c_title, section_class.cname
54  <body>                          FROM section_config INNER JOIN section_class ON section_config.CID = section_class.CID
55  <center>                          WHERE section_config.SID = $sid AND section_config.enable AND section_class.enable";
56  <table cols="2" border="0" cellpadding="0" cellspacing="0" width="770">  
57          <tr>          $rs = mysqli_query($db_conn, $sql);
58                  <td width="60%" style="color: green;">          if ($rs == false)
                         <a class="s2" href="main.php?sid=<? echo $sid; ?>"><? echo $BBS_name; ?></a>&gt;&gt;<? echo ($class_title . "[" . $class_name . "]"); ?>&gt;&gt;<? echo ($section_title."[".$section_name."]"); ?>&gt;&gt;<? echo ($ex ? "文摘区" : "讨论区"); ?>  
                 </td>  
                 <td width="40%" align="right" style="color: gray;">  
 <?  
         if ($_SESSION["BBS_uid"] == 0)  
59          {          {
60  ?>                  $result_set["return"]["code"] = -2;
61                  [<a class="s2" href="index.php?redir=<? echo $redir; ?>">登录</a>]                  $result_set["return"]["message"] = "Query data error: " . mysqli_error($db_conn);
62  <?  
63                    mysqli_close($db_conn);
64                    exit(json_encode($result_set));
65            }
66    
67            if($row = mysqli_fetch_array($rs))
68            {
69                    $class_title = $row["c_title"];
70                    $class_name = $row["cname"];
71                    $section_name = $row["sname"];
72                    $section_title = $row["s_title"];
73                    $announcement = $row["announcement"];
74          }          }
75          else          else
76          {          {
77                  if ($_SESSION["BBS_new_msg"] > 0)                  $result_set["return"]["code"] = -1;
78                  {                  $result_set["return"]["message"] = "版块不存在";
79  ?>  
80          [<a class="s6" href="read_msg.php" target=_blank><? echo $_SESSION["BBS_new_msg"]; ?>条新消息</a>]                  mysqli_close($db_conn);
81  <?                  exit(json_encode($result_set));
                 }  
 ?>  
                 欢迎回来&nbsp;<font color=blue><? echo ($_SESSION["BBS_username"]); ?></font>  
                 [<a class="s6" href="logout.php">退出</a>]  
 <?  
82          }          }
 ?>  
                 </td>  
         </tr>  
 </table>  
 <table cols="2" border="0" cellpadding="0" cellspacing="0" width="770">  
         <tr bgcolor="#d0d3F0" height="2">  
         <td colspan="2"></td>  
         </tr>  
         <tr>  
         <td class="dark" width="3%"><img src="images/master.gif" width="16" height="16" alt="本版版主"></td>  
             <td class="head" width="97%">  
 <?  
 $sql = "SELECT user_list.UID, user_list.username, section_master.major FROM section_master  
                 INNER JOIN user_list ON section_master.UID = user_list.UID  
                 WHERE SID = $sid AND section_master.enable AND (NOW() BETWEEN begin_dt AND end_dt)  
                 ORDER BY major DESC";  
   
 $rs = mysqli_query($db_conn, $sql);  
 if ($rs == false)  
 {  
         echo "版主数据查询错误:" . mysqli_error($db_conn);  
         exit();  
 }  
83    
84  while($row = mysqli_fetch_array($rs))          mysqli_free_result($rs);
 {  
 ?>  
                         <img src="images/<? echo ($row["major"] ? "master_major.gif" : "master_minor.gif"); ?>" width="12" height="11" alt="<? echo ($row["major"] ? "正版主" : "副版主"); ?>"><a class="s3" href="show_profile.php?uid=<? echo $row['UID']; ?>" target=_blank title="查看版主资料"><? echo $row["username"]; ?></a>&nbsp;&nbsp;  
 <?  
 }  
85    
86  mysqli_free_result($rs);          $search_topic = mysqli_real_escape_string($db_conn, $search_text);
87  ?>  
88                  </td>          $sql = "SELECT count(*) AS article_count FROM bbs WHERE SID = $sid AND visible AND " .
89          </tr>                  ($reply ? "" : " TID = 0 AND ") .
90  <?                  ($ex ? " excerption AND " : "") .
91  if ($announcement != "")                  " title LIKE '%" . $search_topic . "%'";
92  {  
93  ?>          $rs = mysqli_query($db_conn, $sql);
94          <tr>          if ($rs == false)
95                  <td class="dark"><img src="images/announce.gif" width="18" height="18" alt="本版公告"></td>          {
96                  <td class="head">                  $result_set["return"]["code"] = -2;
97  <?                  $result_set["return"]["message"] = "Query data error: " . mysqli_error($db_conn);
98          echo (LML(htmlspecialchars($announcement, ENT_HTML401, 'UTF-8'), true));  
99  ?>                  mysqli_close($db_conn);
100                  </td>                  exit(json_encode($result_set));
101          </tr>          }
102  <?  
103  }          $toa = 0;
104  ?>          if ($row = mysqli_fetch_array($rs))
105          <tr>          {
106          <td class="dark"></td>                  $toa = $row["article_count"];
107              <td class="head" align="right">          }
108  <?          mysqli_free_result($rs);
109  if ($_SESSION["BBS_priv"]->checkpriv($sid, S_POST))  
110  {          if (!in_array($rpp, $BBS_list_rpp_options))
111  ?>          {
112                          <a class="s4" href="post.php?sid=<? echo $sid; ?>" title="发表新文章">发帖</a>&nbsp;                  $rpp = $BBS_list_rpp_options[0];
113  <?          }
114  }  
115  ?>          $page_total = ceil($toa / $rpp);
116                          <a class="s4" href="" onclick="return ch_ex(<? echo ($ex ? 0 : 1); ?>);" title="切换"><? echo ($ex ? "讨论区" : "文摘区"); ?></a>&nbsp;          if ($page > $page_total)
117                          <a class="s4" href="/gen_ex/<? echo $sid; ?>/" title="浏览本版块精华区" target=_blank>精华区</a>&nbsp;          {
118                          <a class="s4" href="" onclick="return ch_reply(<? echo ($reply ? 0 : 1); ?>);" title="切换文章显示模式"><? echo ($reply ? "主题" : "普通"); ?></a>&nbsp;                  $page = $page_total;
119                  </td>          }
120          </tr>  
121          <tr height="10">          if ($page <= 0)
122          <td colspan="2"></td>          {
123          </tr>                  $page = 1;
124  </table>          }
125  <table cols="5" border="0" cellpadding="0" cellspacing="0" width="770">  
126          <tr bgcolor="#d0d3F0" height="20">          if ($_SESSION["BBS_uid"] > 0 && time() - $_SESSION["BBS_last_msg_check"] >= $BBS_check_msg_interval)
127          <td width="4%" class="title">状态</td>          {
128              <td width="39%" class="title"><a class="s10" href="" onclick="return ch_sort('topic');" title="按主题发表时间排序">标题</a></td>                  $_SESSION["BBS_new_msg"] = check_new_msg($_SESSION["BBS_uid"], $db_conn);
129          <td width="16%" class="title"><a class="s10" href="" onclick="return use_nick(<? echo ($use_nick ? 0 : 1); ?>);" title="切换用户显示模式">作者</a></td>                  $_SESSION["BBS_last_msg_check"] = time();
130              <td width="10%" class="title"><a class="s10" href="" onclick="return ch_sort('hot');" title="按人气回复排序">回复/人气</a></td>          }
131          <td width="31%" class="title"><a class="s10" href="" onclick="return ch_sort('reply');" title="按最后回复时间排序">最后更新 | 回复人</a></td>  
132          </tr>          $section_select_options = section_list_gen($db_conn);
133  </table>  
134  <div id="article_list"></div>          // Fill up result data
135  <?          $result_set["data"] = array(
136  $sql = "SELECT * FROM bbs WHERE SID = $sid AND visible AND ".                  "redir" => $redir,
137          ($reply ? "" : " TID = 0 AND ") .                  "sid" => $sid,
138          ($ex ? " excerption AND " : "") .                  "ex" => $ex,
139          " title LIKE '%" . $search_topic . "%'".                  "reply" => $reply,
140          " ORDER BY ontop DESC, ".                  "use_nick" => $use_nick,
141          ($reply ? "sub_dt DESC" : $sort_sql).                  "sort" => $sort,
142          " LIMIT " . (($page - 1) * $rpp) . ", $rpp";                  "search_text" => $search_text,
143                    "page" => $page,
144  $rs = mysqli_query($db_conn, $sql);                  "rpp" => $rpp,
145  if ($rs == false)                  "page_total" => $page_total,
146  {  
147          echo "文章列表查询错误:" . mysqli_error($db_conn);                  "class_title" => $class_title,
148          exit();                  "class_name" => $class_name,
149  }                  "section_name" => $section_name,
150                    "section_title" => $section_title,
151  echo ("<script language=\"JavaScript\">\n");                  "announcement" => $announcement,
152                    "section_masters" => array(),
153  $visited_aid_list = array();  
154                    "section_select_options" => $section_select_options,
155  if ($_SESSION["BBS_uid"] > 0)  
156  {                  "articles" => array(),
157          $aid_list = "-1";          );
158    
159            // Query section master
160            $sql = "SELECT user_list.UID, user_list.username, section_master.major FROM section_master
161                            INNER JOIN user_list ON section_master.UID = user_list.UID
162                            WHERE SID = $sid AND section_master.enable AND (NOW() BETWEEN begin_dt AND end_dt)
163                            ORDER BY major DESC";
164    
165            $rs = mysqli_query($db_conn, $sql);
166            if ($rs == false)
167            {
168                    $result_set["return"]["code"] = -2;
169                    $result_set["return"]["message"] = "Query section master error: " . mysqli_error($db_conn);
170    
171                    mysqli_close($db_conn);
172                    exit(json_encode($result_set));
173            }
174    
175          while ($row = mysqli_fetch_array($rs))          while ($row = mysqli_fetch_array($rs))
176          {          {
177                  if ((new DateTimeImmutable("-" . $BBS_new_article_period . " day")) < (new DateTimeImmutable($row["sub_dt"])))                  array_push($result_set["data"]["section_masters"], array(
178                  {                          "uid" => $row["UID"],
179                          $aid_list .= (", " . $row["AID"]);                          "username" => $row["username"],
180                  }                          "major" => $row["major"],
181                  else                  ));
182                  {          }
183                          array_push($visited_aid_list, $row["AID"]);          mysqli_free_result($rs);
184                  }  
185            // Query articles
186            $sql = "SELECT * FROM bbs WHERE SID = $sid AND visible AND ".
187                    ($reply ? "" : " TID = 0 AND ") .
188                    ($ex ? " excerption AND " : "") .
189                    " title LIKE '%" . $search_topic . "%'".
190                    " ORDER BY ontop DESC, ".
191                    ($reply ? "sub_dt DESC" : $sort_sql).
192                    " LIMIT " . (($page - 1) * $rpp) . ", $rpp";
193    
194            $rs = mysqli_query($db_conn, $sql);
195            if ($rs == false)
196            {
197                    $result_set["return"]["code"] = -2;
198                    $result_set["return"]["message"] = "Query article list error: " . mysqli_error($db_conn);
199    
200                    mysqli_close($db_conn);
201                    exit(json_encode($result_set));
202          }          }
           
         mysqli_data_seek($rs, 0);  
203    
204          if ($aid_list != "-1")          $visited_aid_list = array();
205    
206            if ($_SESSION["BBS_uid"] > 0)
207          {          {
208                  $sql = "SELECT AID FROM view_article_log WHERE AID IN ($aid_list) AND UID = " . $_SESSION["BBS_uid"];                  $aid_list = "-1";
209    
210                  $rs_view = mysqli_query($db_conn, $sql);                  while ($row = mysqli_fetch_array($rs))
                 if ($rs_view == false)  
211                  {                  {
212                          echo "文章查看记录查询错误:" . mysqli_error($db_conn);                          if ((new DateTimeImmutable("-" . $BBS_new_article_period . " day")) < (new DateTimeImmutable($row["sub_dt"])))
213                          exit();                          {
214                                    $aid_list .= (", " . $row["AID"]);
215                            }
216                            else
217                            {
218                                    array_push($visited_aid_list, $row["AID"]);
219                            }
220                  }                  }
221                            
222                  while ($row_view = mysqli_fetch_array($rs_view))                  mysqli_data_seek($rs, 0);
223    
224                    if ($aid_list != "-1")
225                  {                  {
226                          array_push($visited_aid_list, $row_view["AID"]);                          $sql = "SELECT AID FROM view_article_log WHERE AID IN ($aid_list) AND UID = " . $_SESSION["BBS_uid"];
227    
228                            $rs_view = mysqli_query($db_conn, $sql);
229                            if ($rs_view == false)
230                            {
231                                    $result_set["return"]["code"] = -2;
232                                    $result_set["return"]["message"] = "Query view_article_log error: " . mysqli_error($db_conn);
233                    
234                                    mysqli_close($db_conn);
235                                    exit(json_encode($result_set));
236                            }
237                    
238                            while ($row_view = mysqli_fetch_array($rs_view))
239                            {
240                                    array_push($visited_aid_list, $row_view["AID"]);
241                            }
242                    
243                            mysqli_free_result($rs_view);
244                  }                  }
           
                 mysqli_free_result($rs_view);  
245          }          }
 }  
246    
247  while ($row = mysqli_fetch_array($rs))          while ($row = mysqli_fetch_array($rs))
248  {          {
249          $length = $row["length"];                  array_push($result_set["data"]["articles"], array(
250          $sub_dt = (new DateTimeImmutable($row["sub_dt"]))->setTimezone($_SESSION["BBS_user_tz"])->format("Y-m-d H:i");                          "aid" => $row["AID"],
251          $last_reply_dt = (new DateTimeImmutable($row["last_reply_dt"]))->setTimezone($_SESSION["BBS_user_tz"])->format("Y-m-d H:i");                          "tid" => $row["TID"],
252          $visited = (($_SESSION["BBS_uid"] > 0 && in_array($row["AID"], $visited_aid_list)) ? 1 : 0);                          "title" => $row["title"],
253          $status = ($row["ontop"] ? "B" : ($row["gen_ex"] ? "G" : ($row["excerption"] ? "M" : ($row["reply_count"] < 10 ? "N" : "H"))));                          "sub_dt" => (new DateTimeImmutable($row["sub_dt"]))->setTimezone($_SESSION["BBS_user_tz"]),
254          $status = ($visited ? strtolower($status) : strtoupper($status));                          "length" => $row["length"],
255                            "icon" => $row["icon"],
256          echo ("show_article(" .                          "uid" => $row["UID"],
257                  $row["TID"] . ", " . //tid                          "username" => $row["username"],
258                  $row["AID"] . ", " . //aid                          "nickname" => $row["nickname"],
259                  "'" . split_line(htmlspecialchars($row["title"], ENT_QUOTES | ENT_HTML401, 'UTF-8'), "", 42, 2, "<br />") . "', " . //title                          "reply_count" => $row["reply_count"],
260                  "$ex, " . //ex                          "view_count" => $row["view_count"],
261                  "'$status', " . //status                          "transship" => $row["transship"],
262                  "'" . $sub_dt . "', " . //sub_dt                          "lock" => $row["lock"],
263                  "'$length', " . //length                          "ontop" => $row["ontop"],
264                  $row["icon"] . ", " . //icon                          "excerption" => $row["excerption"],
265                  $row["UID"] . ", " . //uid                          "gen_ex" => $row["gen_ex"],
266                  "'" . htmlspecialchars($row["username"], ENT_QUOTES | ENT_HTML401, 'UTF-8') . "', " . //username                          "last_reply_dt" => (new DateTimeImmutable($row["last_reply_dt"]))->setTimezone($_SESSION["BBS_user_tz"]),
267                  "'" . htmlspecialchars($row["nickname"], ENT_QUOTES | ENT_HTML401, 'UTF-8') . "', " . //nickname                          "last_reply_uid" => $row["last_reply_UID"],
268                  $row["reply_count"] . ", " . //reply_count                          "last_reply_username" => $row["last_reply_username"],
269                  $row["view_count"] . ", " . //view_count                          "last_reply_nickname" => $row["last_reply_nickname"],
270                  $row["transship"] . ", " . //transship                          "visited" => (($_SESSION["BBS_uid"] > 0 && in_array($row["AID"], $visited_aid_list)) ? 1 : 0),
271                  $row["lock"] . ", " . //lock                  ));
272                  "'" . $last_reply_dt . "', " . //last_reply_dt          }
273                  $row["last_reply_UID"] . ", " . //last_reply_uid          mysqli_free_result($rs);
                 "'" . htmlspecialchars($row["last_reply_username"], ENT_QUOTES | ENT_HTML401, 'UTF-8') . "', " . //last_reply_username  
                 "'" . htmlspecialchars($row["last_reply_nickname"], ENT_QUOTES | ENT_HTML401, 'UTF-8') . "', " . //last_reply_nickname  
                 "0, " . //visible_mode  
                 $use_nick . //use_nick  
                 ");\n");  
 }  
274    
275  mysqli_free_result($rs);          mysqli_close($db_conn);
276    
277  echo ("</script>\n");          // Cleanup
278  ?>          unset($redir);
279  <table cols="3" border="0" cellpadding="0" cellspacing="0" width="770">          unset($sid);
280          <tr bgcolor="#d0d3F0" height="5">          unset($ex);
281                  <td colspan="3"></td></tr>          unset($reply);
282          <tr height="10">          unset($use_nick);
283                  <td colspan="3"></td></tr>          unset($sort);
284          <tr valign="top">          unset($search_text);
285                  <form action="bbs.php" method="get" id="change_page" name="change_page">          unset($search_topic);
286                  <td width="40%" style="color:#909090">          unset($page);
287                          <input type="hidden" id="sid" name="sid" value="<? echo $sid; ?>">          unset($rpp);
288                  <input type="hidden" id="reply" name="reply" value="<? echo $reply; ?>">          unset($page_total);
289                  <input type="hidden" id="ex" name="ex" value="<? echo $ex; ?>">  
290                  <input type="hidden" id="use_nick" name="use_nick" value="<? echo $use_nick; ?>">          unset($class_title);
291                  <input type="hidden" id="sort" name="sort" value="<? echo $sort; ?>">          unset($class_name);
292                          每页<select size="1" id="rpp" name="rpp" onchange="ch_rpp();">          unset($section_name);
293  <?          unset($section_title);
294          foreach ($BBS_list_rpp_options as $v)          unset($announcement);
295    
296            unset($section_select_options);
297    
298            // Output with theme view
299            $theme_view_file = get_theme_file("view/list", $_SESSION["BBS_theme_name"]);
300            if ($theme_view_file == null)
301          {          {
302                  echo ("<option value=\"$v\"" . ($v == $rpp ? " selected" : "") . ">$v</option>");                  exit(json_encode($result_set)); // Output data in Json
303          }          }
304            include $theme_view_file;
305  ?>  ?>
                         </select>篇  
 <?  
 if ($page > 1)  
 {  
 ?>  
                         <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(<? echo ($page - 1); ?>);"><font face=webdings>7</font></a>  
 <?  
 }  
 else  
 {  
 ?>  
 <font face=webdings>9 7</font>  
 <?  
 }  
 ?>  
                 第<input id="page" name="page" value="<? echo ($page) ; ?>" style="width: 30px;">/<? echo $page_total; ?>页  
 <?  
 if ($page < $page_total)  
 {  
 ?>  
                         <a class="s8" title="下一页" href="" onclick="return ch_page(<? echo ($page + 1); ?>);"><font face=webdings>8</font></a>  
                         <a class="s8" title="尾页" href="" onclick="return ch_page(<? echo ($page_total); ?>);"><font face=webdings>:</font></a>  
 <?  
 }  
 else  
 {  
 ?>  
 <font face=webdings>8 :</font>  
 <?  
 }  
 ?>  
                 </td>  
                 <td width="35%">  
                         <font color=#909090>查找文章</font>  
                         <input type="text" id="search_text" name="search_text" value="<? echo $search_text;?>" size="15"> <input type=image src="images/search.gif" alt="按主题内容查找文章" border="0"></a>  
                         <a class="s8" href="search_form.php?sid=<? echo $sid; ?>" target=_blank title="全功能检索">高级</a>&nbsp;  
                 </td>  
                 </form>  
                 <td width="25%" align="right">  
                         <form action="" method="get" id="change_section" name="change_section">  
                                 <select size="1" id="sid" name="sid" onchange="ch_sect(this.value);">  
 <?  
         include "section_list_gen.inc.php";  
 ?>  
                                 </select>  
                         </form>  
                 </td>  
         </tr>  
 </table>    
 </center>  
 <?  
         mysqli_close($db_conn);  
 ?>  
 <?  
 include "./foot.inc.php";  
 ?>  
 </body>  
 </html>  


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

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