| 31 |
}, |
}, |
| 32 |
function (array $section, array $filter_param) : mixed |
function (array $section, array $filter_param) : mixed |
| 33 |
{ |
{ |
| 34 |
return null; |
$db_conn = $filter_param["db"]; |
| 35 |
|
$result = array( |
| 36 |
|
"article_count" => 0, |
| 37 |
|
"section_master" => "", |
| 38 |
|
); |
| 39 |
|
|
| 40 |
|
// Query article count |
| 41 |
|
$sql = "SELECT COUNT(*) AS article_count FROM bbs WHERE SID = " . |
| 42 |
|
$section["SID"] . " AND visible"; |
| 43 |
|
|
| 44 |
|
$rs = mysqli_query($db_conn, $sql); |
| 45 |
|
if ($rs == false) |
| 46 |
|
{ |
| 47 |
|
echo mysqli_error($db_conn); |
| 48 |
|
return $result; |
| 49 |
|
} |
| 50 |
|
|
| 51 |
|
if ($row = mysqli_fetch_array($rs)) |
| 52 |
|
{ |
| 53 |
|
$result["article_count"] = $row["article_count"]; |
| 54 |
|
} |
| 55 |
|
mysqli_free_result($rs); |
| 56 |
|
|
| 57 |
|
// Query section master |
| 58 |
|
$sql = "SELECT user_list.UID, user_list.username, section_master.major FROM section_master |
| 59 |
|
INNER JOIN user_list ON section_master.UID = user_list.UID WHERE SID = " . |
| 60 |
|
$section["SID"] . " AND section_master.enable AND (NOW() BETWEEN begin_dt AND end_dt) |
| 61 |
|
ORDER BY major DESC LIMIT 1"; |
| 62 |
|
|
| 63 |
|
$rs = mysqli_query($db_conn, $sql); |
| 64 |
|
if ($rs == false) |
| 65 |
|
{ |
| 66 |
|
echo mysqli_error($db_conn); |
| 67 |
|
return $result; |
| 68 |
|
} |
| 69 |
|
|
| 70 |
|
if ($row = mysqli_fetch_array($rs)) |
| 71 |
|
{ |
| 72 |
|
$result["section_master"] = $row["username"]; |
| 73 |
|
} |
| 74 |
|
mysqli_free_result($rs); |
| 75 |
|
|
| 76 |
|
return $result; |
| 77 |
}, |
}, |
| 78 |
$db_conn); |
$db_conn, |
| 79 |
|
array( |
| 80 |
|
"db" => $db_conn |
| 81 |
|
) |
| 82 |
|
); |
| 83 |
|
|
| 84 |
if ($ret == false) |
if ($ret == false) |
| 85 |
{ |
{ |
| 91 |
$buffer .= <<<MENU |
$buffer .= <<<MENU |
| 92 |
#--------------------------------------------------------------------- |
#--------------------------------------------------------------------- |
| 93 |
%S_EGROUP |
%S_EGROUP |
| 94 |
·µ»Ø[[1;32m¡û[0;37m] ½øÈë[[1;32m¡ú[0;37m] Ñ¡Ôñ[[1;32m¡ü[0;37m,[1;32m¡ý[0;37m] |
·µ»Ø[[1;32m¡û[0;37m] ½øÈë[[1;32m¡ú[0;37m] Ñ¡Ôñ[[1;32m¡ü PgUp[0;37m,[1;32m¡ý PgDn[0;37m] |
| 95 |
[44;37m [1;37mÏÂÊô°æ¿é À¸Ä¿Ãû³Æ ÖÐ ÎÄ Ðð Êö [m |
[44;37m [1;37m°æ¿éÊýÁ¿ À¸Ä¿Ãû³Æ ÖÐ ÎÄ Ðð Êö [m |
| 96 |
|
|
| 97 |
|
|
| 98 |
|
|
| 128 |
$section_count = count($section_class["sections"]); |
$section_count = count($section_class["sections"]); |
| 129 |
|
|
| 130 |
$title_f = str_repeat(" ", 5 - intval(log10($section_count))) . $section_count . " £« " . |
$title_f = str_repeat(" ", 5 - intval(log10($section_count))) . $section_count . " £« " . |
| 131 |
$section_class['name'] . str_repeat(" ", 28 - strlen($section_class['name'])) . |
$section_class['name'] . str_repeat(" ", 32 - strlen($section_class['name'])) . |
| 132 |
"[" . addslashes($section_class['title']) . "]"; |
"[" . addslashes($section_class['title']) . "]"; |
| 133 |
|
|
| 134 |
$buffer .= <<<MENU |
$buffer .= <<<MENU |
| 148 |
$buffer .= <<<MENU |
$buffer .= <<<MENU |
| 149 |
#--------------------------------------------------------------------- |
#--------------------------------------------------------------------- |
| 150 |
%S__{$section_class["name"]} |
%S__{$section_class["name"]} |
| 151 |
·µ»Ø[[1;32m¡û[0;37m] ½øÈë[[1;32m¡ú[0;37m] Ñ¡Ôñ[[1;32m¡ü[0;37m,[1;32m¡ý[0;37m] |
·µ»Ø[[1;32m¡û[0;37m] ½øÈë[[1;32m¡ú[0;37m] Ñ¡Ôñ[[1;32m¡ü PgUp[0;37m,[1;32m¡ý PgDn[0;37m] |
| 152 |
[44;37m [1;37mÖ÷ÌâÊýÁ¿ °æ¿éÃû³Æ ÖÐ ÎÄ Ðð Êö [m |
[44;37m [1;37mÎÄÕÂÊýÁ¿ °æ¿éÃû³Æ À¸Ä¿ ÖÐ ÎÄ Ðð Êö °æ Ö÷ [m |
| 153 |
|
|
| 154 |
|
|
| 155 |
|
|
| 178 |
|
|
| 179 |
MENU; |
MENU; |
| 180 |
|
|
| 181 |
$class_title_f = "[" . addslashes($section_class['title']) . "]" . str_repeat(" ", 14 - str_length($section_class['title'])); |
$class_title_f = "[" . addslashes($section_class['title']) . "]" . str_repeat(" ", 10 - str_length($section_class['title'])); |
| 182 |
|
|
| 183 |
foreach ($section_class["sections"] as $s_index => $section) |
foreach ($section_class["sections"] as $s_index => $section) |
| 184 |
{ |
{ |
| 185 |
$display_row = ($s_index == 0 ? 4 : 0); |
$display_row = ($s_index == 0 ? 4 : 0); |
| 186 |
|
|
| 187 |
$topic_count = 0; // TODO |
$article_count = $section['udf_values']['article_count']; |
| 188 |
|
|
| 189 |
$title_f = str_repeat(" ", 5 - intval(log10($topic_count))) . $topic_count . " £« " . |
$title_f = str_repeat(" ", 5 - intval(log10($article_count))) . $article_count . " £« " . |
| 190 |
$section['name'] . str_repeat(" ", 22 - strlen($section['name'])) . |
$section['name'] . str_repeat(" ", 20 - strlen($section['name'])) . |
| 191 |
$class_title_f . |
$class_title_f . addslashes($section['title']) . str_repeat(" ", 22 - str_length($section['title'])) . |
| 192 |
addslashes($section['title']); |
$section['udf_values']['section_master']; |
| 193 |
|
|
| 194 |
$buffer .= <<<MENU |
$buffer .= <<<MENU |
| 195 |
@LIST_SECTION {$display_row}, 4, 1, {$section['read_user_level']}, "{$section['name']}", "{$title_f}" |
@LIST_SECTION {$display_row}, 4, 1, {$section['read_user_level']}, "{$section['name']}", "{$title_f}" |
| 208 |
$buffer .= <<<MENU |
$buffer .= <<<MENU |
| 209 |
#--------------------------------------------------------------------- |
#--------------------------------------------------------------------- |
| 210 |
%S_BOARD |
%S_BOARD |
| 211 |
·µ»Ø[[1;32m¡û[0;37m] ½øÈë[[1;32m¡ú[0;37m] Ñ¡Ôñ[[1;32m¡ü[0;37m,[1;32m¡ý[0;37m] |
·µ»Ø[[1;32m¡û[0;37m] ½øÈë[[1;32m¡ú[0;37m] Ñ¡Ôñ[[1;32m¡ü PgUp[0;37m,[1;32m¡ý PgDn[0;37m] |
| 212 |
[44;37m [1;37mÏÂÊô°æ¿é À¸Ä¿Ãû³Æ ÖÐ ÎÄ Ðð Êö [m |
[44;37m [1;37mÎÄÕÂÊýÁ¿ °æ¿éÃû³Æ À¸Ä¿ ÖÐ ÎÄ Ðð Êö °æ Ö÷ [m |
| 213 |
|
|
| 214 |
|
|
| 215 |
|
|
| 243 |
|
|
| 244 |
foreach ($section_hierachy as $c_index => $section_class) |
foreach ($section_hierachy as $c_index => $section_class) |
| 245 |
{ |
{ |
| 246 |
$class_title_f = "[" . addslashes($section_class['title']) . "]" . str_repeat(" ", 14 - str_length($section_class['title'])); |
$class_title_f = "[" . addslashes($section_class['title']) . "]" . str_repeat(" ", 10 - str_length($section_class['title'])); |
| 247 |
|
|
| 248 |
foreach ($section_class["sections"] as $s_index => $section) |
foreach ($section_class["sections"] as $s_index => $section) |
| 249 |
{ |
{ |
| 250 |
$topic_count = 0; // TODO |
$article_count = $section['udf_values']['article_count']; |
| 251 |
|
|
| 252 |
$title_f = str_repeat(" ", 5 - intval(log10($topic_count))) . $topic_count . " £« " . |
$title_f = str_repeat(" ", 5 - intval(log10($article_count))) . $article_count . " £« " . |
| 253 |
$section['name'] . str_repeat(" ", 22 - strlen($section['name'])) . |
$section['name'] . str_repeat(" ", 20 - strlen($section['name'])) . |
| 254 |
$class_title_f . |
$class_title_f . addslashes($section['title']) . str_repeat(" ", 22 - str_length($section['title'])) . |
| 255 |
addslashes($section['title']); |
$section['udf_values']['section_master']; |
| 256 |
|
|
| 257 |
$buffer .= <<<MENU |
$buffer .= <<<MENU |
| 258 |
@LIST_SECTION {$display_row}, 4, 1, {$section['read_user_level']}, "{$section['name']}", "{$title_f}" |
@LIST_SECTION {$display_row}, 4, 1, {$section['read_user_level']}, "{$section['name']}", "{$title_f}" |