| 1 |
<? |
<? |
| 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 |
$ret = load_section_list($section_hierachy, |
// Load section list |
| 9 |
function (int $s) : bool |
$section_hierachy = array(); |
|
{ |
|
|
global $sid; |
|
|
return ($s != $sid && $_SESSION["BBS_priv"]->checkpriv($s, S_POST)); |
|
|
}, |
|
|
function (int $s) : mixed |
|
|
{ |
|
|
return null; |
|
|
}, |
|
|
$db_conn); |
|
| 10 |
|
|
| 11 |
if ($ret == false) |
$ret = load_section_list($section_hierachy, |
| 12 |
{ |
function (array $section, array $filter_param) : bool |
| 13 |
echo mysqli_error($db_conn); |
{ |
| 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 |
|
if ($ret == false) |
| 27 |
|
{ |
| 28 |
|
echo mysqli_error($db_conn); |
| 29 |
?> |
?> |
| 30 |
<option value="0">---数据查询错误---</option> |
<option value="0">---数据查询错误---</option> |
| 31 |
<? |
<? |
| 32 |
} |
} |
| 33 |
else |
else |
| 34 |
{ |
{ |
| 35 |
?> |
?> |
| 36 |
<option value="0">---选择别的版块---</option> |
<option value="0">-----选择版块-----</option> |
| 37 |
<? |
<? |
| 38 |
} |
} |
| 39 |
|
|
| 40 |
foreach ($section_hierachy as $c_index => $section_class) |
foreach ($section_hierachy as $c_index => $section_class) |
| 41 |
{ |
{ |
| 42 |
?> |
?> |
| 43 |
<option value="0">==<? echo $section_class["title"]; ?>==</option> |
<option value="0">==<? echo $section_class["title"]; ?>==</option> |
| 44 |
<? |
<? |
| 45 |
foreach ($section_class["sections"] as $s_index => $section) |
foreach ($section_class["sections"] as $s_index => $section) |
| 46 |
{ |
{ |
| 47 |
?> |
?> |
| 48 |
<option value="<? echo $section["sid"]; ?>"> ├<? echo $section["title"]; ?></option> |
<option value="<? echo $section["sid"]; ?>"> ├<? echo $section["title"]; ?></option> |
| 49 |
<? |
<? |
| 50 |
|
} |
| 51 |
} |
} |
|
} |
|
| 52 |
|
|
| 53 |
unset($section_hierachy); |
unset($section_hierachy); |
| 54 |
|
|
| 55 |
|
$buffer = ob_get_clean(); |
| 56 |
|
|
| 57 |
|
return $buffer; |
| 58 |
|
} |
| 59 |
?> |
?> |