/[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.9 by sysadm, Tue Apr 29 11:55:32 2025 UTC
# Line 1  Line 1 
1  <?  <?php
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($section["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                    if ($ret == false)
27                    {
28                            echo mysqli_error($db_conn);
29    
30                          $last_cid = $row_section["CID"];                          echo <<<HTML
31                          $have_result = false;                                  <option value="0">---数据查询错误---</option>
32                          ob_start();                          HTML;
33  ?>  <option value="-<? echo $row_section["CID"]; ?>">==<? echo $row_section["c_title"]; ?>==</option>                  }
34  <?                  else
35                    {
36                            echo <<<HTML
37                                    <option value="0">-----选择版块-----</option>
38                            HTML;
39                  }                  }
40    
41                  if ($_SESSION["BBS_priv"]->checkpriv($row_section["SID"], S_POST))                  foreach ($section_hierachy as $c_index => $section_class)
42                  {                  {
43                          $have_result = true;                          echo <<<HTML
44  ?>  <option value="<? echo $row_section["SID"];?>">&nbsp;&nbsp;├<? echo $row_section["s_title"]; ?></option>                                  <option value="0">=={$section_class["title"]}==</option>
45  <?                          HTML;
46    
47                            foreach ($section_class["sections"] as $s_index => $section)
48                            {
49                                    echo <<<HTML
50                                    <option value="{$section["sid"]}">&nbsp;&nbsp;├{$section["title"]}</option>
51                                    HTML;
52                            }
53                  }                  }
         }  
54    
55          if ($have_result)                  unset($section_hierachy);
         {  
                 ob_end_flush();  
         }  
         else  
         {  
                 ob_end_clean();  
         }  
56    
57          mysqli_free_result($rs_section);                  $buffer = ob_get_clean();
58  ?>  
59                    return $buffer;
60            }


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

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