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


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

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