diff --git a/.gitignore b/.gitignore index 8b781d5d7..df481935e 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ test.php *.key *.sh cheditor5/ +ckeditor43/ diff --git a/adm/admin.head.php b/adm/admin.head.php index 07d9fe27d..7aef36884 100644 --- a/adm/admin.head.php +++ b/adm/admin.head.php @@ -119,7 +119,9 @@ $menu_key = substr($sub_menu, 0, 3); $nl = ''; foreach($menu['menu'.$menu_key] as $key=>$value) { if($key > 0) { - if ($menu_key == substr($menu['menu'.$key][0][0], 0, 2)) echo 1; + if ($is_admin != 'super' && (!array_key_exists($value[0],$auth) || !strstr($auth[$value[0]], 'r'))) + continue; + echo $nl.'
  • '.$value[1].'
  • '; $nl = PHP_EOL; } diff --git a/adm/admin.js b/adm/admin.js index e5c2a3e04..a3f4c7d64 100644 --- a/adm/admin.js +++ b/adm/admin.js @@ -63,4 +63,12 @@ function delete_confirm() return true; else return false; +} + +function delete_confirm2(msg) +{ + if(confirm(msg)) + return true; + else + return false; } \ No newline at end of file diff --git a/adm/admin.menu100.php b/adm/admin.menu100.php index 4d657b4c1..217dfe9c3 100644 --- a/adm/admin.menu100.php +++ b/adm/admin.menu100.php @@ -4,7 +4,7 @@ $menu['menu100'] = array ( array('', '기본환경설정', G5_ADMIN_URL.'/config_form.php', 'cf_basic'), array('', '관리권한설정', G5_ADMIN_URL.'/auth_list.php', 'cf_auth'), array('100300', '메일 테스트', G5_ADMIN_URL.'/sendmail_test.php', 'cf_mailtest'), - array('100310', '팝업레이어관리', G5_ADMIN_URL.'/newwinlist.php', 'scf_poplayer', 1), + array('100310', '팝업레이어관리', G5_ADMIN_URL.'/newwinlist.php', 'scf_poplayer'), //array('100400', '버전정보', G5_ADMIN_URL.'/version.php', 'cf_version'), array('100800', '세션파일 일괄삭제',G5_ADMIN_URL.'/session_file_delete.php', 'cf_session', 1), array('100900', '캐시파일 일괄삭제',G5_ADMIN_URL.'/cache_file_delete.php', 'cf_cache', 1), diff --git a/adm/board_copy_update.php b/adm/board_copy_update.php index e89c4468b..5636b1cae 100644 --- a/adm/board_copy_update.php +++ b/adm/board_copy_update.php @@ -4,8 +4,8 @@ include_once('./_common.php'); auth_check($auth[$sub_menu], 'w'); -$target_table = escape_trim($_POST['target_table']); -$target_subject = escape_trim($_POST['target_subject']); +$target_table = trim($_POST['target_table']); +$target_subject = trim($_POST['target_subject']); if (!preg_match('/[A-Za-z0-9_]{1,20}/', $target_table)) { alert('게시판 TABLE명은 공백없이 영문자, 숫자, _ 만 사용 가능합니다. (20자 이내)'); @@ -61,7 +61,7 @@ $sql = " insert into {$g5['board_table']} bo_use_nogood = '{$board[bo_use_nogood]}', bo_use_signature = '{$board[bo_use_signature]}', bo_use_ip_view = '{$board[bo_use_ip_view]}', - bo_use_list_view = '{$board['o_use_list_view']}', + bo_use_list_view = '{$board['bo_use_list_view']}', bo_use_list_content = '{$board[bo_use_list_content]}', bo_table_width = '{$board[bo_table_width]}', bo_subject_len = '{$board[bo_subject_len]}', diff --git a/adm/board_form.php b/adm/board_form.php index 86497f74d..6e9d2a54c 100644 --- a/adm/board_form.php +++ b/adm/board_form.php @@ -159,7 +159,9 @@ $frm_submit = '
    목록'.PHP_EOL; if ($w == 'u') $frm_submit .= ' 게시판복사 - 게시판 바로가기'.PHP_EOL; + 게시판 바로가기 + 게시판 썸네일 삭제 + '.PHP_EOL; $frm_submit .= '
    '; ?> diff --git a/adm/board_list_update.php b/adm/board_list_update.php index 5754db411..0cf509bd7 100644 --- a/adm/board_list_update.php +++ b/adm/board_list_update.php @@ -62,7 +62,7 @@ if ($_POST['act_button'] == "선택수정") { $k = $_POST['chk'][$i]; // include 전에 $bo_table 값을 반드시 넘겨야 함 - $tmp_bo_table = escape_trim($_POST['board_table'][$k]); + $tmp_bo_table = trim($_POST['board_table'][$k]); include ('./board_delete.inc.php'); } diff --git a/adm/board_thumbnail_delete.php b/adm/board_thumbnail_delete.php new file mode 100644 index 000000000..720cad4f9 --- /dev/null +++ b/adm/board_thumbnail_delete.php @@ -0,0 +1,52 @@ + + +
    +

    + 완료 메세지가 나오기 전에 프로그램의 실행을 중지하지 마십시오. +

    +
    + +'; + $files = glob($dir.'/thumb-*'); + if (is_array($files)) { + foreach($files as $thumbnail) { + $cnt++; + @unlink($thumbnail); + + echo '
  • '.$thumbnail.'
  • '.PHP_EOL; + + flush(); + + if ($cnt%10==0) + echo PHP_EOL; + } + } + + echo '
  • 완료됨
  • '.PHP_EOL; + echo '

    썸네일 '.$cnt.'건의 삭제 완료됐습니다.

    '.PHP_EOL; +} else { + echo '

    첨부파일 디렉토리가 존재하지 않습니다.

    '; +} +?> + +
    게시판 수정으로 돌아가기
    + + \ No newline at end of file diff --git a/adm/img/logo.jpg b/adm/img/logo.jpg index a186c2c16..a3d9b91a4 100644 Binary files a/adm/img/logo.jpg and b/adm/img/logo.jpg differ diff --git a/adm/mail_select_list.php b/adm/mail_select_list.php index db05cca50..d43d6c200 100644 --- a/adm/mail_select_list.php +++ b/adm/mail_select_list.php @@ -94,7 +94,7 @@ include_once('./admin.head.php'); while ($row=sql_fetch_array($result)) { $i++; $ma_list .= $cr . $row['mb_email'] . "||" . $row['mb_id'] . "||" . $row['mb_name'] . "||" . $row['mb_nick'] . "||" . $row['mb_datetime']; - $cr = "\n"; + $cr = chr(30); $bg = 'bg'.($i%2); ?> diff --git a/adm/mail_select_update.php b/adm/mail_select_update.php index 3bec09bae..5b0f5874e 100644 --- a/adm/mail_select_update.php +++ b/adm/mail_select_update.php @@ -33,10 +33,10 @@ flush(); ob_flush(); $ma_id = trim($_POST['ma_id']); -$select_member_list = addslashes(trim($_POST['ma_list'])); +$select_member_list = trim($_POST['ma_list']); //print_r2($_POST); EXIT; -$member_list = explode("\n", $select_member_list); +$member_list = explode(chr(30), $select_member_list); // 메일내용 가져오기 $sql = "select ma_subject, ma_content from {$g5['mail_table']} where ma_id = '$ma_id' "; diff --git a/adm/member_form_update.php b/adm/member_form_update.php index 18a40b548..50543e0d7 100644 --- a/adm/member_form_update.php +++ b/adm/member_form_update.php @@ -10,7 +10,7 @@ auth_check($auth[$sub_menu], 'w'); check_token(); -$mb_id = escape_trim($_POST['mb_id']); +$mb_id = trim($_POST['mb_id']); // 휴대폰번호 체크 $mb_hp = $_POST['mb_hp']; diff --git a/adm/visit_search.php b/adm/visit_search.php index 1750956e2..fa01682f4 100644 --- a/adm/visit_search.php +++ b/adm/visit_search.php @@ -9,8 +9,8 @@ $g5['title'] = '접속자검색'; include_once('./admin.head.php'); include_once(G5_PLUGIN_PATH.'/jquery-ui/datepicker.php'); -$search_word = escape_trim($_GET['search_word']); -$search_sort = escape_trim($_GET['search_sort']); +$search_word = trim($_GET['search_word']); +$search_sort = trim($_GET['search_sort']); $colspan = 5; $qstr = 'search_word='.$search_word.'&search_sort='.$search_sort; //페이징 처리관련 변수 diff --git a/bbs/ajax.autosave.php b/bbs/ajax.autosave.php index 2073c1f86..2222a86b3 100644 --- a/bbs/ajax.autosave.php +++ b/bbs/ajax.autosave.php @@ -3,9 +3,9 @@ include_once('./_common.php'); if (!$is_member) die('0'); -$uid = escape_trim($_REQUEST['uid']); -$subject = escape_trim(stripslashes($_REQUEST['subject'])); -$content = escape_trim(stripslashes($_REQUEST['content'])); +$uid = trim($_REQUEST['uid']); +$subject = trim(stripslashes($_REQUEST['subject'])); +$content = trim(stripslashes($_REQUEST['content'])); if ($subject && $content) { $sql = " select count(*) as cnt from {$g5['autosave_table']} where mb_id = '{$member['mb_id']}' and as_subject = '$subject' and as_content = '$content' "; diff --git a/bbs/ajax.mb_email.php b/bbs/ajax.mb_email.php index b6673ee51..6c50300cc 100644 --- a/bbs/ajax.mb_email.php +++ b/bbs/ajax.mb_email.php @@ -2,8 +2,8 @@ include_once('./_common.php'); include_once(G5_LIB_PATH.'/register.lib.php'); -$mb_email = escape_trim($_POST['reg_mb_email']); -$mb_id = escape_trim($_POST['reg_mb_id']); +$mb_email = trim($_POST['reg_mb_email']); +$mb_id = trim($_POST['reg_mb_id']); if ($msg = empty_mb_email($mb_email)) die($msg); if ($msg = valid_mb_email($mb_email)) die($msg); diff --git a/bbs/ajax.mb_hp.php b/bbs/ajax.mb_hp.php index 635bef022..5f4c9ffb6 100644 --- a/bbs/ajax.mb_hp.php +++ b/bbs/ajax.mb_hp.php @@ -2,8 +2,8 @@ include_once('./_common.php'); include_once(G5_LIB_PATH.'/register.lib.php'); -$mb_hp = escape_trim($_POST['reg_mb_hp']); -$mb_id = escape_trim($_POST['reg_mb_id']); +$mb_hp = trim($_POST['reg_mb_hp']); +$mb_id = trim($_POST['reg_mb_id']); if ($msg = valid_mb_hp($mb_hp)) die($msg); if ($msg = exist_mb_hp($mb_hp, $mb_id)) die($msg); diff --git a/bbs/ajax.mb_id.php b/bbs/ajax.mb_id.php index 3e4025dbf..6b0badd06 100644 --- a/bbs/ajax.mb_id.php +++ b/bbs/ajax.mb_id.php @@ -2,7 +2,7 @@ include_once('./_common.php'); include_once(G5_LIB_PATH.'/register.lib.php'); -$mb_id = escape_trim($_POST['reg_mb_id']); +$mb_id = trim($_POST['reg_mb_id']); if ($msg = empty_mb_id($mb_id)) die($msg); if ($msg = valid_mb_id($mb_id)) die($msg); diff --git a/bbs/ajax.mb_nick.php b/bbs/ajax.mb_nick.php index b3757dfac..50a90f037 100644 --- a/bbs/ajax.mb_nick.php +++ b/bbs/ajax.mb_nick.php @@ -2,8 +2,8 @@ include_once('./_common.php'); include_once(G5_LIB_PATH.'/register.lib.php'); -$mb_nick = escape_trim($_POST['reg_mb_nick']); -$mb_id = escape_trim($_POST['reg_mb_id']); +$mb_nick = trim($_POST['reg_mb_nick']); +$mb_id = trim($_POST['reg_mb_id']); if ($msg = empty_mb_nick($mb_nick)) die($msg); if ($msg = valid_mb_nick($mb_nick)) die($msg); diff --git a/bbs/ajax.mb_recommend.php b/bbs/ajax.mb_recommend.php index f7e1062e4..c19470fa0 100644 --- a/bbs/ajax.mb_recommend.php +++ b/bbs/ajax.mb_recommend.php @@ -2,7 +2,7 @@ include_once("./_common.php"); include_once(G5_LIB_PATH."/register.lib.php"); -$mb_recommend = escape_trim($_POST["reg_mb_recommend"]); +$mb_recommend = trim($_POST["reg_mb_recommend"]); if ($msg = valid_mb_id($mb_recommend)) { die("추천인의 아이디는 영문자, 숫자, _ 만 입력하세요."); diff --git a/bbs/list.php b/bbs/list.php index 90c946368..c0301b410 100644 --- a/bbs/list.php +++ b/bbs/list.php @@ -61,10 +61,47 @@ if(G5_IS_MOBILE) { $page_rows = $board['bo_page_rows']; } +if ($page < 1) { $page = 1; } // 페이지가 없으면 첫 페이지 (1 페이지) + +// 년도 2자리 +$today2 = G5_TIME_YMD; + +$list = array(); +$i = 0; +$notice_count = 0; +$notice_array = array(); + +// 공지 처리 +if (!$sca && !$stx) { + $arr_notice = explode(',', trim($board['bo_notice'])); + for ($k=0; $k 1 && $notice_count) + $from_record -= $notice_count; + +if($page == 1 && $notice_count) + $page_rows -= $notice_count; + // 관리자라면 CheckBox 보임 $is_checkbox = false; if ($is_member && ($is_admin == 'super' || $group['gr_admin'] == $member['mb_id'] || $board['bo_admin'] == $member['mb_id'])) @@ -85,7 +122,7 @@ if (!$sst) { $sst = $board['bo_sort_field']; } else { $sst = "wr_num, wr_reply"; - $sod = ""; + $sod = ""; } } else { // 게시물 리스트의 정렬 대상 필드가 아니라면 공백으로 (nasca 님 09.06.16) @@ -101,39 +138,17 @@ if ($sst) { if ($sca || $stx) { $sql = " select distinct wr_parent from {$write_table} where {$sql_search} {$sql_order} limit {$from_record}, $page_rows "; } else { - $sql = " select * from {$write_table} where wr_is_comment = 0 {$sql_order} limit {$from_record}, $page_rows "; + $sql = " select * from {$write_table} where wr_is_comment = 0 "; + if($notice_count && !empty($notice_array)) + $sql .= " and wr_id not in (".implode(', ', $notice_array).") "; + $sql .= " {$sql_order} limit {$from_record}, $page_rows "; } $result = sql_query($sql); -// 년도 2자리 -$today2 = G5_TIME_YMD; - -$list = array(); -$i = 0; - -if (!$sca && !$stx) { - $arr_notice = explode(',', trim($board['bo_notice'])); - for ($k=0; $k -
    -
    +
    +