영카트 5.4 버전 내용 적용

This commit is contained in:
thisgun
2019-12-02 10:29:31 +09:00
parent 8517e1e31e
commit 9b0078350d
840 changed files with 36442 additions and 28088 deletions

View File

@ -8,7 +8,7 @@ if (!$board['bo_table']) {
check_device($board['bo_device']);
if (isset($write['wr_is_comment']) && $write['wr_is_comment']) {
goto_url('./board.php?bo_table='.$bo_table.'&wr_id='.$write['wr_parent'].'#c_'.$wr_id);
goto_url(get_pretty_url($bo_table, $write['wr_parent'], '#c_'.$wr_id));
}
if (!$bo_table) {
@ -19,18 +19,18 @@ if (!$bo_table) {
$g5['board_title'] = ((G5_IS_MOBILE && $board['bo_mobile_subject']) ? $board['bo_mobile_subject'] : $board['bo_subject']);
// wr_id 값이 있으면 글읽기
if (isset($wr_id) && $wr_id) {
if ((isset($wr_id) && $wr_id) || (isset($wr_seo_title) && $wr_seo_title)) {
// 글이 없을 경우 해당 게시판 목록으로 이동
if (!$write['wr_id']) {
$msg = '글이 존재하지 않습니다.\\n\\n글이 삭제되었거나 이동된 경우입니다.';
alert($msg, './board.php?bo_table='.$bo_table);
alert($msg, get_pretty_url($bo_table));
}
// 그룹접근 사용
if (isset($group['gr_use_access']) && $group['gr_use_access']) {
if ($is_guest) {
$msg = "비회원은 이 게시판에 접근할 권한이 없습니다.\\n\\n회원이시라면 로그인 후 이용해 보십시오.";
alert($msg, './login.php?wr_id='.$wr_id.$qstr.'&url='.urlencode(G5_BBS_URL.'/board.php?bo_table='.$bo_table.'&wr_id='.$wr_id.$qstr));
alert($msg, G5_BBS_URL.'/login.php?wr_id='.$wr_id.$qstr.'&url='.urlencode(get_pretty_url($bo_table, $wr_id, $qstr)));
}
// 그룹관리자 이상이라면 통과
@ -51,14 +51,14 @@ if (isset($wr_id) && $wr_id) {
if ($is_member)
alert('글을 읽을 권한이 없습니다.', G5_URL);
else
alert('글을 읽을 권한이 없습니다.\\n\\n회원이시라면 로그인 후 이용해 보십시오.', './login.php?wr_id='.$wr_id.$qstr.'&url='.urlencode(G5_BBS_URL.'/board.php?bo_table='.$bo_table.'&wr_id='.$wr_id.$qstr));
alert('글을 읽을 권한이 없습니다.\\n\\n회원이시라면 로그인 후 이용해 보십시오.', G5_BBS_URL.'/login.php?wr_id='.$wr_id.$qstr.'&url='.urlencode(get_pretty_url($bo_table, $wr_id, $qstr)));
}
// 본인확인을 사용한다면
if ($config['cf_cert_use'] && !$is_admin) {
// 인증된 회원만 가능
if ($board['bo_use_cert'] != '' && $is_guest) {
alert('이 게시판은 본인확인 하신 회원님만 글읽기가 가능합니다.\\n\\n회원이시라면 로그인 후 이용해 보십시오.', './login.php?wr_id='.$wr_id.$qstr.'&url='.urlencode(G5_BBS_URL.'/board.php?bo_table='.$bo_table.'&wr_id='.$wr_id.$qstr));
alert('이 게시판은 본인확인 하신 회원님만 글읽기가 가능합니다.\\n\\n회원이시라면 로그인 후 이용해 보십시오.', G5_BBS_URL.'/login.php?wr_id='.$wr_id.$qstr.'&url='.urlencode(get_pretty_url($bo_table, $wr_id, $qstr)));
}
if ($board['bo_use_cert'] == 'cert' && !$member['mb_certify']) {
@ -108,7 +108,7 @@ if (isset($wr_id) && $wr_id) {
// 이 게시물이 저장된 게시물이 아니면서 관리자가 아니라면
//if ("$bo_table|$write['wr_num']" != get_session("ss_secret"))
if (!get_session($ss_name))
goto_url('./password.php?w=s&bo_table='.$bo_table.'&wr_id='.$wr_id.$qstr);
goto_url(G5_BBS_URL.'/password.php?w=s&bo_table='.$bo_table.'&wr_id='.$wr_id.$qstr);
}
set_session($ss_name, TRUE);
@ -144,14 +144,14 @@ if (isset($wr_id) && $wr_id) {
if ($member['mb_id'])
alert('목록을 볼 권한이 없습니다.', G5_URL);
else
alert('목록을 볼 권한이 없습니다.\\n\\n회원이시라면 로그인 후 이용해 보십시오.', './login.php?'.$qstr.'&url='.urlencode(G5_BBS_URL.'/board.php?bo_table='.$bo_table.($qstr?'&':'')));
alert('목록을 볼 권한이 없습니다.\\n\\n회원이시라면 로그인 후 이용해 보십시오.', G5_BBS_URL.'/login.php?'.$qstr.'&url='.urlencode(G5_BBS_URL.'/board.php?bo_table='.$bo_table.($qstr?'&':'')));
}
// 본인확인을 사용한다면
if ($config['cf_cert_use'] && !$is_admin) {
// 인증된 회원만 가능
if ($board['bo_use_cert'] != '' && $is_guest) {
alert('이 게시판은 본인확인 하신 회원님만 글읽기가 가능합니다.\\n\\n회원이시라면 로그인 후 이용해 보십시오.', './login.php?wr_id='.$wr_id.$qstr.'&url='.urlencode(G5_BBS_URL.'/board.php?bo_table='.$bo_table.'&wr_id='.$wr_id.$qstr));
alert('이 게시판은 본인확인 하신 회원님만 글읽기가 가능합니다.\\n\\n회원이시라면 로그인 후 이용해 보십시오.', G5_BBS_URL.'/login.php?wr_id='.$wr_id.$qstr.'&url='.urlencode(get_pretty_url($bo_table, $wr_id, $qstr)));
}
if ($board['bo_use_cert'] == 'cert' && !$member['mb_certify']) {
@ -189,7 +189,7 @@ $ip = "";
$is_ip_view = $board['bo_use_ip_view'];
if ($is_admin) {
$is_ip_view = true;
if (array_key_exists('wr_ip', $write)) {
if ($write && array_key_exists('wr_ip', $write)) {
$ip = $write['wr_ip'];
}
} else {

View File

@ -8,14 +8,23 @@ if( !isset($g5['content_table']) ){
die('<meta charset="utf-8">관리자 모드에서 게시판관리->내용 관리를 먼저 확인해 주세요.');
}
// 내용
if($co_seo_title){
$co = get_content_by_field($g5['content_table'], 'content', 'co_seo_title', generate_seo_title($co_seo_title));
$co_id = $co['co_id'];
} else {
$co = get_content_db($co_id);
}
if( ! (isset($co['co_seo_title']) && $co['co_seo_title']) && $co['co_id'] ){
seo_title_update($g5['content_table'], $co['co_id'], 'content');
}
if (G5_IS_MOBILE) {
include_once(G5_MOBILE_PATH.'/content.php');
return;
}
// 내용
$sql = " select * from {$g5['content_table']} where co_id = '$co_id' ";
$co = sql_fetch($sql);
if (!$co['co_id'])
alert('등록된 내용이 없습니다.');
@ -71,7 +80,7 @@ $content_skin_url = get_skin_url('content', $co['co_skin']);
$skin_file = $content_skin_path.'/content.skin.php';
if ($is_admin)
echo '<div class="ctt_admin"><a href="'.G5_ADMIN_URL.'/contentform.php?w=u&amp;co_id='.$co_id.'" class="btn_admin btn">내용 수정</a></div>';
echo '<div class="ctt_admin"><a href="'.G5_ADMIN_URL.'/contentform.php?w=u&amp;co_id='.$co_id.'" class="btn_admin btn"><span class="sound_only">내용 수정</span><i class="fa fa-cog fa-spin fa-fw"></i></a></div>';
?>
<?php

View File

@ -30,7 +30,7 @@ else if ($is_admin == 'group') { // 그룹관리자
alert('자신의 글이 아니므로 삭제할 수 없습니다.');
} else {
if ($write['mb_id'])
alert('로그인 후 삭제하세요.', './login.php?url='.urlencode('./board.php?bo_table='.$bo_table.'&amp;wr_id='.$wr_id));
alert('로그인 후 삭제하세요.', G5_BBS_URL.'/login.php?url='.urlencode(get_pretty_url($bo_table, $wr_id)));
else if (!check_password($wr_password, $write['wr_password']))
alert('비밀번호가 틀리므로 삭제할 수 없습니다.');
}
@ -80,7 +80,11 @@ while ($row = sql_fetch_array($result))
$sql2 = " select * from {$g5['board_file_table']} where bo_table = '$bo_table' and wr_id = '{$row['wr_id']}' ";
$result2 = sql_query($sql2);
while ($row2 = sql_fetch_array($result2)) {
@unlink(G5_DATA_PATH.'/file/'.$bo_table.'/'.str_replace('../', '', $row2['bf_file']));
$delete_file = run_replace('delete_file_path', G5_DATA_PATH.'/file/'.$bo_table.'/'.str_replace('../', '', $row2['bf_file']), $row2);
if( file_exists($delete_file) ){
@unlink($delete_file);
}
// 썸네일삭제
if(preg_match("/\.({$config['cf_image_extension']})$/i", $row2['bf_file'])) {
delete_board_thumbnail($bo_table, $row2['bf_file']);
@ -134,5 +138,7 @@ if ($count_write > 0 || $count_comment > 0)
delete_cache_latest($bo_table);
goto_url(G5_HTTP_BBS_URL.'/board.php?bo_table='.$bo_table.'&amp;page='.$page.$qstr);
run_event('bbs_delete', $write, $board);
goto_url(short_url_clean(G5_HTTP_BBS_URL.'/board.php?bo_table='.$bo_table.'&amp;page='.$page.$qstr));
?>

View File

@ -98,7 +98,10 @@ for ($i=$chk_count-1; $i>=0; $i--)
$result2 = sql_query($sql2);
while ($row2 = sql_fetch_array($result2)) {
// 파일삭제
@unlink(G5_DATA_PATH.'/file/'.$bo_table.'/'.str_replace('../', '',$row2['bf_file']));
$delete_file = run_replace('delete_file_path', G5_DATA_PATH.'/file/'.$bo_table.'/'.str_replace('../', '',$row2['bf_file']), $row2);
if( file_exists($delete_file) ){
@unlink($delete_file);
}
// 썸네일삭제
if(preg_match("/\.({$config['cf_image_extension']})$/i", $row2['bf_file'])) {
@ -156,5 +159,7 @@ if ($count_write > 0 || $count_comment > 0)
delete_cache_latest($bo_table);
goto_url(G5_HTTP_BBS_URL.'/board.php?bo_table='.$bo_table.'&amp;page='.$page.$qstr);
run_event('bbs_delete_all', $tmp_array, $board);
goto_url(short_url_clean(G5_HTTP_BBS_URL.'/board.php?bo_table='.$bo_table.'&amp;page='.$page.$qstr));
?>

View File

@ -86,5 +86,7 @@ sql_query(" delete from {$g5['board_new_table']} where bo_table = '{$bo_table}'
delete_cache_latest($bo_table);
run_event('bbs_delete_comment', $comment_id, $board);
goto_url(G5_HTTP_BBS_URL.'/board.php?bo_table='.$bo_table.'&amp;wr_id='.$write['wr_parent'].'&amp;page='.$page. $qstr);
?>

View File

@ -15,9 +15,9 @@ if (!get_session('ss_view_'.$bo_table.'_'.$wr_id))
// 다운로드 차감일 때 비회원은 다운로드 불가
if($board['bo_download_point'] < 0 && $is_guest)
alert('다운로드 권한이 없습니다.\\n회원이시라면 로그인 후 이용해 보십시오.', G5_BBS_URL.'/login.php?wr_id='.$wr_id.'&amp;'.$qstr.'&amp;url='.urlencode(G5_BBS_URL.'/board.php?bo_table='.$bo_table.'&amp;wr_id='.$wr_id));
alert('다운로드 권한이 없습니다.\\n회원이시라면 로그인 후 이용해 보십시오.', G5_BBS_URL.'/login.php?wr_id='.$wr_id.'&amp;'.$qstr.'&amp;url='.urlencode(get_pretty_url($bo_table, $wr_id)));
$sql = " select bf_source, bf_file from {$g5['board_file_table']} where bo_table = '$bo_table' and wr_id = '$wr_id' and bf_no = '$no' ";
$sql = " select * from {$g5['board_file_table']} where bo_table = '$bo_table' and wr_id = '$wr_id' and bf_no = '$no' ";
$file = sql_fetch($sql);
if (!$file['bf_file'])
alert_close('파일 정보가 존재하지 않습니다.');
@ -42,13 +42,16 @@ if ($member['mb_level'] < $board['bo_download_level']) {
if ($member['mb_id'])
alert($alert_msg);
else
alert($alert_msg.'\\n회원이시라면 로그인 후 이용해 보십시오.', G5_BBS_URL.'/login.php?wr_id='.$wr_id.'&amp;'.$qstr.'&amp;url='.urlencode(G5_BBS_URL.'/board.php?bo_table='.$bo_table.'&amp;wr_id='.$wr_id));
alert($alert_msg.'\\n회원이시라면 로그인 후 이용해 보십시오.', G5_BBS_URL.'/login.php?wr_id='.$wr_id.'&amp;'.$qstr.'&amp;url='.urlencode(get_pretty_url($bo_table, $wr_id)));
}
$filepath = G5_DATA_PATH.'/file/'.$bo_table.'/'.$file['bf_file'];
$filepath = addslashes($filepath);
if (!is_file($filepath) || !file_exists($filepath))
$file_exist_check = (!is_file($filepath) || !file_exists($filepath)) ? false : true;
if ( false === run_replace('download_file_exist_check', $file_exist_check, $file) ){
alert('파일이 존재하지 않습니다.');
}
// 사용자 코드 실행
@include_once($board_skin_path.'/download.skin.php');
@ -101,6 +104,8 @@ $original = urlencode($file['bf_source']);
@include_once($board_skin_path.'/download.tail.skin.php');
run_event('download_file_header', $file, $file_exist_check);
if(preg_match("/msie/i", $_SERVER['HTTP_USER_AGENT']) && preg_match("/5\.5/", $_SERVER['HTTP_USER_AGENT'])) {
header("content-type: doesn/matter");
header("content-length: ".filesize("$filepath"));

View File

@ -8,6 +8,8 @@ if (!$config['cf_email_use'])
if (!$is_member && $config['cf_formmail_is_member'])
alert_close('회원만 이용하실 수 있습니다.');
$mb_id = isset($mb_id) ? get_search_string($mb_id) : '';
if ($is_member && !$member['mb_open'] && $is_admin != "super" && $member['mb_id'] != $mb_id)
alert_close('자신의 정보를 공개하지 않으면 다른분에게 메일을 보낼 수 없습니다.\\n\\n정보공개 설정은 회원정보수정에서 하실 수 있습니다.');

View File

@ -1,10 +1,12 @@
<?php
include_once('./_common.php');
run_event('bbs_good_before', $bo_table, $wr_id, $good);
@include_once($board_skin_path.'/good.head.skin.php');
// 자바스크립트 사용가능할 때
if($_POST['js'] == "on") {
if(isset($_POST['js']) && $_POST['js'] === "on") {
$error = $count = "";
function print_result($error, $count)
@ -81,6 +83,8 @@ if($_POST['js'] == "on") {
$row = sql_fetch($sql);
$count = $row['count'];
run_event('bbs_increase_good_json', $bo_table, $wr_id, $good);
print_result($error, $count);
}
@ -90,7 +94,7 @@ if($_POST['js'] == "on") {
if (!$is_member)
{
$href = './login.php?'.$qstr.'&amp;url='.urlencode('./board.php?bo_table='.$bo_table.'&amp;wr_id='.$wr_id);
$href = G5_BBS_URL.'/login.php?'.$qstr.'&amp;url='.urlencode(get_pretty_url($bo_table, $wr_id));
alert('회원만 가능합니다.', $href);
}
@ -144,12 +148,16 @@ if($_POST['js'] == "on") {
else
$status = '비추천';
$href = './board.php?bo_table='.$bo_table.'&amp;wr_id='.$wr_id;
$href = get_pretty_url($bo_table, $wr_id);
run_event('bbs_increase_good_html', $bo_table, $wr_id, $good, $href);
alert("이 글을 $status 하셨습니다.", '', false);
}
}
}
run_event('bbs_good_after', $bo_table, $wr_id, $good);
@include_once($board_skin_path.'/good.tail.skin.php');
?>

View File

@ -6,7 +6,7 @@ $is_category = false;
$category_option = '';
if ($board['bo_use_category']) {
$is_category = true;
$category_href = G5_BBS_URL.'/board.php?bo_table='.$bo_table;
$category_href = get_pretty_url($bo_table);
$category_option .= '<li><a href="'.$category_href.'"';
if ($sca=='')
@ -17,7 +17,7 @@ if ($board['bo_use_category']) {
for ($i=0; $i<count($categories); $i++) {
$category = trim($categories[$i]);
if ($category=='') continue;
$category_option .= '<li><a href="'.($category_href."&amp;sca=".urlencode($category)).'"';
$category_option .= '<li><a href="'.(get_pretty_url($bo_table,'','sca='.urlencode($category))).'"';
$category_msg = '';
if ($category==$sca) { // 현재 선택된 카테고리라면
$category_option .= ' id="bo_cate_on"';
@ -153,10 +153,15 @@ if (!$sst) {
$sod = "";
}
} else {
// 게시물 리스트의 정렬 대상 필드가 아니라면 공백으로 (nasca 님 09.06.16)
// 리스트에서 다른 필드로 정렬을 하려면 아래의 코드에 해당 필드를 추가하세요.
// $sst = preg_match("/^(wr_subject|wr_datetime|wr_hit|wr_good|wr_nogood)$/i", $sst) ? $sst : "";
$sst = preg_match("/^(wr_datetime|wr_hit|wr_good|wr_nogood)$/i", $sst) ? $sst : "";
$board_sort_fields = get_board_sort_fields($board, 1);
if (!$sod && array_key_exists($sst, $board_sort_fields)) {
$sst = $board_sort_fields[$sst];
} else {
// 게시물 리스트의 정렬 대상 필드가 아니라면 공백으로 (nasca 님 09.06.16)
// 리스트에서 다른 필드로 정렬을 하려면 아래의 코드에 해당 필드를 추가하세요.
// $sst = preg_match("/^(wr_subject|wr_datetime|wr_hit|wr_good|wr_nogood)$/i", $sst) ? $sst : "";
$sst = preg_match("/^(wr_datetime|wr_hit|wr_good|wr_nogood)$/i", $sst) ? $sst : "";
}
}
if(!$sst)
@ -200,13 +205,15 @@ if($page_rows > 0) {
}
}
$write_pages = get_paging(G5_IS_MOBILE ? $config['cf_mobile_pages'] : $config['cf_write_pages'], $page, $total_page, './board.php?bo_table='.$bo_table.$qstr.'&amp;page=');
g5_latest_cache_data($board['bo_table'], $list);
$write_pages = get_paging(G5_IS_MOBILE ? $config['cf_mobile_pages'] : $config['cf_write_pages'], $page, $total_page, get_pretty_url($bo_table, '', $qstr.'&amp;page='));
$list_href = '';
$prev_part_href = '';
$next_part_href = '';
if ($is_search_bbs) {
$list_href = './board.php?bo_table='.$bo_table;
$list_href = get_pretty_url($bo_table);
$patterns = array('#&amp;page=[0-9]*#', '#&amp;spt=[0-9\-]*#');
@ -214,14 +221,14 @@ if ($is_search_bbs) {
$prev_spt = $spt - $config['cf_search_part'];
if (isset($min_spt) && $prev_spt >= $min_spt) {
$qstr1 = preg_replace($patterns, '', $qstr);
$prev_part_href = './board.php?bo_table='.$bo_table.$qstr1.'&amp;spt='.$prev_spt.'&amp;page=1';
$prev_part_href = get_pretty_url($bo_table,0,$qstr1.'&amp;spt='.$prev_spt.'&amp;page=1');
$write_pages = page_insertbefore($write_pages, '<a href="'.$prev_part_href.'" class="pg_page pg_prev">이전검색</a>');
}
$next_spt = $spt + $config['cf_search_part'];
if ($next_spt < 0) {
$qstr1 = preg_replace($patterns, '', $qstr);
$next_part_href = './board.php?bo_table='.$bo_table.$qstr1.'&amp;spt='.$next_spt.'&amp;page=1';
$next_part_href = get_pretty_url($bo_table,0,$qstr1.'&amp;spt='.$next_spt.'&amp;page=1');
$write_pages = page_insertafter($write_pages, '<a href="'.$next_part_href.'" class="pg_page pg_end">다음검색</a>');
}
}
@ -229,7 +236,7 @@ if ($is_search_bbs) {
$write_href = '';
if ($member['mb_level'] >= $board['bo_write_level']) {
$write_href = './write.php?bo_table='.$bo_table;
$write_href = short_url_clean(G5_BBS_URL.'/write.php?bo_table='.$bo_table);
}
$nobr_begin = $nobr_end = "";
@ -241,7 +248,7 @@ if (preg_match("/gecko|firefox/i", $_SERVER['HTTP_USER_AGENT'])) {
// RSS 보기 사용에 체크가 되어 있어야 RSS 보기 가능 061106
$rss_href = '';
if ($board['bo_use_rss_view']) {
$rss_href = './rss.php?bo_table='.$bo_table;
$rss_href = G5_BBS_URL.'/rss.php?bo_table='.$bo_table;
}
$stx = get_text(stripslashes($stx));

View File

@ -31,5 +31,7 @@ if (!file_exists($login_file))
include_once($member_skin_path.'/login.skin.php');
run_event('member_login_tail', $login_url, $login_action_url, $member_skin_path, $url);
include_once('./_tail.sub.php');
?>

View File

@ -29,7 +29,10 @@ if(function_exists('social_is_login_check')){
// 가입된 회원이 아니다. 비밀번호가 틀리다. 라는 메세지를 따로 보여주지 않는 이유는
// 회원아이디를 입력해 보고 맞으면 또 비밀번호를 입력해보는 경우를 방지하기 위해서입니다.
// 불법사용자의 경우 회원아이디가 틀린지, 비밀번호가 틀린지를 알기까지는 많은 시간이 소요되기 때문입니다.
if (!$is_social_password_check && (!$mb['mb_id'] || !check_password($mb_password, $mb['mb_password'])) ) {
if (!$is_social_password_check && (!$mb['mb_id'] || !login_password_check($mb, $mb_password, $mb['mb_password'])) ) {
run_event('password_is_wrong', 'login', $mb);
alert('가입된 회원아이디가 아니거나 비밀번호가 틀립니다.\\n비밀번호는 대소문자를 구분합니다.');
}
@ -51,6 +54,8 @@ if ( is_use_email_certify() && !preg_match("/[1-9]/", $mb['mb_email_certify']))
confirm("{$mb['mb_email']} 메일로 메일인증을 받으셔야 로그인 가능합니다. 다른 메일주소로 변경하여 인증하시려면 취소를 클릭하시기 바랍니다.", G5_URL, G5_BBS_URL.'/register_email.php?mb_id='.$mb_id.'&ckey='.$ckey);
}
run_event('login_session_before', $mb, $is_social_login);
@include_once($member_skin_path.'/login_check.skin.php');
// 회원아이디 세션 생성
@ -100,6 +105,8 @@ if ($url) {
$post_check_keys[] = 'provider';
}
$post_check_keys = run_replace('login_check_post_check_keys', $post_check_keys, $link, $is_social_login);
foreach($_POST as $key=>$value) {
if ($key && !in_array($key, $post_check_keys)) {
$link .= "$split$key=$value";
@ -131,5 +138,7 @@ if(function_exists('set_cart_id')){
sql_query($sql);
}
run_event('member_login_check', $mb, $link, $is_social_login);
goto_url($link);
?>

View File

@ -32,10 +32,12 @@ if ($url) {
else
$link = $url;
} else if ($bo_table) {
$link = G5_BBS_URL.'/board.php?bo_table='.$bo_table;
$link = get_pretty_url($bo_table);
} else {
$link = G5_URL;
}
run_event('member_logout', $link);
goto_url($link);
?>

View File

@ -18,12 +18,15 @@ else if ($kind == 'send')
else
alert(''.$kind .'값을 넘겨주세요.');
$sql = " select count(*) as cnt from {$g5['memo_table']} where me_{$kind}_mb_id = '{$member['mb_id']}' ";
if ($page < 1) { $page = 1; } // 페이지가 없으면 첫 페이지 (1 페이지)
run_event('memo_list', $kind, $unkind, $page);
$sql = " select count(*) as cnt from {$g5['memo_table']} where me_{$kind}_mb_id = '{$member['mb_id']}' and me_type = '$kind' ";
$row = sql_fetch($sql);
$total_count = $row['cnt'];
$total_page = ceil($total_count / $config['cf_page_rows']); // 전체 페이지 계산
if ($page < 1) { $page = 1; } // 페이지가 없으면 첫 페이지 (1 페이지)
$from_record = ((int) $page - 1) * $config['cf_page_rows']; // 시작 열을 구함
if ($kind == 'recv')
@ -44,8 +47,9 @@ $list = array();
$sql = " select a.*, b.mb_id, b.mb_nick, b.mb_email, b.mb_homepage
from {$g5['memo_table']} a
left join {$g5['member_table']} b on (a.me_{$unkind}_mb_id = b.mb_id)
where a.me_{$kind}_mb_id = '{$member['mb_id']}'
where a.me_{$kind}_mb_id = '{$member['mb_id']}' and a.me_type = '$kind'
order by a.me_id desc limit $from_record, {$config['cf_page_rows']} ";
$result = sql_query($sql);
for ($i=0; $row=sql_fetch_array($result); $i++)
{
@ -67,6 +71,7 @@ for ($i=0; $row=sql_fetch_array($result); $i++)
$send_datetime = substr($row['me_send_datetime'],2,14);
$list[$i]['mb_id'] = $mb_id;
$list[$i]['name'] = $name;
$list[$i]['send_datetime'] = $send_datetime;
$list[$i]['read_datetime'] = $read_datetime;

View File

@ -15,6 +15,11 @@ $me_id = (int)$_REQUEST['me_id'];
$sql = " select * from {$g5['memo_table']} where me_id = '{$me_id}' ";
$row = sql_fetch($sql);
$sql = " delete from {$g5['memo_table']}
where me_id = '{$me_id}'
and (me_recv_mb_id = '{$member['mb_id']}' or me_send_mb_id = '{$member['mb_id']}') ";
sql_query($sql);
if (!$row['me_read_datetime'][0]) // 메모 받기전이면
{
$sql = " update {$g5['member_table']}
@ -22,12 +27,12 @@ if (!$row['me_read_datetime'][0]) // 메모 받기전이면
where mb_id = '{$row['me_recv_mb_id']}'
and mb_memo_call = '{$row['me_send_mb_id']}' ";
sql_query($sql);
$sql = " update `{$g5['member_table']}` set mb_memo_cnt = '".get_memo_not_read($member['mb_id'])."' where mb_id = '{$member['mb_id']}' ";
sql_query($sql);
}
$sql = " delete from {$g5['memo_table']}
where me_id = '{$me_id}'
and (me_recv_mb_id = '{$member['mb_id']}' or me_send_mb_id = '{$member['mb_id']}') ";
sql_query($sql);
run_event('memo_delete', $me_id, $row);
goto_url('./memo.php?kind='.$kind);
?>

View File

@ -13,7 +13,10 @@ $recv_list = explode(',', trim($_POST['me_recv_mb_id']));
$str_nick_list = '';
$msg = '';
$error_list = array();
$member_list = array();
$member_list = array('id'=>array(), 'nick'=>array());
run_event('memo_form_update_before', $recv_list);
for ($i=0; $i<count($recv_list); $i++) {
$row = sql_fetch(" select mb_id, mb_nick, mb_open, mb_leave_date, mb_intercept_date from {$g5['member_table']} where mb_id = '{$recv_list[$i]}' ");
if ($row) {
@ -41,6 +44,10 @@ $error_msg = implode(",", $error_list);
if ($error_msg && !$is_admin)
alert("회원아이디 '{$error_msg}' 은(는) 존재(또는 정보공개)하지 않는 회원아이디 이거나 탈퇴, 접근차단된 회원아이디 입니다.\\n쪽지를 발송하지 않았습니다.");
if (! count($member_list['id'])){
alert('해당 회원이 존재하지 않습니다.');
}
if (!$is_admin) {
if (count($member_list['id'])) {
$point = (int)$config['cf_memo_send_point'] * count($member_list['id']);
@ -59,12 +66,22 @@ for ($i=0; $i<count($member_list['id']); $i++) {
$recv_mb_id = $member_list['id'][$i];
$recv_mb_nick = get_text($member_list['nick'][$i]);
// 쪽지 INSERT
$sql = " insert into {$g5['memo_table']} ( me_id, me_recv_mb_id, me_send_mb_id, me_send_datetime, me_memo, me_read_datetime ) values ( '$me_id', '$recv_mb_id', '{$member['mb_id']}', '".G5_TIME_YMDHIS."', '{$_POST['me_memo']}', '0000-00-00 00:00:00' ) ";
// 받는 회원 쪽지 INSERT
$sql = " insert into {$g5['memo_table']} ( me_recv_mb_id, me_send_mb_id, me_send_datetime, me_memo, me_read_datetime, me_type, me_send_ip ) values ( '$recv_mb_id', '{$member['mb_id']}', '".G5_TIME_YMDHIS."', '{$_POST['me_memo']}', '0000-00-00 00:00:00' , 'recv', '{$_SERVER['REMOTE_ADDR']}' ) ";
sql_query($sql);
if( $me_id = sql_insert_id() ){
// 보내는 회원 쪽지 INSERT
$sql = " insert into {$g5['memo_table']} ( me_recv_mb_id, me_send_mb_id, me_send_datetime, me_memo, me_read_datetime, me_send_id, me_type , me_send_ip ) values ( '$recv_mb_id', '{$member['mb_id']}', '".G5_TIME_YMDHIS."', '{$_POST['me_memo']}', '0000-00-00 00:00:00', '$me_id', 'send', '{$_SERVER['REMOTE_ADDR']}' ) ";
sql_query($sql);
$member_list['me_id'][$i] = $me_id;
}
// 실시간 쪽지 알림 기능
$sql = " update {$g5['member_table']} set mb_memo_call = '{$member['mb_id']}' where mb_id = '$recv_mb_id' ";
$sql = " update {$g5['member_table']} set mb_memo_call = '{$member['mb_id']}', mb_memo_cnt = '".get_memo_not_read($recv_mb_id)."' where mb_id = '$recv_mb_id' ";
sql_query($sql);
if (!$is_admin) {
@ -73,9 +90,19 @@ for ($i=0; $i<count($member_list['id']); $i++) {
}
if ($member_list) {
$redirect_url = G5_HTTP_BBS_URL."/memo.php?kind=send";
$str_nick_list = implode(',', $member_list['nick']);
alert($str_nick_list." 님께 쪽지를 전달하였습니다.", G5_HTTP_BBS_URL."/memo.php?kind=send", false);
run_event('memo_form_update_after', $member_list, $str_nick_list, $redirect_url, $_POST['me_memo']);
alert($str_nick_list." 님께 쪽지를 전달하였습니다.", $redirect_url, false);
} else {
alert("회원아이디 오류 같습니다.", G5_HTTP_BBS_URL."/memo_form.php", false);
$redirect_url = G5_HTTP_BBS_URL."/memo_form.php";
run_event('memo_form_update_failed', $member_list, $redirect_url, $_POST['me_memo']);
alert("회원아이디 오류 같습니다.", $redirect_url, false);
}
?>

View File

@ -13,10 +13,13 @@ if ($kind == 'recv')
$sql = " update {$g5['memo_table']}
set me_read_datetime = '".G5_TIME_YMDHIS."'
where me_id = '$me_id'
where (me_id = '$me_id' or me_send_id = '$me_id' )
and me_recv_mb_id = '{$member['mb_id']}'
and me_read_datetime = '0000-00-00 00:00:00' ";
sql_query($sql);
$sql = " update `{$g5['member_table']}` set mb_memo_cnt = '".get_memo_not_read($member['mb_id'])."' where mb_id = '{$member['mb_id']}' ";
sql_query($sql);
}
else if ($kind == 'send')
{
@ -37,31 +40,28 @@ $sql = " select * from {$g5['memo_table']}
$memo = sql_fetch($sql);
// 이전 쪽지
$sql = " select * from {$g5['memo_table']}
where me_id > '{$me_id}'
and me_{$kind}_mb_id = '{$member['mb_id']}'
order by me_id asc
limit 1 ";
$prev = sql_fetch($sql);
if ($prev['me_id'])
$prev_link = './memo_view.php?kind='.$kind.'&amp;me_id='.$prev['me_id'];
else
//$prev_link = 'javascript:alert(\'쪽지의 처음입니다.\');';
$prev_link = '';
$sql = " select me.*, a.rownum from `{$g5['memo_table']}` as me inner join ( select me_id , (@rownum:=@rownum+1) as rownum from `{$g5['memo_table']}` as memo, (select @rownum:=0) tmp where me_{$kind}_mb_id = '{$member['mb_id']}' and memo.me_type = '$kind' order by me_id desc ) as a on a.me_id = me.me_id where me.me_id < '$me_id' and me.me_{$kind}_mb_id = '{$member['mb_id']}' and me.me_type = '$kind' order by me.me_id desc limit 1 ";
$prev = sql_fetch($sql);
if ($prev['me_id']) {
$prev_link = './memo_view.php?kind='.$kind.'&amp;me_id='.$prev['me_id'];
$prev['page'] = ceil( (int)$prev['rownum'] / $config['cf_page_rows']); // 이동할 페이지 계산
if( (int)$prev['page'] > 0 ) $prev_link .= "&amp;page=".$prev['page'];
} else {
$prev_link = '';
}
// 다음 쪽지
$sql = " select * from {$g5['memo_table']}
where me_id < '{$me_id}'
and me_{$kind}_mb_id = '{$member['mb_id']}'
order by me_id desc
limit 1 ";
$sql = " select me.*, a.rownum from `{$g5['memo_table']}` as me inner join ( select me_id , (@rownum:=@rownum+1) as rownum from `{$g5['memo_table']}` as memo, (select @rownum:=0) tmp where me_{$kind}_mb_id = '{$member['mb_id']}' and memo.me_type = '$kind' order by me_id asc ) as a on a.me_id = me.me_id where me.me_id > '$me_id' and me.me_{$kind}_mb_id = '{$member['mb_id']}' and me.me_type = '$kind' order by me.me_id asc limit 1 ";
$next = sql_fetch($sql);
if ($next['me_id'])
if ($next['me_id']) {
$next_link = './memo_view.php?kind='.$kind.'&amp;me_id='.$next['me_id'];
else
//$next_link = 'javascript:alert(\'쪽지의 마지막입니다.\');';
$next['page'] = ceil( (int)$next['rownum'] / $config['cf_page_rows']); // 이동할 페이지 계산
if( (int)$next['page'] > 0 ) $next_link .= "&amp;page=".$next['page'];
} else {
$next_link = '';
}
$mb = get_member($memo['me_'.$unkind.'_mb_id']);

View File

@ -156,5 +156,6 @@ function fboardmoveall_submit(f)
</script>
<?php
run_event('move_html_footer');
include_once(G5_PATH.'/tail.sub.php');
?>

View File

@ -126,8 +126,13 @@ while ($row = sql_fetch_array($result))
// 원본파일을 복사하고 퍼미션을 변경
// 제이프로님 코드제안 적용
$copy_file_name = ($bo_table !== $move_bo_table) ? $row3['bf_file'] : $row2['wr_id'].'_copy_'.$insert_id.'_'.$row3['bf_file'];
@copy($src_dir.'/'.$row3['bf_file'], $dst_dir.'/'.$copy_file_name);
@chmod($dst_dir.'/'.$copy_file_name, G5_FILE_PERMISSION);
$is_exist_file = is_file($src_dir.'/'.$row3['bf_file']) && file_exists($src_dir.'/'.$row3['bf_file']);
if( $is_exist_file ){
@copy($src_dir.'/'.$row3['bf_file'], $dst_dir.'/'.$copy_file_name);
@chmod($dst_dir.'/'.$row3['bf_file'], G5_FILE_PERMISSION);
}
$row3 = run_replace('bbs_move_update_file', $row3, $copy_file_name, $bo_table, $move_bo_table, $insert_id);
}
$sql = " insert into {$g5['board_file_table']}
@ -138,6 +143,9 @@ while ($row = sql_fetch_array($result))
bf_file = '$copy_file_name',
bf_download = '{$row3['bf_download']}',
bf_content = '".addslashes($row3['bf_content'])."',
bf_fileurl = '".addslashes($row3['bf_fileurl'])."',
bf_thumburl = '".addslashes($row3['bf_thumburl'])."',
bf_storage = '".addslashes($row3['bf_storage'])."',
bf_filesize = '{$row3['bf_filesize']}',
bf_width = '{$row3['bf_width']}',
bf_height = '{$row3['bf_height']}',
@ -200,7 +208,11 @@ if ($sw == 'move')
{
if( isset($save[$i]['bf_file']) && $save[$i]['bf_file'] ){
for ($k=0; $k<count($save[$i]['bf_file']); $k++) {
@unlink($save[$i]['bf_file'][$k]);
$del_file = $save[$i]['bf_file'][$k];
if ( is_file($del_file) && file_exists($del_file) ){
@unlink($del_file);
}
// 썸네일 파일 삭제, 먼지손 님 코드 제안
delete_board_thumbnail($bo_table, basename($save[$i]['bf_file'][$k]));
@ -215,9 +227,11 @@ if ($sw == 'move')
}
$msg = '해당 게시물을 선택한 게시판으로 '.$act.' 하였습니다.';
$opener_href = './board.php?bo_table='.$bo_table.'&amp;page='.$page.'&amp;'.$qstr;
$opener_href = get_pretty_url($bo_table,'','&amp;page='.$page.'&amp;'.$qstr);
$opener_href1 = str_replace('&amp;', '&', $opener_href);
run_event('bbs_move_update', $bo_table, $chk_bo_table, $wr_id_list, $opener_href);
echo <<<HEREDOC
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<script>

View File

@ -99,7 +99,7 @@ for ($i=0; $row=sql_fetch_array($result); $i++) {
$list[$i]['bo_table'] = $row['bo_table'];
$list[$i]['name'] = $name;
$list[$i]['comment'] = $comment;
$list[$i]['href'] = './board.php?bo_table='.$row['bo_table'].'&amp;wr_id='.$row2['wr_id'].$comment_link;
$list[$i]['href'] = get_pretty_url($row['bo_table'], $row2['wr_id'], $comment_link);
$list[$i]['datetime'] = $datetime;
$list[$i]['datetime2'] = $datetime2;
@ -113,4 +113,4 @@ $write_pages = get_paging(G5_IS_MOBILE ? $config['cf_mobile_pages'] : $config['c
include_once($new_skin_path.'/new.skin.php');
include_once('./_tail.php');
?>
?>

View File

@ -143,5 +143,7 @@ foreach ($save_bo_table as $key=>$value) {
delete_cache_latest($value);
}
run_event('bbs_new_delete', $chk_bn_id, $save_bo_table);
goto_url("new.php?sfl=$sfl&stx=$stx&page=$page");
?>

View File

@ -6,35 +6,35 @@ $g5['title'] = '비밀번호 입력';
switch ($w) {
case 'u' :
$action = G5_HTTP_BBS_URL.'/write.php';
$return_url = G5_HTTP_BBS_URL.'/board.php?bo_table='.$bo_table.'&amp;wr_id='.$wr_id;
$return_url = short_url_clean(G5_HTTP_BBS_URL.'/board.php?bo_table='.$bo_table.'&amp;wr_id='.$wr_id);
break;
case 'd' :
set_session('ss_delete_token', $token = uniqid(time()));
$action = https_url(G5_BBS_DIR).'/delete.php?token='.$token;
$return_url = G5_HTTP_BBS_URL.'/board.php?bo_table='.$bo_table.'&amp;wr_id='.$wr_id;
$return_url = short_url_clean(G5_HTTP_BBS_URL.'/board.php?bo_table='.$bo_table.'&amp;wr_id='.$wr_id);
break;
case 'x' :
set_session('ss_delete_comment_'.$comment_id.'_token', $token = uniqid(time()));
$action = https_url(G5_BBS_DIR).'/delete_comment.php?token='.$token;
$row = sql_fetch(" select wr_parent from $write_table where wr_id = '$comment_id' ");
$return_url = G5_HTTP_BBS_URL.'/board.php?bo_table='.$bo_table.'&amp;wr_id='.$row['wr_parent'];
$return_url = short_url_clean(G5_HTTP_BBS_URL.'/board.php?bo_table='.$bo_table.'&amp;wr_id='.$row['wr_parent']);
break;
case 's' :
// 비밀번호 창에서 로그인 하는 경우 관리자 또는 자신의 글이면 바로 글보기로 감
if ($is_admin || ($member['mb_id'] == $write['mb_id'] && $write['mb_id']))
goto_url(G5_HTTP_BBS_URL.'/board.php?bo_table='.$bo_table.'&amp;wr_id='.$wr_id);
goto_url(short_url_clean(G5_HTTP_BBS_URL.'/board.php?bo_table='.$bo_table.'&amp;wr_id='.$wr_id));
else {
$action = https_url(G5_BBS_DIR).'/password_check.php';
$return_url = G5_HTTP_BBS_URL.'/board.php?bo_table='.$bo_table;
$return_url = short_url_clean(G5_HTTP_BBS_URL.'/board.php?bo_table='.$bo_table);
}
break;
case 'sc' :
// 비밀번호 창에서 로그인 하는 경우 관리자 또는 자신의 글이면 바로 글보기로 감
if ($is_admin || ($member['mb_id'] == $write['mb_id'] && $write['mb_id']))
goto_url(G5_HTTP_BBS_URL.'/board.php?bo_table='.$bo_table.'&amp;wr_id='.$wr_id);
goto_url(short_url_clean(G5_HTTP_BBS_URL.'/board.php?bo_table='.$bo_table.'&amp;wr_id='.$wr_id));
else {
$action = https_url(G5_BBS_DIR).'/password_check.php';
$return_url = G5_HTTP_BBS_URL.'/board.php?bo_table='.$bo_table.'&amp;wr_id='.$wr_id;
$return_url = short_url_clean(G5_HTTP_BBS_URL.'/board.php?bo_table='.$bo_table.'&amp;wr_id='.$wr_id);
}
break;
default :

View File

@ -6,8 +6,16 @@ if ($w == 's') {
$wr = get_write($write_table, $wr_id);
if (!check_password($wr_password, $wr['wr_password']))
if( !$wr['wr_password'] && $wr['mb_id'] ){
if ( $mb = get_member($wr['mb_id']) ){
$wr['wr_password'] = $mb['mb_password'];
}
}
if (!check_password($wr_password, $wr['wr_password'])) {
run_event('password_is_wrong', 'bbs', $wr, $qstr);
alert('비밀번호가 틀립니다.');
}
// 세션에 아래 정보를 저장. 하위번호는 비밀번호없이 보아야 하기 때문임.
//$ss_name = 'ss_secret.'_'.$bo_table.'_'.$wr_id';
@ -20,8 +28,16 @@ if ($w == 's') {
$wr = get_write($write_table, $wr_id);
if (!check_password($wr_password, $wr['wr_password']))
if( !$wr['wr_password'] && $wr['mb_id'] ){
if ( $mb = get_member($wr['mb_id']) ){
$wr['wr_password'] = $mb['mb_password'];
}
}
if (!check_password($wr_password, $wr['wr_password'])){
run_event('password_is_wrong', 'bbs', $wr, $qstr);
alert('비밀번호가 틀립니다.');
}
// 세션에 아래 정보를 저장. 하위번호는 비밀번호없이 보아야 하기 때문임.
$ss_name = 'ss_secret_comment_'.$bo_table.'_'.$wr['wr_id'];
@ -31,5 +47,5 @@ if ($w == 's') {
} else
alert('w 값이 제대로 넘어오지 않았습니다.');
goto_url(G5_HTTP_BBS_URL.'/board.php?'.$qstr);
goto_url(short_url_clean(G5_HTTP_BBS_URL.'/board.php?'.$qstr));
?>

View File

@ -71,5 +71,7 @@ $content .= '</div>';
mailer($config['cf_admin_email_name'], $config['cf_admin_email'], $mb['mb_email'], $subject, $content, 1);
run_event('password_lost2_after', $mb, $mb_nonce, $mb_lost_certify);
alert_close($email.' 메일로 회원아이디와 비밀번호를 인증할 수 있는 메일이 발송 되었습니다.\\n\\n메일을 확인하여 주십시오.');
?>

View File

@ -4,9 +4,11 @@ include_once('./_common.php');
// 봇의 메일 링크 크롤링을 방지합니다.
if(function_exists('check_mail_bot')){ check_mail_bot($_SERVER['REMOTE_ADDR']); }
run_event('password_lost_certify_before');
// 오류시 공히 Error 라고 처리하는 것은 회원정보가 있는지? 비밀번호가 틀린지? 를 알아보려는 해킹에 대비한것
$mb_no = trim($_GET['mb_no']);
$mb_no = preg_replace('#[^0-9]#', '', trim($_GET['mb_no']));
$mb_nonce = trim($_GET['mb_nonce']);
// 회원아이디가 아닌 회원고유번호로 회원정보를 구한다.
@ -22,6 +24,9 @@ sql_query(" update {$g5['member_table']} set mb_lost_certify = '' where mb_no =
if ($mb_nonce === substr($mb['mb_lost_certify'], 0, 32)) {
$new_password_hash = substr($mb['mb_lost_certify'], 33);
sql_query(" update {$g5['member_table']} set mb_password = '$new_password_hash' where mb_no = '$mb_no' ");
run_event('password_lost_certify_after', $mb, $mb_nonce);
alert('비밀번호가 변경됐습니다.\\n\\n회원아이디와 변경된 비밀번호로 로그인 하시기 바랍니다.', G5_BBS_URL.'/login.php');
}
else {

View File

@ -7,7 +7,10 @@ if (!$member['mb_id'])
if (!$member['mb_open'] && $is_admin != 'super' && $member['mb_id'] != $mb_id)
alert_close('자신의 정보를 공개하지 않으면 다른분의 정보를 조회할 수 없습니다.\\n\\n정보공개 설정은 회원정보수정에서 하실 수 있습니다.');
$mb_id = isset($mb_id) ? $mb_id : '';
$mb = get_member($mb_id);
if (!$mb['mb_id'])
alert_close('회원정보가 존재하지 않습니다.\\n\\n탈퇴하였을 수 있습니다.');

View File

@ -14,6 +14,7 @@ $msg = array();
// 1:1문의 설정값
$qaconfig = get_qa_config();
$qa_id = isset($qa_id) ? (int) $qa_id : 0;
if(trim($qaconfig['qa_category'])) {
if($w != 'a') {
@ -317,6 +318,8 @@ if($w == '' || $w == 'a' || $w == 'r') {
sql_query($sql);
}
run_event('qawrite_update', $qa_id, $write, $w, $qaconfig);
// SMS 알림
if($config['cf_sms_use'] == 'icode' && $qaconfig['qa_use_sms']) {
if($config['cf_sms_type'] == 'LMS') {

View File

@ -3,6 +3,8 @@ include_once('./_common.php');
include_once(G5_CAPTCHA_PATH.'/captcha.lib.php');
include_once(G5_LIB_PATH.'/register.lib.php');
run_event('register_form_before');
// 불법접근을 막도록 토큰생성
$token = md5(uniqid(rand(), true));
set_session("ss_token", $token);
@ -76,12 +78,14 @@ if ($w == "") {
if ($_POST['mb_password']) {
// 수정된 정보를 업데이트후 되돌아 온것이라면 비밀번호가 암호화 된채로 넘어온것임
if ($_POST['is_update'])
if ($_POST['is_update']) {
$tmp_password = $_POST['mb_password'];
else
$tmp_password = get_encrypt_string($_POST['mb_password']);
$pass_check = ($member['mb_password'] === $tmp_password);
} else {
$pass_check = check_password($_POST['mb_password'], $member['mb_password']);
}
if ($member['mb_password'] != $tmp_password)
if (!$pass_check)
alert('비밀번호가 틀립니다.');
}
@ -117,12 +121,12 @@ if ($w == "") {
include_once('./_head.php');
// 회원아이콘 경로
$mb_icon_path = G5_DATA_PATH.'/member/'.substr($member['mb_id'],0,2).'/'.$member['mb_id'].'.gif';
$mb_icon_url = G5_DATA_URL.'/member/'.substr($member['mb_id'],0,2).'/'.$member['mb_id'].'.gif';
$mb_icon_path = G5_DATA_PATH.'/member/'.substr($member['mb_id'],0,2).'/'.get_mb_icon_name($member['mb_id']).'.gif';
$mb_icon_url = G5_DATA_URL.'/member/'.substr($member['mb_id'],0,2).'/'.get_mb_icon_name($member['mb_id']).'.gif';
// 회원이미지 경로
$mb_img_path = G5_DATA_PATH.'/member_image/'.substr($member['mb_id'],0,2).'/'.$member['mb_id'].'.gif';
$mb_img_url = G5_DATA_URL.'/member_image/'.substr($member['mb_id'],0,2).'/'.$member['mb_id'].'.gif';
$mb_img_path = G5_DATA_PATH.'/member_image/'.substr($member['mb_id'],0,2).'/'.get_mb_icon_name($member['mb_id']).'.gif';
$mb_img_url = G5_DATA_URL.'/member_image/'.substr($member['mb_id'],0,2).'/'.get_mb_icon_name($member['mb_id']).'.gif';
$register_action_url = G5_HTTPS_BBS_URL.'/register_form_update.php';
$req_nick = !isset($member['mb_nick_date']) || (isset($member['mb_nick_date']) && $member['mb_nick_date'] <= date("Y-m-d", G5_SERVER_TIME - ($config['cf_nick_modify'] * 86400)));
@ -137,5 +141,8 @@ if ($config['cf_use_addr'])
add_javascript(G5_POSTCODE_JS, 0); //다음 주소 js
include_once($member_skin_path.'/register_form.skin.php');
run_event('register_form_after', $w, $agree, $agree2);
include_once('./_tail.php');
?>

View File

@ -74,6 +74,8 @@ $mb_addr2 = clean_xss_tags($mb_addr2);
$mb_addr3 = clean_xss_tags($mb_addr3);
$mb_addr_jibeon = preg_match("/^(N|R)$/", $mb_addr_jibeon) ? $mb_addr_jibeon : '';
run_event('register_form_update_before', $mb_id, $w);
if ($w == '' || $w == 'u') {
if ($msg = empty_mb_id($mb_id)) alert($msg, "", true, true); // alert($msg, $url, $error, $post);
@ -146,6 +148,8 @@ if ($w == '' || $w == 'u') {
$old_email = $member['mb_email'];
}
run_event('register_form_update_valid', $w, $mb_id, $mb_nick, $mb_email);
if ($msg = exist_mb_nick($mb_nick, $mb_id)) alert($msg, "", true, true);
if ($msg = exist_mb_email($mb_email, $mb_id)) alert($msg, "", true, true);
}
@ -265,9 +269,13 @@ if ($w == '') {
include_once ('./register_form_update_mail1.php');
$content = ob_get_contents();
ob_end_clean();
$content = run_replace('register_form_update_mail_mb_content', $content, $mb_id);
mailer($config['cf_admin_email_name'], $config['cf_admin_email'], $mb_email, $subject, $content, 1);
run_event('register_form_update_send_mb_mail', $config['cf_admin_email_name'], $config['cf_admin_email'], $mb_email, $subject, $content);
// 메일인증을 사용하는 경우 가입메일에 인증 url이 있으므로 인증메일을 다시 발송되지 않도록 함
if($config['cf_use_email_certify'])
$old_email = $mb_email;
@ -275,14 +283,18 @@ if ($w == '') {
// 최고관리자님께 메일 발송
if ($config['cf_email_mb_super_admin']) {
$subject = '['.$config['cf_title'].'] '.$mb_nick .' 님께서 회원으로 가입하셨습니다.';
$subject = run_replace('register_form_update_mail_admin_subject', '['.$config['cf_title'].'] '.$mb_nick .' 님께서 회원으로 가입하셨습니다.', $mb_id, $mb_nick);
ob_start();
include_once ('./register_form_update_mail2.php');
$content = ob_get_contents();
ob_end_clean();
$content = run_replace('register_form_update_mail_admin_content', $content, $mb_id);
mailer($mb_nick, $mb_email, $config['cf_admin_email'], $subject, $content, 1);
run_event('register_form_update_send_admin_mail', $mb_nick, $mb_email, $config['cf_admin_email'], $subject, $content);
}
// 메일인증 사용하지 않는 경우에만 로그인
@ -356,7 +368,7 @@ $mb_dir = G5_DATA_PATH.'/member/'.substr($mb_id,0,2);
// 아이콘 삭제
if (isset($_POST['del_mb_icon'])) {
@unlink($mb_dir.'/'.$mb_id.'.gif');
@unlink($mb_dir.'/'.get_mb_icon_name($mb_id).'.gif');
}
$msg = "";
@ -364,7 +376,7 @@ $msg = "";
// 아이콘 업로드
$mb_icon = '';
$image_regex = "/(\.(gif|jpe?g|png))$/i";
$mb_icon_img = $mb_id.'.gif';
$mb_icon_img = get_mb_icon_name($mb_id).'.gif';
if (isset($_FILES['mb_icon']) && is_uploaded_file($_FILES['mb_icon']['tmp_name'])) {
if (preg_match($image_regex, $_FILES['mb_icon']['name'])) {
@ -484,8 +496,12 @@ if ($config['cf_use_email_certify'] && $old_email != $mb_email) {
include_once ('./register_form_update_mail3.php');
$content = ob_get_contents();
ob_end_clean();
$content = run_replace('register_form_update_mail_certify_content', $content, $mb_id);
mailer($config['cf_admin_email_name'], $config['cf_admin_email'], $mb_email, $subject, $content, 1);
run_event('register_form_update_send_certify_mail', $config['cf_admin_email_name'], $config['cf_admin_email'], $mb_email, $subject, $content);
}
@ -546,6 +562,8 @@ unset($_SESSION['ss_cert_adult']);
if ($msg)
echo '<script>alert(\''.$msg.'\');</script>';
run_event('register_form_update_after', $mb_id, $w);
if ($w == '') {
goto_url(G5_HTTP_BBS_URL.'/register_result.php');
} else if ($w == 'u') {

View File

@ -47,8 +47,8 @@ echo '<?xml version="1.0" encoding="utf-8" ?>'."\n";
?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title><?php echo specialchars_replace($config['cf_title'].' &gt; '.$subj1.' &gt; '.$subj2) ?></title>
<link><?php echo specialchars_replace(G5_BBS_URL.'/board.php?bo_table='.$bo_table) ?></link>
<title><?php echo specialchars_replace($config['cf_title'].' &gt; '.$subj1.' &gt; '.$subj2); ?></title>
<link><?php echo specialchars_replace(get_pretty_url($bo_table)); ?></link>
<description>테스트 버전 0.2 (2004-04-26)</description>
<language>ko</language>
@ -69,8 +69,8 @@ for ($i=0; $row=sql_fetch_array($result); $i++) {
?>
<item>
<title><?php echo specialchars_replace($row['wr_subject']) ?></title>
<link><?php echo specialchars_replace(G5_BBS_URL.'/board.php?bo_table='.$bo_table.'&amp;wr_id='.$row['wr_id']) ?></link>
<title><?php echo specialchars_replace($row['wr_subject']); ?></title>
<link><?php echo specialchars_replace(get_pretty_url($bo_table, $wr_id)); ?></link>
<description><![CDATA[<?php echo $file ?><?php echo conv_content($row['wr_content'], $html) ?>]]></description>
<dc:creator><?php echo specialchars_replace($row['wr_name']) ?></dc:creator>
<?php

View File

@ -47,8 +47,8 @@ for ($i=0; $row=sql_fetch_array($result); $i++) {
$row3['wr_subject'] = '[글 없음]';
$list[$i]['num'] = $num;
$list[$i]['opener_href'] = './board.php?bo_table='.$row['bo_table'];
$list[$i]['opener_href_wr_id'] = './board.php?bo_table='.$row['bo_table'].'&amp;wr_id='.$row['wr_id'];
$list[$i]['opener_href'] = get_pretty_url($row['bo_table']);
$list[$i]['opener_href_wr_id'] = get_pretty_url($row['bo_table'], $row['wr_id']);
$list[$i]['bo_subject'] = $row2['bo_subject'];
$list[$i]['subject'] = $subject;
$list[$i]['del_href'] = './scrap_delete.php?ms_id='.$row['ms_id'].'&amp;page='.$page;

View File

@ -7,5 +7,8 @@ if (!$is_member)
$sql = " delete from {$g5['scrap_table']} where mb_id = '{$member['mb_id']}' and ms_id = '$ms_id' ";
sql_query($sql);
$sql = " update `{$g5['member_table']}` set mb_scrap_cnt = '".get_scrap_totals($member['mb_id'])."' where mb_id = '{$member['mb_id']}' ";
sql_query($sql);
goto_url('./scrap.php?page='.$page);
?>

View File

@ -4,7 +4,7 @@ include_once('./_common.php');
include_once(G5_PATH.'/head.sub.php');
if ($is_guest) {
$href = './login.php?'.$qstr.'&amp;url='.urlencode('./board.php?bo_table='.$bo_table.'&amp;wr_id='.$wr_id);
$href = './login.php?'.$qstr.'&amp;url='.urlencode(get_pretty_url($bo_table, $wr_id));
$href2 = str_replace('&amp;', '&', $href);
echo <<<HEREDOC
<script>
@ -38,6 +38,9 @@ $sql = " select count(*) as cnt from {$g5['scrap_table']}
and wr_id = '$wr_id' ";
$row = sql_fetch($sql);
if ($row['cnt']) {
$back_url = get_pretty_url($bo_table, $wr_id);
echo <<<HEREDOC
<script>
if (confirm('이미 스크랩하신 글 입니다.\\n\\n지금 스크랩을 확인하시겠습니까?'))
@ -48,7 +51,7 @@ if ($row['cnt']) {
<noscript>
<p>이미 스크랩하신 글 입니다.</p>
<a href="./scrap.php">스크랩 확인하기</a>
<a href="./board.php?bo_table={$bo_table}&amp;wr_id=$wr_id">돌아가기</a>
<a href="{$back_url}">돌아가기</a>
</noscript>
HEREDOC;
exit;

View File

@ -5,7 +5,7 @@ include_once(G5_PATH.'/head.sub.php');
if (!$is_member)
{
$href = './login.php?'.$qstr.'&amp;url='.urlencode('./board.php?bo_table='.$bo_table.'&amp;wr_id='.$wr_id);
$href = './login.php?'.$qstr.'&amp;url='.urlencode(get_pretty_url($bo_table, $wr_id));
echo '<script> alert(\'회원만 접근 가능합니다.\'); top.location.href = \''.str_replace('&amp;', '&', $href).'\'; </script>';
exit;
}
@ -31,7 +31,7 @@ if ($row['cnt'])
<noscript>
<p>이미 스크랩하신 글 입니다.</p>
<a href="./scrap.php">스크랩 확인하기</a>
<a href="./board.php?bo_table='.$bo_table.'&amp;wr_id='.$wr_id.'">돌아가기</a>
<a href="'.get_pretty_url($bo_table, $wr_id).'">돌아가기</a>
</noscript>';
exit;
}
@ -101,6 +101,9 @@ if ($wr_content && ($member['mb_level'] >= $board['bo_comment_level']))
$sql = " insert into {$g5['scrap_table']} ( mb_id, bo_table, wr_id, ms_datetime ) values ( '{$member['mb_id']}', '$bo_table', '$wr_id', '".G5_TIME_YMDHIS."' ) ";
sql_query($sql);
$sql = " update `{$g5['member_table']}` set mb_scrap_cnt = '".get_scrap_totals($member['mb_id'])."' where mb_id = '{$member['mb_id']}' ";
sql_query($sql);
delete_cache_latest($bo_table);
echo <<<HEREDOC

View File

@ -172,7 +172,7 @@ if ($stx) {
for ($i=0; $row=sql_fetch_array($result); $i++) {
// 검색어까지 링크되면 게시판 부하가 일어남
$list[$idx][$i] = $row;
$list[$idx][$i]['href'] = './board.php?bo_table='.$search_table[$idx].'&amp;wr_id='.$row['wr_parent'];
$list[$idx][$i]['href'] = get_pretty_url($search_table[$idx], $row['wr_parent']);
if ($row['wr_is_comment'])
{

View File

@ -13,11 +13,11 @@ $sql_search = "";
if ($sca || $stx || $stx === '0') {
// where 문을 얻음
$sql_search = get_sql_search($sca, $sfl, $stx, $sop);
$search_href = './board.php?bo_table='.$bo_table.'&amp;page='.$page.$qstr;
$list_href = './board.php?bo_table='.$bo_table;
$search_href = get_pretty_url($bo_table,'','&amp;page='.$page.$qstr);
$list_href = get_pretty_url($bo_table);
} else {
$search_href = '';
$list_href = './board.php?bo_table='.$bo_table.'&amp;page='.$page;
$list_href = get_pretty_url($bo_table,'',$qstr);
}
if (!$board['bo_use_list_view']) {
@ -47,7 +47,7 @@ if (!$board['bo_use_list_view']) {
$prev_href = '';
if (isset($prev['wr_id']) && $prev['wr_id']) {
$prev_wr_subject = get_text(cut_str($prev['wr_subject'], 255));
$prev_href = './board.php?bo_table='.$bo_table.'&amp;wr_id='.$prev['wr_id'].$qstr;
$prev_href = get_pretty_url($bo_table, $prev['wr_id'], $qstr);
$prev_wr_date = $prev['wr_datetime'];
}
@ -55,38 +55,40 @@ if (isset($prev['wr_id']) && $prev['wr_id']) {
$next_href = '';
if (isset($next['wr_id']) && $next['wr_id']) {
$next_wr_subject = get_text(cut_str($next['wr_subject'], 255));
$next_href = './board.php?bo_table='.$bo_table.'&amp;wr_id='.$next['wr_id'].$qstr;
$next_href = get_pretty_url($bo_table, $next['wr_id'], $qstr);
$next_wr_date = $next['wr_datetime'];
}
// 쓰기 링크
$write_href = '';
if ($member['mb_level'] >= $board['bo_write_level'])
$write_href = './write.php?bo_table='.$bo_table;
if ($member['mb_level'] >= $board['bo_write_level']) {
$write_href = short_url_clean(G5_BBS_URL.'/write.php?bo_table='.$bo_table);
}
// 답변 링크
$reply_href = '';
if ($member['mb_level'] >= $board['bo_reply_level'])
$reply_href = './write.php?w=r&amp;bo_table='.$bo_table.'&amp;wr_id='.$wr_id.$qstr;
if ($member['mb_level'] >= $board['bo_reply_level']) {
$reply_href = short_url_clean(G5_BBS_URL.'/write.php?w=r&amp;bo_table='.$bo_table.'&amp;wr_id='.$wr_id.$qstr);
}
// 수정, 삭제 링크
$update_href = $delete_href = '';
// 로그인중이고 자신의 글이라면 또는 관리자라면 비밀번호를 묻지 않고 바로 수정, 삭제 가능
if (($member['mb_id'] && ($member['mb_id'] === $write['mb_id'])) || $is_admin) {
$update_href = './write.php?w=u&amp;bo_table='.$bo_table.'&amp;wr_id='.$wr_id.'&amp;page='.$page.$qstr;
$update_href = short_url_clean(G5_BBS_URL.'/write.php?w=u&amp;bo_table='.$bo_table.'&amp;wr_id='.$wr_id.'&amp;page='.$page.$qstr);
set_session('ss_delete_token', $token = uniqid(time()));
$delete_href ='./delete.php?bo_table='.$bo_table.'&amp;wr_id='.$wr_id.'&amp;token='.$token.'&amp;page='.$page.urldecode($qstr);
$delete_href = G5_BBS_URL.'/delete.php?bo_table='.$bo_table.'&amp;wr_id='.$wr_id.'&amp;token='.$token.'&amp;page='.$page.urldecode($qstr);
}
else if (!$write['mb_id']) { // 회원이 쓴 글이 아니라면
$update_href = './password.php?w=u&amp;bo_table='.$bo_table.'&amp;wr_id='.$wr_id.'&amp;page='.$page.$qstr;
$delete_href = './password.php?w=d&amp;bo_table='.$bo_table.'&amp;wr_id='.$wr_id.'&amp;page='.$page.$qstr;
$update_href = G5_BBS_URL.'/password.php?w=u&amp;bo_table='.$bo_table.'&amp;wr_id='.$wr_id.'&amp;page='.$page.$qstr;
$delete_href = G5_BBS_URL.'/password.php?w=d&amp;bo_table='.$bo_table.'&amp;wr_id='.$wr_id.'&amp;page='.$page.$qstr;
}
// 최고, 그룹관리자라면 글 복사, 이동 가능
$copy_href = $move_href = '';
if ($write['wr_reply'] == '' && ($is_admin == 'super' || $is_admin == 'group')) {
$copy_href = './move.php?sw=copy&amp;bo_table='.$bo_table.'&amp;wr_id='.$wr_id.'&amp;page='.$page.$qstr;
$move_href = './move.php?sw=move&amp;bo_table='.$bo_table.'&amp;wr_id='.$wr_id.'&amp;page='.$page.$qstr;
$copy_href = G5_BBS_URL.'/move.php?sw=copy&amp;bo_table='.$bo_table.'&amp;wr_id='.$wr_id.'&amp;page='.$page.$qstr;
$move_href = G5_BBS_URL.'/move.php?sw=move&amp;bo_table='.$bo_table.'&amp;wr_id='.$wr_id.'&amp;page='.$page.$qstr;
}
$scrap_href = '';
@ -94,15 +96,15 @@ $good_href = '';
$nogood_href = '';
if ($is_member) {
// 스크랩 링크
$scrap_href = './scrap_popin.php?bo_table='.$bo_table.'&amp;wr_id='.$wr_id;
$scrap_href = G5_BBS_URL.'/scrap_popin.php?bo_table='.$bo_table.'&amp;wr_id='.$wr_id;
// 추천 링크
if ($board['bo_use_good'])
$good_href = './good.php?bo_table='.$bo_table.'&amp;wr_id='.$wr_id.'&amp;good=good';
$good_href = G5_BBS_URL.'/good.php?bo_table='.$bo_table.'&amp;wr_id='.$wr_id.'&amp;good=good';
// 비추천 링크
if ($board['bo_use_nogood'])
$nogood_href = './good.php?bo_table='.$bo_table.'&amp;wr_id='.$wr_id.'&amp;good=nogood';
$nogood_href = G5_BBS_URL.'/good.php?bo_table='.$bo_table.'&amp;wr_id='.$wr_id.'&amp;good=nogood';
}
$view = get_view($write, $board, $board_skin_path);

View File

@ -48,7 +48,7 @@ for ($i=0; $row=sql_fetch_array($result); $i++)
$ss_name = 'ss_secret_comment_'.$bo_table.'_'.$list[$i]['wr_id'];
if(!get_session($ss_name))
$list[$i]['content'] = '<a href="./password.php?w=sc&amp;bo_table='.$bo_table.'&amp;wr_id='.$list[$i]['wr_id'].$qstr.'" class="s_cmt">댓글내용 확인</a>';
$list[$i]['content'] = '<a href="'.G5_BBS_URL.'/password.php?w=sc&amp;bo_table='.$bo_table.'&amp;wr_id='.$list[$i]['wr_id'].$qstr.'" class="s_cmt">댓글내용 확인</a>';
else {
$list[$i]['content'] = conv_content($row['wr_content'], 0, 'wr_content');
$list[$i]['content'] = search_font($stx, $list[$i]['content']);
@ -74,7 +74,7 @@ for ($i=0; $row=sql_fetch_array($result); $i++)
if ($row['mb_id'] === $member['mb_id'] || $is_admin)
{
set_session('ss_delete_comment_'.$row['wr_id'].'_token', $token = uniqid(time()));
$list[$i]['del_link'] = './delete_comment.php?bo_table='.$bo_table.'&amp;comment_id='.$row['wr_id'].'&amp;token='.$token.'&amp;page='.$page.$qstr;
$list[$i]['del_link'] = G5_BBS_URL.'/delete_comment.php?bo_table='.$bo_table.'&amp;comment_id='.$row['wr_id'].'&amp;token='.$token.'&amp;page='.$page.$qstr;
$list[$i]['is_edit'] = true;
$list[$i]['is_del'] = true;
}
@ -82,7 +82,7 @@ for ($i=0; $row=sql_fetch_array($result); $i++)
else
{
if (!$row['mb_id']) {
$list[$i]['del_link'] = './password.php?w=x&amp;bo_table='.$bo_table.'&amp;comment_id='.$row['wr_id'].'&amp;page='.$page.$qstr;
$list[$i]['del_link'] = G5_BBS_URL.'/password.php?w=x&amp;bo_table='.$bo_table.'&amp;comment_id='.$row['wr_id'].'&amp;page='.$page.$qstr;
$list[$i]['is_del'] = true;
}
}
@ -119,6 +119,7 @@ else
}
$comment_action_url = https_url(G5_BBS_DIR)."/write_comment_update.php";
$comment_common_url = short_url_clean(G5_BBS_URL.'/board.php?'.clean_query_string($_SERVER['QUERY_STRING']));
include_once($board_skin_path.'/view_comment.skin.php');

View File

@ -23,57 +23,87 @@ if(strpos($filename, G5_DATA_DIR.'/editor')) {
$filepath = G5_DATA_PATH.'/file/'.$bo_table.'/'.$filename;
}
if(is_file($filepath)) {
$size = @getimagesize($filepath);
$file_exists = (is_file($filepath) && file_exists($filepath)) ? 1 : 0;
if($file_exists = run_replace('exists_view_image', $file_exists, $filepath, $editor_file)) {
$size = $file_exists ? run_replace('get_view_imagesize', @getimagesize($filepath), $filepath, $editor_file) : array();
if(empty($size))
alert_close('이미지 파일이 아닙니다.');
$width = $size[0];
$height = $size[1];
$width = (isset($size[0]) && $size[0]) ? (int) $size[0] : 0;
$height = (isset($size[1]) && $size[1]) ? (int) $size[1] : 0;
if($editor_file)
$fileurl = G5_DATA_URL.'/'.$editor_file;
$fileurl = run_replace('get_editor_content_url', G5_DATA_URL.'/'.$editor_file);
else
$fileurl = G5_DATA_URL.'/file/'.$bo_table.'/'.$filename;
$fileurl = run_replace('get_file_board_url', G5_DATA_URL.'/file/'.$bo_table.'/'.$filename, $bo_table);
$img = '<img src="'.$fileurl.'" alt="" width="'.$width.'" height="'.$height.'" class="draggable" style="position:relative;top:0;left:0;cursor:move;">';
$img_attr = ($width && $height) ? 'width="'.$width.'" height="'.$height.'"' : '';
$img = '<img src="'.$fileurl.'" alt="" '.$img_attr.' class="draggable" style="position:relative;top:0;left:0;cursor:move;">';
} else {
alert_close('파일이 존재하지 않습니다.');
}
?>
<div><?php echo $img ?></div>
<div class="bbs-view-image"><?php echo $img ?></div>
<script>
var win_w = <?php echo $width ?>;
var win_h = <?php echo $height ?> + 70;
var win_l = (screen.width - win_w) / 2;
var win_t = (screen.height - win_h) / 2;
if(win_w > screen.width) {
win_l = 0;
win_w = screen.width - 20;
jQuery(function($){
if(win_h > screen.height) {
win_t = 0;
win_h = screen.height - 40;
}
}
$.fn.imgLoad = function(callback) {
return this.each(function() {
if (callback) {
if (this.complete || /*for IE 10-*/ $(this).height() > 0) {
callback.apply(this);
}
else {
$(this).on('load', function(){
callback.apply(this);
});
}
}
});
};
if(win_h > screen.height) {
win_t = 0;
win_h = screen.height - 40;
$(".bbs-view-image img").imgLoad(function(){
if(win_w > screen.width) {
win_w = screen.width - 20;
win_l = 0;
}
}
var win_w = <?php echo $width ?>;
var win_h = <?php echo $height ?> + 70;
window.moveTo(win_l, win_t);
window.resizeTo(win_w, win_h);
if( !win_w || !win_h ){
win_w = $(this).width();
win_h = $(this).height();
}
var win_l = (screen.width - win_w) / 2;
var win_t = (screen.height - win_h) / 2;
if(win_w > screen.width) {
win_l = 0;
win_w = screen.width - 20;
if(win_h > screen.height) {
win_t = 0;
win_h = screen.height - 40;
}
}
if(win_h > screen.height) {
win_t = 0;
win_h = screen.height - 40;
if(win_w > screen.width) {
win_w = screen.width - 20;
win_l = 0;
}
}
window.moveTo(win_l, win_t);
window.resizeTo(win_w, win_h);
});
$(function() {
var is_draggable = false;
var x = y = 0;
var pos_x = pos_y = 0;

View File

@ -31,6 +31,8 @@ if ($w == 'u' || $w == 'r') {
}
}
run_event('bbs_write', $board, $wr_id, $w);
if ($w == '') {
if ($wr_id) {
alert('글쓰기에는 \$wr_id 값을 사용하지 않습니다.', G5_BBS_URL.'/board.php?bo_table='.$bo_table);
@ -40,7 +42,7 @@ if ($w == '') {
if ($member['mb_id']) {
alert('글을 쓸 권한이 없습니다.');
} else {
alert("글을 쓸 권한이 없습니다.\\n회원이시라면 로그인 후 이용해 보십시오.", './login.php?'.$qstr.'&amp;url='.urlencode($_SERVER['SCRIPT_NAME'].'?bo_table='.$bo_table));
alert("글을 쓸 권한이 없습니다.\\n회원이시라면 로그인 후 이용해 보십시오.", G5_BBS_URL.'/login.php?'.$qstr.'&amp;url='.urlencode($_SERVER['SCRIPT_NAME'].'?bo_table='.$bo_table));
}
}
@ -62,7 +64,7 @@ if ($w == '') {
if ($member['mb_id']) {
alert('글을 수정할 권한이 없습니다.');
} else {
alert('글을 수정할 권한이 없습니다.\\n\\n회원이시라면 로그인 후 이용해 보십시오.', './login.php?'.$qstr.'&amp;url='.urlencode($_SERVER['SCRIPT_NAME'].'?bo_table='.$bo_table));
alert('글을 수정할 권한이 없습니다.\\n\\n회원이시라면 로그인 후 이용해 보십시오.', G5_BBS_URL.'/login.php?'.$qstr.'&amp;url='.urlencode($_SERVER['SCRIPT_NAME'].'?bo_table='.$bo_table));
}
}
@ -95,7 +97,7 @@ if ($w == '') {
if ($member['mb_id'])
alert('글을 답변할 권한이 없습니다.');
else
alert('답변글을 작성할 권한이 없습니다.\\n\\n회원이시라면 로그인 후 이용해 보십시오.', './login.php?'.$qstr.'&amp;url='.urlencode($_SERVER['SCRIPT_NAME'].'?bo_table='.$bo_table));
alert('답변글을 작성할 권한이 없습니다.\\n\\n회원이시라면 로그인 후 이용해 보십시오.', G5_BBS_URL.'/login.php?'.$qstr.'&amp;url='.urlencode($_SERVER['SCRIPT_NAME'].'?bo_table='.$bo_table));
}
$tmp_point = isset($member['mb_point']) ? $member['mb_point'] : 0;
@ -310,7 +312,8 @@ if ($w == '') {
if (!$is_admin) {
if (!($is_member && $member['mb_id'] === $write['mb_id'])) {
if (!check_password($wr_password, $write['wr_password'])) {
alert('비밀번호가 틀립니다.');
$is_wrong = run_replace('invalid_password', false, 'write', $write);
if(!$is_wrong) alert('비밀번호가 틀립니다.');
}
}
}

View File

@ -20,6 +20,8 @@ if (substr_count($wr_content, "&#") > 50) {
$w = $_POST["w"];
$wr_name = trim($_POST['wr_name']);
$wr_email = '';
$reply_array = array();
if (!empty($_POST['wr_email']))
$wr_email = get_email_address(trim($_POST['wr_email']));
@ -54,18 +56,20 @@ if (empty($wr['wr_id']))
// 이 옵션을 사용 안 함으로 설정할 경우 어떤 스크립트도 실행 되지 않습니다.
//if (!trim($_POST["wr_content"])) die ("내용을 입력하여 주십시오.");
$post_wr_password = '';
if ($is_member)
{
$mb_id = $member['mb_id'];
// 4.00.13 - 실명 사용일때 댓글에 닉네임으로 입력되던 오류를 수정
$wr_name = addslashes(clean_xss_tags($board['bo_use_name'] ? $member['mb_name'] : $member['mb_nick']));
$wr_password = $member['mb_password'];
$wr_password = '';
$wr_email = addslashes($member['mb_email']);
$wr_homepage = addslashes(clean_xss_tags($member['mb_homepage']));
}
else
{
$mb_id = '';
$post_wr_password = $wr_password;
$wr_password = get_encrypt_string($wr_password);
}
@ -83,9 +87,7 @@ if ($w == 'c') // 댓글 입력
// 댓글 답변
if ($comment_id)
{
$sql = " select wr_id, wr_parent, wr_comment, wr_comment_reply from $write_table
where wr_id = '$comment_id' ";
$reply_array = sql_fetch($sql);
$reply_array = get_write($write_table, $comment_id, true);
if (!$reply_array['wr_id'])
alert('답변할 댓글이 없습니다.\\n\\n답변하는 동안 댓글이 삭제되었을 수 있습니다.');
@ -205,7 +207,7 @@ if ($w == 'c') // 댓글 입력
$subject = '['.$config['cf_title'].'] '.$board['bo_subject'].' 게시판에 '.$str.'글이 올라왔습니다.';
// 4.00.15 - 메일로 보내는 댓글의 바로가기 링크 수정
$link_url = G5_BBS_URL."/board.php?bo_table=".$bo_table."&amp;wr_id=".$wr_id."&amp;".$qstr."#c_".$comment_id;
$link_url = get_pretty_url($bo_table, $wr_id, $qstr."#c_".$comment_id);
include_once(G5_LIB_PATH.'/mailer.lib.php');
@ -289,7 +291,7 @@ else if ($w == 'cu') // 댓글 수정
if ($member['mb_id'] !== $comment['mb_id'])
alert('자신의 글이 아니므로 수정할 수 없습니다.');
} else {
if($comment['wr_password'] != $wr_password)
if( !($comment['mb_id'] === '' && $comment['wr_password'] && check_password($post_wr_password, $comment['wr_password'])) )
alert('댓글을 수정할 권한이 없습니다.');
}
@ -337,5 +339,9 @@ else if ($w == 'cu') // 댓글 수정
delete_cache_latest($bo_table);
goto_url(G5_HTTP_BBS_URL.'/board.php?bo_table='.$bo_table.'&amp;wr_id='.$wr['wr_parent'].'&amp;'.$qstr.'&amp;#c_'.$comment_id);
$redirect_url = short_url_clean(G5_HTTP_BBS_URL.'/board.php?bo_table='.$bo_table.'&amp;wr_id='.$wr['wr_parent'].'&amp;'.$qstr.'&amp;#c_'.$comment_id);
run_event('comment_update_after', $board, $wr_id, $w, $qstr, $redirect_url, $comment_id, $reply_array);
goto_url($redirect_url);
?>

View File

@ -22,7 +22,7 @@ if ($_POST['facebook_checked']) {
if ($user) {
try {
$link = G5_BBS_URL.'/board.php?bo_table='.$bo_table.'&wr_id='.$wr['wr_parent'].'&#c_'.$comment_id;
$link = get_pretty_url($bo_table, $wr['wr_parent'], '&#c_'.$comment_id);
$attachment = array(
'message' => stripslashes($wr_content),
'name' => $wr_subject,
@ -53,7 +53,7 @@ if ($_POST['twitter_checked']) {
include_once(G5_SNS_PATH."/twitter/twitterconfig.php");
if ( !(empty($_SESSION['access_token']) || empty($_SESSION['access_token']['oauth_token']) || empty($_SESSION['access_token']['oauth_token_secret'])) ) {
$comment_url = G5_BBS_URL.'/board.php?bo_table='.$bo_table.'&wr_id='.$wr['wr_parent'].'&#c_'.$comment_id;
$comment_url = get_pretty_url($bo_table, $wr['wr_parent'], '&#c_'.$comment_id);
$post = googl_short_url($comment_url).' '.$wr_content;
$post = utf8_strcut($post, 140);

View File

@ -127,6 +127,8 @@ for ($i=1; $i<=10; $i++) {
@include_once($board_skin_path.'/write_update.head.skin.php');
run_event('write_update_before', $board, $wr_id, $w, $qstr);
if ($w == '' || $w == 'u') {
// 외부에서 글을 등록할 수 있는 버그가 존재하므로 공지는 관리자만 등록이 가능해야 함
@ -211,12 +213,14 @@ if ($w == '' || $w == 'r') {
if (!isset($_POST['wr_subject']) || !trim($_POST['wr_subject']))
alert('제목을 입력하여 주십시오.');
$wr_seo_title = exist_seo_title_recursive('bbs', generate_seo_title($wr_subject), $write_table, $wr_id);
if ($w == '' || $w == 'r') {
if ($member['mb_id']) {
$mb_id = $member['mb_id'];
$wr_name = addslashes(clean_xss_tags($board['bo_use_name'] ? $member['mb_name'] : $member['mb_nick']));
$wr_password = $member['mb_password'];
$wr_password = '';
$wr_email = addslashes($member['mb_email']);
$wr_homepage = addslashes(clean_xss_tags($member['mb_homepage']));
} else {
@ -251,6 +255,7 @@ if ($w == '' || $w == 'r') {
wr_option = '$html,$secret,$mail',
wr_subject = '$wr_subject',
wr_content = '$wr_content',
wr_seo_title = '$wr_seo_title',
wr_link1 = '$wr_link1',
wr_link2 = '$wr_link2',
wr_link1_hit = 0,
@ -304,10 +309,10 @@ if ($w == '' || $w == 'r') {
}
} else if ($w == 'u') {
if (get_session('ss_bo_table') != $_POST['bo_table'] || get_session('ss_wr_id') != $_POST['wr_id']) {
alert('올바른 방법으로 수정하여 주십시오.', G5_BBS_URL.'/board.php?bo_table='.$bo_table);
alert('올바른 방법으로 수정하여 주십시오.', get_pretty_url($bo_table));
}
$return_url = './board.php?bo_table='.$bo_table.'&amp;wr_id='.$wr_id;
$return_url = get_pretty_url($bo_table, $wr_id);
if ($is_admin == 'super') // 최고관리자 통과
;
@ -328,7 +333,7 @@ if ($w == '' || $w == 'r') {
alert('자신의 글이 아니므로 수정할 수 없습니다.', $return_url);
} else {
if ($write['mb_id'])
alert('로그인 후 수정하세요.', './login.php?url='.urlencode($return_url));
alert('로그인 후 수정하세요.', G5_BBS_URL.'/login.php?url='.urlencode($return_url));
}
if ($member['mb_id']) {
@ -372,6 +377,7 @@ if ($w == '' || $w == 'r') {
wr_option = '{$html},{$secret},{$mail}',
wr_subject = '{$wr_subject}',
wr_content = '{$wr_content}',
wr_seo_title = '$wr_seo_title',
wr_link1 = '{$wr_link1}',
wr_link2 = '{$wr_link2}',
mb_id = '{$mb_id}',
@ -418,6 +424,9 @@ if ($w == '' || $w == 'r') {
$bo_notice = board_notice($board['bo_notice'], $wr_id, $notice);
sql_query(" update {$g5['board_table']} set bo_notice = '{$bo_notice}' where bo_table = '{$bo_table}' ");
// 글을 수정한 경우에는 제목이 달라질수도 있으니 static variable 를 새로고침합니다.
$write = get_write( $write_table, $wr['wr_id'], false);
}
// 게시판그룹접근사용을 하지 않아야 하고 비회원 글읽기가 가능해야 하며 비밀글이 아니어야 합니다.
@ -460,13 +469,20 @@ for ($i=0; $i<count($_FILES['bf_file']['name']); $i++) {
$upload[$i]['image'][0] = '';
$upload[$i]['image'][1] = '';
$upload[$i]['image'][2] = '';
$upload[$i]['fileurl'] = '';
$upload[$i]['thumburl'] = '';
$upload[$i]['storage'] = '';
// 삭제에 체크가 되어있다면 파일을 삭제합니다.
if (isset($_POST['bf_file_del'][$i]) && $_POST['bf_file_del'][$i]) {
$upload[$i]['del_check'] = true;
$row = sql_fetch(" select bf_file from {$g5['board_file_table']} where bo_table = '{$bo_table}' and wr_id = '{$wr_id}' and bf_no = '{$i}' ");
@unlink(G5_DATA_PATH.'/file/'.$bo_table.'/'.$row['bf_file']);
$row = sql_fetch(" select * from {$g5['board_file_table']} where bo_table = '{$bo_table}' and wr_id = '{$wr_id}' and bf_no = '{$i}' ");
$delete_file = run_replace('delete_file_path', G5_DATA_PATH.'/file/'.$bo_table.'/'.str_replace('../', '', $row['bf_file']), $row);
if( file_exists($delete_file) ){
@unlink($delete_file);
}
// 썸네일삭제
if(preg_match("/\.({$config['cf_image_extension']})$/i", $row['bf_file'])) {
delete_board_thumbnail($bo_table, $row['bf_file']);
@ -518,8 +534,12 @@ for ($i=0; $i<count($_FILES['bf_file']['name']); $i++) {
// 4.00.11 - 글답변에서 파일 업로드시 원글의 파일이 삭제되는 오류를 수정
if ($w == 'u') {
// 존재하는 파일이 있다면 삭제합니다.
$row = sql_fetch(" select bf_file from {$g5['board_file_table']} where bo_table = '$bo_table' and wr_id = '$wr_id' and bf_no = '$i' ");
@unlink(G5_DATA_PATH.'/file/'.$bo_table.'/'.$row['bf_file']);
$row = sql_fetch(" select * from {$g5['board_file_table']} where bo_table = '$bo_table' and wr_id = '$wr_id' and bf_no = '$i' ");
$delete_file = run_replace('delete_file_path', G5_DATA_PATH.'/file/'.$bo_table.'/'.str_replace('../', '', $row['bf_file']), $row);
if( file_exists($delete_file) ){
@unlink(G5_DATA_PATH.'/file/'.$bo_table.'/'.$row['bf_file']);
}
// 이미지파일이면 썸네일삭제
if(preg_match("/\.({$config['cf_image_extension']})$/i", $row['bf_file'])) {
delete_board_thumbnail($bo_table, $row['bf_file']);
@ -546,6 +566,9 @@ for ($i=0; $i<count($_FILES['bf_file']['name']); $i++) {
// 올라간 파일의 퍼미션을 변경합니다.
chmod($dest_file, G5_FILE_PERMISSION);
$dest_file = run_replace('write_update_upload_file', $dest_file, $board, $wr_id, $w);
$upload[$i] = run_replace('write_update_upload_array', $upload[$i], $dest_file, $board, $wr_id, $w);
}
}
@ -567,6 +590,9 @@ for ($i=0; $i<count($upload); $i++)
set bf_source = '{$upload[$i]['source']}',
bf_file = '{$upload[$i]['file']}',
bf_content = '{$bf_content[$i]}',
bf_fileurl = '{$upload[$i]['fileurl']}',
bf_thumburl = '{$upload[$i]['thumburl']}',
bf_storage = '{$upload[$i]['storage']}',
bf_filesize = '{$upload[$i]['filesize']}',
bf_width = '{$upload[$i]['image']['0']}',
bf_height = '{$upload[$i]['image']['1']}',
@ -596,6 +622,9 @@ for ($i=0; $i<count($upload); $i++)
bf_source = '{$upload[$i]['source']}',
bf_file = '{$upload[$i]['file']}',
bf_content = '{$bf_content[$i]}',
bf_fileurl = '{$upload[$i]['fileurl']}',
bf_thumburl = '{$upload[$i]['thumburl']}',
bf_storage = '{$upload[$i]['storage']}',
bf_download = 0,
bf_filesize = '{$upload[$i]['filesize']}',
bf_width = '{$upload[$i]['image']['0']}',
@ -603,6 +632,8 @@ for ($i=0; $i<count($upload); $i++)
bf_type = '{$upload[$i]['image']['2']}',
bf_datetime = '".G5_TIME_YMDHIS."' ";
sql_query($sql);
run_event('write_update_file_insert', $bo_table, $wr_id, $upload[$i], $w);
}
}
@ -655,7 +686,7 @@ if (!($w == 'u' || $w == 'cu') && $config['cf_email_use'] && $board['bo_use_emai
$subject = '['.$config['cf_title'].'] '.$board['bo_subject'].' 게시판에 '.$str.'글이 올라왔습니다.';
$link_url = G5_BBS_URL.'/board.php?bo_table='.$bo_table.'&amp;wr_id='.$wr_id.'&amp;'.$qstr;
$link_url = get_pretty_url($bo_table, $wr_id, $qstr);
include_once(G5_LIB_PATH.'/mailer.lib.php');
@ -686,7 +717,8 @@ if (!($w == 'u' || $w == 'cu') && $config['cf_email_use'] && $board['bo_use_emai
// 중복된 메일 주소는 제거
$unique_email = array_unique($array_email);
$unique_email = array_values($unique_email);
$unique_email = run_replace('write_update_mail_list', array_values($unique_email), $board, $wr_id);
for ($i=0; $i<count($unique_email); $i++) {
mailer($wr_name, $wr_email, $unique_email[$i], $subject, $content, 1);
}
@ -698,8 +730,12 @@ if (!($w == 'u' || $w == 'cu') && $config['cf_email_use'] && $board['bo_use_emai
delete_cache_latest($bo_table);
$redirect_url = run_replace('write_update_move_url', short_url_clean(G5_HTTP_BBS_URL.'/board.php?bo_table='.$bo_table.'&amp;wr_id='.$wr_id.$qstr), $board, $wr_id, $w, $qstr, $file_upload_msg);
run_event('write_update_after', $board, $wr_id, $w, $qstr, $redirect_url);
if ($file_upload_msg)
alert($file_upload_msg, G5_HTTP_BBS_URL.'/board.php?bo_table='.$bo_table.'&amp;wr_id='.$wr_id.$qstr);
alert($file_upload_msg, $redirect_url);
else
goto_url(G5_HTTP_BBS_URL.'/board.php?bo_table='.$bo_table.'&amp;wr_id='.$wr_id.$qstr);
goto_url($redirect_url);
?>