Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
35 changed files
with
3,882 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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&pid=wrfixed_list_update&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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 ? '&wmode=1': ''; | ||
|
||
run_event('admin_board_list_update', $act_button, $chk, $board_table, $qstr); | ||
|
||
alert($msg, G5_ADMIN_URL . '/?dir=board&pid=wrfixed_list&' . $qstr); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.