fix admin menu and add editorfont

This commit is contained in:
Amberstone 2024-09-22 10:46:52 +09:00
parent c4c75f7303
commit 7f8d99014f
Signed by: amber
GPG key ID: 094B0E55F98D8BF1
22 changed files with 971 additions and 992 deletions

View file

@ -4,7 +4,7 @@ if (!defined('_GNUBOARD_'))
$menu["board"] = new MenuCategory("board", "board", "게시판관리", "/board_list.php", true, 2, "", 0); $menu["board"] = new MenuCategory("board", "board", "게시판관리", "/board_list.php", true, 2, "", 0);
$menu["board"]->addChildMenu("member", "게시판관리", G5_ADMIN_URL . "/board_list.php", true, 1, "gear-wide-connected", 0); $menu["board"]->addChildMenu("member", "게시판관리", G5_ADMIN_URL . "/board_list.php", true, 1, "\F463", 0);
$menu["board"]->getLastAddedMenu()->addSubURL("/board_list_update.php"); $menu["board"]->getLastAddedMenu()->addSubURL("/board_list_update.php");
$menu["board"]->getLastAddedMenu()->addSubURL("/board_form.php"); $menu["board"]->getLastAddedMenu()->addSubURL("/board_form.php");
$menu["board"]->getLastAddedMenu()->addSubURL("/board_form_update.php"); $menu["board"]->getLastAddedMenu()->addSubURL("/board_form_update.php");
@ -12,7 +12,7 @@ $menu["board"]->getLastAddedMenu()->addSubURL("/board_delete.php");
$menu["board"]->getLastAddedMenu()->addSubURL("/board_copy.php"); $menu["board"]->getLastAddedMenu()->addSubURL("/board_copy.php");
$menu["board"]->getLastAddedMenu()->addSubURL("/board_copy_update.php"); $menu["board"]->getLastAddedMenu()->addSubURL("/board_copy_update.php");
$menu["board"]->addChildMenu("member", "게시판그룹관리", G5_ADMIN_URL . "/boardgroup_list.php", true, 2, "gear-wide-connected", 0); $menu["board"]->addChildMenu("member", "게시판그룹관리", G5_ADMIN_URL . "/boardgroup_list.php", true, 2, "\F2EE", 0);
$menu["board"]->getLastAddedMenu()->addSubURL("/boardgroup_list_update.php"); $menu["board"]->getLastAddedMenu()->addSubURL("/boardgroup_list_update.php");
$menu["board"]->getLastAddedMenu()->addSubURL("/boardgroup_form.php"); $menu["board"]->getLastAddedMenu()->addSubURL("/boardgroup_form.php");
$menu["board"]->getLastAddedMenu()->addSubURL("/boardgroup_form_update.php"); $menu["board"]->getLastAddedMenu()->addSubURL("/boardgroup_form_update.php");
@ -20,6 +20,6 @@ $menu["board"]->getLastAddedMenu()->addSubURL("/boardgroupmember_list.php");
$menu["board"]->getLastAddedMenu()->addSubURL("/boardgroupmember_update.php"); $menu["board"]->getLastAddedMenu()->addSubURL("/boardgroupmember_update.php");
$menu["board"]->getLastAddedMenu()->addSubURL("/boardgroupmember_form.php"); $menu["board"]->getLastAddedMenu()->addSubURL("/boardgroupmember_form.php");
$menu["board"]->addChildMenu("member", "내용관리", G5_ADMIN_URL . "/contentlist.php", true, 2, "gear-wide-connected", 0); $menu["board"]->addChildMenu("member", "내용관리", G5_ADMIN_URL . "/contentlist.php", true, 2, "\F620", 0);
$menu["board"]->getLastAddedMenu()->addSubURL("/contentform.php"); $menu["board"]->getLastAddedMenu()->addSubURL("/contentform.php");
$menu["board"]->getLastAddedMenu()->addSubURL("/contentformupdate.php"); $menu["board"]->getLastAddedMenu()->addSubURL("/contentformupdate.php");

View file

@ -4,13 +4,13 @@ if (!defined('_GNUBOARD_'))
$menu["member"] = new MenuCategory("member", "member", "회원관리", "/member_list.php", true, 1, "", 0); $menu["member"] = new MenuCategory("member", "member", "회원관리", "/member_list.php", true, 1, "", 0);
$menu["member"]->addChildMenu("member", "회원관리", G5_ADMIN_URL . "/member_list.php", true, 1, "gear-wide-connected", 0); $menu["member"]->addChildMenu("member", "회원관리", G5_ADMIN_URL . "/member_list.php", true, 1, "\F8A7", 0);
$menu["member"]->getLastAddedMenu()->addSubURL("/member_form.php"); $menu["member"]->getLastAddedMenu()->addSubURL("/member_form.php");
$menu["member"]->getLastAddedMenu()->addSubURL("/member_delete.php"); $menu["member"]->getLastAddedMenu()->addSubURL("/member_delete.php");
$menu["member"]->getLastAddedMenu()->addSubURL("/member_list_update.php"); $menu["member"]->getLastAddedMenu()->addSubURL("/member_list_update.php");
$menu["member"]->getLastAddedMenu()->addSubURL("/member_list_delete.php"); $menu["member"]->getLastAddedMenu()->addSubURL("/member_list_delete.php");
$menu["member"]->addChildMenu("member", "접속자집계", G5_ADMIN_URL . "/visit_list.php", true, 2, "grid-1x2", 0); $menu["member"]->addChildMenu("member", "접속자집계", G5_ADMIN_URL . "/visit_list.php", true, 2, "\F3F2", 0);
$menu["member"]->getLastAddedMenu()->addSubURL("/visit_domain.php"); $menu["member"]->getLastAddedMenu()->addSubURL("/visit_domain.php");
$menu["member"]->getLastAddedMenu()->addSubURL("/visit_browser.php"); $menu["member"]->getLastAddedMenu()->addSubURL("/visit_browser.php");
$menu["member"]->getLastAddedMenu()->addSubURL("/visit_os.php"); $menu["member"]->getLastAddedMenu()->addSubURL("/visit_os.php");
@ -21,5 +21,5 @@ $menu["member"]->getLastAddedMenu()->addSubURL("/visit_week.php");
$menu["member"]->getLastAddedMenu()->addSubURL("/visit_month.php"); $menu["member"]->getLastAddedMenu()->addSubURL("/visit_month.php");
$menu["member"]->getLastAddedMenu()->addSubURL("/visit_year.php"); $menu["member"]->getLastAddedMenu()->addSubURL("/visit_year.php");
$menu["member"]->addChildMenu("member", "접속자로그삭제", G5_ADMIN_URL . "/visit_delete.php", true, 3, "palette2", 0); $menu["member"]->addChildMenu("member", "접속자로그삭제", G5_ADMIN_URL . "/visit_delete.php", true, 3, "\F5DE", 0);
$menu["member"]->getLastAddedMenu()->addSubURL("/visit_delete_update.php"); $menu["member"]->getLastAddedMenu()->addSubURL("/visit_delete_update.php");

View file

@ -4,8 +4,8 @@ if (!defined('_GNUBOARD_'))
$menu["other"] = new MenuCategory("other", "other", "기타관리", "/config_form.php", true, 99, "", 0); $menu["other"] = new MenuCategory("other", "other", "기타관리", "/config_form.php", true, 99, "", 0);
$menu["other"]->addChildMenu("other", "홈페이지 상세관리", G5_ADMIN_URL . "/config_form.php", true, 1, "gear-wide-connected", 0); $menu["other"]->addChildMenu("other", "홈페이지 상세관리", G5_ADMIN_URL . "/config_form.php", true, 1, "\F3E3", 0);
$menu["other"]->getLastAddedMenu()->addSubURL("/config_form_update.php"); $menu["other"]->getLastAddedMenu()->addSubURL("/config_form_update.php");
$menu["other"]->addChildMenu("other", "세션파일 일괄삭제", G5_ADMIN_URL . "/session_file_delete.php", true, 1, "gear-wide-connected", 0); $menu["other"]->addChildMenu("other", "세션파일 일괄삭제", G5_ADMIN_URL . "/session_file_delete.php", true, 1, "\F8C3", 0);
$menu["other"]->addChildMenu("other", "캐시파일 일괄삭제", G5_ADMIN_URL . "/cache_file_delete.php", true, 1, "gear-wide-connected", 0); $menu["other"]->addChildMenu("other", "캐시파일 일괄삭제", G5_ADMIN_URL . "/cache_file_delete.php", true, 1, "\F8C3", 0);

View file

@ -4,22 +4,25 @@ if (!defined('_GNUBOARD_'))
$menu["config"] = new MenuCategory("config", "config", "사이트 설정", "/site_config_form.php", true, 0, "", 0); $menu["config"] = new MenuCategory("config", "config", "사이트 설정", "/site_config_form.php", true, 0, "", 0);
$menu["config"]->addChildMenu("config", "환경설정", G5_ADMIN_URL . "/site_config_form.php", true, 1, "gear-wide-connected", 0); $menu["config"]->addChildMenu("config", "환경설정", G5_ADMIN_URL . "/site_config_form.php", true, 1, "\F3E5", 0);
$menu["config"]->getLastAddedMenu()->addSubURL("/site_config_form_update.php"); $menu["config"]->getLastAddedMenu()->addSubURL("/site_config_form_update.php");
$menu["config"]->addChildMenu("config", "메인 편집", G5_ADMIN_URL . "/viewer_form.php", true, 2, "grid-1x2", 0); $menu["config"]->addChildMenu("config", "메인 편집", G5_ADMIN_URL . "/viewer_form.php", true, 2, "\F3F4", 0);
$menu["config"]->getLastAddedMenu()->addSubURL("/viewer_form_update.php"); $menu["config"]->getLastAddedMenu()->addSubURL("/viewer_form_update.php");
$menu["config"]->addChildMenu("config", "테마 설정", G5_ADMIN_URL . "/theme.php", true, 3, "palette2", 0); $menu["config"]->addChildMenu("config", "테마 설정", G5_ADMIN_URL . "/theme.php", true, 3, "\F4B2", 0);
$menu["config"]->getLastAddedMenu()->addSubURL("/theme_config_load.php"); $menu["config"]->getLastAddedMenu()->addSubURL("/theme_config_load.php");
$menu["config"]->getLastAddedMenu()->addSubURL("/theme_detail.php"); $menu["config"]->getLastAddedMenu()->addSubURL("/theme_detail.php");
$menu["config"]->getLastAddedMenu()->addSubURL("/theme_update.php"); $menu["config"]->getLastAddedMenu()->addSubURL("/theme_update.php");
$menu["config"]->getLastAddedMenu()->addSubURL("/theme_preview.php"); $menu["config"]->getLastAddedMenu()->addSubURL("/theme_preview.php");
$menu["config"]->addChildMenu("config", "디자인 설정", G5_ADMIN_URL . "/design_form.php", true, 4, "brush", 0); $menu["config"]->addChildMenu("config", "디자인 설정", G5_ADMIN_URL . "/design_form.php", true, 4, "\F1D8", 0);
$menu["config"]->getLastAddedMenu()->addSubURL("/design_form_update.php"); $menu["config"]->getLastAddedMenu()->addSubURL("/design_form_update.php");
$menu["config"]->addChildMenu("config", "메뉴 설정", G5_ADMIN_URL . "/menu_list.php", true, 5, "list", 0); $menu["config"]->addChildMenu("config", "폰트 설정", G5_ADMIN_URL . "/editor_font.php", true, 5, "\F3DA", 0);
$menu["config"]->getLastAddedMenu()->addSubURL("/editor_font_update.php");
$menu["config"]->addChildMenu("config", "메뉴 설정", G5_ADMIN_URL . "/menu_list.php", true, 6, "\F478", 0);
$menu["config"]->getLastAddedMenu()->addSubURL("/menu_list_update.php"); $menu["config"]->getLastAddedMenu()->addSubURL("/menu_list_update.php");
$menu["config"]->getLastAddedMenu()->addSubURL("/menu_form.php"); $menu["config"]->getLastAddedMenu()->addSubURL("/menu_form.php");
$menu["config"]->getLastAddedMenu()->addSubURL("/menu_form_search.php"); $menu["config"]->getLastAddedMenu()->addSubURL("/menu_form_search.php");

View file

@ -30,7 +30,7 @@ if ($copy_case == 'schema_only') {
} }
// 게시판 정보 // 게시판 정보
$sql = " insert into {$g5['board_table']} $sql = "INSERT INTO {$g5['board_table']}
set bo_table = '$target_table', set bo_table = '$target_table',
bo_type = '{$board['bo_type']}', bo_type = '{$board['bo_type']}',
gr_id = '{$board['gr_id']}', gr_id = '{$board['gr_id']}',
@ -180,7 +180,7 @@ if ($copy_case == 'schema_data_both') {
if (count($file_copy)) { if (count($file_copy)) {
for ($i = 0; $i < count($file_copy); $i++) { for ($i = 0; $i < count($file_copy); $i++) {
$sql = " insert into {$g5['board_file_table']} $sql = "INSERT INTO {$g5['board_file_table']}
set bo_table = '$target_table', set bo_table = '$target_table',
wr_id = '{$file_copy[$i]['wr_id']}', wr_id = '{$file_copy[$i]['wr_id']}',
bf_no = '{$file_copy[$i]['bf_no']}', bf_no = '{$file_copy[$i]['bf_no']}',

View file

@ -16,19 +16,19 @@ if (!$tmp_bo_table) {
//if ($row['cnt'] <= 1) { return; } //if ($row['cnt'] <= 1) { return; }
// 게시판 설정 삭제 // 게시판 설정 삭제
sql_query(" delete from {$g5['board_table']} where bo_table = '{$tmp_bo_table}' "); sql_query("DELETE FROM {$g5['board_table']} WHERE bo_table = '{$tmp_bo_table}' ");
// 최신글 삭제 // 최신글 삭제
sql_query(" delete from {$g5['board_new_table']} where bo_table = '{$tmp_bo_table}' "); sql_query("DELETE FROM {$g5['board_new_table']} WHERE bo_table = '{$tmp_bo_table}' ");
// 스크랩 삭제 // 스크랩 삭제
sql_query(" delete from {$g5['scrap_table']} where bo_table = '{$tmp_bo_table}' "); sql_query("DELETE FROM {$g5['scrap_table']} WHERE bo_table = '{$tmp_bo_table}' ");
// 파일 삭제 // 파일 삭제
sql_query(" delete from {$g5['board_file_table']} where bo_table = '{$tmp_bo_table}' "); sql_query("DELETE FROM {$g5['board_file_table']} WHERE bo_table = '{$tmp_bo_table}' ");
// 게시판 테이블 DROP // 게시판 테이블 DROP
sql_query(" drop table {$g5['write_prefix']}{$tmp_bo_table} ", FALSE); sql_query("DROP TABLE {$g5['write_prefix']}{$tmp_bo_table} ", FALSE);
delete_cache_latest($tmp_bo_table); delete_cache_latest($tmp_bo_table);

View file

@ -73,7 +73,7 @@ $colspan = 11;
<label for="sfl" class="sound_only">검색대상</label> <label for="sfl" class="sound_only">검색대상</label>
<select name="sfl" id="sfl"> <select name="sfl" id="sfl">
<option value="bo_table" <?php echo get_selected($_GET['sfl'], "bo_table", true); ?>>TABLE</option> <option value="bo_table" <?php echo get_selected($_GET['sfl'], "bo_table"); ?>>TABLE</option>
<option value="bo_subject" <?php echo get_selected($_GET['sfl'], "bo_subject"); ?>>제목</option> <option value="bo_subject" <?php echo get_selected($_GET['sfl'], "bo_subject"); ?>>제목</option>
<option value="a.gr_id" <?php echo get_selected($_GET['sfl'], "a.gr_id"); ?>>그룹ID</option> <option value="a.gr_id" <?php echo get_selected($_GET['sfl'], "a.gr_id"); ?>>그룹ID</option>
</select> </select>

View file

@ -18,17 +18,17 @@ if ($_POST['act_button'] == "선택수정") {
$k = $_POST['chk'][$i]; $k = $_POST['chk'][$i];
if ($is_admin != 'super') { if ($is_admin != 'super') {
$sql = " select count(*) as cnt from {$g5['board_table']} a, {$g5['group_table']} b $sql = "SELECT count(*) AS cnt FROM {$g5['board_table']} a, {$g5['group_table']} b
where a.gr_id = '{$_POST['gr_id'][$k]}' WHERE a.gr_id = '{$_POST['gr_id'][$k]}'
and a.gr_id = b.gr_id AND a.gr_id = b.gr_id
and b.gr_admin = '{$member['mb_id']}' "; AND b.gr_admin = '{$member['mb_id']}' ";
$row = sql_fetch($sql); $row = sql_fetch($sql);
if (!$row['cnt']) if (!$row['cnt'])
alert('최고관리자가 아닌 경우 다른 관리자의 게시판(' . $board_table[$k] . ')은 수정이 불가합니다.'); alert('최고관리자가 아닌 경우 다른 관리자의 게시판(' . $board_table[$k] . ')은 수정이 불가합니다.');
} }
$sql = " update {$g5['board_table']} $sql = "UPDATE {$g5['board_table']}
set gr_id = '{$_POST['gr_id'][$k]}', SET gr_id = '{$_POST['gr_id'][$k]}',
bo_subject = '{$_POST['bo_subject'][$k]}', bo_subject = '{$_POST['bo_subject'][$k]}',
bo_skin = '{$_POST['bo_skin'][$k]}', bo_skin = '{$_POST['bo_skin'][$k]}',
bo_list_level = '{$_POST['bo_list_level'][$k]}', bo_list_level = '{$_POST['bo_list_level'][$k]}',
@ -36,7 +36,7 @@ if ($_POST['act_button'] == "선택수정") {
bo_write_level = '{$_POST['bo_write_level'][$k]}', bo_write_level = '{$_POST['bo_write_level'][$k]}',
bo_comment_level = '{$_POST['bo_comment_level'][$k]}', bo_comment_level = '{$_POST['bo_comment_level'][$k]}',
bo_reply_level = '{$_POST['bo_reply_level'][$k]}' bo_reply_level = '{$_POST['bo_reply_level'][$k]}'
where bo_table = '{$_POST['board_table'][$k]}' "; WHERE bo_table = '{$_POST['board_table'][$k]}' ";
sql_query($sql); sql_query($sql);
} }
@ -46,7 +46,6 @@ if ($_POST['act_button'] == "선택수정") {
alert('게시판 삭제는 최고관리자만 가능합니다.'); alert('게시판 삭제는 최고관리자만 가능합니다.');
auth_check($auth[$sub_menu], 'd'); auth_check($auth[$sub_menu], 'd');
check_admin_token(); check_admin_token();
// _BOARD_DELETE_ 상수를 선언해야 board_delete.inc.php 가 정상 작동함 // _BOARD_DELETE_ 상수를 선언해야 board_delete.inc.php 가 정상 작동함
@ -60,8 +59,6 @@ if ($_POST['act_button'] == "선택수정") {
$tmp_bo_table = trim($_POST['board_table'][$k]); $tmp_bo_table = trim($_POST['board_table'][$k]);
include('./board_delete.inc.php'); include('./board_delete.inc.php');
} }
} }
goto_url('./board_list.php'); goto_url('./board_list.php');

View file

@ -314,72 +314,10 @@ body {
height: 16px; height: 16px;
} }
#gnb .gnb_2dli>a:before {
#gnb .gnb_2dli>a[data-text="메뉴 설정"]:before { content: var(--icon, "\F3E3");
content: "\F488";
} }
#gnb .gnb_2dli>a[data-text="환경설정"]:before {
content: "\F3E3";
}
#gnb .gnb_2dli>a[data-text="메인 편집"]:before {
content: "\F6CF";
}
#gnb .gnb_2dli>a[data-text="테마 설정"]:before {
content: "\F4B1";
}
#gnb .gnb_2dli>a[data-text="디자인 설정"]:before {
content: "\F7BF";
}
#gnb .gnb_2dli>a[data-text="DB관리"]:before {
content: "\F8C4";
}
#gnb .gnb_2dli>a[data-text="회원관리"]:before {
content: "\F4D6";
}
#gnb .gnb_2dli>a[data-text="접속자집계"]:before {
content: "\F17E";
}
#gnb .gnb_2dli>a[data-text="접속자검색"]:before {
content: "\F52A";
}
#gnb .gnb_2dli>a[data-text="접속자로그삭제"]:before {
content: "\F5DE";
}
#gnb .gnb_2dli>a[data-text="게시판관리"]:before {
content: "\F463";
}
#gnb .gnb_2dli>a[data-text="게시판그룹관리"]:before {
content: "\F2EE";
}
#gnb .gnb_2dli>a[data-text="내용관리"]:before {
content: "\F4CB";
}
#gnb .gnb_2dli>a[data-text="이모티콘관리"]:before {
content: "\e9e1";
}
#gnb .gnb_2dli>a[data-text="세션파일 일괄삭제"]:before {
content: "\F8C1";
}
#gnb .gnb_2dli>a[data-text="캐시파일 일괄삭제"]:before {
content: "\F8C1";
}
#container { #container {
padding: 25px; padding: 25px;
} }

View file

@ -0,0 +1,15 @@
<?php
include_once __DIR__ . '/_common.php';
if ($is_admin != 'super') {
alert_close('최고관리자만 접근 가능합니다.');
}
$g5['title'] = '에디터 폰트 관리';
include_once __DIR__ . '/admin.head.php';
?>
<?php
include_once __DIR__ . '/admin.tail.php';

View file

@ -0,0 +1,6 @@
<?php
include_once __DIR__ . '/_common.php';
if ($is_admin != 'super') {
alert_close('최고관리자만 접근 가능합니다.');
}

View file

@ -1,8 +1,7 @@
<?php <?php
// 이 파일은 새로운 파일 생성시 반드시 포함되어야 함
if (!defined('_GNUBOARD_')) if (!defined('_GNUBOARD_'))
exit; // 개별 페이지 접근 불가 exit; // 개별 페이지 접근 불가
check_site_auth($is_member); check_site_auth();
$begin_time = get_microtime(); $begin_time = get_microtime();
if (!isset($g5['title'])) { if (!isset($g5['title'])) {

View file

@ -139,10 +139,10 @@ $colspan = 10;
$intercept_msg = ''; $intercept_msg = '';
$intercept_title = ''; $intercept_title = '';
if ($row['mb_leave_date']) { if ($row['mb_leave_date']) {
$mb_id = $mb_id; // $mb_id = $mb_id;
$leave_msg = '<span class="mb_leave_msg">탈퇴함</span>'; $leave_msg = '<span class="mb_leave_msg">탈퇴함</span>';
} else if ($row['mb_intercept_date']) { } else if ($row['mb_intercept_date']) {
$mb_id = $mb_id; // $mb_id = $mb_id;
$intercept_msg = '<span class="mb_intercept_msg">차단됨</span>'; $intercept_msg = '<span class="mb_intercept_msg">차단됨</span>';
$intercept_title = '차단해제'; $intercept_title = '차단해제';
} }

View file

@ -11,8 +11,9 @@ $colspan = 6;
$sql_common = " from {$g5['visit_table']} "; $sql_common = " from {$g5['visit_table']} ";
$sql_search = " where vi_date between '{$fr_date}' and '{$to_date}' "; $sql_search = " where vi_date between '{$fr_date}' and '{$to_date}' ";
if (isset($domain)) if (isset($domain) && is_string($domain)) {
$sql_search .= " and vi_referer like '%{$domain}%' "; $sql_search .= " and vi_referer like '%{$domain}%' ";
}
$sql = " select count(*) as cnt $sql = " select count(*) as cnt
{$sql_common} {$sql_common}

View file

@ -76,7 +76,7 @@ class MenuCategory extends Menu
$this->selected = true; $this->selected = true;
} }
$str .= '<li class="gnb_2dli ' . $check_gnb_grp_style . '"><a href="' . $menu->url . '" class="gnb_2da ' . $gnb_grp_style . ' ' . $gnb_grp_div . '" data-text="' . $menu->name . '">' . $menu->name . '</a></li>'; $str .= '<li class="gnb_2dli ' . $check_gnb_grp_style . '"><a href="' . $menu->url . '" class="gnb_2da ' . $gnb_grp_style . ' ' . $gnb_grp_div . '" data-text="' . $menu->name . '" style="--icon:\'' . $menu->icon . '\'">' . $menu->name . '</a></li>';
} }
$str .= "</ul>"; $str .= "</ul>";

View file

@ -1,6 +1,6 @@
<?php <?php
if (!defined('_GNUBOARD_')) if (!defined('_GNUBOARD_'))
exit; // 개별 페이지 접근 불가 exit;
function editor_html($id, $content, $is_dhtml_editor = true) function editor_html($id, $content, $is_dhtml_editor = true)
{ {
@ -13,8 +13,8 @@ function editor_html($id, $content, $is_dhtml_editor = true)
(!$w && (isset($board['bo_insert_content']) && !empty($board['bo_insert_content']))) (!$w && (isset($board['bo_insert_content']) && !empty($board['bo_insert_content'])))
|| ($w == 'u' && isset($write['wr_option']) && strpos($write['wr_option'], 'html') === false) || ($w == 'u' && isset($write['wr_option']) && strpos($write['wr_option'], 'html') === false)
) )
) { //글쓰기 기본 내용 처리 ) {
if (preg_match('/\r|\n/', $content) && $content === strip_tags($content, '<a><strong><b>')) { //textarea로 작성되고, html 내용이 없다면 if (preg_match('/\r|\n/', $content) && $content === strip_tags($content, '<a><strong><b>')) {
$content = nl2br($content); $content = nl2br($content);
} }
} }
@ -23,13 +23,15 @@ function editor_html($id, $content, $is_dhtml_editor = true)
$html = ""; $html = "";
$html .= "<span class=\"sound_only\">웹에디터 시작</span>"; $html .= "<span class=\"sound_only\">웹에디터 시작</span>";
if ($is_dhtml_editor)
if ($is_dhtml_editor) {
$html .= '<script>document.write("<div class=\'cke_sc\'><button type=\'button\' class=\'btn_cke_sc\'>단축키 일람</button></div>");</script>'; $html .= '<script>document.write("<div class=\'cke_sc\'><button type=\'button\' class=\'btn_cke_sc\'>단축키 일람</button></div>");</script>';
}
if ($is_dhtml_editor && $js) { if ($is_dhtml_editor && $js) {
$html .= "\n" . '<script src="' . $editor_url . '/js/service/HuskyEZCreator.js"></script>'; $html .= "\n<script src=\"{$editor_url}/js/service/HuskyEZCreator.js\"></script>";
$html .= "\n" . '<script>var g5_editor_url = "' . $editor_url . '", oEditors = [], ed_nonce = "' . ft_nonce_create('smarteditor') . '";</script>'; $html .= "\n<script>var g5_editor_url = \"{$editor_url}\", oEditors = [], ed_nonce = \"{ft_nonce_create('smarteditor')}\";</script>";
$html .= "\n" . '<script src="' . $editor_url . '/config.js"></script>'; $html .= "\n<script src=\"{$editor_url}/config.js\"></script>";
$html .= "\n<script>"; $html .= "\n<script>";
$html .= ' $html .= '
$(function(){ $(function(){

View file

@ -1,5 +1,6 @@
<?php <?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가 if (!defined('_GNUBOARD_'))
exit; // 개별 페이지 접근 불가
// 선택옵션으로 인해 셀합치기가 가변적으로 변함 // 선택옵션으로 인해 셀합치기가 가변적으로 변함
$colspan = 5; $colspan = 5;
@ -22,7 +23,8 @@ add_stylesheet('<link rel="stylesheet" href="'.$board_skin_url.'/style.css">', 0
<?php if ($is_category) { ?> <?php if ($is_category) { ?>
<nav class="board-category"> <nav class="board-category">
<ul> <ul>
<li><a href="./board.php?bo_table=<?=$bo_table?>" class="ui-btn <?=!$sca || $sca == ''? 'point' : 'etc'?>">ALL</a></li> <li><a href="./board.php?bo_table=<?= $bo_table ?>" class="ui-btn <?= !$sca || $sca == '' ? 'point' : 'etc' ?>">ALL</a>
</li>
<?php echo $category_list ?> <?php echo $category_list ?>
</ul> </ul>
</nav> </nav>
@ -30,7 +32,8 @@ add_stylesheet('<link rel="stylesheet" href="'.$board_skin_url.'/style.css">', 0
<!-- } 게시판 카테고리 --> <!-- } 게시판 카테고리 -->
<form name="fboardlist" id="fboardlist" action="./board_list_update.php" onsubmit="return fboardlist_submit(this);" method="post"> <form name="fboardlist" id="fboardlist" action="./board_list_update.php" onsubmit="return fboardlist_submit(this);"
method="post">
<input type="hidden" name="bo_table" value="<?php echo $bo_table ?>"> <input type="hidden" name="bo_table" value="<?php echo $bo_table ?>">
<input type="hidden" name="sfl" value="<?php echo $sfl ?>"> <input type="hidden" name="sfl" value="<?php echo $sfl ?>">
<input type="hidden" name="stx" value="<?php echo $stx ?>"> <input type="hidden" name="stx" value="<?php echo $stx ?>">
@ -80,17 +83,22 @@ add_stylesheet('<link rel="stylesheet" href="'.$board_skin_url.'/style.css">', 0
echo $list[$i]['icon_reply']; echo $list[$i]['icon_reply'];
if ($is_category && $list[$i]['ca_name']) { if ($is_category && $list[$i]['ca_name']) {
?> ?>
<a href="<?php echo $list[$i]['ca_name_href'] ?>" class="bo_cate_link" style="font-weight: 600; color: #a9cfff;">[<?php echo $list[$i]['ca_name'] ?>] </a> <a href="<?php echo $list[$i]['ca_name_href'] ?>" class="bo_cate_link"
style="font-weight: 600; color: #a9cfff;">[<?php echo $list[$i]['ca_name'] ?>] </a>
<?php } ?> <?php } ?>
<a href="<?php echo $list[$i]['href'] ?>"> <a href="<?php echo $list[$i]['href'] ?>">
<?php echo $list[$i]['subject'] ?> <?php echo $list[$i]['subject'] ?>
<?php if ($list[$i]['comment_cnt']) { ?><span class="sound_only">댓글</span><?php echo $list[$i]['comment_cnt']; ?><span class="sound_only">개</span><?php } ?> <?php if ($list[$i]['comment_cnt']) { ?><span
class="sound_only">댓글</span><?php echo $list[$i]['comment_cnt']; ?><span
class="sound_only"></span><?php } ?>
</a> </a>
<?php <?php
if (isset($list[$i]['icon_new'])) echo $list[$i]['icon_new']; if (isset($list[$i]['icon_new']))
if (isset($list[$i]['icon_secret'])) echo $list[$i]['icon_secret']; echo $list[$i]['icon_new'];
if (isset($list[$i]['icon_secret']))
echo $list[$i]['icon_secret'];
?> ?>
</td> </td>
<td class="txt-center"><?php echo $list[$i]['wr_name'] ?></td> <td class="txt-center"><?php echo $list[$i]['wr_name'] ?></td>
@ -98,7 +106,9 @@ add_stylesheet('<link rel="stylesheet" href="'.$board_skin_url.'/style.css">', 0
<td class="txt-center"><?php echo $list[$i]['wr_hit'] ?></td> <td class="txt-center"><?php echo $list[$i]['wr_hit'] ?></td>
</tr> </tr>
<?php } ?> <?php } ?>
<?php if (count($list) == 0) { echo '<tr><td colspan="'.$colspan.'" class="empty_table">게시물이 없습니다.</td></tr>'; } ?> <?php if (count($list) == 0) {
echo '<tr><td colspan="' . $colspan . '" class="empty_table">게시물이 없습니다.</td></tr>';
} ?>
</tbody> </tbody>
</table> </table>
</div> </div>
@ -108,8 +118,10 @@ add_stylesheet('<link rel="stylesheet" href="'.$board_skin_url.'/style.css">', 0
<?php if ($list_href || $is_checkbox || $write_href) { ?> <?php if ($list_href || $is_checkbox || $write_href) { ?>
<div class="bo_fx"> <div class="bo_fx">
<?php if ($list_href || $write_href) { ?> <?php if ($list_href || $write_href) { ?>
<?php if ($list_href) { ?><a href="<?php echo $list_href ?>" class="ui-btn"><i class="material-icons">list</i> 목록</a><?php } ?> <?php if ($list_href) { ?><a href="<?php echo $list_href ?>" class="ui-btn"><i class="material-icons">list</i>
<?php if ($write_href) { ?><a href="<?php echo $write_href ?>" class="ui-btn point"><i class="material-icons">edit</i> 글쓰기</a><?php } ?> 목록</a><?php } ?>
<?php if ($write_href) { ?><a href="<?php echo $write_href ?>" class="ui-btn point"><i
class="material-icons">edit</i> 글쓰기</a><?php } ?>
<?php } ?> <?php } ?>
</div> </div>
<?php } ?> <?php } ?>
@ -131,10 +143,12 @@ add_stylesheet('<link rel="stylesheet" href="'.$board_skin_url.'/style.css">', 0
<select name="sfl" id="sfl"> <select name="sfl" id="sfl">
<option value="wr_subject" <?php echo get_selected($sfl, 'wr_subject', true); ?>>제목</option> <option value="wr_subject" <?php echo get_selected($sfl, 'wr_subject', true); ?>>제목</option>
<option value="wr_content" <?php echo get_selected($sfl, 'wr_content'); ?>>내용</option> <option value="wr_content" <?php echo get_selected($sfl, 'wr_content'); ?>>내용</option>
<option value="wr_subject||wr_content"<?php echo get_selected($sfl, 'wr_subject||wr_content'); ?>>제목+내용</option> <option value="wr_subject||wr_content" <?php echo get_selected($sfl, 'wr_subject||wr_content'); ?>>제목+내용
</option>
</select> </select>
<label for="stx" class="sound_only">검색어<strong class="sound_only"> 필수</strong></label> <label for="stx" class="sound_only">검색어<strong class="sound_only"> 필수</strong></label>
<input type="text" name="stx" value="<?php echo stripslashes($stx) ?>" required id="stx" class="frm_input required" size="15" maxlength="20"> <input type="text" name="stx" value="<?php echo stripslashes($stx) ?>" required id="stx"
class="frm_input required" size="15" maxlength="20">
<button type="submit" class="ui-btn"><i class="material-icons">search</i></button> <button type="submit" class="ui-btn"><i class="material-icons">search</i></button>
</form> </form>
</fieldset> </fieldset>

View file

@ -1,4 +1 @@
@charset "utf-8"; @charset "utf-8";

View file

@ -1,35 +1,32 @@
<?php <?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가 if (!defined("_GNUBOARD_"))
exit; // 개별 페이지 접근 불가
include_once(G5_LIB_PATH . '/thumbnail.lib.php'); include_once(G5_LIB_PATH . '/thumbnail.lib.php');
// add_stylesheet('css 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨 // add_stylesheet('css 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨
add_stylesheet('<link rel="stylesheet" href="' . $board_skin_url . '/style.css">', 0); add_stylesheet('<link rel="stylesheet" href="' . $board_skin_url . '/style.css">', 0);
?> ?>
<script src="<?php echo G5_JS_URL; ?>/viewimageresize.js"></script> <script src="<?php echo G5_JS_URL; ?>/viewimageresize.js"></script>
<article id="bo_v"> <article id="bo_v">
<?php if ($board['bo_content_head']) { ?> <?php if ($board['bo_content_head']) { ?>
<div class="board-notice-box"> <div class="board-notice-box">
<?= stripslashes($board['bo_content_head']); ?> <?= stripslashes($board['bo_content_head']); ?>
</div> </div>
<?php } ?> <?php } ?>
<div class="board-title"> <div class="board-title">
<?php <?php
if ($category_name) echo "<em>{$view['ca_name']}</em>"; // 분류 출력 끝 if ($category_name)
echo "<em>{$view['ca_name']}</em>"; // 분류 출력 끝
echo "<strong>" . cut_str(get_text($view['wr_subject']), 70) . "</strong>"; // 글제목 출력 echo "<strong>" . cut_str(get_text($view['wr_subject']), 70) . "</strong>"; // 글제목 출력
?> ?>
</div> </div>
<div class="board-info"> <div class="board-info">
<strong><?php echo $view['name'] ?><?php if ($is_ip_view) { echo "&nbsp;($ip)"; } ?></strong> <strong><?php echo $view['name'] ?><?php if ($is_ip_view) {
echo "&nbsp;($ip)";
} ?></strong>
<strong><?php echo date("y-m-d H:i", strtotime($view['wr_datetime'])) ?></strong> <strong><?php echo date("y-m-d H:i", strtotime($view['wr_datetime'])) ?></strong>
<strong><?php echo number_format($view['wr_hit']) ?></strong> <strong><?php echo number_format($view['wr_hit']) ?></strong>
</div> </div>
<?php <?php
if ($view['file']['count']) { if ($view['file']['count']) {
$cnt = 0; $cnt = 0;
@ -39,7 +36,6 @@ add_stylesheet('<link rel="stylesheet" href="'.$board_skin_url.'/style.css">', 0
} }
} }
?> ?>
<?php if ($cnt) { ?> <?php if ($cnt) { ?>
<!-- 첨부파일 시작 { --> <!-- 첨부파일 시작 { -->
<div class="board-file"> <div class="board-file">
@ -66,7 +62,6 @@ add_stylesheet('<link rel="stylesheet" href="'.$board_skin_url.'/style.css">', 0
</div> </div>
<!-- } 첨부파일 --> <!-- } 첨부파일 -->
<?php } ?> <?php } ?>
<div class="board-content"> <div class="board-content">
<?php <?php
// 파일 출력 // 파일 출력
@ -84,29 +79,28 @@ add_stylesheet('<link rel="stylesheet" href="'.$board_skin_url.'/style.css">', 0
echo "</div>\n"; echo "</div>\n";
} }
?> ?>
<!-- 본문 내용 시작 { --> <!-- 본문 내용 시작 { -->
<div id="bo_v_con"><?php echo get_view_thumbnail($view['content']); ?></div> <div id="bo_v_con"><?php echo get_view_thumbnail($view['content']); ?></div>
</div> </div>
<?php <?php
// 코멘트 입출력 // 코멘트 입출력
include_once(G5_BBS_PATH . '/view_comment.php'); include_once(G5_BBS_PATH . '/view_comment.php');
?> ?>
<!-- 링크 버튼 시작 { --> <!-- 링크 버튼 시작 { -->
<div id="bo_v_bot"> <div id="bo_v_bot">
<div class="bo_v_com" style="text-align: right;"> <div class="bo_v_com" style="text-align: right;">
<?php if ($update_href) { ?><a href="<?php echo $update_href ?>" class="ui-btn etc"><i class="material-icons">edit</i> 수정</a><?php } ?> <?php if ($update_href) { ?><a href="<?php echo $update_href ?>" class="ui-btn etc"><i
<?php if ($delete_href) { ?><a href="<?php echo $delete_href ?>" class="ui-btn etc" onclick="del(this.href); return false;"><i class="material-icons">delete</i> 삭제</a><?php } ?> class="material-icons">edit</i> 수정</a><?php } ?>
<?php if ($delete_href) { ?><a href="<?php echo $delete_href ?>" class="ui-btn etc"
onclick="del(this.href); return false;"><i class="material-icons">delete</i> 삭제</a><?php } ?>
<a href="<?php echo $list_href ?>" class="ui-btn etc"><i class="material-icons">list</i> 목록</a> <a href="<?php echo $list_href ?>" class="ui-btn etc"><i class="material-icons">list</i> 목록</a>
<?php if ($reply_href) { ?><a href="<?php echo $reply_href ?>" class="ui-btn"><i class="material-icons">list</i> 답변</a><?php } ?> <?php if ($reply_href) { ?><a href="<?php echo $reply_href ?>" class="ui-btn"><i class="material-icons">list</i>
<?php if ($write_href) { ?><a href="<?php echo $write_href ?>" class="ui-btn point"><i class="material-icons">edit</i> 글쓰기</a><?php } ?> 답변</a><?php } ?>
<?php if ($write_href) { ?><a href="<?php echo $write_href ?>" class="ui-btn point"><i
class="material-icons">edit</i> 글쓰기</a><?php } ?>
</div> </div>
</div> </div>
<!-- } 링크 버튼 --> <!-- } 링크 버튼 -->
</article> </article>
<!-- } 게시판 읽기 --> <!-- } 게시판 읽기 -->
<script> <script>
@ -132,12 +126,10 @@ $(function() {
}); });
<?php } ?> <?php } ?>
function board_move(href) function board_move(href) {
{
window.open(href, "boardmove", "left=50, top=50, width=500, height=550, scrollbars=1"); window.open(href, "boardmove", "left=50, top=50, width=500, height=550, scrollbars=1");
} }
</script> </script>
<script> <script>
$(function () { $(function () {
$("a.view_image").click(function () { $("a.view_image").click(function () {
@ -161,8 +153,7 @@ $(function() {
$("#bo_v_atc").viewimageresize(); $("#bo_v_atc").viewimageresize();
}); });
function excute_good(href, $el, $tx) function excute_good(href, $el, $tx) {
{
$.post( $.post(
href, href,
{ js: "on" }, { js: "on" },

View file

@ -1,5 +1,6 @@
<?php <?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가 if (!defined('_GNUBOARD_'))
exit; // 개별 페이지 접근 불가
$comment_action_url = https_url(G5_BBS_DIR) . "/write_comment_update.php"; $comment_action_url = https_url(G5_BBS_DIR) . "/write_comment_update.php";
?> ?>
@ -27,13 +28,15 @@ var char_max = parseInt(<?php echo $comment_max ?>); // 최대
$cmt_sv = $cmt_amt - $i + 1; // 댓글 헤더 z-index 재설정 ie8 이하 사이드뷰 겹침 문제 해결 $cmt_sv = $cmt_amt - $i + 1; // 댓글 헤더 z-index 재설정 ie8 이하 사이드뷰 겹침 문제 해결
?> ?>
<article id="c_<?php echo $comment_id ?>" <?php if ($cmt_depth) { ?>class="is-reply" style="border-left-width:<?php echo $cmt_depth ?>px;"<?php } ?>> <article id="c_<?php echo $comment_id ?>" <?php if ($cmt_depth) { ?>class="is-reply"
style="border-left-width:<?php echo $cmt_depth ?>px;" <?php } ?>>
<header style="z-index:<?php echo $cmt_sv; ?>"> <header style="z-index:<?php echo $cmt_sv; ?>">
<?php echo $list[$i]['name'] ?> <?php echo $list[$i]['name'] ?>
<?php if ($is_ip_view) { ?> <?php if ($is_ip_view) { ?>
<span class="bo_vc_hdinfo"><?php echo $list[$i]['ip']; ?></span> <span class="bo_vc_hdinfo"><?php echo $list[$i]['ip']; ?></span>
<?php } ?> <?php } ?>
<span class="bo_vc_hdinfo"><time datetime="<?php echo date('Y-m-d\TH:i:s+09:00', strtotime($list[$i]['datetime'])) ?>"><?php echo date('m/d H:i', strtotime($list[$i]['datetime'])) ?></time></span> <span class="bo_vc_hdinfo"><time
datetime="<?php echo date('Y-m-d\TH:i:s+09:00', strtotime($list[$i]['datetime'])) ?>"><?php echo date('m/d H:i', strtotime($list[$i]['datetime'])) ?></time></span>
<?php <?php
include(G5_SNS_PATH . '/view_comment_list.sns.skin.php'); include(G5_SNS_PATH . '/view_comment_list.sns.skin.php');
?> ?>
@ -41,15 +44,18 @@ var char_max = parseInt(<?php echo $comment_max ?>); // 최대
<!-- 댓글 출력 --> <!-- 댓글 출력 -->
<p> <p>
<?php if (strstr($list[$i]['wr_option'], "secret")) { ?><img src="<?php echo $board_skin_url; ?>/img/icon_secret.gif" alt="비밀글"><?php } ?> <?php if (strstr($list[$i]['wr_option'], "secret")) { ?><img
src="<?php echo $board_skin_url; ?>/img/icon_secret.gif" alt="비밀글"><?php } ?>
<?php echo $comment ?> <?php echo $comment ?>
</p> </p>
<span id="edit_<?php echo $comment_id ?>"></span><!-- 수정 --> <span id="edit_<?php echo $comment_id ?>"></span><!-- 수정 -->
<span id="reply_<?php echo $comment_id ?>"></span><!-- 답변 --> <span id="reply_<?php echo $comment_id ?>"></span><!-- 답변 -->
<input type="hidden" value="<?php echo strstr($list[$i]['wr_option'],"secret") ?>" id="secret_comment_<?php echo $comment_id ?>"> <input type="hidden" value="<?php echo strstr($list[$i]['wr_option'], "secret") ?>"
<textarea id="save_comment_<?php echo $comment_id ?>" style="display:none"><?php echo get_text($list[$i]['content1'], 0) ?></textarea> id="secret_comment_<?php echo $comment_id ?>">
<textarea id="save_comment_<?php echo $comment_id ?>"
style="display:none"><?php echo get_text($list[$i]['content1'], 0) ?></textarea>
<?php if ($list[$i]['is_reply'] || $list[$i]['is_edit'] || $list[$i]['is_del']) { <?php if ($list[$i]['is_reply'] || $list[$i]['is_edit'] || $list[$i]['is_del']) {
$query_string = clean_query_string($_SERVER['QUERY_STRING']); $query_string = clean_query_string($_SERVER['QUERY_STRING']);
@ -67,15 +73,24 @@ var char_max = parseInt(<?php echo $comment_max ?>); // 최대
?> ?>
<footer> <footer>
<ul class="bo_vc_act"> <ul class="bo_vc_act">
<?php if ($list[$i]['is_reply']) { ?><li><a href="<?php echo $c_reply_href; ?>" onclick="comment_box('<?php echo $comment_id ?>', 'c'); return false;" class="ui-btn small point">답변</a></li><?php } ?> <?php if ($list[$i]['is_reply']) { ?>
<?php if ($list[$i]['is_edit']) { ?><li><a href="<?php echo $c_edit_href; ?>" onclick="comment_box('<?php echo $comment_id ?>', 'cu'); return false;" class="ui-btn small etc">수정</a></li><?php } ?> <li><a href="<?php echo $c_reply_href; ?>"
<?php if ($list[$i]['is_del']) { ?><li><a href="<?php echo $list[$i]['del_link']; ?>" onclick="return comment_delete();" class="ui-btn small">삭제</a></li><?php } ?> onclick="comment_box('<?php echo $comment_id ?>', 'c'); return false;" class="ui-btn small point">답변</a>
</li><?php } ?>
<?php if ($list[$i]['is_edit']) { ?>
<li><a href="<?php echo $c_edit_href; ?>"
onclick="comment_box('<?php echo $comment_id ?>', 'cu'); return false;" class="ui-btn small etc">수정</a></li>
<?php } ?>
<?php if ($list[$i]['is_del']) { ?>
<li><a href="<?php echo $list[$i]['del_link']; ?>" onclick="return comment_delete();"
class="ui-btn small">삭제</a></li><?php } ?>
</ul> </ul>
</footer> </footer>
<?php } ?> <?php } ?>
</article> </article>
<?php } ?> <?php } ?>
<?php if ($i == 0) { //댓글이 없다면 ?><p id="bo_vc_empty">등록된 댓글이 없습니다.</p><?php } ?> <?php if ($i == 0) { //댓글이 없다면 ?>
<p id="bo_vc_empty">등록된 댓글이 없습니다.</p><?php } ?>
</section> </section>
<!-- } 댓글 --> <!-- } 댓글 -->
@ -86,7 +101,8 @@ var char_max = parseInt(<?php echo $comment_max ?>); // 최대
?> ?>
<!-- 댓글 쓰기 시작 { --> <!-- 댓글 쓰기 시작 { -->
<aside id="bo_vc_w" class="theme-box"> <aside id="bo_vc_w" class="theme-box">
<form name="fviewcomment" action="<?php echo $comment_action_url; ?>" onsubmit="return fviewcomment_submit(this);" method="post" autocomplete="off"> <form name="fviewcomment" action="<?php echo $comment_action_url; ?>" onsubmit="return fviewcomment_submit(this);"
method="post" autocomplete="off">
<input type="hidden" name="w" value="<?php echo $w ?>" id="w"> <input type="hidden" name="w" value="<?php echo $w ?>" id="w">
<input type="hidden" name="bo_table" value="<?php echo $bo_table ?>"> <input type="hidden" name="bo_table" value="<?php echo $bo_table ?>">
<input type="hidden" name="wr_id" value="<?php echo $wr_id ?>"> <input type="hidden" name="wr_id" value="<?php echo $wr_id ?>">
@ -108,11 +124,13 @@ var char_max = parseInt(<?php echo $comment_max ?>); // 최대
<?php if ($is_guest) { ?> <?php if ($is_guest) { ?>
<tr> <tr>
<th scope="row"><label for="wr_name">이름<strong class="sound_only"> 필수</strong></label></th> <th scope="row"><label for="wr_name">이름<strong class="sound_only"> 필수</strong></label></th>
<td><input type="text" name="wr_name" value="<?php echo get_cookie("ck_sns_name"); ?>" id="wr_name" required class="frm_input required" size="5" maxLength="20"></td> <td><input type="text" name="wr_name" value="<?php echo get_cookie("ck_sns_name"); ?>" id="wr_name" required
class="frm_input required" size="5" maxLength="20"></td>
</tr> </tr>
<tr> <tr>
<th scope="row"><label for="wr_password">비밀번호<strong class="sound_only"> 필수</strong></label></th> <th scope="row"><label for="wr_password">비밀번호<strong class="sound_only"> 필수</strong></label></th>
<td><input type="password" name="wr_password" id="wr_password" required class="frm_input required" size="10" maxLength="20"></td> <td><input type="password" name="wr_password" id="wr_password" required class="frm_input required" size="10"
maxLength="20"></td>
</tr> </tr>
<?php } ?> <?php } ?>
<tr> <tr>
@ -129,10 +147,11 @@ var char_max = parseInt(<?php echo $comment_max ?>); // 최대
<tr> <tr>
<th scope="row">내용</th> <th scope="row">내용</th>
<td> <td>
<?php if ($comment_min || $comment_max) { ?><strong id="char_cnt"><span id="char_count"></span>글자</strong><?php } ?> <?php if ($comment_min || $comment_max) { ?><strong id="char_cnt"><span
<textarea id="wr_content" name="wr_content" maxlength="10000" required class="required" title="내용" id="char_count"></span>글자</strong><?php } ?>
<?php if ($comment_min || $comment_max) { ?>onkeyup="check_byte('wr_content', 'char_count');"<?php } ?>><?php echo $c_wr_content; ?></textarea> <textarea id="wr_content" name="wr_content" maxlength="10000" required class="required" title="내용" <?php if ($comment_min || $comment_max) { ?>onkeyup="check_byte('wr_content', 'char_count');" <?php } ?>><?php echo $c_wr_content; ?></textarea>
<?php if ($comment_min || $comment_max) { ?><script> check_byte('wr_content', 'char_count'); </script><?php } ?> <?php if ($comment_min || $comment_max) { ?>
<script> check_byte('wr_content', 'char_count'); </script><?php } ?>
<script> <script>
$(document).on("keyup change", "textarea#wr_content[maxlength]", function () { $(document).on("keyup change", "textarea#wr_content[maxlength]", function () {
var str = $(this).val() var str = $(this).val()
@ -160,8 +179,7 @@ var char_max = parseInt(<?php echo $comment_max ?>); // 최대
var save_before = ''; var save_before = '';
var save_html = document.getElementById('bo_vc_w').innerHTML; var save_html = document.getElementById('bo_vc_w').innerHTML;
function good_and_write() function good_and_write() {
{
var f = document.fviewcomment; var f = document.fviewcomment;
if (fviewcomment_submit(f)) { if (fviewcomment_submit(f)) {
f.is_good.value = 1; f.is_good.value = 1;
@ -171,8 +189,7 @@ function good_and_write()
} }
} }
function fviewcomment_submit(f) function fviewcomment_submit(f) {
{
var pattern = /(^\s*)|(\s*$)/g; // \s 공백 문자 var pattern = /(^\s*)|(\s*$)/g; // \s 공백 문자
f.is_good.value = 0; f.is_good.value = 0;
@ -204,49 +221,42 @@ function fviewcomment_submit(f)
// 양쪽 공백 없애기 // 양쪽 공백 없애기
var pattern = /(^\s*)|(\s*$)/g; // \s 공백 문자 var pattern = /(^\s*)|(\s*$)/g; // \s 공백 문자
document.getElementById('wr_content').value = document.getElementById('wr_content').value.replace(pattern, ""); document.getElementById('wr_content').value = document.getElementById('wr_content').value.replace(pattern, "");
if (char_min > 0 || char_max > 0) if (char_min > 0 || char_max > 0) {
{
check_byte('wr_content', 'char_count'); check_byte('wr_content', 'char_count');
var cnt = parseInt(document.getElementById('char_count').innerHTML); var cnt = parseInt(document.getElementById('char_count').innerHTML);
if (char_min > 0 && char_min > cnt) if (char_min > 0 && char_min > cnt) {
{
alert("댓글은 " + char_min + "글자 이상 쓰셔야 합니다."); alert("댓글은 " + char_min + "글자 이상 쓰셔야 합니다.");
return false; return false;
} else if (char_max > 0 && char_max < cnt) } else if (char_max > 0 && char_max < cnt) {
{
alert("댓글은 " + char_max + "글자 이하로 쓰셔야 합니다."); alert("댓글은 " + char_max + "글자 이하로 쓰셔야 합니다.");
return false; return false;
} }
} }
else if (!document.getElementById('wr_content').value) else if (!document.getElementById('wr_content').value) {
{
alert("댓글을 입력하여 주십시오."); alert("댓글을 입력하여 주십시오.");
return false; return false;
} }
if (typeof(f.wr_name) != 'undefined') if (typeof (f.wr_name) != 'undefined') {
{
f.wr_name.value = f.wr_name.value.replace(pattern, ""); f.wr_name.value = f.wr_name.value.replace(pattern, "");
if (f.wr_name.value == '') if (f.wr_name.value == '') {
{
alert('이름이 입력되지 않았습니다.'); alert('이름이 입력되지 않았습니다.');
f.wr_name.focus(); f.wr_name.focus();
return false; return false;
} }
} }
if (typeof(f.wr_password) != 'undefined') if (typeof (f.wr_password) != 'undefined') {
{
f.wr_password.value = f.wr_password.value.replace(pattern, ""); f.wr_password.value = f.wr_password.value.replace(pattern, "");
if (f.wr_password.value == '') if (f.wr_password.value == '') {
{
alert('비밀번호가 입력되지 않았습니다.'); alert('비밀번호가 입력되지 않았습니다.');
f.wr_password.focus(); f.wr_password.focus();
return false; return false;
} }
} }
<?php if($is_guest) echo chk_captcha_js(); ?> <?php if ($is_guest)
echo chk_captcha_js(); ?>
set_comment_token(f); set_comment_token(f);
@ -255,12 +265,10 @@ function fviewcomment_submit(f)
return true; return true;
} }
function comment_box(comment_id, work) function comment_box(comment_id, work) {
{
var el_id; var el_id;
// 댓글 아이디가 넘어오면 답변, 수정 // 댓글 아이디가 넘어오면 답변, 수정
if (comment_id) if (comment_id) {
{
if (work == 'c') if (work == 'c')
el_id = 'reply_' + comment_id; el_id = 'reply_' + comment_id;
else else
@ -269,10 +277,8 @@ function comment_box(comment_id, work)
else else
el_id = 'bo_vc_w'; el_id = 'bo_vc_w';
if (save_before != el_id) if (save_before != el_id) {
{ if (save_before) {
if (save_before)
{
document.getElementById(save_before).style.display = 'none'; document.getElementById(save_before).style.display = 'none';
document.getElementById(save_before).innerHTML = ''; document.getElementById(save_before).innerHTML = '';
} }
@ -280,8 +286,7 @@ function comment_box(comment_id, work)
document.getElementById(el_id).style.display = ''; document.getElementById(el_id).style.display = '';
document.getElementById(el_id).innerHTML = save_html; document.getElementById(el_id).innerHTML = save_html;
// 댓글 수정 // 댓글 수정
if (work == 'cu') if (work == 'cu') {
{
document.getElementById('wr_content').value = document.getElementById('save_comment_' + comment_id).value; document.getElementById('wr_content').value = document.getElementById('save_comment_' + comment_id).value;
if (typeof char_count != 'undefined') if (typeof char_count != 'undefined')
check_byte('wr_content', 'char_count'); check_byte('wr_content', 'char_count');
@ -301,8 +306,7 @@ function comment_box(comment_id, work)
} }
} }
function comment_delete() function comment_delete() {
{
return confirm("이 댓글을 삭제하시겠습니까?"); return confirm("이 댓글을 삭제하시겠습니까?");
} }

View file

@ -1,5 +1,6 @@
<?php <?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가 if (!defined('_GNUBOARD_'))
exit; // 개별 페이지 접근 불가
// add_stylesheet('css 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨 // add_stylesheet('css 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨
add_stylesheet('<link rel="stylesheet" href="' . $board_skin_url . '/style.css">', 0); add_stylesheet('<link rel="stylesheet" href="' . $board_skin_url . '/style.css">', 0);
@ -15,7 +16,8 @@ add_stylesheet('<link rel="stylesheet" href="'.$board_skin_url.'/style.css">', 0
<?php } ?> <?php } ?>
<!-- 게시물 작성/수정 시작 { --> <!-- 게시물 작성/수정 시작 { -->
<form name="fwrite" id="fwrite" action="<?php echo $action_url ?>" onsubmit="return fwrite_submit(this);" method="post" enctype="multipart/form-data" autocomplete="off"> <form name="fwrite" id="fwrite" action="<?php echo $action_url ?>" onsubmit="return fwrite_submit(this);"
method="post" enctype="multipart/form-data" autocomplete="off">
<input type="hidden" name="uid" value="<?php echo get_uniqid(); ?>"> <input type="hidden" name="uid" value="<?php echo get_uniqid(); ?>">
<input type="hidden" name="w" value="<?php echo $w ?>"> <input type="hidden" name="w" value="<?php echo $w ?>">
<input type="hidden" name="bo_table" value="<?php echo $bo_table ?>"> <input type="hidden" name="bo_table" value="<?php echo $bo_table ?>">
@ -69,28 +71,32 @@ add_stylesheet('<link rel="stylesheet" href="'.$board_skin_url.'/style.css">', 0
<?php if ($is_name) { ?> <?php if ($is_name) { ?>
<tr> <tr>
<th scope="row"><label for="wr_name">이름<strong class="sound_only">필수</strong></label></th> <th scope="row"><label for="wr_name">이름<strong class="sound_only">필수</strong></label></th>
<td><input type="text" name="wr_name" value="<?php echo $name ?>" id="wr_name" required class="frm_input required" size="10" maxlength="20"></td> <td><input type="text" name="wr_name" value="<?php echo $name ?>" id="wr_name" required
class="frm_input required" size="10" maxlength="20"></td>
</tr> </tr>
<?php } ?> <?php } ?>
<?php if ($is_password) { ?> <?php if ($is_password) { ?>
<tr> <tr>
<th scope="row"><label for="wr_password">비밀번호<strong class="sound_only">필수</strong></label></th> <th scope="row"><label for="wr_password">비밀번호<strong class="sound_only">필수</strong></label></th>
<td><input type="password" name="wr_password" id="wr_password" <?php echo $password_required ?> class="frm_input <?php echo $password_required ?>" maxlength="20"></td> <td><input type="password" name="wr_password" id="wr_password" <?php echo $password_required ?>
class="frm_input <?php echo $password_required ?>" maxlength="20"></td>
</tr> </tr>
<?php } ?> <?php } ?>
<?php if ($is_email) { ?> <?php if ($is_email) { ?>
<tr> <tr>
<th scope="row"><label for="wr_email">이메일</label></th> <th scope="row"><label for="wr_email">이메일</label></th>
<td><input type="text" name="wr_email" value="<?php echo $email ?>" id="wr_email" class="frm_input email" size="50" maxlength="100"></td> <td><input type="text" name="wr_email" value="<?php echo $email ?>" id="wr_email" class="frm_input email"
size="50" maxlength="100"></td>
</tr> </tr>
<?php } ?> <?php } ?>
<?php if ($is_homepage) { ?> <?php if ($is_homepage) { ?>
<tr> <tr>
<th scope="row"><label for="wr_homepage">홈페이지</label></th> <th scope="row"><label for="wr_homepage">홈페이지</label></th>
<td><input type="text" name="wr_homepage" value="<?php echo $homepage ?>" id="wr_homepage" class="frm_input" size="50"></td> <td><input type="text" name="wr_homepage" value="<?php echo $homepage ?>" id="wr_homepage" class="frm_input"
size="50"></td>
</tr> </tr>
<?php } ?> <?php } ?>
@ -117,7 +123,8 @@ add_stylesheet('<link rel="stylesheet" href="'.$board_skin_url.'/style.css">', 0
<th scope="row"><label for="wr_subject">제목<strong class="sound_only">필수</strong></label></th> <th scope="row"><label for="wr_subject">제목<strong class="sound_only">필수</strong></label></th>
<td> <td>
<div id="autosave_wrapper"> <div id="autosave_wrapper">
<input type="text" name="wr_subject" value="<?php echo $subject ?>" id="wr_subject" required class="frm_input required" size="50" maxlength="255"> <input type="text" name="wr_subject" value="<?php echo $subject ?>" id="wr_subject" required
class="frm_input required" size="50" maxlength="255">
</div> </div>
</td> </td>
</tr> </tr>
@ -127,7 +134,8 @@ add_stylesheet('<link rel="stylesheet" href="'.$board_skin_url.'/style.css">', 0
<td class="wr_content"> <td class="wr_content">
<?php if ($write_min || $write_max) { ?> <?php if ($write_min || $write_max) { ?>
<!-- 최소/최대 글자 사용 --> <!-- 최소/최대 글자 사용 -->
<p id="char_count_desc"> 게시판은 최소 <strong><?php echo $write_min; ?></strong>글자 이상, 최대 <strong><?php echo $write_max; ?></strong>글자 이하까지 글을 쓰실 수 있습니다.</p> <p id="char_count_desc"> 게시판은 최소 <strong><?php echo $write_min; ?></strong>글자 이상, 최대
<strong><?php echo $write_max; ?></strong>글자 이하까지 글을 쓰실 수 있습니다.</p>
<?php } ?> <?php } ?>
<?php echo $editor_html; // 에디터 사용시는 에디터로, 아니면 textarea 로 노출 ?> <?php echo $editor_html; // 에디터 사용시는 에디터로, 아니면 textarea 로 노출 ?>
<?php if ($write_min || $write_max) { ?> <?php if ($write_min || $write_max) { ?>
@ -148,12 +156,17 @@ add_stylesheet('<link rel="stylesheet" href="'.$board_skin_url.'/style.css">', 0
<tr> <tr>
<th scope="row">파일 #<?php echo $i + 1 ?></th> <th scope="row">파일 #<?php echo $i + 1 ?></th>
<td> <td>
<input type="file" name="bf_file[]" title="파일첨부 <?php echo $i+1 ?> : 용량 <?php echo $upload_max_filesize ?> 이하만 업로드 가능" class="frm_file frm_input"> <input type="file" name="bf_file[]"
title="파일첨부 <?php echo $i + 1 ?> : 용량 <?php echo $upload_max_filesize ?> 이하만 업로드 가능"
class="frm_file frm_input">
<?php if ($is_file_content) { ?> <?php if ($is_file_content) { ?>
<input type="text" name="bf_content[]" value="<?php echo ($w == 'u') ? $file[$i]['bf_content'] : ''; ?>" title="파일 설명을 입력해주세요." class="frm_file frm_input" size="50"> <input type="text" name="bf_content[]" value="<?php echo ($w == 'u') ? $file[$i]['bf_content'] : ''; ?>"
title="파일 설명을 입력해주세요." class="frm_file frm_input" size="50">
<?php } ?> <?php } ?>
<?php if ($w == 'u' && $file[$i]['file']) { ?> <?php if ($w == 'u' && $file[$i]['file']) { ?>
<input type="checkbox" id="bf_file_del<?php echo $i ?>" name="bf_file_del[<?php echo $i; ?>]" value="1"> <label for="bf_file_del<?php echo $i ?>"><?php echo $file[$i]['source'].'('.$file[$i]['size'].')'; ?> 파일 삭제</label> <input type="checkbox" id="bf_file_del<?php echo $i ?>" name="bf_file_del[<?php echo $i; ?>]" value="1">
<label for="bf_file_del<?php echo $i ?>"><?php echo $file[$i]['source'] . '(' . $file[$i]['size'] . ')'; ?> 파일
삭제</label>
<?php } ?> <?php } ?>
</td> </td>
</tr> </tr>
@ -172,7 +185,8 @@ add_stylesheet('<link rel="stylesheet" href="'.$board_skin_url.'/style.css">', 0
</table> </table>
<div class="btn_confirm"> <div class="btn_confirm">
<button type="submit" id="btn_submit" accesskey="s" class="ui-btn point"><i class="material-icons">edit</i> 작성</button> <button type="submit" id="btn_submit" accesskey="s" class="ui-btn point"><i class="material-icons">edit</i>
작성</button>
<a href="./board.php?bo_table=<?php echo $bo_table ?>" class="ui-btn"><i class="material-icons">list</i> 목록</a> <a href="./board.php?bo_table=<?php echo $bo_table ?>" class="ui-btn"><i class="material-icons">list</i> 목록</a>
</div> </div>
</form> </form>
@ -191,8 +205,7 @@ add_stylesheet('<link rel="stylesheet" href="'.$board_skin_url.'/style.css">', 0
}); });
<?php } ?> <?php } ?>
function html_auto_br(obj) function html_auto_br(obj) {
{
if (obj.checked) { if (obj.checked) {
result = confirm("자동 줄바꿈을 하시겠습니까?\n\n자동 줄바꿈은 게시물 내용중 줄바뀐 곳을<br>태그로 변환하는 기능입니다."); result = confirm("자동 줄바꿈을 하시겠습니까?\n\n자동 줄바꿈은 게시물 내용중 줄바뀐 곳을<br>태그로 변환하는 기능입니다.");
if (result) if (result)
@ -204,8 +217,7 @@ add_stylesheet('<link rel="stylesheet" href="'.$board_skin_url.'/style.css">', 0
obj.value = ""; obj.value = "";
} }
function fwrite_submit(f) function fwrite_submit(f) {
{
<?php echo $editor_js; // 에디터 사용시 자바스크립트에서 내용을 폼필드로 넣어주며 내용이 입력되었는지 검사함 ?> <?php echo $editor_js; // 에디터 사용시 자바스크립트에서 내용을 폼필드로 넣어주며 내용이 입력되었는지 검사함 ?>
var subject = ""; var subject = "";