Skip to content

Commit

Permalink
Eyoom Builder 4 - [4.5.3]
Browse files Browse the repository at this point in the history
  • Loading branch information
eyoom committed Jul 27, 2022
1 parent 7d6611b commit 57bceef
Show file tree
Hide file tree
Showing 35 changed files with 3,882 additions and 89 deletions.
7 changes: 7 additions & 0 deletions adm/admin.menu999.eyoom.php
Expand Up @@ -42,6 +42,13 @@
array('200990', '포인트 압축하기', G5_ADMIN_URL.'/point_compress.php', 'mb_point_compress')
);

/**
* 상단고정 게시물 추가메뉴
*/
array_push ($menu['menu300'],
array('300900', '상단고정 게시물 관리', G5_ADMIN_URL.'/wrfixed_list.php', 'wrfixed_list')
);

/**
* 쇼핑몰 브랜드관리
*/
Expand Down
2 changes: 2 additions & 0 deletions adm/eyoom_admin/core/board/board_form_update.php
Expand Up @@ -298,6 +298,8 @@
$target = array($create_table, '');
$sql = preg_replace($source, $target, $sql);
sql_query($sql, false);

$msg = "게시판 정상적으로 생성하였습니다.";
} elseif ($w == 'u') {
// 게시판의 글 수
$sql = " select count(*) as cnt from {$g5['write_prefix']}{$bo_table} where wr_is_comment = 0 ";
Expand Down
79 changes: 79 additions & 0 deletions adm/eyoom_admin/core/board/wrfixed_list.php
@@ -0,0 +1,79 @@
<?php
/**
* @file /adm/eyoom_admin/core/board/board_list.php
*/
if (!defined('_EYOOM_IS_ADMIN_')) exit;

$sub_menu = "300900";

$action_url1 = G5_ADMIN_URL . '/?dir=board&amp;pid=wrfixed_list_update&amp;smode=1';

auth_check_menu($auth, $sub_menu, 'r');

/**
* 전체 게시판 정보
*/
$sql = "select bo_table, bo_subject from {$g5['board_table']} where (1) order by bo_table asc";
$result = sql_query($sql);
for ($i=0; $row=sql_fetch_array($result); $i++) {
$bo_subject[$row['bo_table']] = $row['bo_subject'];
}

$sql_common = " from {$g5['eyoom_wrfixed']} ";

$sql_search = " where (1) ";

if ($stx) {
$sql_search .= " and ( ";
switch ($sfl) {
case "bo_table":
$sql_search .= " ($sfl like '$stx%') ";
break;
default:
$sql_search .= " ($sfl like '%$stx%') ";
break;
}
$sql_search .= " ) ";
}

if (!$sst) {
$sst = "bf_datetime";
$sod = "desc";
}
$sql_order = " order by $sst $sod ";

$sql = " select count(*) as cnt {$sql_common} {$sql_search} {$sql_order} ";
$row = sql_fetch($sql);
$total_count = $row['cnt'];

$rows = $config['cf_page_rows'];
$total_page = ceil($total_count / $rows); // 전체 페이지 계산
if ($page < 1) {
$page = 1; // 페이지가 없으면 첫 페이지 (1 페이지)
}
$from_record = ($page - 1) * $rows; // 시작 열을 구함

$sql = " select * {$sql_common} {$sql_search} {$sql_order} limit {$from_record}, {$rows} ";

$result = sql_query($sql);
$list = array();
for ($i=0; $row=sql_fetch_array($result); $i++) {
$list[$i] = $row;

$list[$i]['bo_subject'] = $bo_subject[$row['bo_table']];

$wr_table = $g5['write_prefix'] . $row['bo_table'];
$row1 = sql_fetch("select * from {$wr_table} where wr_id = '{$row['wr_id']}' ");
$row2 = sql_fetch("select mb_point from {$g5['member_table']} where mb_id='{$row1['mb_id']}' ");

$list[$i]['wr_subject'] = $row1['wr_subject'];
$list[$i]['wr_name'] = $row1['wr_name'];
$list[$i]['wr_mb_id'] = $row1['mb_id'];
$list[$i]['mb_point'] = $row2['mb_point'];

$list_num = $total_count - ($page - 1) * $rows;
$list[$i]['num'] = $list_num - $k;
$k++;
}

$bf_cnt = count($list);
88 changes: 88 additions & 0 deletions adm/eyoom_admin/core/board/wrfixed_list_update.php
@@ -0,0 +1,88 @@
<?php
/**
* @file /adm/eyoom_admin/core/board/board_list_update.php
*/
if (!defined('_EYOOM_IS_ADMIN_')) exit;

$sub_menu = "300900";

check_demo();

$post_count_chk = (isset($_POST['chk']) && is_array($_POST['chk'])) ? count($_POST['chk']) : 0;
$chk = (isset($_POST['chk']) && is_array($_POST['chk'])) ? $_POST['chk'] : array();
$act_button = isset($_POST['act_button']) ? strip_tags($_POST['act_button']) : '';

if (!$post_count_chk) {
alert($act_button . " 하실 항목을 하나 이상 체크하세요.");
}

check_admin_token();

if ($act_button == "선택수정") {

auth_check_menu($auth, $sub_menu, 'w');

for ($i = 0; $i < $post_count_chk; $i++) {
// 실제 번호를 넘김
$k = isset($_POST['chk'][$i]) ? (int) $_POST['chk'][$i] : 0;

$post_bf_open = isset($_POST['bf_open'][$k]) ? clean_xss_tags($_POST['bf_open'][$k], 1, 1) : '';
$post_bo_table = isset($_POST['bo_table'][$k]) ? clean_xss_tags($_POST['bo_table'][$k], 1, 1) : '';
$post_wr_id = isset($_POST['wr_id'][$k]) ? clean_xss_tags($_POST['wr_id'][$k], 1, 1) : '';

$sql_where = " bo_table = '" . sql_real_escape_string($post_bo_table) . "' and wr_id='" . sql_real_escape_string($post_wr_id) . "' ";

$sql_add = '';
if ($post_bf_open == 'y') {
$row = sql_fetch("select * from {$g5['eyoom_wrfixed']} where {$sql_where}");
$mbinfo = get_member($row['mb_id']);

if ($row['bf_wrfixed_point'] > $mbinfo['mb_point']) {
continue;
} else {
if ($row['po_datetime'] == '0000-00-00 00:00:00' && $row['mb_id'] != $config['cf_admin']) {
insert_point($row['mb_id'], $row['bf_wrfixed_point']*(-1), "{$row['bo_table']}-{$row['wr_id']} 게시물 상단고정", $row['bo_table'], $row['wr_id'], "상단고정 - ".time());
$sql_add = ", po_datetime = '" . G5_TIME_YMDHIS . "' ";
}
}
$ex_time = $bbs->get_exdatetime($row['bf_wrfixed_date']);
$ex_datetime = date('Y-m-d H:i:s', $ex_time);
$sql_add .= ", ex_datetime = '" . $ex_datetime . "' ";
}

$sql = " update {$g5['eyoom_wrfixed']} set bf_open = '" . sql_real_escape_string($post_bf_open) . "' {$sql_add} where {$sql_where} ";

sql_query($sql);
}
$msg = "정상적으로 수정하였습니다.";

} else if ($act_button == "선택삭제") {
if ($is_admin != 'super') {
alert('삭제는 최고관리자만 가능합니다.');
}

auth_check_menu($auth, $sub_menu, 'd');

define('_WRFIXED_DELETE_', true);

for ($i=0; $i<$post_count_chk; $i++) {
// 실제 번호를 넘김
$k = isset($_POST['chk'][$i]) ? (int) $_POST['chk'][$i] : 0;

$post_bo_table = isset($_POST['bo_table'][$k]) ? clean_xss_tags($_POST['bo_table'][$k], 1, 1) : '';
$post_wr_id = isset($_POST['wr_id'][$k]) ? clean_xss_tags($_POST['wr_id'][$k], 1, 1) : '';

// 확장필드 정보 삭제
$sql = "delete from {$g5['eyoom_wrfixed']} where bo_table = '" . sql_real_escape_string($post_bo_table) . "' and wr_id='" . sql_real_escape_string($post_wr_id) . "' ";
sql_query($sql);
}
$msg = "선택한 게시판을 삭제하였습니다.";

}

// query string
$qstr .= $wmode ? '&amp;wmode=1': '';

run_event('admin_board_list_update', $act_button, $chk, $board_table, $qstr);

alert($msg, G5_ADMIN_URL . '/?dir=board&amp;pid=wrfixed_list&amp;' . $qstr);
3 changes: 2 additions & 1 deletion adm/eyoom_admin/core/theme/board_form.php
Expand Up @@ -37,7 +37,8 @@
'anc_bo_addon' => '애드온기능',
'anc_bo_cmtbest' => '댓글베스트',
'anc_bo_exif' => '이미지 EXIF',
'anc_bo_cmtpoint' => '댓글포인트'
'anc_bo_cmtpoint' => '댓글포인트',
'anc_bo_wrfixed' => '게시물 상단고정'
);

/**
Expand Down
47 changes: 47 additions & 0 deletions adm/eyoom_admin/core/theme/board_form_update.php
Expand Up @@ -69,6 +69,37 @@
sql_query($sql, true);
}

/**
* 게시물 상단고정 설정 필드 추가
*/
if(!sql_query(" select bo_use_wrfixed from {$g5['eyoom_board']} limit 1 ", false)) {
$sql = " alter table `{$g5['eyoom_board']}`
add `bo_use_wrfixed` char(1) NOT NULL default '' after `bo_adopt_ratio`,
add `bo_wrfixed_type` char(1) NOT NULL default '1' after `bo_use_wrfixed`,
add `bo_wrfixed_point` int(7) NOT NULL default '1000' after `bo_wrfixed_type`,
add `bo_wrfixed_date` smallint(3) NOT NULL default '5' after `bo_wrfixed_point`
";
sql_query($sql, true);
}

// 게시물 상단고정 관리 테이블 없을 경우 생성
if (!sql_query(" DESC {$g5['eyoom_wrfixed']} ", false)) {
sql_query(
" CREATE TABLE IF NOT EXISTS `{$g5['eyoom_wrfixed']}` (
`bo_table` varchar(20) NOT NULL DEFAULT '',
`wr_id` int(11) NOT NULL DEFAULT '0',
`mb_id` varchar(30) NOT NULL,
`bf_wrfixed_point` int(11) NOT NULL DEFAULT '0',
`bf_wrfixed_date` smallint(3) NOT NULL DEFAULT '1',
`bf_open` enum('y','n') NOT NULL DEFAULT 'n',
`po_datetime` datetime NOT NULL,
`ex_datetime` datetime NOT NULL,
`bf_datetime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00'
) ",
true
);
}

$use_shop_skin = isset($_POST['use_shop_skin']) ? clean_xss_tags($_POST['use_shop_skin'], 1, 1) : '';
$use_gnu_skin = isset($_POST['use_gnu_skin']) ? clean_xss_tags($_POST['use_gnu_skin'], 1, 1) : '';
$bo_skin = isset($_POST['bo_skin']) ? clean_xss_tags($_POST['bo_skin'], 1, 1) : '';
Expand All @@ -89,6 +120,10 @@
$bo_adopt_minpoint = isset($_POST['bo_adopt_minpoint']) ? (int) $_POST['bo_adopt_minpoint'] : 0;
$bo_adopt_maxpoint = isset($_POST['bo_adopt_maxpoint']) ? (int) $_POST['bo_adopt_maxpoint'] : 0;
$bo_adopt_ratio = isset($_POST['bo_adopt_ratio']) ? (int) $_POST['bo_adopt_ratio'] : 0;
$bo_use_wrfixed = isset($_POST['bo_use_wrfixed']) ? (int) $_POST['bo_use_wrfixed'] : 0;
$bo_wrfixed_type = isset($_POST['bo_wrfixed_type']) ? (int) $_POST['bo_wrfixed_type'] : 1;
$bo_wrfixed_point = isset($_POST['bo_wrfixed_point']) ? (int) $_POST['bo_wrfixed_point'] : 1000;
$bo_wrfixed_date = isset($_POST['bo_wrfixed_date']) ? (int) $_POST['bo_wrfixed_date'] : 5;
$bo_write_limit = isset($_POST['bo_write_limit']) ? (int) $_POST['bo_write_limit'] : 0;
$bo_use_profile_photo = isset($_POST['bo_use_profile_photo']) ? (int) $_POST['bo_use_profile_photo']: 0;
$bo_sel_date_type = isset($_POST['bo_sel_date_type']) ? (int) $_POST['bo_sel_date_type'] : 1;
Expand Down Expand Up @@ -150,6 +185,10 @@
bo_adopt_minpoint = '{$bo_adopt_minpoint}',
bo_adopt_maxpoint = '{$bo_adopt_maxpoint}',
bo_adopt_ratio = '{$bo_adopt_ratio}',
bo_use_wrfixed = '{$bo_use_wrfixed}',
bo_wrfixed_type = '{$bo_wrfixed_type}',
bo_wrfixed_point = '{$bo_wrfixed_point}',
bo_wrfixed_date = '{$bo_wrfixed_date}',
bo_write_limit = '{$bo_write_limit}',
bo_use_profile_photo = '{$bo_use_profile_photo}',
bo_sel_date_type = '{$bo_sel_date_type}',
Expand Down Expand Up @@ -219,6 +258,10 @@
if (is_checked('chk_grp_rating_comment')) $grp_fields .= " , bo_use_rating_comment = '{$bo_use_rating_comment}' ";
if (is_checked('chk_grp_rating_point')) $grp_fields .= " , bo_rating_point = '{$bo_rating_point}' ";
if (is_checked('chk_grp_use_tag')) $grp_fields .= " , bo_use_tag = '{$bo_use_tag}' ";
if (is_checked('chk_grp_use_wrfixed')) $grp_fields .= " , bo_use_wrfixed = '{$bo_use_wrfixed}' ";
if (is_checked('chk_grp_wrfixed_type')) $grp_fields .= " , bo_wrfixed_type = '{$bo_wrfixed_type}' ";
if (is_checked('chk_grp_wrfixed_point')) $grp_fields .= " , bo_wrfixed_point = '{$bo_wrfixed_point}' ";
if (is_checked('chk_grp_wrfixed_date')) $grp_fields .= " , bo_wrfixed_date = '{$bo_wrfixed_date}' ";
if (is_checked('chk_grp_use_automove')) $grp_fields .= " , bo_use_automove = '{$bo_use_automove}' ";
if (is_checked('chk_grp_addon_emoticon')) $grp_fields .= " , bo_use_addon_emoticon = '{$bo_use_addon_emoticon}' ";
if (is_checked('chk_grp_addon_video')) $grp_fields .= " , bo_use_addon_video = '{$bo_use_addon_video}' ";
Expand Down Expand Up @@ -284,6 +327,10 @@
if (is_checked('chk_all_rating_comment')) $all_fields .= " , bo_use_rating_comment = '{$bo_use_rating_comment}' ";
if (is_checked('chk_all_rating_point')) $all_fields .= " , bo_rating_point = '{$bo_rating_point}' ";
if (is_checked('chk_all_use_tag')) $all_fields .= " , bo_use_tag = '{$bo_use_tag}' ";
if (is_checked('chk_all_use_wrfixed')) $all_fields .= " , bo_use_wrfixed = '{$bo_use_wrfixed}' ";
if (is_checked('chk_all_wrfixed_type')) $all_fields .= " , bo_wrfixed_type = '{$bo_wrfixed_type}' ";
if (is_checked('chk_all_wrfixed_point')) $all_fields .= " , bo_wrfixed_point = '{$bo_wrfixed_point}' ";
if (is_checked('chk_all_wrfixed_date')) $all_fields .= " , bo_wrfixed_date = '{$bo_wrfixed_date}' ";
if (is_checked('chk_all_use_automove')) $all_fields .= " , bo_use_automove = '{$bo_use_automove}' ";
if (is_checked('chk_all_addon_emoticon')) $all_fields .= " , bo_use_addon_emoticon = '{$bo_use_addon_emoticon}' ";
if (is_checked('chk_all_addon_video')) $all_fields .= " , bo_use_addon_video = '{$bo_use_addon_video}' ";
Expand Down
9 changes: 5 additions & 4 deletions adm/eyoom_admin/theme/basic/skin/board/board_form.html.php
Expand Up @@ -931,7 +931,7 @@
</th>
<td>
<label class="input form-width-250px">
<input type="text" name="bo_include_head" id="bo_include_head" value="<?php echo $board['bo_include_head'] ?>">
<input type="text" name="bo_include_head" id="bo_include_head" value="<?php echo get_sanitize_input($board['bo_include_head']); ?>">
</label>
</td>
<td class="table-chk-td">
Expand All @@ -947,7 +947,7 @@
</th>
<td>
<label class="input form-width-250px">
<input type="text" name="bo_include_tail" id="bo_include_tail" value="<?php echo $board['bo_include_tail'] ?>">
<input type="text" name="bo_include_tail" id="bo_include_tail" value="<?php echo get_sanitize_input($board['bo_include_tail']); ?>">
</label>
</td>
<td class="table-chk-td">
Expand Down Expand Up @@ -1623,9 +1623,10 @@ function use_captcha_check(){
});
}

var bo_include_head = jQuery.trim(jQuery("#bo_include_head").val()),
bo_include_tail = jQuery.trim(jQuery("#bo_include_tail").val());

function frm_check_file(){
var bo_include_head = "<?php echo $board['bo_include_head']; ?>";
var bo_include_tail = "<?php echo $board['bo_include_tail']; ?>";
var head = jQuery.trim(jQuery("#bo_include_head").val());
var tail = jQuery.trim(jQuery("#bo_include_tail").val());

Expand Down
4 changes: 2 additions & 2 deletions adm/eyoom_admin/theme/basic/skin/board/contentform.html.php
Expand Up @@ -117,7 +117,7 @@
</th>
<td>
<label class="input form-width-250px">
<input type="text" name="co_include_head" value="<?php echo $co['co_include_head']; ?>" id="co_include_head">
<input type="text" name="co_include_head" value="<?php echo get_sanitize_input($co['co_include_head']); ?>" id="co_include_head">
</label>
<div class="note"><strong>Note:</strong> 설정값이 없으면 기본 상단 파일을 사용합니다.</div>
</td>
Expand All @@ -128,7 +128,7 @@
</th>
<td>
<label class="input form-width-250px">
<input type="text" name="co_include_tail" value="<?php echo $co['co_include_tail']; ?>" id="co_include_tail">
<input type="text" name="co_include_tail" value="<?php echo get_sanitize_input($co['co_include_tail']); ?>" id="co_include_tail">
</label>
<div class="note"><strong>Note:</strong> 설정값이 없으면 기본 하단 파일을 사용합니다..</div>
</td>
Expand Down
10 changes: 5 additions & 5 deletions adm/eyoom_admin/theme/basic/skin/board/qa_config.html.php
Expand Up @@ -236,7 +236,7 @@
</th>
<td colspan="3">
<label class="input form-width-250px">
<input type="text" name="qa_include_head" value="<?php echo $qaconfig['qa_include_head']; ?>" id="qa_include_head">
<input type="text" name="qa_include_head" value="<?php echo get_sanitize_input($qaconfig['qa_include_head']); ?>" id="qa_include_head">
</label>
</td>
</tr>
Expand All @@ -246,7 +246,7 @@
</th>
<td colspan="3">
<label class="input form-width-250px">
<input type="text" name="qa_include_tail" value="<?php echo $qaconfig['qa_include_tail']; ?>" id="qa_include_tail">
<input type="text" name="qa_include_tail" value="<?php echo get_sanitize_input($qaconfig['qa_include_tail']); ?>" id="qa_include_tail">
</label>
</td>
</tr>
Expand Down Expand Up @@ -354,7 +354,9 @@
</div>

<script>
var captcha_chk = false;
var captcha_chk = false,
qa_include_head = jQuery.trim(jQuery("#qa_include_head").val()),
qa_include_tail = jQuery.trim(jQuery("#qa_include_tail").val());

function use_captcha_check(){
$.ajax({
Expand All @@ -370,8 +372,6 @@ function use_captcha_check(){
}

function frm_check_file(){
var qa_include_head = "<?php echo $qaconfig['qa_include_head']; ?>";
var qa_include_tail = "<?php echo $qaconfig['qa_include_tail']; ?>";
var head = jQuery.trim(jQuery("#qa_include_head").val());
var tail = jQuery.trim(jQuery("#qa_include_tail").val());

Expand Down

0 comments on commit 57bceef

Please sign in to comment.