update codes
This commit is contained in:
parent
4cc841ced1
commit
e44492d5fc
14 changed files with 291 additions and 251 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
|
@ -1,3 +1,5 @@
|
||||||
|
.vscode
|
||||||
|
.vscode/*
|
||||||
[Aa]vocado[Ee]dition_[Ll]ight/data
|
[Aa]vocado[Ee]dition_[Ll]ight/data
|
||||||
[Aa]vocado[Ee]dition_[Ll]ight/data/*
|
[Aa]vocado[Ee]dition_[Ll]ight/data/*
|
||||||
error.log
|
error.log
|
||||||
|
|
|
||||||
49
AvocadoEdition_Light/adm/_menu.class.php
Normal file
49
AvocadoEdition_Light/adm/_menu.class.php
Normal 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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -5,26 +5,23 @@ if (!defined('_GNUBOARD_'))
|
||||||
function get_skin_select($skin_gubun, $id, $name, $selected = '', $event = '')
|
function get_skin_select($skin_gubun, $id, $name, $selected = '', $event = '')
|
||||||
{
|
{
|
||||||
global $config;
|
global $config;
|
||||||
|
$skins = [];
|
||||||
$skins = array();
|
|
||||||
|
|
||||||
if (defined('G5_THEME_PATH') && $config['cf_theme']) {
|
if (defined('G5_THEME_PATH') && $config['cf_theme']) {
|
||||||
$dirs = get_skin_dir($skin_gubun, G5_THEME_PATH . '/' . G5_SKIN_DIR);
|
$dirs = get_skin_dir($skin_gubun, G5_THEME_PATH . '/' . G5_SKIN_DIR);
|
||||||
if (!empty($dirs)) {
|
if (!empty($dirs)) {
|
||||||
foreach ($dirs as $dir) {
|
foreach ($dirs as $dir) {
|
||||||
$skins[] = 'theme/' . $dir;
|
$skins[] = "theme/{$dir}";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$skins = array_merge($skins, get_skin_dir($skin_gubun));
|
$skins = array_merge($skins, get_skin_dir($skin_gubun));
|
||||||
|
|
||||||
$str = "<select id=\"$id\" name=\"$name\" $event>\n";
|
$str = "<select id=\"$id\" name=\"$name\" $event>\n";
|
||||||
for ($i = 0; $i < count($skins); $i++) {
|
for ($i = 0; $i < count($skins); $i++) {
|
||||||
if ($i == 0)
|
if ($i == 0)
|
||||||
$str .= "<option value=\"\">선택</option>";
|
$str .= "<option value=\"\">선택</option>";
|
||||||
if (preg_match('#^theme/(.+)$#', $skins[$i], $match))
|
if (preg_match('#^theme/(.+)$#', $skins[$i], $match))
|
||||||
$text = '(테마) ' . $match[1];
|
$text = "(테마) {$match[1]}";
|
||||||
else
|
else
|
||||||
$text = $skins[$i];
|
$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 = '')
|
function get_mobile_skin_select($skin_gubun, $id, $name, $selected = '', $event = '')
|
||||||
{
|
{
|
||||||
global $config;
|
global $config;
|
||||||
|
$skins = [];
|
||||||
$skins = array();
|
|
||||||
|
|
||||||
if (defined('G5_THEME_PATH') && $config['cf_theme']) {
|
if (defined('G5_THEME_PATH') && $config['cf_theme']) {
|
||||||
$dirs = get_skin_dir($skin_gubun, G5_THEME_MOBILE_PATH . '/' . G5_SKIN_DIR);
|
$dirs = get_skin_dir($skin_gubun, G5_THEME_MOBILE_PATH . '/' . G5_SKIN_DIR);
|
||||||
if (!empty($dirs)) {
|
if (!empty($dirs)) {
|
||||||
foreach ($dirs as $dir) {
|
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)
|
if ($i == 0)
|
||||||
$str .= "<option value=\"\">선택</option>";
|
$str .= "<option value=\"\">선택</option>";
|
||||||
if (preg_match('#^theme/(.+)$#', $skins[$i], $match))
|
if (preg_match('#^theme/(.+)$#', $skins[$i], $match))
|
||||||
$text = '(테마) ' . $match[1];
|
$text = "(테마) {$match[1]}";
|
||||||
else
|
else
|
||||||
$text = $skins[$i];
|
$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)
|
function get_skin_dir($skin, $skin_path = G5_SKIN_PATH)
|
||||||
{
|
{
|
||||||
global $g5;
|
global $g5;
|
||||||
|
$result_array = [];
|
||||||
$result_array = array();
|
$dirname = implode(DIRECTORY_SEPARATOR, [$skin_path, $skin, ""]);
|
||||||
|
|
||||||
$dirname = $skin_path . '/' . $skin . '/';
|
|
||||||
if (!is_dir($dirname))
|
if (!is_dir($dirname))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
@ -96,7 +89,7 @@ function get_skin_dir($skin, $skin_path = G5_SKIN_PATH)
|
||||||
// 테마
|
// 테마
|
||||||
function get_theme_dir()
|
function get_theme_dir()
|
||||||
{
|
{
|
||||||
$result_array = array();
|
$result_array = [];
|
||||||
|
|
||||||
$dirname = G5_PATH . '/' . G5_THEME_DIR . '/';
|
$dirname = G5_PATH . '/' . G5_THEME_DIR . '/';
|
||||||
$handle = opendir($dirname);
|
$handle = opendir($dirname);
|
||||||
|
|
@ -121,7 +114,7 @@ function get_theme_select($id, $name, $selected = '', $event = '')
|
||||||
{
|
{
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
$theme = array();
|
$theme = [];
|
||||||
$theme = array_merge($theme, get_theme_dir());
|
$theme = array_merge($theme, get_theme_dir());
|
||||||
|
|
||||||
$str = "<select id=\"$id\" name=\"$name\" $event>\n";
|
$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)
|
function get_theme_info($dir)
|
||||||
{
|
{
|
||||||
$info = array();
|
$info = [];
|
||||||
$path = G5_PATH . '/' . G5_THEME_DIR . '/' . $dir;
|
$path = implode(DIRECTORY_SEPARATOR, [G5_PATH, G5_THEME_DIR, $dir]);
|
||||||
|
|
||||||
if (is_dir($path)) {
|
if (is_dir($path)) {
|
||||||
$screenshot = $path . '/screenshot.png';
|
$screenshot = $path . '/screenshot.png';
|
||||||
|
|
@ -188,7 +181,7 @@ function get_theme_info($dir)
|
||||||
// 테마설정 정보
|
// 테마설정 정보
|
||||||
function get_theme_config_value($dir, $key = '*')
|
function get_theme_config_value($dir, $key = '*')
|
||||||
{
|
{
|
||||||
$tconfig = array();
|
$tconfig = [];
|
||||||
|
|
||||||
$theme_config_file = G5_PATH . '/' . G5_THEME_DIR . '/' . $dir . '/theme.config.php';
|
$theme_config_file = G5_PATH . '/' . G5_THEME_DIR . '/' . $dir . '/theme.config.php';
|
||||||
if (is_file($theme_config_file)) {
|
if (is_file($theme_config_file)) {
|
||||||
|
|
@ -207,8 +200,6 @@ function get_theme_config_value($dir, $key = '*')
|
||||||
return $tconfig;
|
return $tconfig;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 회원권한을 SELECT 형식으로 얻음
|
// 회원권한을 SELECT 형식으로 얻음
|
||||||
function get_member_level_select($name, $start_id = 0, $end_id = 10, $selected = "", $event = "")
|
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;
|
return $str;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// 회원아이디를 SELECT 형식으로 얻음
|
// 회원아이디를 SELECT 형식으로 얻음
|
||||||
function get_member_id_select($name, $level, $selected = "", $event = "")
|
function get_member_id_select($name, $level, $selected = "", $event = "")
|
||||||
{
|
{
|
||||||
|
|
@ -424,7 +414,7 @@ function admin_referer_check($return = false)
|
||||||
if (!$member['mb_id']) {
|
if (!$member['mb_id']) {
|
||||||
goto_url(G5_BBS_URL . '/login.php?url=' . urlencode(G5_ADMIN_URL));
|
goto_url(G5_BBS_URL . '/login.php?url=' . urlencode(G5_ADMIN_URL));
|
||||||
} else if ($is_admin != 'super') {
|
} else if ($is_admin != 'super') {
|
||||||
$auth = array();
|
$auth = [];
|
||||||
$sql = " select au_menu, au_auth from {$g5['auth_table']} where mb_id = '{$member['mb_id']}' ";
|
$sql = " select au_menu, au_auth from {$g5['auth_table']} where mb_id = '{$member['mb_id']}' ";
|
||||||
$result = sql_query($sql);
|
$result = sql_query($sql);
|
||||||
for ($i = 0; $row = sql_fetch_array($result); $i++) {
|
for ($i = 0; $row = sql_fetch_array($result); $i++) {
|
||||||
|
|
@ -456,17 +446,20 @@ unset($auth_menu);
|
||||||
unset($menu);
|
unset($menu);
|
||||||
unset($amenu);
|
unset($amenu);
|
||||||
$tmp = dir(G5_ADMIN_PATH);
|
$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;
|
$amenu[$m[1]] = $entry;
|
||||||
include_once(G5_ADMIN_PATH . '/' . $entry);
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ksort($amenu);
|
@ksort($amenu);
|
||||||
|
|
||||||
$arr_query = array();
|
$arr_query = [];
|
||||||
if (isset($sst))
|
if (isset($sst))
|
||||||
$arr_query[] = 'sst=' . $sst;
|
$arr_query[] = 'sst=' . $sst;
|
||||||
if (isset($sod))
|
if (isset($sod))
|
||||||
|
|
|
||||||
|
|
@ -62,4 +62,3 @@ if ($w == 'ld')
|
||||||
goto_url('./boardgroupmember_list.php?gr_id=' . $gr_id);
|
goto_url('./boardgroupmember_list.php?gr_id=' . $gr_id);
|
||||||
else
|
else
|
||||||
goto_url('./boardgroupmember_form.php?mb_id=' . $mb_id);
|
goto_url('./boardgroupmember_form.php?mb_id=' . $mb_id);
|
||||||
?>
|
|
||||||
|
|
|
||||||
|
|
@ -155,4 +155,4 @@ sql_query($sql);
|
||||||
|
|
||||||
//sql_query(" OPTIMIZE TABLE `$g5['config_table']` ");
|
//sql_query(" OPTIMIZE TABLE `$g5['config_table']` ");
|
||||||
|
|
||||||
goto_url('./config_form.php', false);
|
goto_url('./config_form.php');
|
||||||
|
|
|
||||||
|
|
@ -57,4 +57,3 @@ $row = sql_fetch($sql);
|
||||||
$total_count2 = $row['cnt'];
|
$total_count2 = $row['cnt'];
|
||||||
|
|
||||||
alert('총 ' . number_format($total_count) . '건 중 ' . number_format($total_count - $total_count2) . '건 삭제 완료', './visit_delete.php');
|
alert('총 ' . number_format($total_count) . '건 중 ' . number_format($total_count - $total_count2) . '건 삭제 완료', './visit_delete.php');
|
||||||
?>
|
|
||||||
|
|
|
||||||
|
|
@ -136,4 +136,3 @@ if (is_file($skin_file)) {
|
||||||
}
|
}
|
||||||
|
|
||||||
include_once('./qatail.php');
|
include_once('./qatail.php');
|
||||||
?>
|
|
||||||
|
|
|
||||||
|
|
@ -379,8 +379,8 @@ if ($w == '' || $w == 'r') {
|
||||||
if (!$is_admin)
|
if (!$is_admin)
|
||||||
$sql_ip = " , wr_ip = '{$_SERVER['REMOTE_ADDR']}' ";
|
$sql_ip = " , wr_ip = '{$_SERVER['REMOTE_ADDR']}' ";
|
||||||
|
|
||||||
$sql = " update {$write_table}
|
$sql = "UPDATE {$write_table}
|
||||||
set ca_name = '{$ca_name}',
|
SET ca_name = '{$ca_name}',
|
||||||
wr_option = '{$html},{$secret},{$mail}',
|
wr_option = '{$html},{$secret},{$mail}',
|
||||||
wr_subject = '{$wr_subject}',
|
wr_subject = '{$wr_subject}',
|
||||||
wr_content = '{$wr_content}',
|
wr_content = '{$wr_content}',
|
||||||
|
|
@ -415,7 +415,7 @@ if ($w == '' || $w == 'r') {
|
||||||
wr_10= '{$wr_10}'
|
wr_10= '{$wr_10}'
|
||||||
{$sql_ip}
|
{$sql_ip}
|
||||||
{$sql_password}
|
{$sql_password}
|
||||||
where wr_id = '{$wr['wr_id']}' ";
|
WHERE wr_id = '{$wr['wr_id']}' ";
|
||||||
sql_query($sql);
|
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 . '&wr_id=' . $wr_id . $qstr);
|
alert($file_upload_msg, G5_HTTP_BBS_URL . '/board.php?bo_table=' . $bo_table . '&wr_id=' . $wr_id . $qstr);
|
||||||
else
|
else
|
||||||
goto_url(G5_HTTP_BBS_URL . '/board.php?bo_table=' . $bo_table . '&wr_id=' . $wr_id . $qstr);
|
goto_url(G5_HTTP_BBS_URL . '/board.php?bo_table=' . $bo_table . '&wr_id=' . $wr_id . $qstr);
|
||||||
?>
|
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
Theme Name: 샘플
|
Theme Name: 기본 테마
|
||||||
Theme URI:
|
Theme URI:
|
||||||
Maker: Avocado
|
Maker: Avocado
|
||||||
Maker URI: https://avocado-edition-rout.postype.com/
|
Maker URI: https://avocado-edition-rout.postype.com/
|
||||||
Version: 1.0.0
|
Version: 1.0.0
|
||||||
Detail: 샘플 테마는 기본적인 부분만을 제공하는 테마입니다.
|
Detail: 기본 테마는 기본적인 부분만을 제공하는 테마입니다.
|
||||||
License: GNU LESSER GENERAL PUBLIC LICENSE Version 2.1
|
License: GNU LESSER GENERAL PUBLIC LICENSE Version 2.1
|
||||||
License URI: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html
|
License URI: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html
|
||||||
Loading…
Reference in a new issue