/[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.3 by sysadm, Fri Apr 11 03:45:26 2025 UTC Revision 1.8 by sysadm, Sun Apr 27 04:32:05 2025 UTC
# Line 1  Line 1 
1  <?  <?php
2          require_once "./section_list.inc.php";          require_once "../bbs/section_list.inc.php";
3    
4          // Load section list          function section_list_dst(mysqli $db_conn, int $sid_exclude = 0) : string
5          $section_hierachy = array();          {
6                    ob_start();
7    
8                    // Load section list
9                    $section_hierachy = array();
10    
11                    $ret = load_section_list($section_hierachy,
12                            function (array $section, array $filter_param) : bool
13                            {
14                                    return ($section["SID"] != $filter_param["sid"] && $_SESSION["BBS_priv"]->checkpriv($section["SID"], S_POST));
15                            },
16                            function (array $section, array $filter_param) : mixed
17                            {
18                                    return null;
19                            },
20                            $db_conn,
21                            array(
22                                    "sid" => $sid_exclude,
23                            )
24                    );
25    
26          $ret = load_section_list($section_hierachy,                  if ($ret == false)
                 function (int $s) : bool  
27                  {                  {
28                          global $sid;                          echo mysqli_error($db_conn);
29                          return ($s != $sid && $_SESSION["BBS_priv"]->checkpriv($s, S_POST));  
30                  },                          echo <<<HTML
31                  function (int $s) : mixed                                  <option value="0">---数据查询错误---</option>
32                            HTML;
33                    }
34                    else
35                  {                  {
36                          return null;                          echo <<<HTML
37                  },                                  <option value="0">-----选择版块-----</option>
38                  $db_conn);                          HTML;
39                    }
40    
41          if ($ret == false)                  foreach ($section_hierachy as $c_index => $section_class)
         {  
                 echo mysqli_error($db_conn);  
 ?>  
         <option value="0">---数据查询错误---</option>  
 <?  
         }  
         else  
         {  
 ?>  
         <option value="0">---选择别的版块---</option>  
 <?  
         }  
           
         foreach ($section_hierachy as $c_index => $section_class)  
         {  
 ?>  
         <option value="0">==<? echo $section_class["title"]; ?>==</option>  
 <?  
                 foreach ($section_class["sections"] as $s_index => $section)  
42                  {                  {
43  ?>                          echo <<<HTML
44          <option value="<? echo $section["sid"]; ?>">&nbsp;&nbsp;├<? echo $section["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          unset($section_hierachy);                  unset($section_hierachy);
56    
57                    $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