| 1 |
<? |
<? |
| 2 |
$sql = "SELECT section_config.SID, section_config.CID, section_config.title AS s_title, section_class.title AS c_title |
require_once "./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) |
// Load section list |
| 5 |
|
$section_hierachy = array(); |
| 6 |
|
|
| 7 |
|
$ret = load_section_list($section_hierachy, |
| 8 |
|
function (int $s) : bool |
| 9 |
|
{ |
| 10 |
|
global $sid; |
| 11 |
|
return ($s != $sid && $_SESSION["BBS_priv"]->checkpriv($s, S_POST)); |
| 12 |
|
}, |
| 13 |
|
function (int $s) : mixed |
| 14 |
|
{ |
| 15 |
|
return null; |
| 16 |
|
}, |
| 17 |
|
$db_conn); |
| 18 |
|
|
| 19 |
|
if ($ret == false) |
| 20 |
{ |
{ |
| 21 |
echo mysqli_error($db_conn); |
echo mysqli_error($db_conn); |
| 22 |
?> <option value="0">---数据查询错误---</option> |
?> |
| 23 |
|
<option value="0">---数据查询错误---</option> |
| 24 |
<? |
<? |
| 25 |
} |
} |
| 26 |
else |
else |
| 27 |
{ |
{ |
| 28 |
?> <option value="0">---选择别的版块---</option> |
?> |
| 29 |
|
<option value="0">---选择别的版块---</option> |
| 30 |
<? |
<? |
| 31 |
} |
} |
| 32 |
|
|
| 33 |
$last_cid = -1; |
foreach ($section_hierachy as $c_index => $section_class) |
|
$have_result = false; |
|
|
ob_start(); |
|
|
|
|
|
while ($rs_section != false && $row_section = mysqli_fetch_array($rs_section)) |
|
| 34 |
{ |
{ |
| 35 |
if ($row_section["CID"] != $last_cid) |
?> |
| 36 |
{ |
<option value="0">==<? echo $section_class["title"]; ?>==</option> |
| 37 |
if ($have_result) |
<? |
| 38 |
{ |
foreach ($section_class["sections"] as $s_index => $section) |
|
ob_end_flush(); |
|
|
} |
|
|
else |
|
|
{ |
|
|
ob_end_clean(); |
|
|
} |
|
|
|
|
|
$last_cid = $row_section["CID"]; |
|
|
$have_result = false; |
|
|
ob_start(); |
|
|
?> <option value="-<? echo $row_section['CID']; ?>">==<? echo $row_section["c_title"]; ?>==</option> |
|
|
<? |
|
|
} |
|
|
|
|
|
if ($_SESSION["BBS_priv"]->checkpriv($row_section["SID"], S_POST)) |
|
| 39 |
{ |
{ |
| 40 |
$have_result = true; |
?> |
| 41 |
?> <option value="<? echo $row_section['SID'];?>"> ├<? echo $row_section["s_title"]; ?></option> |
<option value="<? echo $section["sid"]; ?>"> ├<? echo $section["title"]; ?></option> |
| 42 |
<? |
<? |
| 43 |
} |
} |
| 44 |
} |
} |
| 45 |
|
|
| 46 |
if ($have_result) |
unset($section_hierachy); |
|
{ |
|
|
ob_end_flush(); |
|
|
} |
|
|
else |
|
|
{ |
|
|
ob_end_clean(); |
|
|
} |
|
|
|
|
|
mysqli_free_result($rs_section); |
|
| 47 |
?> |
?> |