/[LeafOK_CVS]/fenglin/bbs/section_list_dst.inc.php
ViewVC logotype

Diff of /fenglin/bbs/section_list_dst.inc.php

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

Revision 1.2 by sysadm, Fri Mar 28 11:56:54 2025 UTC Revision 1.4 by sysadm, Sat Apr 12 05:04:07 2025 UTC
# Line 1  Line 1 
1  <?  <?
2          $sql = "SELECT section_config.SID, section_config.CID, section_config.title AS s_title, section_class.title AS c_title          require_once "../bbs/section_list.inc.php";
                         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  
                         ORDER BY section_class.sort_order, section_config.sort_order";  
         $rs_section = mysqli_query($db_conn, $sql);  
3    
4          if ($rs_section == false)          function section_list_dst(mysqli $db_conn, int $sid_exclude = 0) : string
5          {          {
6                  echo mysqli_error($db_conn);                  ob_start();
 ?>      <option value="0">---数据查询错误---</option>  
 <?  
         }  
         else  
         {  
 ?>      <option value="0">---选择别的版块---</option>  
 <?  
         }  
7    
8          $last_cid = -1;                  // Load section list
9          $have_result = false;                  $section_hierachy = array();
         ob_start();  
10    
11          while ($rs_section != false && $row_section = mysqli_fetch_array($rs_section))                  $ret = load_section_list($section_hierachy,
12          {                          function (array $section, array $filter_param) : bool
                 if ($row_section["CID"] != $last_cid)  
                 {  
                         if ($have_result)  
13                          {                          {
14                                  ob_end_flush();                                  return ($section["SID"] != $filter_param["sid"] && $_SESSION["BBS_priv"]->checkpriv($secion["SID"], S_POST));
15                          }                          },
16                          else                          function (array $section, array $filter_param) : mixed
17                          {                          {
18                                  ob_end_clean();                                  return null;
19                          }                          },
20                            $db_conn,
21                            array(
22                                    "sid" => $sid_exclude,
23                            )
24                    );
25    
26                          $last_cid = $row_section["CID"];                  if ($ret == false)
27                          $have_result = false;                  {
28                          ob_start();                          echo mysqli_error($db_conn);
29  ?>  <option value="-<? echo $row_section["CID"]; ?>">==<? echo $row_section["c_title"]; ?>==</option>  ?>
30  <?                          <option value="0">---数据查询错误---</option>
31    <?
32                  }                  }
33                    else
34                  if ($_SESSION["BBS_priv"]->checkpriv($row_section["SID"], S_POST))                  {
35    ?>
36                            <option value="0">-----选择版块-----</option>
37    <?
38                    }
39                    
40                    foreach ($section_hierachy as $c_index => $section_class)
41                  {                  {
42                          $have_result = true;  ?>
43  ?>  <option value="<? echo $row_section["SID"];?>">&nbsp;&nbsp;├<? echo $row_section["s_title"]; ?></option>                          <option value="0">==<? echo $section_class["title"]; ?>==</option>
44  <?  <?
45                            foreach ($section_class["sections"] as $s_index => $section)
46                            {
47    ?>
48                            <option value="<? echo $section["sid"]; ?>">&nbsp;&nbsp;├<? echo $section["title"]; ?></option>
49    <?
50                            }
51                  }                  }
         }  
52    
53          if ($have_result)                  unset($section_hierachy);
54          {  
55                  ob_end_flush();                  $buffer = ob_get_clean();
         }  
         else  
         {  
                 ob_end_clean();  
         }  
56    
57          mysqli_free_result($rs_section);                  return $buffer;
58            }
59  ?>  ?>


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

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