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

Diff of /fenglin/bbs/msg_read.php

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

Revision 1.1 by sysadm, Wed Apr 23 06:31:34 2025 UTC Revision 1.5 by sysadm, Wed Feb 11 10:59:14 2026 UTC
# Line 137  Line 137 
137                  exit(json_encode($result_set));                  exit(json_encode($result_set));
138          }          }
139    
140          $unread_mid_list = "-1";          $unread_mid_list = array(-1);
141          while ($row = mysqli_fetch_array($rs))          while ($row = mysqli_fetch_array($rs))
142          {          {
143                  array_push($result_set["data"]["messages"], array(                  array_push($result_set["data"]["messages"], array(
# Line 148  Line 148 
148                          "new" => $row["new"],                          "new" => $row["new"],
149                          "nickname" => $row["nickname"],                          "nickname" => $row["nickname"],
150                  ));                  ));
151                    
152                  if (!$sent && $row["new"])                  if (!$sent && $row["new"])
153                  {                  {
154                          $unread_mid_list .= (", " . $row["MID"]);                          array_push($unread_mid_list, $row["MID"]);
155                  }                  }
156    
157          }          }
158          mysqli_free_result($rs);          mysqli_free_result($rs);
159    
160          if (!$sent && $unread_mid_list != "-1")          if (!$sent && count($unread_mid_list) > 1)
161          {          {
162                  $sql = "UPDATE bbs_msg SET new = 0 WHERE MID IN ($unread_mid_list)";                  $sql = "UPDATE bbs_msg SET new = 0 WHERE MID IN (" .
163                                    implode(",", $unread_mid_list) .
164                                    ")";
165    
166                  $rs = mysqli_query($db_conn, $sql);                  $rs = mysqli_query($db_conn, $sql);
167                  if ($rs == false)                  if ($rs == false)
168                  {                  {
169                          $result_set["return"]["code"] = -2;                          $result_set["return"]["code"] = -2;
170                          $result_set["return"]["message"] = "Update message error: " . mysqli_error($db_conn);                          $result_set["return"]["message"] = "Update message error: " . mysqli_error($db_conn);
171            
172                          mysqli_close($db_conn);                          mysqli_close($db_conn);
173                          exit(json_encode($result_set));                          exit(json_encode($result_set));
174                  }                  }
# Line 186  Line 188 
188          unset($unread_mid_list);          unset($unread_mid_list);
189    
190          // Output with theme view          // Output with theme view
191          $theme_view_file = get_theme_file("view/read_msg", $_SESSION["BBS_theme_name"]);          $theme_view_file = get_theme_file("view/msg_read", $_SESSION["BBS_theme_name"]);
192          if ($theme_view_file == null)          if ($theme_view_file == null)
193          {          {
194                  exit(json_encode($result_set)); // Output data in Json                  exit(json_encode($result_set)); // Output data in Json
195          }          }
196          include $theme_view_file;          include $theme_view_file;
 ?>  


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

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