update codes

This commit is contained in:
Amberstone 2024-09-20 22:12:00 +09:00
parent 4cc841ced1
commit e44492d5fc
Signed by: amber
GPG key ID: 094B0E55F98D8BF1
14 changed files with 291 additions and 251 deletions

2
.gitignore vendored
View file

@ -1,3 +1,5 @@
.vscode
.vscode/*
[Aa]vocado[Ee]dition_[Ll]ight/data
[Aa]vocado[Ee]dition_[Ll]ight/data/*
error.log

View file

@ -0,0 +1,49 @@
<?php
if (!defined('_GNUBOARD_'))
exit;
class Menu
{
public $mid;
public $name;
public $order;
public $target;
public $icon;
public $gnb_grp_div;
public function __construct($mid, $name, $target, $order = 0, $icon = "", $gnb_grp_div = 0)
{
$this->mid = $mid;
$this->name = $name;
$this->order = $order;
$this->target = $target;
$this->icon = $icon;
$this->gnb_grp_div = $gnb_grp_div;
}
}
class MenuCategory extends Menu
{
public $key;
public $childmenu;
public function __construct($key, $mid, $name, $target, $order = 0, $icon = '', $gnb_grp_div = 0)
{
$this->key = $key;
$this->childmenu = [];
parent::__construct($mid, $name, $target, $order, $icon, $gnb_grp_div);
}
public function addChildMenu($mid, $name, $target, $order = 0, $icon = '', $gnb_grp_div = 0)
{
$this->childmenu[] = new Menu($mid, $name, $target, $order, $icon, $gnb_grp_div);
usort($this->childmenu, function($a, $b) {
return $a->order - $b->order;
});
}
public function buildHtml()
{
global $g5, $is_admin, $auth, $menu, $auth_menu, $sub_menu;
}
}

View file

@ -5,26 +5,23 @@ if (!defined('_GNUBOARD_'))
function get_skin_select($skin_gubun, $id, $name, $selected = '', $event = '')
{
global $config;
$skins = array();
$skins = [];
if (defined('G5_THEME_PATH') && $config['cf_theme']) {
$dirs = get_skin_dir($skin_gubun, G5_THEME_PATH . '/' . G5_SKIN_DIR);
if (!empty($dirs)) {
foreach ($dirs as $dir) {
$skins[] = 'theme/' . $dir;
$skins[] = "theme/{$dir}";
}
}
}
$skins = array_merge($skins, get_skin_dir($skin_gubun));
$str = "<select id=\"$id\" name=\"$name\" $event>\n";
for ($i = 0; $i < count($skins); $i++) {
if ($i == 0)
$str .= "<option value=\"\">선택</option>";
if (preg_match('#^theme/(.+)$#', $skins[$i], $match))
$text = '(테마) ' . $match[1];
$text = "(테마) {$match[1]}";
else
$text = $skins[$i];
@ -38,14 +35,12 @@ function get_skin_select($skin_gubun, $id, $name, $selected = '', $event = '')
function get_mobile_skin_select($skin_gubun, $id, $name, $selected = '', $event = '')
{
global $config;
$skins = array();
$skins = [];
if (defined('G5_THEME_PATH') && $config['cf_theme']) {
$dirs = get_skin_dir($skin_gubun, G5_THEME_MOBILE_PATH . '/' . G5_SKIN_DIR);
if (!empty($dirs)) {
foreach ($dirs as $dir) {
$skins[] = 'theme/' . $dir;
$skins[] = "theme/{$dir}";
}
}
}
@ -57,7 +52,7 @@ function get_mobile_skin_select($skin_gubun, $id, $name, $selected = '', $event
if ($i == 0)
$str .= "<option value=\"\">선택</option>";
if (preg_match('#^theme/(.+)$#', $skins[$i], $match))
$text = '(테마) ' . $match[1];
$text = "(테마) {$match[1]}";
else
$text = $skins[$i];
@ -72,10 +67,8 @@ function get_mobile_skin_select($skin_gubun, $id, $name, $selected = '', $event
function get_skin_dir($skin, $skin_path = G5_SKIN_PATH)
{
global $g5;
$result_array = array();
$dirname = $skin_path . '/' . $skin . '/';
$result_array = [];
$dirname = implode(DIRECTORY_SEPARATOR, [$skin_path, $skin, ""]);
if (!is_dir($dirname))
return;
@ -96,7 +89,7 @@ function get_skin_dir($skin, $skin_path = G5_SKIN_PATH)
// 테마
function get_theme_dir()
{
$result_array = array();
$result_array = [];
$dirname = G5_PATH . '/' . G5_THEME_DIR . '/';
$handle = opendir($dirname);
@ -121,7 +114,7 @@ function get_theme_select($id, $name, $selected = '', $event = '')
{
global $config;
$theme = array();
$theme = [];
$theme = array_merge($theme, get_theme_dir());
$str = "<select id=\"$id\" name=\"$name\" $event>\n";
@ -139,8 +132,8 @@ function get_theme_select($id, $name, $selected = '', $event = '')
// 테마정보
function get_theme_info($dir)
{
$info = array();
$path = G5_PATH . '/' . G5_THEME_DIR . '/' . $dir;
$info = [];
$path = implode(DIRECTORY_SEPARATOR, [G5_PATH, G5_THEME_DIR, $dir]);
if (is_dir($path)) {
$screenshot = $path . '/screenshot.png';
@ -188,7 +181,7 @@ function get_theme_info($dir)
// 테마설정 정보
function get_theme_config_value($dir, $key = '*')
{
$tconfig = array();
$tconfig = [];
$theme_config_file = G5_PATH . '/' . G5_THEME_DIR . '/' . $dir . '/theme.config.php';
if (is_file($theme_config_file)) {
@ -207,8 +200,6 @@ function get_theme_config_value($dir, $key = '*')
return $tconfig;
}
// 회원권한을 SELECT 형식으로 얻음
function get_member_level_select($name, $start_id = 0, $end_id = 10, $selected = "", $event = "")
{
@ -236,7 +227,6 @@ function get_member_level_select($name, $start_id = 0, $end_id = 10, $selected =
return $str;
}
// 회원아이디를 SELECT 형식으로 얻음
function get_member_id_select($name, $level, $selected = "", $event = "")
{
@ -424,7 +414,7 @@ function admin_referer_check($return = false)
if (!$member['mb_id']) {
goto_url(G5_BBS_URL . '/login.php?url=' . urlencode(G5_ADMIN_URL));
} else if ($is_admin != 'super') {
$auth = array();
$auth = [];
$sql = " select au_menu, au_auth from {$g5['auth_table']} where mb_id = '{$member['mb_id']}' ";
$result = sql_query($sql);
for ($i = 0; $row = sql_fetch_array($result); $i++) {
@ -456,17 +446,20 @@ unset($auth_menu);
unset($menu);
unset($amenu);
$tmp = dir(G5_ADMIN_PATH);
while ($entry = $tmp->read()) {
if (!preg_match('/^admin.menu([0-9]{3}).*\.php$/', $entry, $m))
continue; // 파일명이 menu 으로 시작하지 않으면 무시한다.
$menu = [];
$amenu = [];
while ($entry = $tmp->read()) {
if (preg_match('/(.*?)\.menu\.php$/', $entry, $m)) {
include_once implode(DIRECTORY_SEPARATOR, [G5_ADMIN_PATH, $entry]);
$amenu[$m[1]] = $entry;
include_once(G5_ADMIN_PATH . '/' . $entry);
}
}
@ksort($amenu);
$arr_query = array();
$arr_query = [];
if (isset($sst))
$arr_query[] = 'sst=' . $sst;
if (isset($sod))

View file

@ -62,4 +62,3 @@ if ($w == 'ld')
goto_url('./boardgroupmember_list.php?gr_id=' . $gr_id);
else
goto_url('./boardgroupmember_form.php?mb_id=' . $mb_id);
?>

View file

@ -155,4 +155,4 @@ sql_query($sql);
//sql_query(" OPTIMIZE TABLE `$g5['config_table']` ");
goto_url('./config_form.php', false);
goto_url('./config_form.php');

View file

@ -57,4 +57,3 @@ $row = sql_fetch($sql);
$total_count2 = $row['cnt'];
alert('총 ' . number_format($total_count) . '건 중 ' . number_format($total_count - $total_count2) . '건 삭제 완료', './visit_delete.php');
?>

View file

@ -136,4 +136,3 @@ if (is_file($skin_file)) {
}
include_once('./qatail.php');
?>

View file

@ -379,8 +379,8 @@ if ($w == '' || $w == 'r') {
if (!$is_admin)
$sql_ip = " , wr_ip = '{$_SERVER['REMOTE_ADDR']}' ";
$sql = " update {$write_table}
set ca_name = '{$ca_name}',
$sql = "UPDATE {$write_table}
SET ca_name = '{$ca_name}',
wr_option = '{$html},{$secret},{$mail}',
wr_subject = '{$wr_subject}',
wr_content = '{$wr_content}',
@ -415,7 +415,7 @@ if ($w == '' || $w == 'r') {
wr_10= '{$wr_10}'
{$sql_ip}
{$sql_password}
where wr_id = '{$wr['wr_id']}' ";
WHERE wr_id = '{$wr['wr_id']}' ";
sql_query($sql);
// 분류가 수정되는 경우 해당되는 코멘트의 분류명도 모두 수정함
@ -727,4 +727,3 @@ if ($file_upload_msg)
alert($file_upload_msg, G5_HTTP_BBS_URL . '/board.php?bo_table=' . $bo_table . '&amp;wr_id=' . $wr_id . $qstr);
else
goto_url(G5_HTTP_BBS_URL . '/board.php?bo_table=' . $bo_table . '&amp;wr_id=' . $wr_id . $qstr);
?>

View file

@ -1,8 +1,8 @@
Theme Name: 샘플
Theme Name: 기본 테마
Theme URI:
Maker: Avocado
Maker URI: https://avocado-edition-rout.postype.com/
Version: 1.0.0
Detail: 샘플 테마는 기본적인 부분만을 제공하는 테마입니다.
Detail: 기본 테마는 기본적인 부분만을 제공하는 테마입니다.
License: GNU LESSER GENERAL PUBLIC LICENSE Version 2.1
License URI: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html